From d601b91b6b16be3f93bac2f10952c1e5d273f91f Mon Sep 17 00:00:00 2001 From: David Storch Date: Tue, 7 Oct 2014 18:23:21 -0400 Subject: SERVER-14875 explain helpers for the shell --- jstests/sharding/auth_slaveok_routing.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'jstests/sharding/auth_slaveok_routing.js') diff --git a/jstests/sharding/auth_slaveok_routing.js b/jstests/sharding/auth_slaveok_routing.js index a6552590351..96cc1cf6155 100644 --- a/jstests/sharding/auth_slaveok_routing.js +++ b/jstests/sharding/auth_slaveok_routing.js @@ -13,7 +13,9 @@ * @return {boolean} true if query was routed to a secondary node. */ function doesRouteToSec( coll, query ) { - var serverInfo = coll.find( query ).explain().serverInfo; + var explain = coll.find( query ).explain(); + assert.eq("SINGLE_SHARD", explain.queryPlanner.winningPlan.stage); + var serverInfo = explain.queryPlanner.winningPlan.shards[0].serverInfo; var conn = new Mongo( serverInfo.host + ":" + serverInfo.port.toString()); var cmdRes = conn.getDB( 'admin' ).runCommand({ isMaster: 1 }); -- cgit v1.2.1