You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The service doesn't index the shard key by default. Once the collection is sharded an index must be explicitly created on the shard key property.
108
+
The collection can also be sharded using an admin command:
109
+
```javascript
110
+
use cosmicworks;
111
+
db.adminCommand({
112
+
"shardCollection":"cosmicworks.employee",
113
+
"key": {"firstName":"hashed"}
114
+
})
115
+
```
116
+
117
+
While it is not ideal to change the shard key after the collection has grown significantly in storage volume, the reshardCollection command can be used to alter the shard key.
0 commit comments