Skip to content

feat(shell-api): add collection.getShardLocation helper method MONGOSH-1996 #2467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 12, 2025

Conversation

nirinchev
Copy link
Collaborator

Adds the collection.getShardLocation helper that returns { shards: string[], sharded: boolean } as a response. Under the hood calls

db.aggregate([$listClusterCatalog: {
    shards: true,
}]);

and filters the result to extract the information about the current collection.

@nirinchev nirinchev requested review from addaleax and gagik June 10, 2025 11:51
@addaleax addaleax changed the title feat: add collection.getShardLocation helper method MONGOSH-1996 feat(shell-api): add collection.getShardLocation helper method MONGOSH-1996 Jun 10, 2025
@nirinchev nirinchev merged commit f852f52 into main Jun 12, 2025
130 of 134 checks passed
@nirinchev nirinchev deleted the ni/get-shard-location branch June 12, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants