Navigation
This version of the documentation is archived and no longer supported.

UUID()

On this page

Definition

UUID(<string>)

Generates a BSON UUID object.

Parameter Type Description
hex string Specify a 32-byte hexadecimal string to convert to the UUID BSON subtype.
Returns:A BSON UUID object.

Example

Create a 32 byte hexadecimal string:

var myuuid = '0123456789abcdeffedcba9876543210'

Convert it to the BSON UUID subtype:

UUID(myuuid)
BinData(3,"ASNFZ4mrze/+3LqYdlQyEA==")
←   Date() ObjectId  →