how to get greater than or equal integer values from Mongodb using Mongoose? assume that below list
list = [134,56,89,89,90,200] //Marks field
want to get values equal or greater than 89, result set must be [89,90,200]
in my query I was able to get values greater than 89, I want to get it with 89
let x = 89;
query.find().where('marks').gt(x);
I don't know what version of mongodb you are using. But this is what available in the latest releases.
$gte
selects the documents where the value of the field is greater than or equal to (i.e. >=) a specified value
query.find( { marks: { $gte: 89} } )
Here
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