diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-05-19 11:47:32 -0400 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-05-21 18:00:44 -0400 |
commit | 87a7b96365801d1ee4a55b65d5177f202e7fc903 (patch) | |
tree | 65a13dc6ef31fdbe7570c99d3ba305e2d30b4406 /jstests/gle | |
parent | 6351419085ce95145bbb75c3ef98ca608dbb25c9 (diff) | |
download | mongo-87a7b96365801d1ee4a55b65d5177f202e7fc903.tar.gz |
SERVER-18557 remove usage of $cmd.findOne from shell and jstests
Diffstat (limited to 'jstests/gle')
-rw-r--r-- | jstests/gle/core/error1.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/jstests/gle/core/error1.js b/jstests/gle/core/error1.js index 4043bff4783..b29986976c4 100644 --- a/jstests/gle/core/error1.js +++ b/jstests/gle/core/error1.js @@ -1,9 +1,9 @@ db.jstests_error1.drop(); // test 1 -db.$cmd.findOne({reseterror:1}); -assert( db.$cmd.findOne({getlasterror:1}).err == null, "A" ); -assert( db.$cmd.findOne({getpreverror:1}).err == null, "B" ); +db.runCommand({reseterror:1}); +assert( db.runCommand({getlasterror:1}).err == null, "A" ); +assert( db.runCommand({getpreverror:1}).err == null, "B" ); db.resetError(); assert( db.getLastError() == null, "C" ); @@ -11,9 +11,9 @@ assert( db.getPrevError().err == null , "preverror 1" ); // test 2 -db.$cmd.findOne({forceerror:1}); -assert( db.$cmd.findOne({getlasterror:1}).err != null, "D" ); -assert( db.$cmd.findOne({getpreverror:1}).err != null, "E" ); +db.runCommand({forceerror:1}); +assert( db.runCommand({getlasterror:1}).err != null, "D" ); +assert( db.runCommand({getpreverror:1}).err != null, "E" ); assert( db.getLastError() != null, "F" ); @@ -21,14 +21,14 @@ assert( db.getPrevError().err != null , "preverror 2" ); assert( db.getPrevError().nPrev == 1, "G" ); db.jstests_error1.findOne(); -assert( db.$cmd.findOne({getlasterror:1}).err == null, "H" ); -assert( db.$cmd.findOne({getpreverror:1}).err != null, "I" ); -assert( db.$cmd.findOne({getpreverror:1}).nPrev == 2, "J" ); +assert( db.runCommand({getlasterror:1}).err == null, "H" ); +assert( db.runCommand({getpreverror:1}).err != null, "I" ); +assert( db.runCommand({getpreverror:1}).nPrev == 2, "J" ); db.jstests_error1.findOne(); -assert( db.$cmd.findOne({getlasterror:1}).err == null, "K" ); -assert( db.$cmd.findOne({getpreverror:1}).err != null, "L" ); -assert( db.$cmd.findOne({getpreverror:1}).nPrev == 3, "M" ); +assert( db.runCommand({getlasterror:1}).err == null, "K" ); +assert( db.runCommand({getpreverror:1}).err != null, "L" ); +assert( db.runCommand({getpreverror:1}).nPrev == 3, "M" ); db.resetError(); db.forceError(); @@ -37,5 +37,5 @@ assert( db.getLastError() == null , "getLastError 5" ); assert( db.getPrevError().err != null , "preverror 3" ); // test 3 -db.$cmd.findOne({reseterror:1}); -assert( db.$cmd.findOne({getpreverror:1}).err == null, "N" ); +db.runCommand({reseterror:1}); +assert( db.runCommand({getpreverror:1}).err == null, "N" ); |