fotonauts/MongoHub-Mac — Issue #28: Incorrect saving of data
Author: simoncoulton
Created: 2012-03-08 11:07:13+00:00
State: open

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*
```javascript
{"parts": [1,2,3,4]}
```

*Expected result from* `db.things.find()`
```javascript
{ "_id" : ObjectId("4f5890ff624df1578936963c"), "parts" : [ 1,2,3,4 ] }
```

*Actual result*
```javascript
{ "_id" : ObjectId("4f5890ff624df1578936963c"), "parts" : [ NumberLong(4) ] }
```
which translates to this in php
```php
[
"_id" => "4f5890ff624df1578936963c",
"parts" => [ 1 ]
]
```