Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

_bsontype: "ObjectID"
cacheHexString: boolean

Constructors

Accessors

  • The ObjectId bytes

    readonly

    Returns <internal>.Buffer

  • The ObjectId bytes

    readonly

    Parameters

    Returns void

  • get generationTime(): number
  • set generationTime(value: number): void
  • The generation time of this ObjectId instance

    deprecated

    Please use getTimestamp / createFromTime which returns an int32 epoch

    Returns number

  • The generation time of this ObjectId instance

    deprecated

    Please use getTimestamp / createFromTime which returns an int32 epoch

    Parameters

    • value: number

    Returns void

Methods

  • toHexString(): string
  • Returns the ObjectId id as a 24 character hex string representation

    Returns string

  • Generate a 12 byte id buffer used in ObjectId's

    Parameters

    • Optional time: number

      pass in a second based timestamp.

    Returns <internal>.Buffer

  • toString(format?: string): string
  • Converts the id into a 24 character hex string for printing

    Parameters

    • Optional format: string

      The Buffer toString format parameter.

    Returns string

  • toJSON(): string
  • Converts to its JSON the 24 character hex string representation.

    Returns string

  • Compares the equality of this ObjectId with otherID.

    Parameters

    Returns boolean

  • getTimestamp(): Date
  • Returns the generation date (accurate up to the second) that this ID was generated.

    Returns Date

  • Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId.

    Parameters

    • time: number

      an integer number representing a number of seconds.

    Returns <internal>.ObjectId

  • Creates an ObjectId from a hex string representation of an ObjectId.

    Parameters

    • hexString: string

      create a ObjectId from a passed in 24 character hexstring.

    Returns <internal>.ObjectId

  • inspect(): string
  • Returns string

Generated using TypeDoc