this is how I imagine it
//b is variable
collection.findAll({a:'!'+b}function(err, cursor) {
});
What the correct way to that query, find all result where a != b ?
You can use the not equals '$ne' for comparation
collection.findAll({a: {'$ne':b }}, function(err, cursor) {});
Check out this advanced queries manual page for more detailed explanations.
The answer can be found here
nodejs - mongodb - how to find all where a != b?
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