summaryrefslogtreecommitdiff
path: root/jstests/core/index_partial_write_ops.js
diff options
context:
space:
mode:
authorRobert Guo <robert.guo@10gen.com>2016-03-19 21:26:21 -0400
committerRobert Guo <robert.guo@10gen.com>2016-04-12 11:04:46 -0400
commit3caa06819ab544bf9e88f4413c363a6439fe1998 (patch)
tree20e22c13c5c5794cc68052f4d650e248d0c441cb /jstests/core/index_partial_write_ops.js
parent80859ca45c2392fd6c7a48f94bd6805d3fd013b0 (diff)
downloadmongo-3caa06819ab544bf9e88f4413c363a6439fe1998.tar.gz
SERVER-22588 make validate command work in a sharded collection
Diffstat (limited to 'jstests/core/index_partial_write_ops.js')
-rw-r--r--jstests/core/index_partial_write_ops.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/jstests/core/index_partial_write_ops.js b/jstests/core/index_partial_write_ops.js
index b962347a26d..2653a2edf00 100644
--- a/jstests/core/index_partial_write_ops.js
+++ b/jstests/core/index_partial_write_ops.js
@@ -2,13 +2,14 @@
(function() {
"use strict";
- var isMongos = (db.runCommand("isMaster").msg === "isdbgrid");
var coll = db.index_partial_write_ops;
var getNumKeys = function(idxName) {
var res = assert.commandWorked(coll.validate(true));
var kpi;
- if (isMongos) {
+
+ var isShardedNS = res.hasOwnProperty('raw');
+ if (isShardedNS) {
kpi = res.raw[Object.getOwnPropertyNames(res.raw)[0]].keysPerIndex;
} else {
kpi = res.keysPerIndex;