In mongo (and robomongo) shell:
db.tasks.insert({"a":1,"a":2})
will produce a document:
{
"a": 2
}
However if you click edit document in robomongo and change the document to:
{
"a": 1,
"a": 2
}
Now when doing a find() robomongo will return the above document but mongo shell will return
{
"a": 1,
"a": 1
}
I guess robomongo should either fail when attempting to add duplicate fields or at least be consistent with mongo shell?
This issue caused a bit of a headache. A duplicate field was added by mistake to a document, and suddenly the response back from MongoDB is different than what you are seeing in Robo 3T.
MongoDB documentation states this:
"BSON documents may have more than one field with the same name. Most MongoDB interfaces, however, represent MongoDB with a structure (e.g. a hash table) that does not support duplicate field names. "
This should definitely throw some validation error in Robo 3T when trying to add duplicate field
Most helpful comment
This issue caused a bit of a headache. A duplicate field was added by mistake to a document, and suddenly the response back from MongoDB is different than what you are seeing in Robo 3T.
MongoDB documentation states this:
"BSON documents may have more than one field with the same name. Most MongoDB interfaces, however, represent MongoDB with a structure (e.g. a hash table) that does not support duplicate field names. "
This should definitely throw some validation error in Robo 3T when trying to add duplicate field