[CSHARP-3746] Casing not handled properly after array all-positional operator with camel case convention Created: 16/Jul/21  Updated: 22/Jun/22

Status: Backlog
Project: C# Driver
Component/s: Builders, Write Operations
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Ben Zuill-Smith Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I use the CamelCaseElementNameConvention. I'm attempting to remove an old field nested inside of some arrays. The CSharp driver will translate a query in Pascal case down to camelCase for me in most cases without issue. However, the following does not work for me:

 

collection.UpdateManyAsync(Builders<Thing>.Filter.Exist("Job.Stuff.DeeperStuff"), Builders<Thing>.Update.Unset("Job.Stuff.$[].DeeperStuff.$[].Id"));

This produces a MongoBulkWriteException: "The path 'job.stuff.0.DeeperStuff' must exist in the document in order to apply array updates.'" Note the capital D on DeeperStuff. In order to make this work, I currently must write my update document using camelCase and the exact field names after the $[] like:

collection.UpdateManyAsync(Builders<Thing>.Filter.Exist("Job.Stuff.DeeperStuff"), Builders<Thing>.Update.Unset("Job.Stuff.$[].deeperStuff.$[]._id"));

It seems somehow the $[] causes the driver to stop applying the conventions to the remaining path

 



 Comments   
Comment by Boris Dogadov [ 26/Jul/21 ]

Hello ben@gdsestimating.com,
This behaviour is confirmed to be a bug. We are adding this ticket to our backlog.

Thank you for reporting this.

Comment by Boris Dogadov [ 19/Jul/21 ]

Hello ben@gdsestimating.com
Thank you for reporting this behaviour, we have scheduled this ticket for investigation.

Generated at Wed Feb 07 21:46:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.