toObjectId
This function is used by Ignition's Expression language.
Descriptionβ
Converts String to org.bson.types.ObjectId.
Syntaxβ
toObjectId(stringId)
Type | Parameter | Description |
---|---|---|
String | stringId | A unique, 24 character string identifier that matches with an id of an existing document of a collection. |
Resultsβ
ObjectId - A unique, 12 byte identifier that matches with an id of an existing document of a collection in both value and data type.
Exampleβ
Code Snippet
// In a Perspective MongoDB Binding, the expression below is applied to βvalueβ of
// filter { _id: βvalueβ }
toObjectId("5553a998e4b02cf7151190b8") // binding will return entire document of the matching _id