-
Notifications
You must be signed in to change notification settings - Fork 407
NumberInt changes to NumberLong #29
Comments
Fail to re-produce the problem. If you did not click "Apply" button, the document should not be changed. |
This is happening to me as well. I even tried manually replacing all instances of NumberLong to NumberInt, hit save, and it still converts to NumberLong. I tried doing an insert of this document: {
"test": NumberInt(1)
} And the result is: {
"test": NumberLong(1)
} I am using Rockmongo 1.1.5. This was also occuring in 1.1.2. Additional info:
|
From the debugging I've done, it appears to be caused by PHP's I inserted a simple test document with NumberInt, which became NumberLong: {
"test": NumberLong(1)
} When trying to update it and change The dump looked correct: At this point, it's all in the hands of |
I'm also encountering this problem with Rockmongo (and other Mongo Admin UIs -- MongoHub, RoboMongo, etc.). It seems like the way that MongoDB is handling the |
I used Robomongo to correct my document successfully. Are you sure this bug is applicable to all MongoDB admin UIs? I assumed the issue lied within PHP's implementation |
You're right. Inserting a document directly in RoboMongo doesn't cause this error. i.e. if you insert a document like This problem didn't exist in earlier builds (pre-July) of MongoDB, and I remember finding out that recent versions of Mongo's BSON parser changed the way it parses Numbers. Before, the example I mention above would get parsed as a Double, but now it gets interpreted as a Long, which is probably something similar to what you're seeing. There might be a way to get around this by forcing all Numbers to be interpreted as Doubles (add |
I don't believe it's a problem as a result of upgrading mongodb: we upgraded a demo cluster from 2.2 to 2.4 to ensure everything was up to date prior to filing this bug. However, could the issue lay within the php mongo driver perhaps? I'm on holiday at present and don't have time to investigate this until next week at earliest. James Sent from my iPad On 15 Aug 2013, at 00:11, Ritik Malhotra [email protected] wrote:
|
See also http://php.net/manual/en/mongo.types.php and an upcoming change to a default value. |
Vote on this issue please #133 |
If you go to update any document featuring a NumberInt and merely hit Update (without making any changes), the field type is now set to NumberLong. This causes ClassCastExceptions in Java, and I imagine quite a few similar problems in other langauges.
The text was updated successfully, but these errors were encountered: