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

Insertion of document with duplicate fields permitted in C++

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Internal Client
    • Labels:
      None
    • Operating System:
      ALL

      Description

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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: