diff options
author | Geert Bosch <geert@mongodb.com> | 2017-09-19 14:10:39 -0400 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2017-09-21 11:27:15 -0400 |
commit | affde69fb41c8a76bbd80dab2df3b36b3efb0450 (patch) | |
tree | a793afb50f199e8f9aaad07bd74ef8cc61388d36 /jstests | |
parent | f3bf7e7920a51df7100238a55c304ed7cd3aed1f (diff) | |
download | mongo-affde69fb41c8a76bbd80dab2df3b36b3efb0450.tar.gz |
SERVER-31159 Make count command support UUIDs
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/core/commands_with_uuid.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/jstests/core/commands_with_uuid.js b/jstests/core/commands_with_uuid.js index 4ce9a789ad9..120184ae4c8 100644 --- a/jstests/core/commands_with_uuid.js +++ b/jstests/core/commands_with_uuid.js @@ -28,7 +28,8 @@ } assert.commandWorked(db.runCommand({insert: mainCollName, documents: [{fooField: 'FOO'}]})); - assert.commandWorked(db.runCommand({insert: subCollName, documents: [{fooField: 'BAR'}]})); + assert.commandWorked( + db.runCommand({insert: subCollName, documents: [{fooField: 'BAR'}, {fooField: 'FOOBAR'}]})); // Ensure passing a UUID to find retrieves results from the correct collection. let cmd = {find: uuid}; @@ -57,6 +58,12 @@ assert.eq(doc.ns, 'test.' + mainCollName); }); + // Ensure passing a UUID to count retrieves results from the correct collection. + cmd = {count: uuid}; + res = db.runCommand(cmd); + assert.commandWorked(res, 'could not run ' + tojson(cmd)); + assert.eq(res.n, 1, "expected to count a single document with command: " + tojson(cmd)); + // Ensure passing a UUID to parallelCollectionScan retrieves results from the correct // collection. cmd = {parallelCollectionScan: uuid, numCursors: 1}; |