如果使用节点红色函数节点从嵌套文档匹配键值对,则查找 mongodb 文档
find the mongodb document if a key-value paired is matched from nested document using node red function node
我有一个名为 "Device_Records" 的 mongodb 集合,使用 node-red 我想提取所有满足 mongo query.Till 的文档,现在我使用mongodb 节点,从操作 selector 中拖放 mongo 节点和 select "find"。但是当文档是嵌套文档时,这不起作用。
此外,我想在节点红色功能节点中使用 msg.operation,以便我可以编写动态查询。
我想从这个 collection.since 中获取所有匹配 "device_id":66 的文档 条件是一个对象数组的键,我对查询感到困惑 :(
您可以在查询中使用 dot notation:{ 'Condition.device_id': 66 }
:
我有一个名为 "Device_Records" 的 mongodb 集合,使用 node-red 我想提取所有满足 mongo query.Till 的文档,现在我使用mongodb 节点,从操作 selector 中拖放 mongo 节点和 select "find"。但是当文档是嵌套文档时,这不起作用。
您可以在查询中使用 dot notation:{ 'Condition.device_id': 66 }
: