max_key.ts 527 B

12345678910111213141516171819202122232425262728293031
  1. import { BSONValue } from './bson_value';
  2. /** @public */
  3. export interface MaxKeyExtended {
  4. $maxKey: 1;
  5. }
  6. /**
  7. * A class representation of the BSON MaxKey type.
  8. * @public
  9. * @category BSONType
  10. */
  11. export class MaxKey extends BSONValue {
  12. get _bsontype(): 'MaxKey' {
  13. return 'MaxKey';
  14. }
  15. /** @internal */
  16. toExtendedJSON(): MaxKeyExtended {
  17. return { $maxKey: 1 };
  18. }
  19. /** @internal */
  20. static fromExtendedJSON(): MaxKey {
  21. return new MaxKey();
  22. }
  23. inspect(): string {
  24. return 'new MaxKey()';
  25. }
  26. }