I'm trying to use the mongodb-2 node to retrieve a saved information and for that I'm using the example of the mongodb-2 node page but without success...
In the terminal the query returns me the desired information as shown in the print below:
This is the flow I'm following as a model:
[{"id":"68165b4c.c9e594","type":"function","z":"78f389d4.a3e498","name":"findOne","func":" var newMsg = {};\nnewMsg.operation = 'findOne';\nnewMsg.payload = { 'name' : 'Pete1' , 'names' : 'Pete2' };\nnewMsg.projection = { 'name' : 1 , '_id' : 0 };\nreturn newMsg;","outputs":1,"x":332,"y":220,"wires":[["a5eff45.9a49908"]]}]
This is what I'm trying to use to retrieve the information:
[{"id":"528be7f.6a30d18","type":"function","z":"ca7a266a.c18118","name":"findOne","func":" var newMsg = {};\nnewMsg.operation = 'findOne';\nnewMsg.payload = { 'timestamp' : '/28\\/08\\/2021/' };\n//newMsg.projection = { 'timestamp' : 1 };\nreturn newMsg;","outputs":1,"noerr":0,"x":760,"y":240,"wires":[["3f71662.230999a"]]}]
Could someone help me how do I fix this request to mongo?
I thank you and I'm waiting!