-
Type: Question
-
Resolution: Won't Do
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: JavaScript, Shell
-
None
Using the cxx driver I managed to create an object containing the following fields:
{ _id: ObjId(4f59f734a695f63cb649e03b), a: 1, a: 2, a: 3, a: 4 }In most drivers (PHP, PyMongo, Java, node.js) the result of retrieving the object is predictably:
{ _id: ObjId(4f59f734a695f63cb649e03b), a: 4 }However in the shell I get:
> db.persons.find().forEach(printjson)
{
"_id" : ObjectId("4f59f734a695f63cb649e03b"),
"a" : 1,
"a" : 1,
"a" : 1,
"a" : 1
}
What I'm curious about is why the shell uses the first value of "a" instead of the last one.