diff options
author | David Storch <david.storch@mongodb.com> | 2022-11-17 19:04:21 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-11-17 20:02:18 +0000 |
commit | 20d43f94ce5e943971904f65f8abff1e8b67521f (patch) | |
tree | 3fef7261394ad0b2078708f89df032b3ecc9d25a /jstests/sharding/read_pref_with_hedging_mode.js | |
parent | be0adb109bfac64bc1177b7f43eb3a4accb6d3e9 (diff) | |
download | mongo-20d43f94ce5e943971904f65f8abff1e8b67521f.tar.gz |
SERVER-59302 Remove support in client code for commands wrapped with $query
The shell and internal client used to upconvert commands
wrapped in a "$query" or "query" to a well-formed OP_MSG.
This behavior is a holdover from when OP_QUERY was supported
and is no longer needed.
Diffstat (limited to 'jstests/sharding/read_pref_with_hedging_mode.js')
-rw-r--r-- | jstests/sharding/read_pref_with_hedging_mode.js | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/jstests/sharding/read_pref_with_hedging_mode.js b/jstests/sharding/read_pref_with_hedging_mode.js index 05c890885ee..408d93e4ca7 100644 --- a/jstests/sharding/read_pref_with_hedging_mode.js +++ b/jstests/sharding/read_pref_with_hedging_mode.js @@ -16,12 +16,12 @@ assert.commandWorked(st.s.adminCommand({shardCollection: ns, key: {x: 1}})); // Test "hedge" read preference validation. assert.commandFailedWithCode( - testDB.runCommand({query: {count: collName}, $readPreference: {mode: "primary", hedge: {}}}), + testDB.runCommand({count: collName, $readPreference: {mode: "primary", hedge: {}}}), ErrorCodes.InvalidOptions); assert.commandFailedWithCode( testDB.runCommand( - {query: {count: collName}, $readPreference: {mode: "secondaryPreferred", hedge: "_1"}}), + {count: collName, $readPreference: {mode: "secondaryPreferred", hedge: "_1"}}), ErrorCodes.TypeMismatch); // Test "readHedgingMode" server parameter validation. @@ -33,21 +33,17 @@ assert.commandWorked(st.s.adminCommand({setParameter: 1, maxTimeMSForHedgedReads // Test hedging with maxTimeMS. assert.commandWorked(st.s.getDB(dbName).runCommand( - {query: {find: collName, maxTimeMS: 1000}, $readPreference: {mode: "nearest", hedge: {}}})); + {find: collName, maxTimeMS: 1000, $readPreference: {mode: "nearest", hedge: {}}})); // Test hedging without maxTimeMS. -assert.commandWorked(st.s.getDB(dbName).runCommand({ - query: {count: collName}, - $readPreference: {mode: "secondaryPreferred", hedge: {enabled: true}} -})); +assert.commandWorked(st.s.getDB(dbName).runCommand( + {count: collName, $readPreference: {mode: "secondaryPreferred", hedge: {enabled: true}}})); // Set "readHedgingMode" to "off", expect no hedging. st.s.adminCommand({setParameter: 1, readHedgingMode: "off"}); -assert.commandWorked(st.s.getDB(dbName).runCommand({ - query: {distinct: collName, key: "x"}, - $readPreference: {mode: "primaryPreferred", hedge: {}} -})); +assert.commandWorked(st.s.getDB(dbName).runCommand( + {distinct: collName, key: "x", $readPreference: {mode: "primaryPreferred", hedge: {}}})); st.stop(); -})(); +})();
\ No newline at end of file |