-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Client
-
None
-
ALL
Using the C++ driver, nothing prevents a user from inserting a document that has two fields which share a name. I don't believe that the behavior of future updates on this document is documented or well-defined (as a sidenote, operating on this document can't crash the server, right?).
See:
> db.test.find() { "_id" : ObjectId("5058f25f7d54ac9bc09d4e57"), "a" : 0, "a" : 0 } >
as a product of:
#include "mongo/client/dbclient.h" using namespace mongo; int main() { DBClientConnection c; c.connect("localhost"); BSONObj bsonData = BSON("a" << 0 << "a" << 0); c.insert("test.test", bsonData); return 0; }
- duplicates
-
SERVER-6439 Duplicate fields at the same level should not be allowed
- Backlog