Insertion of document with duplicate fields permitted in C++

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Client
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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;
      }
      

              Assignee:
              Unassigned
              Reporter:
              J Rassi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: