Open antdementyev opened 3 years ago
Do you have a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem? The pipeline stage looks ok to me.
"$project": {
"id": 1,
"isInList": {
"$cond": {
"if": {
"$all": [
"$priorityList",
[
"here-my-string-to-check"
]
]
},
"then": 1,
"else": 0
}
}
}
Have you tried to run the aggregation on the shell? If so, does it work and what does it look like?
Sorry I can't prepare a sample for time reasons.
But running of aggregation on the shell results the same error: MongoServerError: Invalid $project :: caused by :: Unrecognized expression '$all'
$all
is not listed in the mongo doc https://docs.mongodb.com/manual/reference/operator/aggregation/
Current doc to spring doesn't support $all
too: https://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#mongo.aggregation.supported-aggregation-operations#mongo.aggregation.supported-aggregation-operations
So it seems to be not a bug in the implementation but just the existing of an unsupported feature in the spring API.
Structure of documents:
Using of
$all
in Aggregation:produces