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

cloneCollection ignores the copyindexes field

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major - P3 Major - P3
    • None
    • 2.2.6, 2.4.7, 2.5.3
    • Admin
    • Storage Execution
    • ALL
    • Hide

      On ubuntu:11111:

      > db.dropDatabase()
      { "dropped": "test", "ok": 1 }
      > db.foo.insert({a:1})
      > db.foo.ensureIndex({a:1})

      On ubuntu:22222:

      > db.dropDatabase()
      { "dropped": "test", "ok": 1 }
      > db.runCommand({cloneCollection:'test.foo', from:'ubuntu:11111', copyindexes:false})
      { "ok": 1 }
      > db.system.indexes.find()
      { "v": 1, "key": { "_id": 1 }, "ns": "test.foo", "name": "_id_" }
      { "v": 1, "key": { "a": 1 }, "ns": "test.foo", "name": "a_1" }
      // Note the a_1 index was copied

      Show
      On ubuntu:11111: > db.dropDatabase() { "dropped": "test", "ok": 1 } > db.foo.insert({a:1}) > db.foo.ensureIndex({a:1}) On ubuntu:22222: > db.dropDatabase() { "dropped": "test", "ok": 1 } > db.runCommand({cloneCollection:'test.foo', from:'ubuntu:11111', copyindexes:false}) { "ok": 1 } > db.system.indexes.find() { "v": 1, "key": { "_id": 1 }, "ns": "test.foo", "name": "_id_" } { "v": 1, "key": { "a": 1 }, "ns": "test.foo", "name": "a_1" } // Note the a_1 index was copied

    Description

      If you run cloneCollection with copyindexes:false, the indexes are still copied. There is a message logged:

      ERROR copy collection copyIndexes not implemented?  test.foo
      

      Attachments

        Activity

          People

            backlog-server-execution Backlog - Storage Execution Team
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: