-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect saving of data #28
Comments
Sorry about that. I will try to look at that this week-end. Meanwhile, it might work if you put spaces around the coma. |
I'm not able to reproduce this bug... So the document you inserted is just : {"parts": [1,2,3,4]} ? nothing else? |
I will have to make a build with a lot of logs in order to understand what is going on... I'm not able to reproduce this bug... |
In your system preferences, open "Language & Text". Can you give a screen shot of the "Language" tab and the "Formats" tab? Thanks, |
Sorry about, this issue, but I can't find why you have this problem... Plus I can't reproduce it. Unfortunately I don't have much time. I will try to help you as soon as I can. |
Can you try the application MongoHub_test in the download? I did no fix yet (I still don't understand, and I still can't reproduce it), but I added logs into the console. Please, give me the log of the application after reproducing this issue. Thanks |
I've encountered the same issue. I used your MongoHub_test.app to grab the logs you requested. Here's what's happening. Via CLI: > db.examples.findOne()
null
> db.examples.insert({name: "test", items: [{foo: 1}, {foo: 2}, {foo: 3}]})
> db.examples.findOne()
{
"_id" : ObjectId("4fa3161604924cddfc7f2869"),
"name" : "test",
"items" : [
{
"foo" : 1
},
{
"foo" : 2
},
{
"foo" : 3
}
]
} So far so good, MongoHub displays the object properly in the Find tab. If you go to edit the object in MongoHub to add a fourth item to the items array
But, the CLI now returns: > db.examples.findOne()
{
"_id" : ObjectId("4fa3161604924cddfc7f2869"),
"name" : "test",
"items" : [
{
"foo" : NumberLong(4)
}
]
} Moreover, if I add a fifth item from the CLI: > db.examples.update({ "_id": ObjectId("4fa3161604924cddfc7f2869") }, { $pushAll: {"items": [{foo: 5}]} }) I get this result: {
"_id" : ObjectId("4fa3161604924cddfc7f2869"),
"items" : [
{
"foo" : NumberLong(4)
},
undefined,
undefined,
undefined,
{
"foo" : 5
}
],
"name" : "test"
} Although MongoHub still shows the "undefined" items correctly. MongoDB version is 2.0.4. |
This doesn't seem to be a parsing problem (based on the log), and I can't reproduce it with 2.0.1… This is really weird. I will install 2.0.4 to see if I can reproduce this bug. Thanks for the help |
I finally can reproduce it. Sorry, I didn't understand that the problem is not visible in MongoHub. But only in the CLI. |
I found the bug, and I have a fix for it. I need to create a test case for it, to make sure it will never happen again. The data send to mongodb is corrupted. The quick explanation, when an array of value is create, each element of the array needs to have the position index set. When the array contains a structure of objects, the position index is set to 0 for all objects. I hope to do the test case and the push an update soon. |
@jeromelebel Thanks for the quick investigation and fix! This was exceedingly puzzling for a while there. |
Fix with 314413b Fixed in 2.4.17 |
Yes, this is works for me, now. |
When attempting to save a simple array in the example below the wrong data is returned from the query. While it displays fine in MongoHub (in the Find tab), retrieving the data from either the console or the PHP driver returns only the first index from an array. If the resulting document contains multiple array objects, then only the first index from all arrays will be shown. This caused me a good hour or two's headache today, and resulted in me going back to the console for all my managing of data, which is a shame as MongoHub is the only native MongoDB GUI (and the PHP based ones just don't cut it).
Saving the following object to the data through the insert tab
Expected result from
db.things.find()
Actual result
which translates to this in php
The text was updated successfully, but these errors were encountered: