mongo-python-driver/test/read_write_concern/operation/default-write-concern-2.6.json

637 lines
15 KiB
JSON

{
"description": "default-write-concern-2.6",
"schemaVersion": "1.0",
"runOnRequirements": [
{
"minServerVersion": "2.6"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "default-write-concern-tests",
"databaseOptions": {
"writeConcern": {}
}
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "coll",
"collectionOptions": {
"writeConcern": {}
}
}
}
],
"initialData": [
{
"collectionName": "coll",
"databaseName": "default-write-concern-tests",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "DeleteOne omits default write concern",
"operations": [
{
"name": "deleteOne",
"object": "collection0",
"arguments": {
"filter": {}
},
"expectResult": {
"deletedCount": 1
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "coll",
"deletes": [
{
"q": {},
"limit": 1
}
],
"writeConcern": {
"$$exists": false
}
}
}
}
]
}
]
},
{
"description": "DeleteMany omits default write concern",
"operations": [
{
"name": "deleteMany",
"object": "collection0",
"arguments": {
"filter": {}
},
"expectResult": {
"deletedCount": 2
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "coll",
"deletes": [
{
"q": {},
"limit": 0
}
],
"writeConcern": {
"$$exists": false
}
}
}
}
]
}
]
},
{
"description": "BulkWrite with all models omits default write concern",
"operations": [
{
"name": "bulkWrite",
"object": "collection0",
"arguments": {
"ordered": true,
"requests": [
{
"deleteMany": {
"filter": {}
}
},
{
"insertOne": {
"document": {
"_id": 1
}
}
},
{
"updateOne": {
"filter": {
"_id": 1
},
"update": {
"$set": {
"x": 1
}
}
}
},
{
"insertOne": {
"document": {
"_id": 2
}
}
},
{
"replaceOne": {
"filter": {
"_id": 1
},
"replacement": {
"x": 2
}
}
},
{
"insertOne": {
"document": {
"_id": 3
}
}
},
{
"updateMany": {
"filter": {
"_id": 1
},
"update": {
"$set": {
"x": 3
}
}
}
},
{
"deleteOne": {
"filter": {
"_id": 3
}
}
}
]
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "coll",
"deletes": [
{
"q": {},
"limit": 0
}
],
"writeConcern": {
"$$exists": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"insert": "coll",
"documents": [
{
"_id": 1
}
],
"writeConcern": {
"$$exists": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"update": "coll",
"updates": [
{
"q": {
"_id": 1
},
"u": {
"$set": {
"x": 1
}
},
"upsert": {
"$$unsetOrMatches": false
},
"multi": {
"$$unsetOrMatches": false
}
}
],
"writeConcern": {
"$$exists": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"insert": "coll",
"documents": [
{
"_id": 2
}
],
"writeConcern": {
"$$exists": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"update": "coll",
"updates": [
{
"q": {
"_id": 1
},
"u": {
"x": 2
},
"upsert": {
"$$unsetOrMatches": false
},
"multi": {
"$$unsetOrMatches": false
}
}
],
"writeConcern": {
"$$exists": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"insert": "coll",
"documents": [
{
"_id": 3
}
],
"writeConcern": {
"$$exists": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"update": "coll",
"updates": [
{
"q": {
"_id": 1
},
"u": {
"$set": {
"x": 3
}
},
"multi": true,
"upsert": {
"$$unsetOrMatches": false
}
}
],
"writeConcern": {
"$$exists": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"delete": "coll",
"deletes": [
{
"q": {
"_id": 3
},
"limit": 1
}
],
"writeConcern": {
"$$exists": false
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "coll",
"databaseName": "default-write-concern-tests",
"documents": [
{
"_id": 1,
"x": 3
},
{
"_id": 2
}
]
}
]
},
{
"description": "InsertOne and InsertMany omit default write concern",
"operations": [
{
"name": "insertOne",
"object": "collection0",
"arguments": {
"document": {
"_id": 3
}
}
},
{
"name": "insertMany",
"object": "collection0",
"arguments": {
"documents": [
{
"_id": 4
},
{
"_id": 5
}
]
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"insert": "coll",
"documents": [
{
"_id": 3
}
],
"writeConcern": {
"$$exists": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"insert": "coll",
"documents": [
{
"_id": 4
},
{
"_id": 5
}
],
"writeConcern": {
"$$exists": false
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "coll",
"databaseName": "default-write-concern-tests",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3
},
{
"_id": 4
},
{
"_id": 5
}
]
}
]
},
{
"description": "UpdateOne, UpdateMany, and ReplaceOne omit default write concern",
"operations": [
{
"name": "updateOne",
"object": "collection0",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$set": {
"x": 1
}
}
}
},
{
"name": "updateMany",
"object": "collection0",
"arguments": {
"filter": {
"_id": 2
},
"update": {
"$set": {
"x": 2
}
}
}
},
{
"name": "replaceOne",
"object": "collection0",
"arguments": {
"filter": {
"_id": 2
},
"replacement": {
"x": 3
}
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "coll",
"updates": [
{
"q": {
"_id": 1
},
"u": {
"$set": {
"x": 1
}
},
"upsert": {
"$$unsetOrMatches": false
},
"multi": {
"$$unsetOrMatches": false
}
}
],
"writeConcern": {
"$$exists": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"update": "coll",
"updates": [
{
"q": {
"_id": 2
},
"u": {
"$set": {
"x": 2
}
},
"multi": true,
"upsert": {
"$$unsetOrMatches": false
}
}
],
"writeConcern": {
"$$exists": false
}
}
}
},
{
"commandStartedEvent": {
"command": {
"update": "coll",
"updates": [
{
"q": {
"_id": 2
},
"u": {
"x": 3
},
"upsert": {
"$$unsetOrMatches": false
},
"multi": {
"$$unsetOrMatches": false
}
}
],
"writeConcern": {
"$$exists": false
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "coll",
"databaseName": "default-write-concern-tests",
"documents": [
{
"_id": 1,
"x": 1
},
{
"_id": 2,
"x": 3
}
]
}
]
}
]
}