[JAVA-3452] java.lang.IllegalArgumentException: Invalid BSON field name Created: 01/Oct/19 Updated: 27/Oct/23 Resolved: 01/Oct/19 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Amol Potbhare | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
I am facing issue as "java.lang.IllegalArgumentException: Invalid BSON field name center.alignment.threshold". center.alignment.threshold is my key which contains "dot" in it. I have gone through few of the internet sites and got to know that the "dot" and "doller" sign is not supported in mongodb. I have not got any resolution for this problem. Can you please just suggest the alternative here... Update in scope of |
| Comments |
| Comment by Jeffrey Yemin [ 25/Jul/23 ] | |||
|
FYI: in scope of | |||
| Comment by Sergiu Starciuc [ 29/Mar/20 ] | |||
|
From mongoDB reference manual: "...Otherwise, starting in MongoDB 3.6, the server permits storage of field names that contain dots (i.e. .) and dollar signs (i.e. $)..." See https://docs.mongodb.com/manual/reference/limits/#Restrictions-on-Field-Names | |||
| Comment by Jeffrey Yemin [ 01/Oct/19 ] | |||
|
At this point MongoDB drivers do not support dots in field names. The only workaround is to replace the "." character with a different character, e.g. "_". The reasons are complicated, but generally have to do with the semantics of the "." character in the MongoDB query language, where "." is used to indicate a path into an embedded document. For example, the query filter
matches this document
but does not match this document:
| |||
| Comment by Amol Potbhare [ 01/Oct/19 ] | |||
|
Hi Team, I have recently started working on MognoDB and I loved using it. I am facing issue as "java.lang.IllegalArgumentException: Invalid BSON field name center.alignment.threshold". center.alignment.threshold is my key which contains "dot" in it. I have gone through few of the internet sites and got to know that the "dot" and "doller" sign is not supported in mongodb. I have not got any resolution for this problem. Can you please just suggest the alternative here... Thanks in advance |