Search code examples
mongodbmongoosemongoose-populate

How can i use $gte with other values in mongoose


How can I do something similar to the following piece of code using Mongoose:

"filter":{"custom_fields.ram": {"$in": [1.2, {"$gte":1.8}]}} 

Solution

  • Rather than using it like this, you can do it like this:

    "filter":{"custom_fields.ram": {"$or": [{"$in": [1.2]}, {"$gte":1.8}]}}