0

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.  here is the screenshort 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 :(

Lisa
  • 655
  • 3
  • 10
  • 34

1 Answers1

1

You can use the dot notation in your query: { 'Condition.device_id': 66 }:

suda
  • 2,604
  • 1
  • 27
  • 38