-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Sharding
-
Sharding
Changing the shard key "on the fly" is pretty much impossible (see https://jira.mongodb.org/browse/SERVER-4000 ).
A possible workaround could be to move all the chunks to the same shard (database's primary), unsharding the collection and then shard it again.
But it's not currently possible to do so, we have to copy the source collection to another collection (and then drop the source/rename the target), but no changes must be happening to the source collection meanwhile or you would lose those changes.
While not ideal, this could work for some use cases.
- is duplicated by
-
SERVER-1037 Sharding - command to remove or "unshard" a collection
- Closed
- related to
-
SERVER-4000 command to change shard key of a collection
- Closed
-
SERVER-9845 Command to unshard a collection
- Closed