Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7070

Insertion of document with duplicate fields permitted in C++

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 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;
      }
      

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

              Created:
              Updated:
              Resolved: