This is the object which I inserted to mongodb.
{
'_array': [1,2,3],
'_ass_array': [{'num': 1, 'name': 'One'}],
'_obj': {'key': 'val'}
}
If I query on terminal, I can get the same as I inserted. But while querying via PHP's MongoCollection::findOne()/ MongoCollection::find()
, I am getting following format.
{
'_array': { 0: 1, 1: 2, 2: 3},
'_ass_array': {
0: {'num': 1, 'name': 'One'}
},
'_obj': {'key': 'val'}
}
Is there any way I can get the array as array and object as object? if required, I can update the question with the complete code.