ozomer / node-red-contrib-mongodb2

MongoDB driver node for Node-RED
Apache License 2.0
15 stars 19 forks source link

ObjectId is not defined #30

Closed Digital-Thor closed 5 years ago

Digital-Thor commented 5 years ago

Thanks for this great Mongo V3 node @ozomer! One question though, have you seen the Mongo find problem where:

msg.payload = { "_id": ObjectId("5bb59066e7179a6602f38d4e") } 

Debug Console --> "ReferenceError: ObjectId is not defined"

I'm having the same trouble. I've tried stringifying the value:

{ "_id": "ObjectId(\"5bb59066e7179a6602f38d4e\")" } 

as well omitting the ObjectId: { "_id": "5bb59066e7179a6602f38d4e" }

Any suggestions?

PS. installing node-red-contrib-objectid didn't help.

Digital-Thor commented 5 years ago

Okay I got it working. Targetting the id field in node-red-contrib-objectid was the problem. Thanks.