Hello
I have 2 classes:
public class Donation
{ public ObjectId Id \{ get; set; }public ICollection<Item> Items { get; set; }
}
public class Item
{ public ObjectId Id { get; set; }
public ICollection<ObjectId> ParentIds { get; set; }
}
Example Data:
{
"_id" : ObjectId("553682b4ecab640ee4ba35e5"),
"Items" : [
{ "_id" : ObjectId("553682b4ecab640ee4ba35e6"), "ParentIds" : [ ObjectId("55368285ecab640eb8d6976f"), ObjectId("55368256ecab640eb8d6976e"), ObjectId("55016c84b9e76f04a8821be5") ] }
]}
I have the following c# predicate:
find(x => x.Items.Any(d => d.ParentIds.Any(p => p == ObjectId("55368256ecab640eb8d6976e"))))
V2.7.3 behaviour emits:
.find({ "Items.ParentIds" : ObjectId("55368256ecab640eb8d6976e") })
V.2.8.0 behaviour emits:
.find({ "Items.ParentIds" : { "$elemMatch" :
{ "" : ObjectId("55368256ecab640eb8d6976e") }} })
This breaks our production build, working happily for several years now....
Thanks
- is related to
-
CSHARP-2574 $elemMatch query contains gaps when It's generated based on LINQ Any and predicate contains `DocumentExpression` as operand.
- Closed