summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorIan Boros <puppyofkosh@gmail.com>2019-05-15 19:05:00 -0400
committerIan Boros <puppyofkosh@gmail.com>2019-05-20 21:38:07 -0400
commitd7c2ad76b418912c16d4250bdbe74f8a9b3f51ca (patch)
tree4ff2622d3a38fbf67d73f848e2deaf3c6c5e2cc5 /jstests
parentcb7eff01f675d854d7484bd68ce298a8817d2af2 (diff)
downloadmongo-d7c2ad76b418912c16d4250bdbe74f8a9b3f51ca.tar.gz
SERVER-40555 add searchSnippet metadata
Diffstat (limited to 'jstests')
-rw-r--r--jstests/core/find_projection_meta_errors.js4
-rw-r--r--jstests/sharding/aggregates_during_balancing.js4
2 files changed, 7 insertions, 1 deletions
diff --git a/jstests/core/find_projection_meta_errors.js b/jstests/core/find_projection_meta_errors.js
index bbf91801ee0..6fd69cb9d04 100644
--- a/jstests/core/find_projection_meta_errors.js
+++ b/jstests/core/find_projection_meta_errors.js
@@ -14,6 +14,10 @@
ErrorCodes.BadValue);
assert.commandFailedWithCode(
+ db.runCommand({find: coll.getName(), projection: {score: {$meta: "searchHighlights"}}}),
+ ErrorCodes.BadValue);
+
+ assert.commandFailedWithCode(
db.runCommand({find: coll.getName(), projection: {score: {$meta: "some garbage"}}}),
ErrorCodes.BadValue);
}());
diff --git a/jstests/sharding/aggregates_during_balancing.js b/jstests/sharding/aggregates_during_balancing.js
index 149f6031583..003674e1530 100644
--- a/jstests/sharding/aggregates_during_balancing.js
+++ b/jstests/sharding/aggregates_during_balancing.js
@@ -179,7 +179,9 @@
function testSample() {
jsTestLog('testing $sample');
[0, 1, 10, nItems, nItems + 1].forEach(function(size) {
- var res = db.ts1.aggregate([{$sample: {size: size}}]).toArray();
+ // Run with 'allowDiskUse' set to true because this may exceed the in-memory sort
+ // limit.
+ var res = db.ts1.aggregate([{$sample: {size: size}}], {allowDiskUse: true}).toArray();
assert.eq(res.length, Math.min(nItems, size));
});
}