Node-RED node to create an Object-Id for mongodb operations.
npm install node-red-contrib-objectid!Platform Node-RED
!Contribution Bit
!NodeJS_Version





This Node-Red node is to create an Object-Id for mongodb write operations from JSON inputs.
The selected property in msg.payload or in Array-Objects will be set to a BSON-Object-Id,
you can also inject a 24 hex characters and the node creates
a valid Object-Id property from it or raise an error if it is not valid.
For example:
msg.payload._id = "572dbc06f307c8682045c55c"
or
msg.payload.uuid = "572dbc06f307c8682045c55c"
If the target property is not to find or empty, then a random Object-Id is created.
[Flow example][1]
[1]:https://flows.nodered.org/flow/fd92765c02efd19453927e992bb1349c