Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
2.4.4
-
None
Description
This code works great when I run it in a standard .NET Core console app:
collection.UpdateOne(
|
filter: Builders<Animal>.Filter.Where(x => x.Subdocument.Subarray.Any(itm => itm.SomeProperty == "foobar")), |
update: Builders<Animal>.Update.Inc(x => x.Subdocument.Subarray[-1].SomeNumericProperty, 10)
|
);
|
But when I run that same console app in a Linux container on my Windows machine, I get this exception:
MongoBulkWriteException`1: A bulk write operation resulted in one or more errors.
|
cannot use the part (Subarray of Subdocument.Subarray.−1.SomeNumericProperty) to traverse the element ({Subarray: [ /* All elements of Subarray listed here */ ]})
|
MongoDB.Driver.MongoCollectionImpl+<BulkWriteAsync>d__22.MoveNext()
|
|
|
MongoWriteException: A write operation resulted in an error.
|
cannot use the part (Subarray of Order.Subarray.−1.SomeNumericProperty) to traverse the element ({Items: [ /* All elements of Subarray listed here */ ]})
|
I've tried with simpler update expressions, like just set a property without any positional operator, and that works, so my conclusion is that it has something to do with the positional operator.