'Find' in Mongodb not working as expected

Hi,
@mcnaveen
My Find operation in Mongodb Node is not working.
Am I doing anything wrong?
Here is a picture of my execution

The data from the db is not being returned. There is no text data found
image

1 Like

Hi @ruby09

I just tested and it works as expected.

Make sure to use the same key name when fetching the data

Here I’m fetching the data with the email [email protected] and it works as expected.

Please make sure there is no typo in the key, also it’s case sensitive

  • Typing email as Email won’t work.
  • Same for the value. If I pass the data as [email protected] it won’t return any data.

1 Like

Hi @mcnaveen, I did try finding all and it works but when i try it with an expression it doesnt work.
Here is the expression. It looks right to me as I have checked spelling of the variable against the one in the db.
image

1 Like

I just checked with an Expression and looks like it’s working as expected

Can you try turning on this option and check?

1 Like

Hey, @mcnaveen , I tried and it works but then it shows that no JSON data is found but in reality there are data that is being passed on to the Mongo find node. Is there any reason to why this is happening?
Update:
I figured out what my issue was! Thank you so much for your help!
Its a very silly mistake, I realized that since the variable that I wanted to filter was integer, I just had to remove the apostrophes and it worked perfectly.

1 Like

Awesome.

You got that right.

In JavaScript 1 is not equal to "1".

If it’s wrapped with Single or Double Quotes it’s a string. Not a number.

Glad you found the issue and fixed it.

1 Like