mongoObjectIdNew

Creates a MongoDB ObjectId

mongoObjectIdNew(objectId) → returns any

This function requires Adobe ColdFusion 2021 and up.  Not supported on Lucee, etc.

Argument Reference

objectId string
Required

A 24-character hexadecimal ObjectId string.

Compatibility

ColdFusion:

Version 2021+ Requires the mongodb package

Examples
Sample code invoking the mongoObjectIdNew function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub