Consider compound indexes in shardcollection command

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: 1.8.0-rc1
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When using shardcollection with a key that is a prefix of an existing compound index, one gets a message 'please create an index over the sharding key before sharding.', even though the compound index could have been used for sharding.

      For instance:

      db.Test.save(

      { a:1, b:2, c: 3}

      )
      db.Test.ensureIndex (

      {a:1,b:1}

      )

      db.runCommand({shardcollection: "test.Test", key: {a:1}}) << use compound index on a,b here instead of giving error message

            Assignee:
            Unassigned
            Reporter:
            Janick Bernet
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: