...
1# Test that setting a default write concern does not add a write concern
2# to the command sent over the wire.
3# Test operations that require 4.2+ server.
4
5data:
6 - {_id: 1, x: 11}
7 - {_id: 2, x: 22}
8collection_name: &collection_name default_write_concern_coll
9database_name: &database_name default_write_concern_db
10
11runOn:
12 - minServerVersion: "4.2"
13
14tests:
15 - description: Aggregate with $merge omits default write concern
16 operations:
17 - object: collection
18 databaseOptions: {writeConcern: {}}
19 collectionOptions: {writeConcern: {}}
20 name: aggregate
21 arguments:
22 pipeline: &merge_pipeline
23 - $match: {_id: {$gt: 1}}
24 - $merge: {into: &other_collection_name "other_collection_name" }
25 expectations:
26 - command_started_event:
27 command:
28 aggregate: *collection_name
29 pipeline: *merge_pipeline
30 # "null" fields will be checked for non-existence
31 writeConcern: null
32 outcome:
33 collection:
34 name: *other_collection_name
35 data:
36 - {_id: 2, x: 22}
View as plain text