Projection document using mongodb3?
axelhult opened this issue · 2 comments
Hi!
Im switching from the mongodb2- to mongodb3 node. Using the following code to return specific fields (x_data) from my documents:
msg.collection="data"; msg.operation="findOne"; msg.payload=[{_id: "id123"}, {x_data: 1}];
Works as expected using the mongodb2-node, but the same code returns the whole document when using the mongodb3 node.
Any thoughts on this? Thanks
... adding "fields" before parameters solved it:
msg.collection="data"; msg.operation="findOne"; msg.payload=[{_id: "id123"}, {"fields":{x_data: 1}}]
hello, I am not being able to use a MongoDB auto-generated _id, is there any way to use "_id": 'ObjectId("myID")' as an argument?