[JAVA-794] Java driver fails to detect fields with dots (.) under certain circumstances Created: 27/Mar/13 Updated: 02/Jul/13 Resolved: 25/Jun/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API |
| Affects Version/s: | 2.9.2, 2.10.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Caleb Jones | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
$ java -version |
||
| Issue Links: |
|
||||||||||||
| Description |
|
Using the java driver (I tried 2.9.2 and 2.10.1), I am able to create a document with field names with dots (.) in them. Document:
(note I've stripped out some other fields which I believe are irrelevant to this bug, but let me know if this example does not reproduce for you) If, however, I try to create this document from the Mongo shell, it properly detects the field with dots and returns an error:
|
| Comments |
| Comment by auto [ 02/Jul/13 ] | |||||
|
Author: {u'username': u'trnl', u'name': u'Uladzimir Mihura', u'email': u'trnl.me@gmail.com'}Message: test(driver-compat) add tests from | |||||
| Comment by Caleb Jones [ 08/May/13 ] | |||||
|
I've fixed this and created a pull request. | |||||
| Comment by Caleb Jones [ 27/Mar/13 ] | |||||
|
My preference would be that all extra validation beyond BSON is done server-side and client libraries just worry about sending valid BSON (see | |||||
| Comment by Jeffrey Yemin [ 27/Mar/13 ] | |||||
|
It looks like com.mongodb.DBCollection#_checkKeys does not recurse through List, only Map. Good catch. | |||||
| Comment by Caleb Jones [ 27/Mar/13 ] | |||||
|
I've gotten this narrowed down to:
|