mongo-python-driver/test/crud/unified/bypassDocumentValidation.json

494 lines
11 KiB
JSON

{
"description": "bypassDocumentValidation",
"schemaVersion": "1.4",
"runOnRequirements": [
{
"minServerVersion": "3.2",
"serverless": "forbid"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "coll"
}
}
],
"initialData": [
{
"collectionName": "coll",
"databaseName": "crud",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "Aggregate with $out passes bypassDocumentValidation: false",
"operations": [
{
"object": "collection0",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
],
"bypassDocumentValidation": false
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
],
"bypassDocumentValidation": false
},
"commandName": "aggregate",
"databaseName": "crud"
}
}
]
}
]
},
{
"description": "BulkWrite passes bypassDocumentValidation: false",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"insertOne": {
"document": {
"_id": 4,
"x": 44
}
}
}
],
"bypassDocumentValidation": false
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"insert": "coll",
"documents": [
{
"_id": 4,
"x": 44
}
],
"bypassDocumentValidation": false
}
}
}
]
}
]
},
{
"description": "FindOneAndReplace passes bypassDocumentValidation: false",
"operations": [
{
"object": "collection0",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 32
},
"bypassDocumentValidation": false
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "coll",
"query": {
"_id": {
"$gt": 1
}
},
"update": {
"x": 32
},
"bypassDocumentValidation": false
}
}
}
]
}
]
},
{
"description": "FindOneAndUpdate passes bypassDocumentValidation: false",
"operations": [
{
"object": "collection0",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"bypassDocumentValidation": false
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "coll",
"query": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"bypassDocumentValidation": false
}
}
}
]
}
]
},
{
"description": "InsertMany passes bypassDocumentValidation: false",
"operations": [
{
"object": "collection0",
"name": "insertMany",
"arguments": {
"documents": [
{
"_id": 4,
"x": 44
}
],
"bypassDocumentValidation": false
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"insert": "coll",
"documents": [
{
"_id": 4,
"x": 44
}
],
"bypassDocumentValidation": false
}
}
}
]
}
]
},
{
"description": "InsertOne passes bypassDocumentValidation: false",
"operations": [
{
"object": "collection0",
"name": "insertOne",
"arguments": {
"document": {
"_id": 4,
"x": 44
},
"bypassDocumentValidation": false
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"insert": "coll",
"documents": [
{
"_id": 4,
"x": 44
}
],
"bypassDocumentValidation": false
}
}
}
]
}
]
},
{
"description": "ReplaceOne passes bypassDocumentValidation: false",
"operations": [
{
"object": "collection0",
"name": "replaceOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 32
},
"bypassDocumentValidation": false
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "coll",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"x": 32
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
],
"bypassDocumentValidation": false
}
}
}
]
}
]
},
{
"description": "UpdateMany passes bypassDocumentValidation: false",
"operations": [
{
"object": "collection0",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"bypassDocumentValidation": false
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "coll",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"upsert": {
"$$unsetOrMatches": false
}
}
],
"bypassDocumentValidation": false
}
}
}
]
}
]
},
{
"description": "UpdateOne passes bypassDocumentValidation: false",
"operations": [
{
"object": "collection0",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"bypassDocumentValidation": false
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "coll",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
],
"bypassDocumentValidation": false
}
}
}
]
}
]
}
]
}