[CDRIVER-2045] Cannot insert keys with dots Created: 12/Feb/17  Updated: 27/Oct/23  Resolved: 12/Feb/17

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.6.0
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Jeroen Ooms [X] Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-30575 Please add escaping convention for do... Backlog

 Description   

After upgrading mongo-c-driver to 1.6.0 I can no longer insert JSON data where they key contains a dot:

> m$insert('{"foo.bar":true}')
Error: document to insert contains invalid keys

This was not a problem with 1.5.x.



 Comments   
Comment by Jeroen Ooms [X] [ 12/Feb/17 ]

Oh yikes that's a bit tricky, R loves dots in variable names. Wil need to fix some unit tests...

Comment by A. Jesse Jiryu Davis [ 12/Feb/17 ]

Yes, this is by design, CDRIVER-1341. No driver should allow such an insert, since the resulting document is hard to query.

https://docs.mongodb.com/manual/reference/limits/#Restrictions-on-Field-Names

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