Details
-
Question
-
Resolution: Gone away
-
Major - P3
-
None
-
None
-
None
Description
Summary
We have multiple filters with $expr in a list, and we are passing this list in to method
AggregateIterable<TDocument> aggregate(List<? extends Bson> pipeline); of class MongoCollection.
If we have and filter in it and if you see com.mongodb.client.model.Filters.AndFilter it will l combine all the condition into one condition.
Value passed as :
{"$expr": {"$eq": [ {"$strcasecmp": ["$CreatedBy", "tenant21"]}, 0] }}
|
|
|
{"$expr": {"$in": [ {"$toLower": "$a"}, ["a"]] }}
|
Command executed:
{"$expr": {"$eq": [ {"$strcasecmp": ["$CreatedBy", "tenant21"]}, 0], "$in": [{"$toLower": "$a"}, ["a"]]}}
|
If you see above it will combine two $expr into single $expr and while executing it will fail saying, $expr can only contain single object.