Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-247

Changing Shard Key Index; shard key index can be a compound index using the shard key as the prefix

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: Server
    • Labels:
      None
    • Environment:
      2.2

      All versions:

      • you need to have an index on the shard key if the collection has data.
      • the collection doesn't have data, then shardcollection creates the index.

      For 2.2:

      • SERVER-1506, if you have an a,b index then your shard key can be a.
      • if you have an index on a, you can create an index on a,b and then drop index on a.
      • at any given time you must have one index that contains the shard key as a prefix.
        (Can't be a multi-key index.)

            Assignee:
            sam.kleinman Sam Kleinman (Inactive)
            Reporter:
            matulef Kevin Matulef
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              11 years, 44 weeks, 3 days ago