min_key.ts 635 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { BSONValue } from './bson_value';
  2. /** @public */
  3. export interface MinKeyExtended {
  4. $minKey: 1;
  5. }
  6. /**
  7. * A class representation of the BSON MinKey type.
  8. * @public
  9. * @category BSONType
  10. */
  11. export class MinKey extends BSONValue {
  12. get _bsontype(): 'MinKey' {
  13. return 'MinKey';
  14. }
  15. /** @internal */
  16. toExtendedJSON(): MinKeyExtended {
  17. return { $minKey: 1 };
  18. }
  19. /** @internal */
  20. static fromExtendedJSON(): MinKey {
  21. return new MinKey();
  22. }
  23. /** @internal */
  24. [Symbol.for('nodejs.util.inspect.custom')](): string {
  25. return this.inspect();
  26. }
  27. inspect(): string {
  28. return 'new MinKey()';
  29. }
  30. }