mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-24 00:17:37 +01:00
17 lines
634 B
JavaScript
17 lines
634 B
JavaScript
import {
|
|
ClusterIndexConsistencyChecker
|
|
} from "jstests/libs/check_cluster_index_consistency_helpers.js";
|
|
import {DiscoverTopology, Topology} from "jstests/libs/discover_topology.js";
|
|
|
|
assert.neq(typeof db, "undefined", "No `db` object, is the shell connected to a server?");
|
|
|
|
const conn = db.getMongo();
|
|
const topology = DiscoverTopology.findConnectedNodes(conn);
|
|
|
|
if (topology.type !== Topology.kShardedCluster) {
|
|
throw new Error(
|
|
"Cluster index consistency check must be run against a sharded cluster, but got: " +
|
|
tojson(topology));
|
|
}
|
|
ClusterIndexConsistencyChecker.run(db.getMongo(), globalThis.keyFile);
|