Query MongoDB msg.projection

Hello,

I want to query a Mongo DB.
Before the "MongoDB in"-node I have a "function"-node.
There I define an msg.projection object like this:

msg.projection =
{
temperature: 21
}
return msg;

However, this is not working.
Do you have an example to define projections for mongo db queries?

Regards
Martin

1 Like

Welcome to the forum.
Which MongoDB node are you using?

I am using the "mongodb in node" with the find method.
I want to make a concrete query and specify it.

There are a couple of MongoDB nodes, you have to tell us which one you installed. have a look in the "Manage palette" menu for installed nodes.

I am using node-red-node-mongodb 0.0.14.
Thanks for your help.

Martin

Good, that node is maintained by @knolleary and @dceejay. I have no knowledge of MongoDB but I'm sure you will get some help soon.