We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3bf0025 commit 10d6b60Copy full SHA for 10d6b60
packages/shell-api/src/collection.ts
@@ -42,6 +42,7 @@ import {
42
buildConfigChunksCollectionMatch,
43
onlyShardedCollectionsInConfigFilter,
44
aggregateBackgroundOptionNotSupportedHelp,
45
+ getConfigDB,
46
} from './helpers';
47
import type {
48
AnyBulkWriteOperation,
@@ -2076,6 +2077,8 @@ export default class Collection extends ShellApiWithMongoClass {
2076
2077
async getShardDistribution(): Promise<CommandResult> {
2078
this._emitCollectionApiCall('getShardDistribution', {});
2079
2080
+ await getConfigDB(this._database); // Warns if not connected to mongos
2081
+
2082
const result = {} as Document;
2083
const config = this._mongo.getDB('config');
2084
const ns = `${this._database._name}.${this._name}`;
0 commit comments