Create Index showing duplicate key error

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • v3.6
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When I try to create an Index I get:

      MongoDB Enterprise PRIMARY> db.col.createIndex( { "Content._id": 1 }, {unique : true } )
      {
              "operationTime" : Timestamp(1533699325, 1),
              "ok" : 0,
              "errmsg" : "E11000 duplicate key error collection: db.col index: Content._id_1 dup key: { : null }",
              "code" : 11000,
              "codeName" : "DuplicateKey",
              "$clusterTime" : {
                      "clusterTime" : Timestamp(1533699325, 1),
                      "signature" : {
                              "hash" : BinData(0,"8H8uDcd1rDYdqnXH/zX/Qul1uz8="),
                              "keyId" : NumberLong("6551211271260209154")
                      }
              }
      }
      

      I can't find any existing Indexes with same name:

      MongoDB Enterprise PRIMARY> db.col.dropIndex( { "Content._id": 1 })
      {
              "nIndexesWas" : 2,
              "ok" : 0,
              "errmsg" : "can't find index with key: { Content._id: 1.0 }",
              "code" : 27,
              "codeName" : "IndexNotFound",
              "operationTime" : Timestamp(1533699815, 1),
              "$clusterTime" : {
                      "clusterTime" : Timestamp(1533699815, 1),
                      "signature" : {
                              "hash" : BinData(0,"NMKXIv/5UI2eh1ip3CnEuRrx8cQ="),
                              "keyId" : NumberLong("6551211271260209154")
                      }
              }
      }
      

      Or find duplicate indexes with value of null:

      MongoDB Enterprise PRIMARY> db.Users.find( { "Content._id": null })
      MongoDB Enterprise PRIMARY>
      

      Would someone know what else would prevent me from creating that index?  On my localhost instance, I can create the index without any problems.  Any help would be greatly appreciated.

       

       

       

       

            Assignee:
            Nick Brewer (Inactive)
            Reporter:
            Ryan Joseph
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: