Closed ldoguin closed 1 year ago
hi @ldoguin
You can use exactly the same syntax in Ottoman:
query.tagList = { $in: [req.query.tag] }
this will work.
On other hand, Ottoman queries are built using N1QL, and of course, Ottoman's goal is to make easier the way to build queries, but N1QL knowledge is required to use Couchbase full power and understand the queries.
"test" IN tagList
: means "test" string exist in tagList field (the field can be a complex object, also check the WITHIN operator)
tagList IN ["test"]
: means tagList field has "test" string (think in ["test", "test2"] like an enum)
For a more detailed answer please visit Couchbase's documentation IN operator section, you can find how IN operator works
It seems like the $in operator does not have the same behavior between Ottoman and Mongoose.
With Ottoman you have to write:
With Mongoose you have to write:
Basically the terms are inverted. Here is the resulting queries in both situations:
Ideally we would be compatible with Mongoose, if not our documentation should explain the differences.