summaryrefslogtreecommitdiff
path: root/jstests/core/index_partial_create_drop.js
diff options
context:
space:
mode:
authorIan Whalen <ian.whalen@gmail.com>2016-04-12 11:19:52 -0400
committerIan Whalen <ian.whalen@gmail.com>2016-04-12 11:19:52 -0400
commit574a4910e189536215d3e3ab3c206dd44f1d699d (patch)
tree2fbbb702a16418f6917c7c1b1d2d687d227db593 /jstests/core/index_partial_create_drop.js
parent89a3de326d0e6a999149e7eca5fbab5c77f559b6 (diff)
downloadmongo-574a4910e189536215d3e3ab3c206dd44f1d699d.tar.gz
Revert "SERVER-22588 make validate command work in a sharded collection"
This reverts commit 3caa06819ab544bf9e88f4413c363a6439fe1998.
Diffstat (limited to 'jstests/core/index_partial_create_drop.js')
-rw-r--r--jstests/core/index_partial_create_drop.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/jstests/core/index_partial_create_drop.js b/jstests/core/index_partial_create_drop.js
index 483dc26f5e5..34693ec9ae9 100644
--- a/jstests/core/index_partial_create_drop.js
+++ b/jstests/core/index_partial_create_drop.js
@@ -2,14 +2,13 @@
(function() {
"use strict";
+ var isMongos = (db.runCommand("isMaster").msg === "isdbgrid");
var coll = db.index_partial_create_drop;
var getNumKeys = function(idxName) {
var res = assert.commandWorked(coll.validate(true));
var kpi;
-
- var isShardedNS = res.hasOwnProperty('raw');
- if (isShardedNS) {
+ if (isMongos) {
kpi = res.raw[Object.getOwnPropertyNames(res.raw)[0]].keysPerIndex;
} else {
kpi = res.keysPerIndex;