I have a mongo property (category), where I want to filter with equals. I used the following syntax:
{"category":{"$eq":"cat1"}}
(I know, it can be written like:
{"category":"cat1"}
If I use the $eq operator, the mongoClient fails with "invalid operator: $eq". But only on localhost. If I deploy the same code to a remote server, it works perfectly.
How can I make it work on localhost? It would be preferred to use the $eq operator - there are many places in the code where this is used.
Thx
The $eq
query operator was introduced in version 3.0, but it seems to also work on my local 2.6.7 install.
So you likely just need to update your local install.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With