Skip to content

Commit b49ec57

Browse files
authored
CXX-2077 add find-allowdiskuse to test_files (#695)
1 parent 5b73b8d commit b49ec57

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

data/crud/test_files.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ v2/aggregate-merge.json
3737
v2/aggregate-out-readConcern.json
3838
v2/bulkWrite-arrayFilters.json
3939
v2/db-aggregate.json
40+
v2/find-allowdiskuse.json
4041
v2/updateWithPipelines.json

src/mongocxx/test/spec/operation.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ document::value operation_runner::_run_find(document::view operation) {
267267
options.sort(arguments["sort"].get_document().value);
268268
}
269269

270+
if (arguments["allowDiskUse"]) {
271+
options.allow_disk_use(arguments["allowDiskUse"].get_bool().value);
272+
}
273+
270274
if (arguments["modifiers"]) {
271275
document::view modifiers = arguments["modifiers"].get_document().value;
272276
if (modifiers["$comment"]) {

src/mongocxx/test_util/client_helpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ bool matches(types::bson_value::view main,
343343
continue;
344344
}
345345
if (main_view.find(el.key()) == main_view.end()) {
346-
return false;
346+
return el.get_value().type() == type::k_null;
347347
}
348348
if (!matches(main_view[el.key()].get_value(), el.get_value(), visitor_fn)) {
349349
return false;

0 commit comments

Comments
 (0)