-
The filter stage is not working returning that response: [8:UnknownError]: PlanExecutor error during aggregation :: caused by :: Remote error from mongot :: caused by :: "compound.filter[0].equals.value" must be a boolean, objectId, number, or date (on develpment-main-api-shard-00-02.prt8v.mongodb.net:27017, modern retry, attempt 1) How can I filter by ID? The same query works on SearchTester |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @ppascualv, the issue you appear to be facing is the pipeline being sent to the server that will be used by Atlas Search contains an invalid value type ( Instead of trying to convert Try the following and let us know if it works: def filter_stage
[
{
equals: {
path: 'account_id',
value: current_user.account_id
}
}
]
end |
Beta Was this translation helpful? Give feedback.
Hi @ppascualv, the issue you appear to be facing is the pipeline being sent to the server that will be used by Atlas Search contains an invalid value type (
"compound.filter[0].equals.value" must be a boolean, objectId, number, or date
).Instead of trying to convert
current_user.account_id
to EJSON, just let the driver serialize the value as needed.Try the following and let us know if it works: