- Reference >
mongo
Shell Methods >- Object Constructors and Methods >
- UUID()
UUID()¶
On this page
Definition¶
Generates a BSON UUID object.
UUID()
has the following syntax:
Parameter | Type | Description |
---|---|---|
hex |
string | Optional. Specify a 36 character string to convert to a UUID BSON object. If not provided, MongoDB generates a random UUID in RFC 4122 v4 format. Changed in version 3.6: In earlier versions of the |
returns: | A BSON UUID object. |
---|