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

Duplicate _id in the same collection without sharding/replicaset configured

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Blocker - P1 Blocker - P1
    • None
    • Affects Version/s: 3.0.8
    • Component/s: Storage
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Hide

      db.testDup.insert(
      {
      _id :

      { "field1":1, "field2":2 }

      }

      db.testDup.insert(
      {
      _id :

      { "field2":2, "field1":1 }

      }

      Show
      db.testDup.insert( { _id : { "field1":1, "field2":2 } } db.testDup.insert( { _id : { "field2":2, "field1":1 } }

      I've a compound _id that has duplicated entries as shown below.

      /* 1 */
      {
          "_id" : {
              "field1" : 6001,
              "field2" : 6004,
              "from" : "ORIGINAL",
              "field3" : 6006,
              "field4" : 6002
          }
      }
      
      /* 2 */
      {
          "_id" : {
              "field1" : 6001,
              "from" : "ORIGINAL",
              "field2" : 6004,
              "field3" : 6006,
              "field4" : 6002
          }
      }
      
      /* 3 */
      {
          "_id" : {
              "field1" : 6001,
              "field3" : 6006,
              "from" : "ORIGINAL",
              "field2" : 6004,
              "field4" : 6002
          }
      }
      
      /* 4 */
      {
          "_id" : {
              "field1" : 6001,
              "from" : "ORIGINAL",
              "field3" : 6006,
              "field2" : 6004,
              "field4" : 6002
          }
      }
      

      The only difference is the order of the fields inside. Is this behaviour ok?

            Assignee:
            Unassigned Unassigned
            Reporter:
            jousepo José Mª Pérez
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: