ObjectID()

Constructor

Create a new ObjectID instance

class ObjectID()
Arguments:
  • id ((string) – Can be a 24 byte hex string, 12 byte binary string or a Number.
Returns:

objectid instance of ObjectID.

Properties

Property
{number} generationTime The generation time of this ObjectId instance

toString

Converts the id into a 24 byte hex string for printing

toString()
Returns:string return the 24 byte hex string representation.

Examples

toJSON

Converts to its JSON representation.

toJSON()
Returns:string return the 24 byte hex string representation.

Contents

Manual

MongoDB Wiki