diff options
Diffstat (limited to 'jstests/validate_cmd_ns.js')
-rw-r--r-- | jstests/validate_cmd_ns.js | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/jstests/validate_cmd_ns.js b/jstests/validate_cmd_ns.js deleted file mode 100644 index b13a0d98159..00000000000 --- a/jstests/validate_cmd_ns.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Tests that query against the $cmd namespace will error out when the request has - * a number to return value other than 1 or -1. Note that users cannot have - * collections named $cmd since $ is an illegal character. - */ - -// Note: _exec gives you the raw response from the server. -var res = db.$cmd.find({ whatsmyuri: 1 })._exec().next(); -assert(res.$err != null); -assert(res.$err.indexOf('bad numberToReturn') > -1); - -res = db.$cmd.find({ whatsmyuri: 1 }).limit(0)._exec().next(); -assert(res.$err != null); -assert(res.$err.indexOf('bad numberToReturn') > -1); - -res = db.$cmd.find({ whatsmyuri: 1 }).limit(-2)._exec().next(); -assert(res.$err != null); -assert(res.$err.indexOf('bad numberToReturn') > -1); - -var res = db.$cmd.find({ whatsmyuri: 1 }).limit(1).next(); -assert(res.ok); - -res = db.$cmd.find({ whatsmyuri: 1 }).limit(-1).next(); -assert(res.ok); - |