i have a mongodb collection named "Device_Records", using node-red i would like to extract all the documents that satisfy a mongo query.Till now i used mongodb node , drag and drop the mongo node and select "find" from the operation selector. But this does not work when the document is of a nested document.
more over i want to use msg.operation in the node-red function node so that i can write dynamic query.
i would like to get all the documents that match "device_id":66 from this collection.since Condition is a key which is a array of objets,am confused about the query :(
Asked
Active
Viewed 374 times
0

Lisa
- 655
- 3
- 10
- 34
1 Answers
1
You can use the dot notation in your query: { 'Condition.device_id': 66 }
:

suda
- 2,604
- 1
- 27
- 38
-
Great to hear! I'd appreciate if you'd mark this answer as the solution :) – suda May 08 '18 at 13:26