google-code-export / morphia

Automatically exported from code.google.com/p/morphia
1 stars 0 forks source link

In a hashmap, if a key contains a dot, it is impossible to insert or update the object in MongoDB #268

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version are you using? (Morphia/Driver/MongoDB)
Morphia : 0.99, Driver : 2.5, MongoDB : 1.6.5
Please include a stack trace below:
com.mongodb.MongoException: not okForStorage
    at com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:141) ~[mongo-java-driver-2.5.jar:na]
    at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:162) ~[mongo-java-driver-2.5.jar:na]
    at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:146) ~[mongo-java-driver-2.5.jar:na]
    at com.mongodb.DBApiLayer$MyCollection.update(DBApiLayer.java:335) ~[mongo-java-driver-2.5.jar:na]
    at com.mongodb.DBCollection.update(DBCollection.java:145) ~[mongo-java-driver-2.5.jar:na]
    at com.mongodb.DBCollection.update(DBCollection.java:157) ~[mongo-java-driver-2.5.jar:na]

Original issue reported on code.google.com by ah...@octo.com on 13 Apr 2011 at 10:21

GoogleCodeExporter commented 9 years ago
You are not allowed to have "." in the key (field) name. This is a limitation 
of the server and the driver is checking this. If you believe this validation 
is in error, please provide an example and open an issue in jira (for the 
driver)

Original comment by scotthernandez on 13 Apr 2011 at 2:17

GoogleCodeExporter commented 9 years ago
I know this limitation. I'm just wondering if it is normal it limits the use of 
some key name in an hash map.
Thank you for your answer anyway.

Original comment by ah...@octo.com on 13 Apr 2011 at 2:26

GoogleCodeExporter commented 9 years ago
Each map key/value get converted into the equivalent in the document, are you 
asking for another representation in the database? If so, please create a new 
issue.

Original comment by scotthernandez on 13 Apr 2011 at 2:37