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