Navigation

Shard a Collection for Global Writes in Data Explorer

Administrators can shard collections residing in a Global Cluster for Global Writes using the Data Explorer.

Required Roles

You must have the Project Owner or Organization Owner role for the cluster’s Atlas project to shard a collection for Global Writes in the Data Explorer.

Considerations

Review the restrictions and compatibility requirements for Sharding Collections for Global Writes before beginning this procedure.

After selecting a shard key via the Data Explorer, Atlas attempts to shard the target collection. During this period, make sure that no user manually shards the collection. If Atlas detects that the target collection was sharded with a different key than that selected via the Data Explorer, Atlas stops the procedure and displays a warning for that collection in the Data Explorer. You can Click Unmanage Collection to clear the warning. This removes the collection from Atlas management while leaving the underlying collection and the manually chosen shard key intact.

You cannot update the value of a shard key field in an existing document in a Global Writes-enabled collection.

Procedure

To shard a collection in a Global Cluster:

1

Click Clusters in the left navigation pane.

2

Click the Collections button below the cluster that contains the collection that you want to shard.

3

Click the collection that you want to shard.

4

Click the Global Writes tab.

5

Enter the second field of the compound shard key in Second shard key field.

6

Click Shard Collection.

Atlas displays the compound shard key near the top of the Global Writes tab after configuring the collection.