PYTHON-2676 Unified Test Runner changes in preparation for Load Balancer Support (#623)

Resync crud, change stream, SDAM, server_selection, transactions, uri-options, tests.
PYTHON-2348 Correctly express lack of event assertions in change stream tests.
This commit is contained in:
Shane Harvey 2021-05-18 10:20:36 -07:00 committed by GitHub
parent e221b49dfc
commit 2a74601572
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
230 changed files with 11625 additions and 8442 deletions

View File

@ -632,6 +632,8 @@ class ClientContext(object):
func=func)
def is_topology_type(self, topologies):
if 'load-balanced' in topologies and self.load_balancer:
return True
if 'single' in topologies and not (self.is_mongos or self.is_rs):
return True
if 'replicaset' in topologies and self.is_rs:

View File

@ -14,7 +14,7 @@
"changeStreamPipeline": [],
"changeStreamOptions": {},
"operations": [],
"expectations": [],
"expectations": null,
"result": {
"error": {
"code": 40573
@ -78,7 +78,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [
{
@ -125,7 +126,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},

View File

@ -20,7 +20,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -777,7 +778,7 @@
}
},
{
"description": "change stream resumes after NotMaster",
"description": "change stream resumes after NotWritablePrimary",
"minServerVersion": "4.2",
"maxServerVersion": "4.2.99",
"failPoint": {
@ -1068,7 +1069,7 @@
}
},
{
"description": "change stream resumes after NotMasterNoSlaveOk",
"description": "change stream resumes after NotPrimaryNoSecondaryOk",
"minServerVersion": "4.2",
"maxServerVersion": "4.2.99",
"failPoint": {
@ -1165,7 +1166,7 @@
}
},
{
"description": "change stream resumes after NotMasterOrSecondary",
"description": "change stream resumes after NotPrimaryOrSecondary",
"minServerVersion": "4.2",
"maxServerVersion": "4.2.99",
"failPoint": {

View File

@ -18,7 +18,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -111,7 +112,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -204,7 +206,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -297,7 +300,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -390,7 +394,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -483,7 +488,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -576,7 +582,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -654,7 +661,7 @@
}
},
{
"description": "change stream resumes after NotMaster",
"description": "change stream resumes after NotWritablePrimary",
"minServerVersion": "4.3.1",
"failPoint": {
"configureFailPoint": "failGetMoreAfterCursorCheckout",
@ -669,7 +676,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -762,7 +770,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -855,7 +864,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -933,7 +943,7 @@
}
},
{
"description": "change stream resumes after NotMasterNoSlaveOk",
"description": "change stream resumes after NotPrimaryNoSecondaryOk",
"minServerVersion": "4.3.1",
"failPoint": {
"configureFailPoint": "failGetMoreAfterCursorCheckout",
@ -948,7 +958,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -1026,7 +1037,7 @@
}
},
{
"description": "change stream resumes after NotMasterOrSecondary",
"description": "change stream resumes after NotPrimaryOrSecondary",
"minServerVersion": "4.3.1",
"failPoint": {
"configureFailPoint": "failGetMoreAfterCursorCheckout",
@ -1041,7 +1052,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -1134,7 +1146,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -1227,7 +1240,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -1320,7 +1334,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -1413,7 +1428,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -1512,7 +1528,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},
@ -1608,7 +1625,8 @@
"target": "collection",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
],
"changeStreamPipeline": [],
"changeStreamOptions": {},

View File

@ -82,7 +82,7 @@
}
}
],
"expectations": [],
"expectations": null,
"result": {
"success": [
{

View File

@ -0,0 +1,497 @@
{
"description": "aggregate-merge",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.1.11"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_aggregate_merge"
}
},
{
"collection": {
"id": "collection_readConcern_majority",
"database": "database0",
"collectionName": "test_aggregate_merge",
"collectionOptions": {
"readConcern": {
"level": "majority"
}
}
}
},
{
"collection": {
"id": "collection_readConcern_local",
"database": "database0",
"collectionName": "test_aggregate_merge",
"collectionOptions": {
"readConcern": {
"level": "local"
}
}
}
},
{
"collection": {
"id": "collection_readConcern_available",
"database": "database0",
"collectionName": "test_aggregate_merge",
"collectionOptions": {
"readConcern": {
"level": "available"
}
}
}
}
],
"initialData": [
{
"collectionName": "test_aggregate_merge",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "Aggregate with $merge",
"operations": [
{
"object": "collection0",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
]
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "test_aggregate_merge",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "other_test_collection",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "Aggregate with $merge and batch size of 0",
"operations": [
{
"object": "collection0",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
],
"batchSize": 0
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "test_aggregate_merge",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
],
"cursor": {}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "other_test_collection",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "Aggregate with $merge and majority readConcern",
"operations": [
{
"object": "collection_readConcern_majority",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
]
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "test_aggregate_merge",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
],
"readConcern": {
"level": "majority"
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "other_test_collection",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "Aggregate with $merge and local readConcern",
"operations": [
{
"object": "collection_readConcern_local",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
]
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "test_aggregate_merge",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
],
"readConcern": {
"level": "local"
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "other_test_collection",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "Aggregate with $merge and available readConcern",
"operations": [
{
"object": "collection_readConcern_available",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
]
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "test_aggregate_merge",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
],
"readConcern": {
"level": "available"
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "other_test_collection",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
}
]
}

View File

@ -0,0 +1,406 @@
{
"description": "aggregate-out-readConcern",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.1.0",
"topologies": [
"replicaset",
"sharded"
]
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_aggregate_out_readconcern"
}
},
{
"collection": {
"id": "collection_readConcern_majority",
"database": "database0",
"collectionName": "test_aggregate_out_readconcern",
"collectionOptions": {
"readConcern": {
"level": "majority"
}
}
}
},
{
"collection": {
"id": "collection_readConcern_local",
"database": "database0",
"collectionName": "test_aggregate_out_readconcern",
"collectionOptions": {
"readConcern": {
"level": "local"
}
}
}
},
{
"collection": {
"id": "collection_readConcern_available",
"database": "database0",
"collectionName": "test_aggregate_out_readconcern",
"collectionOptions": {
"readConcern": {
"level": "available"
}
}
}
},
{
"collection": {
"id": "collection_readConcern_linearizable",
"database": "database0",
"collectionName": "test_aggregate_out_readconcern",
"collectionOptions": {
"readConcern": {
"level": "linearizable"
}
}
}
}
],
"initialData": [
{
"collectionName": "test_aggregate_out_readconcern",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "readConcern majority with out stage",
"operations": [
{
"object": "collection_readConcern_majority",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
]
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "test_aggregate_out_readconcern",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
],
"readConcern": {
"level": "majority"
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "other_test_collection",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "readConcern local with out stage",
"operations": [
{
"object": "collection_readConcern_local",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
]
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "test_aggregate_out_readconcern",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
],
"readConcern": {
"level": "local"
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "other_test_collection",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "readConcern available with out stage",
"operations": [
{
"object": "collection_readConcern_available",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
]
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "test_aggregate_out_readconcern",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
],
"readConcern": {
"level": "available"
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "other_test_collection",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "readConcern linearizable with out stage",
"operations": [
{
"object": "collection_readConcern_linearizable",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
]
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "test_aggregate_out_readconcern",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
],
"readConcern": {
"level": "linearizable"
}
}
}
}
]
}
]
}
]
}

View File

@ -0,0 +1,166 @@
{
"description": "aggregate",
"schemaVersion": "1.0",
"createEntities": [
{
"client": {
"id": "client0",
"useMultipleMongoses": true,
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "aggregate-tests"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "coll0"
}
}
],
"initialData": [
{
"collectionName": "coll0",
"databaseName": "aggregate-tests",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
},
{
"_id": 5,
"x": 55
},
{
"_id": 6,
"x": 66
}
]
}
],
"tests": [
{
"description": "aggregate with multiple batches works",
"operations": [
{
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$match": {
"_id": {
"$gt": 1
}
}
}
],
"batchSize": 2
},
"object": "collection0",
"expectResult": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
},
{
"_id": 5,
"x": 55
},
{
"_id": 6,
"x": 66
}
]
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll0",
"pipeline": [
{
"$match": {
"_id": {
"$gt": 1
}
}
}
],
"cursor": {
"batchSize": 2
}
},
"commandName": "aggregate",
"databaseName": "aggregate-tests"
}
},
{
"commandStartedEvent": {
"command": {
"getMore": {
"$$type": [
"int",
"long"
]
},
"collection": "coll0",
"batchSize": 2
},
"commandName": "getMore",
"databaseName": "aggregate-tests"
}
},
{
"commandStartedEvent": {
"command": {
"getMore": {
"$$type": [
"int",
"long"
]
},
"collection": "coll0",
"batchSize": 2
},
"commandName": "getMore",
"databaseName": "aggregate-tests"
}
}
]
}
]
}
]
}

View File

@ -1,29 +1,61 @@
{
"runOn": [
"description": "bulkWrite-arrayFilters-clientError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"maxServerVersion": "3.5.5"
}
],
"data": [
"createEntities": [
{
"_id": 1,
"y": [
{
"b": 3
},
{
"b": 1
}
]
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"_id": 2,
"y": [
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "crud-v2"
}
}
],
"initialData": [
{
"collectionName": "crud-v2",
"databaseName": "crud-v2",
"documents": [
{
"b": 0
"_id": 1,
"y": [
{
"b": 3
},
{
"b": 1
}
]
},
{
"b": 1
"_id": 2,
"y": [
{
"b": 0
},
{
"b": 1
}
]
}
]
}
@ -33,12 +65,12 @@
"description": "BulkWrite on server that doesn't support arrayFilters",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateOne",
"arguments": {
"updateOne": {
"filter": {},
"update": {
"$set": {
@ -53,25 +85,30 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": []
"expectEvents": [
{
"client": "client0",
"events": []
}
]
},
{
"description": "BulkWrite on server that doesn't support arrayFilters with arrayFilters on second op",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateOne",
"arguments": {
"updateOne": {
"filter": {},
"update": {
"$set": {
@ -81,8 +118,7 @@
}
},
{
"name": "updateMany",
"arguments": {
"updateMany": {
"filter": {},
"update": {
"$set": {
@ -97,14 +133,19 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": []
"expectEvents": [
{
"client": "client0",
"events": []
}
]
}
]
}

View File

@ -0,0 +1,279 @@
{
"description": "bulkWrite-arrayFilters",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "3.5.6"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-tests"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test"
}
}
],
"initialData": [
{
"collectionName": "test",
"databaseName": "crud-tests",
"documents": [
{
"_id": 1,
"y": [
{
"b": 3
},
{
"b": 1
}
]
},
{
"_id": 2,
"y": [
{
"b": 0
},
{
"b": 1
}
]
}
]
}
],
"tests": [
{
"description": "BulkWrite updateOne with arrayFilters",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"updateOne": {
"filter": {},
"update": {
"$set": {
"y.$[i].b": 2
}
},
"arrayFilters": [
{
"i.b": 3
}
]
}
}
],
"ordered": true
},
"expectResult": {
"deletedCount": 0,
"insertedCount": 0,
"insertedIds": {
"$$unsetOrMatches": {}
},
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test",
"updates": [
{
"q": {},
"u": {
"$set": {
"y.$[i].b": 2
}
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
},
"arrayFilters": [
{
"i.b": 3
}
]
}
],
"ordered": true
},
"commandName": "update",
"databaseName": "crud-tests"
}
}
]
}
],
"outcome": [
{
"collectionName": "test",
"databaseName": "crud-tests",
"documents": [
{
"_id": 1,
"y": [
{
"b": 2
},
{
"b": 1
}
]
},
{
"_id": 2,
"y": [
{
"b": 0
},
{
"b": 1
}
]
}
]
}
]
},
{
"description": "BulkWrite updateMany with arrayFilters",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"updateMany": {
"filter": {},
"update": {
"$set": {
"y.$[i].b": 2
}
},
"arrayFilters": [
{
"i.b": 1
}
]
}
}
],
"ordered": true
},
"expectResult": {
"deletedCount": 0,
"insertedCount": 0,
"insertedIds": {
"$$unsetOrMatches": {}
},
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test",
"updates": [
{
"q": {},
"u": {
"$set": {
"y.$[i].b": 2
}
},
"multi": true,
"upsert": {
"$$unsetOrMatches": false
},
"arrayFilters": [
{
"i.b": 1
}
]
}
],
"ordered": true
},
"commandName": "update",
"databaseName": "crud-tests"
}
}
]
}
],
"outcome": [
{
"collectionName": "test",
"databaseName": "crud-tests",
"documents": [
{
"_id": 1,
"y": [
{
"b": 3
},
{
"b": 2
}
]
},
{
"_id": 2,
"y": [
{
"b": 0
},
{
"b": 2
}
]
}
]
}
]
}
]
}

View File

@ -1,39 +1,70 @@
{
"runOn": [
"description": "bulkWrite-delete-hint-clientError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"maxServerVersion": "3.3.99"
}
],
"data": [
"createEntities": [
{
"_id": 1,
"x": 11
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"_id": 2,
"x": 22
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "BulkWrite_delete_hint"
}
}
],
"initialData": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
],
"collection_name": "BulkWrite_delete_hint",
"tests": [
{
"description": "BulkWrite deleteOne with hints unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "deleteOne",
"arguments": {
"deleteOne": {
"filter": {
"_id": 1
},
@ -41,8 +72,7 @@
}
},
{
"name": "deleteOne",
"arguments": {
"deleteOne": {
"filter": {
"_id": 2
},
@ -52,17 +82,24 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -81,18 +118,18 @@
}
]
}
}
]
},
{
"description": "BulkWrite deleteMany with hints unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "deleteMany",
"arguments": {
"deleteMany": {
"filter": {
"_id": {
"$lt": 3
@ -102,8 +139,7 @@
}
},
{
"name": "deleteMany",
"arguments": {
"deleteMany": {
"filter": {
"_id": {
"$gte": 4
@ -115,17 +151,24 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -144,7 +187,7 @@
}
]
}
}
]
}
]
}

View File

@ -0,0 +1,252 @@
{
"description": "bulkWrite-delete-hint-serverError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.3.3"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "BulkWrite_delete_hint"
}
}
],
"initialData": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
],
"tests": [
{
"description": "BulkWrite deleteOne with hints unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"deleteOne": {
"filter": {
"_id": 1
},
"hint": "_id_"
}
},
{
"deleteOne": {
"filter": {
"_id": 2
},
"hint": {
"_id": 1
}
}
}
],
"ordered": true
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "BulkWrite_delete_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": "_id_",
"limit": 1
},
{
"q": {
"_id": 2
},
"hint": {
"_id": 1
},
"limit": 1
}
],
"ordered": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
]
},
{
"description": "BulkWrite deleteMany with hints unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"deleteMany": {
"filter": {
"_id": {
"$lt": 3
}
},
"hint": "_id_"
}
},
{
"deleteMany": {
"filter": {
"_id": {
"$gte": 4
}
},
"hint": {
"_id": 1
}
}
}
],
"ordered": true
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "BulkWrite_delete_hint",
"deletes": [
{
"q": {
"_id": {
"$lt": 3
}
},
"hint": "_id_",
"limit": 0
},
{
"q": {
"_id": {
"$gte": 4
}
},
"hint": {
"_id": 1
},
"limit": 0
}
],
"ordered": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
]
}
]
}

View File

@ -0,0 +1,247 @@
{
"description": "bulkWrite-delete-hint",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.3.4"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "BulkWrite_delete_hint"
}
}
],
"initialData": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
],
"tests": [
{
"description": "BulkWrite deleteOne with hints",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"deleteOne": {
"filter": {
"_id": 1
},
"hint": "_id_"
}
},
{
"deleteOne": {
"filter": {
"_id": 2
},
"hint": {
"_id": 1
}
}
}
],
"ordered": true
},
"expectResult": {
"deletedCount": 2,
"insertedCount": 0,
"insertedIds": {
"$$unsetOrMatches": {}
},
"matchedCount": 0,
"modifiedCount": 0,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "BulkWrite_delete_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": "_id_",
"limit": 1
},
{
"q": {
"_id": 2
},
"hint": {
"_id": 1
},
"limit": 1
}
],
"ordered": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
]
},
{
"description": "BulkWrite deleteMany with hints",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"deleteMany": {
"filter": {
"_id": {
"$lt": 3
}
},
"hint": "_id_"
}
},
{
"deleteMany": {
"filter": {
"_id": {
"$gte": 4
}
},
"hint": {
"_id": 1
}
}
}
],
"ordered": true
},
"expectResult": {
"deletedCount": 3,
"insertedCount": 0,
"insertedIds": {
"$$unsetOrMatches": {}
},
"matchedCount": 0,
"modifiedCount": 0,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "BulkWrite_delete_hint",
"deletes": [
{
"q": {
"_id": {
"$lt": 3
}
},
"hint": "_id_",
"limit": 0
},
{
"q": {
"_id": {
"$gte": 4
}
},
"hint": {
"_id": 1
},
"limit": 0
}
],
"ordered": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 3,
"x": 33
}
]
}
]
}
]
}

View File

@ -1,39 +1,70 @@
{
"runOn": [
"description": "bulkWrite-update-hint-clientError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"maxServerVersion": "3.3.99"
}
],
"data": [
"createEntities": [
{
"_id": 1,
"x": 11
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"_id": 2,
"x": 22
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_bulkwrite_update_hint"
}
}
],
"initialData": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
],
"collection_name": "test_bulkwrite_update_hint",
"tests": [
{
"description": "BulkWrite updateOne with update hints unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateOne",
"arguments": {
"updateOne": {
"filter": {
"_id": 1
},
@ -46,8 +77,7 @@
}
},
{
"name": "updateOne",
"arguments": {
"updateOne": {
"filter": {
"_id": 1
},
@ -62,17 +92,24 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -91,18 +128,18 @@
}
]
}
}
]
},
{
"description": "BulkWrite updateMany with update hints unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateMany",
"arguments": {
"updateMany": {
"filter": {
"_id": {
"$lt": 3
@ -117,8 +154,7 @@
}
},
{
"name": "updateMany",
"arguments": {
"updateMany": {
"filter": {
"_id": {
"$lt": 3
@ -135,17 +171,24 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -164,18 +207,18 @@
}
]
}
}
]
},
{
"description": "BulkWrite replaceOne with update hints unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "replaceOne",
"arguments": {
"replaceOne": {
"filter": {
"_id": 3
},
@ -186,8 +229,7 @@
}
},
{
"name": "replaceOne",
"arguments": {
"replaceOne": {
"filter": {
"_id": 4
},
@ -200,17 +242,24 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -229,7 +278,7 @@
}
]
}
}
]
}
]
}

View File

@ -0,0 +1,422 @@
{
"description": "bulkWrite-update-hint-serverError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.1.9"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_bulkwrite_update_hint"
}
}
],
"initialData": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
],
"tests": [
{
"description": "BulkWrite updateOne with update hints unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"updateOne": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
},
{
"updateOne": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"ordered": true
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": 1
},
"u": {
"$inc": {
"x": 1
}
},
"hint": "_id_",
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
},
{
"q": {
"_id": 1
},
"u": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
],
"ordered": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
]
},
{
"description": "BulkWrite updateMany with update hints unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"updateMany": {
"filter": {
"_id": {
"$lt": 3
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
},
{
"updateMany": {
"filter": {
"_id": {
"$lt": 3
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"ordered": true
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": {
"$lt": 3
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": "_id_",
"upsert": {
"$$unsetOrMatches": false
}
},
{
"q": {
"_id": {
"$lt": 3
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": {
"_id": 1
},
"upsert": {
"$$unsetOrMatches": false
}
}
],
"ordered": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
]
},
{
"description": "BulkWrite replaceOne with update hints unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"replaceOne": {
"filter": {
"_id": 3
},
"replacement": {
"x": 333
},
"hint": "_id_"
}
},
{
"replaceOne": {
"filter": {
"_id": 4
},
"replacement": {
"x": 444
},
"hint": {
"_id": 1
}
}
}
],
"ordered": true
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": 3
},
"u": {
"x": 333
},
"hint": "_id_",
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
},
{
"q": {
"_id": 4
},
"u": {
"x": 444
},
"hint": {
"_id": 1
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
],
"ordered": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
]
}
]
}

View File

@ -0,0 +1,445 @@
{
"description": "bulkWrite-update-hint",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.2.0"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_bulkwrite_update_hint"
}
}
],
"initialData": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
],
"tests": [
{
"description": "BulkWrite updateOne with update hints",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"updateOne": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
},
{
"updateOne": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"ordered": true
},
"expectResult": {
"deletedCount": 0,
"insertedCount": 0,
"insertedIds": {
"$$unsetOrMatches": {}
},
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": 1
},
"u": {
"$inc": {
"x": 1
}
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
},
"hint": "_id_"
},
{
"q": {
"_id": 1
},
"u": {
"$inc": {
"x": 1
}
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
},
"hint": {
"_id": 1
}
}
],
"ordered": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 13
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
]
},
{
"description": "BulkWrite updateMany with update hints",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"updateMany": {
"filter": {
"_id": {
"$lt": 3
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
},
{
"updateMany": {
"filter": {
"_id": {
"$lt": 3
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"ordered": true
},
"expectResult": {
"deletedCount": 0,
"insertedCount": 0,
"insertedIds": {
"$$unsetOrMatches": {}
},
"matchedCount": 4,
"modifiedCount": 4,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": {
"$lt": 3
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"upsert": {
"$$unsetOrMatches": false
},
"hint": "_id_"
},
{
"q": {
"_id": {
"$lt": 3
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"upsert": {
"$$unsetOrMatches": false
},
"hint": {
"_id": 1
}
}
],
"ordered": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 13
},
{
"_id": 2,
"x": 24
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
]
},
{
"description": "BulkWrite replaceOne with update hints",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"replaceOne": {
"filter": {
"_id": 3
},
"replacement": {
"x": 333
},
"hint": "_id_"
}
},
{
"replaceOne": {
"filter": {
"_id": 4
},
"replacement": {
"x": 444
},
"hint": {
"_id": 1
}
}
}
],
"ordered": true
},
"expectResult": {
"deletedCount": 0,
"insertedCount": 0,
"insertedIds": {
"$$unsetOrMatches": {}
},
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": 3
},
"u": {
"x": 333
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
},
"hint": "_id_"
},
{
"q": {
"_id": 4
},
"u": {
"x": 444
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
},
"hint": {
"_id": 1
}
}
],
"ordered": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 333
},
{
"_id": 4,
"x": 444
}
]
}
]
}
]
}

View File

@ -1,16 +1,48 @@
{
"data": [
"description": "bulkWrite-update-validation",
"schemaVersion": "1.1",
"createEntities": [
{
"_id": 1,
"x": 11
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"_id": 2,
"x": 22
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"_id": 3,
"x": 33
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "crud-v2"
}
}
],
"initialData": [
{
"collectionName": "crud-v2",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
@ -18,12 +50,12 @@
"description": "BulkWrite replaceOne prohibits atomic modifiers",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "replaceOne",
"arguments": {
"replaceOne": {
"filter": {
"_id": 1
},
@ -36,13 +68,22 @@
}
]
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "crud-v2",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -57,18 +98,18 @@
}
]
}
}
]
},
{
"description": "BulkWrite updateOne requires atomic modifiers",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateOne",
"arguments": {
"updateOne": {
"filter": {
"_id": 1
},
@ -79,13 +120,22 @@
}
]
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "crud-v2",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -100,18 +150,18 @@
}
]
}
}
]
},
{
"description": "BulkWrite updateMany requires atomic modifiers",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateMany",
"arguments": {
"updateMany": {
"filter": {
"_id": {
"$gt": 1
@ -124,13 +174,22 @@
}
]
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "crud-v2",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -145,7 +204,7 @@
}
]
}
}
]
}
]
}

View File

@ -1,17 +1,43 @@
{
"runOn": [
"description": "db-aggregate",
"schemaVersion": "1.4",
"runOnRequirements": [
{
"minServerVersion": "3.6.0"
"minServerVersion": "3.6.0",
"serverless": "forbid"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "admin"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "crud-v2"
}
}
],
"database_name": "admin",
"tests": [
{
"description": "Aggregate with $listLocalSessions",
"operations": [
{
"object": "database0",
"name": "aggregate",
"object": "database",
"arguments": {
"pipeline": [
{
@ -33,7 +59,7 @@
}
]
},
"result": [
"expectResult": [
{
"dummy": "dummy field"
}
@ -45,8 +71,8 @@
"description": "Aggregate with $listLocalSessions and allowDiskUse",
"operations": [
{
"object": "database0",
"name": "aggregate",
"object": "database",
"arguments": {
"pipeline": [
{
@ -69,7 +95,7 @@
],
"allowDiskUse": true
},
"result": [
"expectResult": [
{
"dummy": "dummy field"
}

View File

@ -0,0 +1,149 @@
{
"description": "deleteMany-hint-clientError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"maxServerVersion": "3.3.99"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "DeleteMany_hint"
}
}
],
"initialData": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "DeleteMany with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "DeleteMany with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
}
]
}

View File

@ -0,0 +1,190 @@
{
"description": "deleteMany-hint-serverError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.3.3"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "DeleteMany_hint"
}
}
],
"initialData": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "DeleteMany with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "DeleteMany_hint",
"deletes": [
{
"q": {
"_id": {
"$gt": 1
}
},
"hint": "_id_",
"limit": 0
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "DeleteMany with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "DeleteMany_hint",
"deletes": [
{
"q": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
},
"limit": 0
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
}
]
}

View File

@ -0,0 +1,173 @@
{
"description": "deleteMany-hint",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.3.4"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "DeleteMany_hint"
}
}
],
"initialData": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "DeleteMany with hint string",
"operations": [
{
"object": "collection0",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": "_id_"
},
"expectResult": {
"deletedCount": 2
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "DeleteMany_hint",
"deletes": [
{
"q": {
"_id": {
"$gt": 1
}
},
"hint": "_id_",
"limit": 0
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
}
]
}
]
},
{
"description": "DeleteMany with hint document",
"operations": [
{
"object": "collection0",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
}
},
"expectResult": {
"deletedCount": 2
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "DeleteMany_hint",
"deletes": [
{
"q": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
},
"limit": 0
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
}
]
}
]
}
]
}

View File

@ -0,0 +1,133 @@
{
"description": "deleteOne-hint-clientError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"maxServerVersion": "3.3.99"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "DeleteOne_hint"
}
}
],
"initialData": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "DeleteOne with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "DeleteOne with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,170 @@
{
"description": "deleteOne-hint-serverError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.3.3"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "DeleteOne_hint"
}
}
],
"initialData": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "DeleteOne with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "DeleteOne_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": "_id_",
"limit": 1
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "DeleteOne with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "DeleteOne_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": {
"_id": 1
},
"limit": 1
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,161 @@
{
"description": "deleteOne-hint",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.3.4"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "DeleteOne_hint"
}
}
],
"initialData": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "DeleteOne with hint string",
"operations": [
{
"object": "collection0",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"expectResult": {
"deletedCount": 1
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "DeleteOne_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": "_id_",
"limit": 1
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "deleteOne with hint document",
"operations": [
{
"object": "collection0",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"expectResult": {
"deletedCount": 1
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"delete": "DeleteOne_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": {
"_id": 1
},
"limit": 1
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,79 @@
{
"description": "find-allowdiskuse-clientError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"maxServerVersion": "3.0.99"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_find_allowdiskuse_clienterror"
}
}
],
"tests": [
{
"description": "Find fails when allowDiskUse true is specified against pre 3.2 server",
"operations": [
{
"object": "collection0",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": true
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
]
},
{
"description": "Find fails when allowDiskUse false is specified against pre 3.2 server",
"operations": [
{
"object": "collection0",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": false
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
]
}
]
}

View File

@ -0,0 +1,100 @@
{
"description": "find-allowdiskuse-serverError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "3.2",
"maxServerVersion": "4.3.0"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_find_allowdiskuse_servererror"
}
}
],
"tests": [
{
"description": "Find fails when allowDiskUse true is specified against pre 4.4 server (server-side error)",
"operations": [
{
"object": "collection0",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": true
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"find": "test_find_allowdiskuse_servererror",
"filter": {},
"allowDiskUse": true
}
}
}
]
}
]
},
{
"description": "Find fails when allowDiskUse false is specified against pre 4.4 server (server-side error)",
"operations": [
{
"object": "collection0",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": false
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"find": "test_find_allowdiskuse_servererror",
"filter": {},
"allowDiskUse": false
}
}
}
]
}
]
}
]
}

View File

@ -0,0 +1,120 @@
{
"description": "find-allowdiskuse",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.3.1"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_find_allowdiskuse"
}
}
],
"tests": [
{
"description": "Find does not send allowDiskuse when value is not specified",
"operations": [
{
"object": "collection0",
"name": "find",
"arguments": {
"filter": {}
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"find": "test_find_allowdiskuse",
"allowDiskUse": {
"$$exists": false
}
}
}
}
]
}
]
},
{
"description": "Find sends allowDiskuse false when false is specified",
"operations": [
{
"object": "collection0",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": false
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"find": "test_find_allowdiskuse",
"allowDiskUse": false
}
}
}
]
}
]
},
{
"description": "Find sends allowDiskUse true when true is specified",
"operations": [
{
"object": "collection0",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"find": "test_find_allowdiskuse",
"allowDiskUse": true
}
}
}
]
}
]
}
]
}

156
test/crud/unified/find.json Normal file
View File

@ -0,0 +1,156 @@
{
"description": "find",
"schemaVersion": "1.0",
"createEntities": [
{
"client": {
"id": "client0",
"useMultipleMongoses": true,
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "find-tests"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "coll0"
}
}
],
"initialData": [
{
"collectionName": "coll0",
"databaseName": "find-tests",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
},
{
"_id": 5,
"x": 55
},
{
"_id": 6,
"x": 66
}
]
}
],
"tests": [
{
"description": "find with multiple batches works",
"operations": [
{
"name": "find",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"batchSize": 2
},
"object": "collection0",
"expectResult": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
},
{
"_id": 5,
"x": 55
},
{
"_id": 6,
"x": 66
}
]
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"find": "coll0",
"filter": {
"_id": {
"$gt": 1
}
},
"batchSize": 2
},
"commandName": "find",
"databaseName": "find-tests"
}
},
{
"commandStartedEvent": {
"command": {
"getMore": {
"$$type": [
"int",
"long"
]
},
"collection": "coll0",
"batchSize": 2
},
"commandName": "getMore",
"databaseName": "find-tests"
}
},
{
"commandStartedEvent": {
"command": {
"getMore": {
"$$type": [
"int",
"long"
]
},
"collection": "coll0",
"batchSize": 2
},
"commandName": "getMore",
"databaseName": "find-tests"
}
}
]
}
]
}
]
}

View File

@ -0,0 +1,133 @@
{
"description": "findOneAndDelete-hint-clientError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"maxServerVersion": "4.0.99"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "findOneAndDelete_hint"
}
}
],
"initialData": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "FindOneAndDelete with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "FindOneAndDelete with hint document",
"operations": [
{
"object": "collection0",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,162 @@
{
"description": "findOneAndDelete-hint-serverError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.2.0",
"maxServerVersion": "4.3.3"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "findOneAndDelete_hint"
}
}
],
"initialData": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "FindOneAndDelete with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndDelete_hint",
"query": {
"_id": 1
},
"hint": "_id_",
"remove": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "FindOneAndDelete with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndDelete_hint",
"query": {
"_id": 1
},
"hint": {
"_id": 1
},
"remove": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,155 @@
{
"description": "findOneAndDelete-hint",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.3.4"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "findOneAndDelete_hint"
}
}
],
"initialData": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "FindOneAndDelete with hint string",
"operations": [
{
"object": "collection0",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"expectResult": {
"_id": 1,
"x": 11
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndDelete_hint",
"query": {
"_id": 1
},
"hint": "_id_",
"remove": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "FindOneAndDelete with hint document",
"operations": [
{
"object": "collection0",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"expectResult": {
"_id": 1,
"x": 11
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndDelete_hint",
"query": {
"_id": 1
},
"hint": {
"_id": 1
},
"remove": true
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,139 @@
{
"description": "findOneAndReplace-hint-clientError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"maxServerVersion": "4.0.99"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "findOneAndReplace_hint"
}
}
],
"initialData": [
{
"collectionName": "findOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "FindOneAndReplace with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "findOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "FindOneAndReplace with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "findOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,172 @@
{
"description": "findOneAndReplace-hint-serverError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.2.0",
"maxServerVersion": "4.3.0"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "findOneAndReplace_hint"
}
}
],
"initialData": [
{
"collectionName": "findOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "FindOneAndReplace with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndReplace_hint",
"query": {
"_id": 1
},
"update": {
"x": 33
},
"hint": "_id_"
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "FindOneAndReplace with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndReplace_hint",
"query": {
"_id": 1
},
"update": {
"x": 33
},
"hint": {
"_id": 1
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,173 @@
{
"description": "findOneAndReplace-hint",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.3.1"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "findOneAndReplace_hint"
}
}
],
"initialData": [
{
"collectionName": "findOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "FindOneAndReplace with hint string",
"operations": [
{
"object": "collection0",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": "_id_"
},
"expectResult": {
"_id": 1,
"x": 11
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndReplace_hint",
"query": {
"_id": 1
},
"update": {
"x": 33
},
"hint": "_id_"
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 33
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "FindOneAndReplace with hint document",
"operations": [
{
"object": "collection0",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": {
"_id": 1
}
},
"expectResult": {
"_id": 1,
"x": 11
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndReplace_hint",
"query": {
"_id": 1
},
"update": {
"x": 33
},
"hint": {
"_id": 1
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 33
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,143 @@
{
"description": "findOneAndUpdate-hint-clientError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"maxServerVersion": "4.0.99"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "findOneAndUpdate_hint"
}
}
],
"initialData": [
{
"collectionName": "findOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "FindOneAndUpdate with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "findOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "FindOneAndUpdate with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "findOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,180 @@
{
"description": "findOneAndUpdate-hint-serverError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.2.0",
"maxServerVersion": "4.3.0"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "findOneAndUpdate_hint"
}
}
],
"initialData": [
{
"collectionName": "findOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "FindOneAndUpdate with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndUpdate_hint",
"query": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "FindOneAndUpdate with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndUpdate_hint",
"query": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,181 @@
{
"description": "findOneAndUpdate-hint",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.3.1"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "findOneAndUpdate_hint"
}
}
],
"initialData": [
{
"collectionName": "findOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "FindOneAndUpdate with hint string",
"operations": [
{
"object": "collection0",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"expectResult": {
"_id": 1,
"x": 11
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndUpdate_hint",
"query": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 12
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "FindOneAndUpdate with hint document",
"operations": [
{
"object": "collection0",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"expectResult": {
"_id": 1,
"x": 11
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "findOneAndUpdate_hint",
"query": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
}
]
}
],
"outcome": [
{
"collectionName": "findOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 12
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,203 @@
{
"description": "replaceOne-hint",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.2.0"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_replaceone_hint"
}
}
],
"initialData": [
{
"collectionName": "test_replaceone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "ReplaceOne with hint string",
"operations": [
{
"object": "collection0",
"name": "replaceOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 111
},
"hint": "_id_"
},
"expectResult": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_replaceone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"x": 111
},
"hint": "_id_",
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_replaceone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 111
}
]
}
]
},
{
"description": "ReplaceOne with hint document",
"operations": [
{
"object": "collection0",
"name": "replaceOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 111
},
"hint": {
"_id": 1
}
},
"expectResult": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_replaceone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"x": 111
},
"hint": {
"_id": 1
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_replaceone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 111
}
]
}
]
}
]
}

View File

@ -0,0 +1,82 @@
{
"description": "replaceOne-validation",
"schemaVersion": "1.1",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "crud-v2"
}
}
],
"initialData": [
{
"collectionName": "crud-v2",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
}
]
}
],
"tests": [
{
"description": "ReplaceOne prohibits atomic modifiers",
"operations": [
{
"object": "collection0",
"name": "replaceOne",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"$set": {
"x": 22
}
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "crud-v2",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
}
]
}
]
}
]
}

View File

@ -1,39 +1,70 @@
{
"data": [
"description": "unacknowledged-bulkWrite-delete-hint-clientError",
"schemaVersion": "1.1",
"createEntities": [
{
"_id": 1,
"x": 11
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"_id": 2,
"x": 22
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "BulkWrite_delete_hint",
"collectionOptions": {
"writeConcern": {
"w": 0
}
}
}
}
],
"initialData": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
],
"collection_name": "BulkWrite_delete_hint",
"tests": [
{
"description": "Unacknowledged bulkWrite deleteOne with hints fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"arguments": {
"requests": [
{
"name": "deleteOne",
"arguments": {
"deleteOne": {
"filter": {
"_id": 1
},
@ -41,8 +72,7 @@
}
},
{
"name": "deleteOne",
"arguments": {
"deleteOne": {
"filter": {
"_id": 2
},
@ -52,17 +82,24 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -81,23 +118,18 @@
}
]
}
}
]
},
{
"description": "Unacknowledged bulkWrite deleteMany with hints fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"arguments": {
"requests": [
{
"name": "deleteMany",
"arguments": {
"deleteMany": {
"filter": {
"_id": {
"$lt": 3
@ -107,8 +139,7 @@
}
},
{
"name": "deleteMany",
"arguments": {
"deleteMany": {
"filter": {
"_id": {
"$gte": 4
@ -120,17 +151,24 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "BulkWrite_delete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -149,7 +187,7 @@
}
]
}
}
]
}
]
}

View File

@ -1,39 +1,70 @@
{
"data": [
"description": "unacknowledged-bulkWrite-update-hint-clientError",
"schemaVersion": "1.1",
"createEntities": [
{
"_id": 1,
"x": 11
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"_id": 2,
"x": 22
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "Bulkwrite_update_hint",
"collectionOptions": {
"writeConcern": {
"w": 0
}
}
}
}
],
"initialData": [
{
"collectionName": "Bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
],
"collection_name": "Bulkwrite_update_hint",
"tests": [
{
"description": "Unacknowledged bulkWrite updateOne with hints fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"arguments": {
"requests": [
{
"name": "updateOne",
"arguments": {
"updateOne": {
"filter": {
"_id": 1
},
@ -46,8 +77,7 @@
}
},
{
"name": "updateOne",
"arguments": {
"updateOne": {
"filter": {
"_id": 1
},
@ -62,17 +92,24 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "Bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -91,23 +128,18 @@
}
]
}
}
]
},
{
"description": "Unacknowledged bulkWrite updateMany with hints fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"arguments": {
"requests": [
{
"name": "updateMany",
"arguments": {
"updateMany": {
"filter": {
"_id": {
"$lt": 3
@ -122,8 +154,7 @@
}
},
{
"name": "updateMany",
"arguments": {
"updateMany": {
"filter": {
"_id": {
"$lt": 3
@ -140,17 +171,24 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "Bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -169,23 +207,18 @@
}
]
}
}
]
},
{
"description": "Unacknowledged bulkWrite replaceOne with hints fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"arguments": {
"requests": [
{
"name": "replaceOne",
"arguments": {
"replaceOne": {
"filter": {
"_id": 3
},
@ -196,8 +229,7 @@
}
},
{
"name": "replaceOne",
"arguments": {
"replaceOne": {
"filter": {
"_id": 4
},
@ -210,17 +242,24 @@
}
}
],
"options": {
"ordered": true
}
"ordered": true
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "Bulkwrite_update_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -239,7 +278,7 @@
}
]
}
}
]
}
]
}

View File

@ -0,0 +1,149 @@
{
"description": "unacknowledged-deleteMany-hint-clientError",
"schemaVersion": "1.1",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "DeleteMany_hint",
"collectionOptions": {
"writeConcern": {
"w": 0
}
}
}
}
],
"initialData": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "Unacknowledged deleteMany with hint string fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "Unacknowledged deleteMany with hint document fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "DeleteMany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
}
]
}

View File

@ -0,0 +1,133 @@
{
"description": "unacknowledged-deleteOne-hint-clientError",
"schemaVersion": "1.1",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "DeleteOne_hint",
"collectionOptions": {
"writeConcern": {
"w": 0
}
}
}
}
],
"initialData": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "Unacknowledged deleteOne with hint string fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "Unacknowledged deleteOne with hint document fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "DeleteOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,133 @@
{
"description": "unacknowledged-findOneAndDelete-hint-clientError",
"schemaVersion": "1.1",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "findOneAndDelete_hint",
"collectionOptions": {
"writeConcern": {
"w": 0
}
}
}
}
],
"initialData": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "Unacknowledged findOneAndDelete with hint string fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "Unacknowledged findOneAndDelete with hint document fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "findOneAndDelete_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,139 @@
{
"description": "unacknowledged-findOneAndReplace-hint-clientError",
"schemaVersion": "1.1",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "FindOneAndReplace_hint",
"collectionOptions": {
"writeConcern": {
"w": 0
}
}
}
}
],
"initialData": [
{
"collectionName": "FindOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "Unacknowledged findOneAndReplace with hint string fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "FindOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "Unacknowledged findOneAndReplace with hint document fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "FindOneAndReplace_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,143 @@
{
"description": "unacknowledged-findOneAndUpdate-hint-clientError",
"schemaVersion": "1.1",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "FindOneAndUpdate_hint",
"collectionOptions": {
"writeConcern": {
"w": 0
}
}
}
}
],
"initialData": [
{
"collectionName": "FindOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "Unacknowledged findOneAndUpdate with hint string fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "FindOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "Unacknowledged findOneAndUpdate with hint document fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "FindOneAndUpdate_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,143 @@
{
"description": "unacknowledged-replaceOne-hint-clientError",
"schemaVersion": "1.1",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "ReplaceOne_hint",
"collectionOptions": {
"writeConcern": {
"w": 0
}
}
}
}
],
"initialData": [
{
"collectionName": "ReplaceOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "Unacknowledged ReplaceOne with hint string fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "replaceOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 111
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "ReplaceOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "Unacknowledged ReplaceOne with hint document fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "replaceOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 111
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "ReplaceOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,159 @@
{
"description": "unacknowledged-updateMany-hint-clientError",
"schemaVersion": "1.1",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "Updatemany_hint",
"collectionOptions": {
"writeConcern": {
"w": 0
}
}
}
}
],
"initialData": [
{
"collectionName": "Updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "Unacknowledged updateMany with hint string fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "Updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "Unacknowledged updateMany with hint document fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "Updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
}
]
}

View File

@ -0,0 +1,147 @@
{
"description": "unacknowledged-updateOne-hint-clientError",
"schemaVersion": "1.1",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "UpdateOne_hint",
"collectionOptions": {
"writeConcern": {
"w": 0
}
}
}
}
],
"initialData": [
{
"collectionName": "UpdateOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "Unacknowledged updateOne with hint string fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "UpdateOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "Unacknowledged updateOne with hint document fails with client-side error",
"operations": [
{
"object": "collection0",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "UpdateOne_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -1,30 +1,61 @@
{
"runOn": [
"description": "updateMany-hint-clientError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"maxServerVersion": "3.3.99"
}
],
"data": [
"createEntities": [
{
"_id": 1,
"x": 11
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"_id": 2,
"x": 22
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"_id": 3,
"x": 33
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_updatemany_hint"
}
}
],
"initialData": [
{
"collectionName": "test_updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"collection_name": "test_updatemany_hint",
"tests": [
{
"description": "UpdateMany with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection",
"object": "collection0",
"name": "updateMany",
"arguments": {
"filter": {
@ -39,13 +70,22 @@
},
"hint": "_id_"
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "test_updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -60,13 +100,13 @@
}
]
}
}
]
},
{
"description": "UpdateMany with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection",
"object": "collection0",
"name": "updateMany",
"arguments": {
"filter": {
@ -83,13 +123,22 @@
"_id": 1
}
},
"error": true
"expectError": {
"isError": true
}
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "test_updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
@ -104,7 +153,7 @@
}
]
}
}
]
}
]
}

View File

@ -0,0 +1,216 @@
{
"description": "updateMany-hint-serverError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.1.9"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_updatemany_hint"
}
}
],
"initialData": [
{
"collectionName": "test_updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "UpdateMany with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_updatemany_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": "_id_",
"upsert": {
"$$unsetOrMatches": false
}
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
},
{
"description": "UpdateMany with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_updatemany_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": {
"_id": 1
},
"upsert": {
"$$unsetOrMatches": false
}
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
}
]
}

View File

@ -0,0 +1,219 @@
{
"description": "updateMany-hint",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.2.0"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_updatemany_hint"
}
}
],
"initialData": [
{
"collectionName": "test_updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "UpdateMany with hint string",
"operations": [
{
"object": "collection0",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"expectResult": {
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_updatemany_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": "_id_",
"upsert": {
"$$unsetOrMatches": false
}
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 23
},
{
"_id": 3,
"x": 34
}
]
}
]
},
{
"description": "UpdateMany with hint document",
"operations": [
{
"object": "collection0",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"expectResult": {
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_updatemany_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": {
"_id": 1
},
"upsert": {
"$$unsetOrMatches": false
}
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_updatemany_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 23
},
{
"_id": 3,
"x": 34
}
]
}
]
}
]
}

View File

@ -0,0 +1,98 @@
{
"description": "updateMany-validation",
"schemaVersion": "1.1",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "crud-v2"
}
}
],
"initialData": [
{
"collectionName": "crud-v2",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "UpdateOne requires atomic modifiers",
"operations": [
{
"object": "collection0",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"x": 44
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "crud-v2",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
]
}
]
}

View File

@ -0,0 +1,147 @@
{
"description": "updateOne-hint-clientError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"maxServerVersion": "3.3.99"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_updateone_hint"
}
}
],
"initialData": [
{
"collectionName": "test_updateone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "UpdateOne with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "test_updateone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "UpdateOne with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection0",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "test_updateone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,208 @@
{
"description": "updateOne-hint-serverError",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.1.9"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_updateone_hint"
}
}
],
"initialData": [
{
"collectionName": "test_updateone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "UpdateOne with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_updateone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"hint": "_id_",
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_updateone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "UpdateOne with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection0",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_updateone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_updateone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}

View File

@ -0,0 +1,211 @@
{
"description": "updateOne-hint",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.2.0"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test_updateone_hint"
}
}
],
"initialData": [
{
"collectionName": "test_updateone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "UpdateOne with hint string",
"operations": [
{
"object": "collection0",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"expectResult": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_updateone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"hint": "_id_",
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_updateone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 23
}
]
}
]
},
{
"description": "UpdateOne with hint document",
"operations": [
{
"object": "collection0",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"expectResult": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test_updateone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
},
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
]
}
}
}
]
}
],
"outcome": [
{
"collectionName": "test_updateone_hint",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 23
}
]
}
]
}
]
}

View File

@ -0,0 +1,80 @@
{
"description": "updateOne-validation",
"schemaVersion": "1.1",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-v2"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "crud-v2"
}
}
],
"initialData": [
{
"collectionName": "crud-v2",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
}
]
}
],
"tests": [
{
"description": "UpdateOne requires atomic modifiers",
"operations": [
{
"object": "collection0",
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"x": 22
}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": []
}
],
"outcome": [
{
"collectionName": "crud-v2",
"databaseName": "crud-v2",
"documents": [
{
"_id": 1,
"x": 11
}
]
}
]
}
]
}

View File

@ -0,0 +1,494 @@
{
"description": "updateWithPipelines",
"schemaVersion": "1.1",
"runOnRequirements": [
{
"minServerVersion": "4.1.11"
}
],
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "crud-tests"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test"
}
}
],
"initialData": [
{
"collectionName": "test",
"databaseName": "crud-tests",
"documents": [
{
"_id": 1,
"x": 1,
"y": 1,
"t": {
"u": {
"v": 1
}
}
},
{
"_id": 2,
"x": 2,
"y": 1
}
]
}
],
"tests": [
{
"description": "UpdateOne using pipelines",
"operations": [
{
"object": "collection0",
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": [
{
"$replaceRoot": {
"newRoot": "$t"
}
},
{
"$addFields": {
"foo": 1
}
}
]
},
"expectResult": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test",
"updates": [
{
"q": {
"_id": 1
},
"u": [
{
"$replaceRoot": {
"newRoot": "$t"
}
},
{
"$addFields": {
"foo": 1
}
}
],
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
]
},
"commandName": "update",
"databaseName": "crud-tests"
}
}
]
}
],
"outcome": [
{
"collectionName": "test",
"databaseName": "crud-tests",
"documents": [
{
"_id": 1,
"u": {
"v": 1
},
"foo": 1
},
{
"_id": 2,
"x": 2,
"y": 1
}
]
}
]
},
{
"description": "UpdateMany using pipelines",
"operations": [
{
"object": "collection0",
"name": "updateMany",
"arguments": {
"filter": {},
"update": [
{
"$project": {
"x": 1
}
},
{
"$addFields": {
"foo": 1
}
}
]
},
"expectResult": {
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test",
"updates": [
{
"q": {},
"u": [
{
"$project": {
"x": 1
}
},
{
"$addFields": {
"foo": 1
}
}
],
"multi": true,
"upsert": {
"$$unsetOrMatches": false
}
}
]
},
"commandName": "update",
"databaseName": "crud-tests"
}
}
]
}
],
"outcome": [
{
"collectionName": "test",
"databaseName": "crud-tests",
"documents": [
{
"_id": 1,
"x": 1,
"foo": 1
},
{
"_id": 2,
"x": 2,
"foo": 1
}
]
}
]
},
{
"description": "FindOneAndUpdate using pipelines",
"operations": [
{
"object": "collection0",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": [
{
"$project": {
"x": 1
}
},
{
"$addFields": {
"foo": 1
}
}
]
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"findAndModify": "test",
"update": [
{
"$project": {
"x": 1
}
},
{
"$addFields": {
"foo": 1
}
}
]
},
"commandName": "findAndModify",
"databaseName": "crud-tests"
}
}
]
}
],
"outcome": [
{
"collectionName": "test",
"databaseName": "crud-tests",
"documents": [
{
"_id": 1,
"x": 1,
"foo": 1
},
{
"_id": 2,
"x": 2,
"y": 1
}
]
}
]
},
{
"description": "UpdateOne in bulk write using pipelines",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"updateOne": {
"filter": {
"_id": 1
},
"update": [
{
"$replaceRoot": {
"newRoot": "$t"
}
},
{
"$addFields": {
"foo": 1
}
}
]
}
}
]
},
"expectResult": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test",
"updates": [
{
"q": {
"_id": 1
},
"u": [
{
"$replaceRoot": {
"newRoot": "$t"
}
},
{
"$addFields": {
"foo": 1
}
}
],
"multi": {
"$$unsetOrMatches": false
},
"upsert": {
"$$unsetOrMatches": false
}
}
]
},
"commandName": "update",
"databaseName": "crud-tests"
}
}
]
}
],
"outcome": [
{
"collectionName": "test",
"databaseName": "crud-tests",
"documents": [
{
"_id": 1,
"u": {
"v": 1
},
"foo": 1
},
{
"_id": 2,
"x": 2,
"y": 1
}
]
}
]
},
{
"description": "UpdateMany in bulk write using pipelines",
"operations": [
{
"object": "collection0",
"name": "bulkWrite",
"arguments": {
"requests": [
{
"updateMany": {
"filter": {},
"update": [
{
"$project": {
"x": 1
}
},
{
"$addFields": {
"foo": 1
}
}
]
}
}
]
},
"expectResult": {
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"update": "test",
"updates": [
{
"q": {},
"u": [
{
"$project": {
"x": 1
}
},
{
"$addFields": {
"foo": 1
}
}
],
"multi": true,
"upsert": {
"$$unsetOrMatches": false
}
}
]
},
"commandName": "update",
"databaseName": "crud-tests"
}
}
]
}
],
"outcome": [
{
"collectionName": "test",
"databaseName": "crud-tests",
"documents": [
{
"_id": 1,
"x": 1,
"foo": 1
},
{
"_id": 2,
"x": 2,
"foo": 1
}
]
}
]
}
]
}

View File

@ -1,415 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.1.11"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"collection_name": "test_aggregate_merge",
"tests": [
{
"description": "Aggregate with $merge",
"operations": [
{
"object": "collection",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
]
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"aggregate": "test_aggregate_merge",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
]
}
}
}
],
"outcome": {
"collection": {
"name": "other_test_collection",
"data": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "Aggregate with $merge and batch size of 0",
"operations": [
{
"object": "collection",
"name": "aggregate",
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
],
"batchSize": 0
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"aggregate": "test_aggregate_merge",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
],
"cursor": {}
}
}
}
],
"outcome": {
"collection": {
"name": "other_test_collection",
"data": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "Aggregate with $merge and majority readConcern",
"operations": [
{
"object": "collection",
"name": "aggregate",
"collectionOptions": {
"readConcern": {
"level": "majority"
}
},
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
]
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"aggregate": "test_aggregate_merge",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
],
"readConcern": {
"level": "majority"
}
}
}
}
],
"outcome": {
"collection": {
"name": "other_test_collection",
"data": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "Aggregate with $merge and local readConcern",
"operations": [
{
"object": "collection",
"name": "aggregate",
"collectionOptions": {
"readConcern": {
"level": "local"
}
},
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
]
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"aggregate": "test_aggregate_merge",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
],
"readConcern": {
"level": "local"
}
}
}
}
],
"outcome": {
"collection": {
"name": "other_test_collection",
"data": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "Aggregate with $merge and available readConcern",
"operations": [
{
"object": "collection",
"name": "aggregate",
"collectionOptions": {
"readConcern": {
"level": "available"
}
},
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
]
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"aggregate": "test_aggregate_merge",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$merge": {
"into": "other_test_collection"
}
}
],
"readConcern": {
"level": "available"
}
}
}
}
],
"outcome": {
"collection": {
"name": "other_test_collection",
"data": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
}
]
}

View File

@ -1,385 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.1.0",
"topology": [
"replicaset",
"sharded"
]
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"collection_name": "test_aggregate_out_readconcern",
"tests": [
{
"description": "readConcern majority with out stage",
"operations": [
{
"object": "collection",
"name": "aggregate",
"collectionOptions": {
"readConcern": {
"level": "majority"
}
},
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
]
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"aggregate": "test_aggregate_out_readconcern",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
],
"readConcern": {
"level": "majority"
}
}
}
}
],
"outcome": {
"collection": {
"name": "other_test_collection",
"data": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "readConcern local with out stage",
"operations": [
{
"object": "collection",
"name": "aggregate",
"collectionOptions": {
"readConcern": {
"level": "local"
}
},
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
]
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"aggregate": "test_aggregate_out_readconcern",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
],
"readConcern": {
"level": "local"
}
}
}
}
],
"outcome": {
"collection": {
"name": "other_test_collection",
"data": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "readConcern available with out stage",
"operations": [
{
"object": "collection",
"name": "aggregate",
"collectionOptions": {
"readConcern": {
"level": "available"
}
},
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
]
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"aggregate": "test_aggregate_out_readconcern",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
],
"readConcern": {
"level": "available"
}
}
}
}
],
"outcome": {
"collection": {
"name": "other_test_collection",
"data": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "readConcern linearizable with out stage",
"operations": [
{
"object": "collection",
"name": "aggregate",
"collectionOptions": {
"readConcern": {
"level": "linearizable"
}
},
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
]
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"aggregate": "test_aggregate_out_readconcern",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
],
"readConcern": {
"level": "linearizable"
}
}
}
}
]
},
{
"description": "invalid readConcern with out stage",
"operations": [
{
"object": "collection",
"name": "aggregate",
"collectionOptions": {
"readConcern": {
"level": "!invalid123"
}
},
"arguments": {
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
]
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"aggregate": "test_aggregate_out_readconcern",
"pipeline": [
{
"$sort": {
"x": 1
}
},
{
"$match": {
"_id": {
"$gt": 1
}
}
},
{
"$out": "other_test_collection"
}
],
"readConcern": {
"level": "!invalid123"
}
}
}
}
]
}
]
}

View File

@ -1,226 +0,0 @@
{
"runOn": [
{
"minServerVersion": "3.5.6"
}
],
"data": [
{
"_id": 1,
"y": [
{
"b": 3
},
{
"b": 1
}
]
},
{
"_id": 2,
"y": [
{
"b": 0
},
{
"b": 1
}
]
}
],
"collection_name": "test",
"database_name": "crud-tests",
"tests": [
{
"description": "BulkWrite updateOne with arrayFilters",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateOne",
"arguments": {
"filter": {},
"update": {
"$set": {
"y.$[i].b": 2
}
},
"arrayFilters": [
{
"i.b": 3
}
]
}
}
],
"options": {
"ordered": true
}
},
"result": {
"deletedCount": 0,
"insertedCount": 0,
"insertedIds": {},
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test",
"updates": [
{
"q": {},
"u": {
"$set": {
"y.$[i].b": 2
}
},
"arrayFilters": [
{
"i.b": 3
}
]
}
],
"ordered": true
},
"command_name": "update",
"database_name": "crud-tests"
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"y": [
{
"b": 2
},
{
"b": 1
}
]
},
{
"_id": 2,
"y": [
{
"b": 0
},
{
"b": 1
}
]
}
]
}
}
},
{
"description": "BulkWrite updateMany with arrayFilters",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateMany",
"arguments": {
"filter": {},
"update": {
"$set": {
"y.$[i].b": 2
}
},
"arrayFilters": [
{
"i.b": 1
}
]
}
}
],
"options": {
"ordered": true
}
},
"result": {
"deletedCount": 0,
"insertedCount": 0,
"insertedIds": {},
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test",
"updates": [
{
"q": {},
"u": {
"$set": {
"y.$[i].b": 2
}
},
"multi": true,
"arrayFilters": [
{
"i.b": 1
}
]
}
],
"ordered": true
},
"command_name": "update",
"database_name": "crud-tests"
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"y": [
{
"b": 3
},
{
"b": 2
}
]
},
{
"_id": 2,
"y": [
{
"b": 0
},
{
"b": 2
}
]
}
]
}
}
}
]
}

View File

@ -1,209 +0,0 @@
{
"runOn": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.3.3"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
],
"collection_name": "BulkWrite_delete_hint",
"tests": [
{
"description": "BulkWrite deleteOne with hints unsupported (server-side error)",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
}
},
{
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 2
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": true
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "BulkWrite_delete_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": "_id_",
"limit": 1
},
{
"q": {
"_id": 2
},
"hint": {
"_id": 1
},
"limit": 1
}
],
"ordered": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
},
{
"description": "BulkWrite deleteMany with hints unsupported (server-side error)",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$lt": 3
}
},
"hint": "_id_"
}
},
{
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gte": 4
}
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": true
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "BulkWrite_delete_hint",
"deletes": [
{
"q": {
"_id": {
"$lt": 3
}
},
"hint": "_id_",
"limit": 0
},
{
"q": {
"_id": {
"$gte": 4
}
},
"hint": {
"_id": 1
},
"limit": 0
}
],
"ordered": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
}
]
}

View File

@ -1,204 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.3.4"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
],
"collection_name": "BulkWrite_delete_hint",
"tests": [
{
"description": "BulkWrite deleteOne with hints",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
}
},
{
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 2
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": true
}
},
"result": {
"deletedCount": 2,
"insertedCount": 0,
"insertedIds": {},
"matchedCount": 0,
"modifiedCount": 0,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "BulkWrite_delete_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": "_id_",
"limit": 1
},
{
"q": {
"_id": 2
},
"hint": {
"_id": 1
},
"limit": 1
}
],
"ordered": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
},
{
"description": "BulkWrite deleteMany with hints",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$lt": 3
}
},
"hint": "_id_"
}
},
{
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gte": 4
}
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": true
}
},
"result": {
"deletedCount": 3,
"insertedCount": 0,
"insertedIds": {},
"matchedCount": 0,
"modifiedCount": 0,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "BulkWrite_delete_hint",
"deletes": [
{
"q": {
"_id": {
"$lt": 3
}
},
"hint": "_id_",
"limit": 0
},
{
"q": {
"_id": {
"$gte": 4
}
},
"hint": {
"_id": 1
},
"limit": 0
}
],
"ordered": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 3,
"x": 33
}
]
}
}
}
]
}

View File

@ -1,343 +0,0 @@
{
"runOn": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.1.9"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
],
"collection_name": "test_bulkwrite_update_hint",
"tests": [
{
"description": "BulkWrite updateOne with update hints unsupported (server-side error)",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
},
{
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": true
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": 1
},
"u": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
{
"q": {
"_id": 1
},
"u": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
],
"ordered": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
},
{
"description": "BulkWrite updateMany with update hints unsupported (server-side error)",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$lt": 3
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
},
{
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$lt": 3
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": true
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": {
"$lt": 3
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": "_id_"
},
{
"q": {
"_id": {
"$lt": 3
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": {
"_id": 1
}
}
],
"ordered": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
},
{
"description": "BulkWrite replaceOne with update hints unsupported (server-side error)",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "replaceOne",
"arguments": {
"filter": {
"_id": 3
},
"replacement": {
"x": 333
},
"hint": "_id_"
}
},
{
"name": "replaceOne",
"arguments": {
"filter": {
"_id": 4
},
"replacement": {
"x": 444
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": true
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": 3
},
"u": {
"x": 333
},
"hint": "_id_"
},
{
"q": {
"_id": 4
},
"u": {
"x": 444
},
"hint": {
"_id": 1
}
}
],
"ordered": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
}
]
}

View File

@ -1,366 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.2.0"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
],
"collection_name": "test_bulkwrite_update_hint",
"tests": [
{
"description": "BulkWrite updateOne with update hints",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
},
{
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": true
}
},
"result": {
"deletedCount": 0,
"insertedCount": 0,
"insertedIds": {},
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": 1
},
"u": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
{
"q": {
"_id": 1
},
"u": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
],
"ordered": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 13
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
},
{
"description": "BulkWrite updateMany with update hints",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$lt": 3
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
},
{
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$lt": 3
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": true
}
},
"result": {
"deletedCount": 0,
"insertedCount": 0,
"insertedIds": {},
"matchedCount": 4,
"modifiedCount": 4,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": {
"$lt": 3
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": "_id_"
},
{
"q": {
"_id": {
"$lt": 3
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": {
"_id": 1
}
}
],
"ordered": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 13
},
{
"_id": 2,
"x": 24
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
},
{
"description": "BulkWrite replaceOne with update hints",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "replaceOne",
"arguments": {
"filter": {
"_id": 3
},
"replacement": {
"x": 333
},
"hint": "_id_"
}
},
{
"name": "replaceOne",
"arguments": {
"filter": {
"_id": 4
},
"replacement": {
"x": 444
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": true
}
},
"result": {
"deletedCount": 0,
"insertedCount": 0,
"insertedIds": {},
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0,
"upsertedIds": {}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_bulkwrite_update_hint",
"updates": [
{
"q": {
"_id": 3
},
"u": {
"x": 333
},
"hint": "_id_"
},
{
"q": {
"_id": 4
},
"u": {
"x": 444
},
"hint": {
"_id": 1
}
}
],
"ordered": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 333
},
{
"_id": 4,
"x": 444
}
]
}
}
}
]
}

View File

@ -1,100 +0,0 @@
{
"runOn": [
{
"maxServerVersion": "3.3.99"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"collection_name": "DeleteMany_hint",
"tests": [
{
"description": "DeleteMany with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "DeleteMany with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
}
]
}

View File

@ -1,141 +0,0 @@
{
"runOn": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.3.3"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"collection_name": "DeleteMany_hint",
"tests": [
{
"description": "DeleteMany with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteMany_hint",
"deletes": [
{
"q": {
"_id": {
"$gt": 1
}
},
"hint": "_id_",
"limit": 0
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "DeleteMany with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteMany_hint",
"deletes": [
{
"q": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
},
"limit": 0
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
}
]
}

View File

@ -1,128 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.3.4"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"collection_name": "DeleteMany_hint",
"tests": [
{
"description": "DeleteMany with hint string",
"operations": [
{
"object": "collection",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": "_id_"
},
"result": {
"deletedCount": 2
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteMany_hint",
"deletes": [
{
"q": {
"_id": {
"$gt": 1
}
},
"hint": "_id_",
"limit": 0
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
}
]
}
}
},
{
"description": "DeleteMany with hint document",
"operations": [
{
"object": "collection",
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
}
},
"result": {
"deletedCount": 2
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteMany_hint",
"deletes": [
{
"q": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
},
"limit": 0
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
}
]
}
}
}
]
}

View File

@ -1,84 +0,0 @@
{
"runOn": [
{
"maxServerVersion": "3.3.99"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "DeleteOne_hint",
"tests": [
{
"description": "DeleteOne with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "DeleteOne with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,121 +0,0 @@
{
"runOn": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.3.3"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "DeleteOne_hint",
"tests": [
{
"description": "DeleteOne with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteOne_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": "_id_",
"limit": 1
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "DeleteOne with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteOne_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": {
"_id": 1
},
"limit": 1
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,116 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.3.4"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "DeleteOne_hint",
"tests": [
{
"description": "DeleteOne with hint string",
"operations": [
{
"object": "collection",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"result": {
"deletedCount": 1
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteOne_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": "_id_",
"limit": 1
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "deleteOne with hint document",
"operations": [
{
"object": "collection",
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"result": {
"deletedCount": 1
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteOne_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": {
"_id": 1
},
"limit": 1
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,40 +0,0 @@
{
"runOn": [
{
"maxServerVersion": "3.0.99"
}
],
"collection_name": "test_find_allowdiskuse_clienterror",
"tests": [
{
"description": "Find fails when allowDiskUse true is specified against pre 3.2 server",
"operations": [
{
"object": "collection",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": true
},
"error": true
}
],
"expectations": []
},
{
"description": "Find fails when allowDiskUse false is specified against pre 3.2 server",
"operations": [
{
"object": "collection",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": false
},
"error": true
}
],
"expectations": []
}
]
}

View File

@ -1,61 +0,0 @@
{
"runOn": [
{
"minServerVersion": "3.2",
"maxServerVersion": "4.3.0"
}
],
"collection_name": "test_find_allowdiskuse_servererror",
"tests": [
{
"description": "Find fails when allowDiskUse true is specified against pre 4.4 server (server-side error)",
"operations": [
{
"object": "collection",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": true
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"find": "test_find_allowdiskuse_servererror",
"filter": {},
"allowDiskUse": true
}
}
}
]
},
{
"description": "Find fails when allowDiskUse false is specified against pre 4.4 server (server-side error)",
"operations": [
{
"object": "collection",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": false
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"find": "test_find_allowdiskuse_servererror",
"filter": {},
"allowDiskUse": false
}
}
}
]
}
]
}

View File

@ -1,78 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.3.1"
}
],
"collection_name": "test_find_allowdiskuse",
"tests": [
{
"description": "Find does not send allowDiskuse when value is not specified",
"operations": [
{
"object": "collection",
"name": "find",
"arguments": {
"filter": {}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"find": "test_find_allowdiskuse",
"allowDiskUse": null
}
}
}
]
},
{
"description": "Find sends allowDiskuse false when false is specified",
"operations": [
{
"object": "collection",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": false
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"find": "test_find_allowdiskuse",
"allowDiskUse": false
}
}
}
]
},
{
"description": "Find sends allowDiskUse true when true is specified",
"operations": [
{
"object": "collection",
"name": "find",
"arguments": {
"filter": {},
"allowDiskUse": true
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"find": "test_find_allowdiskuse",
"allowDiskUse": true
}
}
}
]
}
]
}

View File

@ -1,84 +0,0 @@
{
"runOn": [
{
"maxServerVersion": "4.0.99"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "findOneAndDelete_hint",
"tests": [
{
"description": "FindOneAndDelete with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndDelete with hint document",
"operations": [
{
"object": "collection",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,113 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.2.0",
"maxServerVersion": "4.3.3"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "findOneAndDelete_hint",
"tests": [
{
"description": "FindOneAndDelete with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndDelete_hint",
"query": {
"_id": 1
},
"hint": "_id_",
"remove": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndDelete with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndDelete_hint",
"query": {
"_id": 1
},
"hint": {
"_id": 1
},
"remove": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,110 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.3.4"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "findOneAndDelete_hint",
"tests": [
{
"description": "FindOneAndDelete with hint string",
"operations": [
{
"object": "collection",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"result": {
"_id": 1,
"x": 11
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndDelete_hint",
"query": {
"_id": 1
},
"hint": "_id_",
"remove": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndDelete with hint document",
"operations": [
{
"object": "collection",
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"result": {
"_id": 1,
"x": 11
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndDelete_hint",
"query": {
"_id": 1
},
"hint": {
"_id": 1
},
"remove": true
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,90 +0,0 @@
{
"runOn": [
{
"maxServerVersion": "4.0.99"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "findOneAndReplace_hint",
"tests": [
{
"description": "FindOneAndReplace with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndReplace with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,123 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.2.0",
"maxServerVersion": "4.3.0"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "findOneAndReplace_hint",
"tests": [
{
"description": "FindOneAndReplace with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndReplace_hint",
"query": {
"_id": 1
},
"update": {
"x": 33
},
"hint": "_id_"
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndReplace with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndReplace_hint",
"query": {
"_id": 1
},
"update": {
"x": 33
},
"hint": {
"_id": 1
}
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,128 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.3.1"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "findOneAndReplace_hint",
"tests": [
{
"description": "FindOneAndReplace with hint string",
"operations": [
{
"object": "collection",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": "_id_"
},
"result": {
"_id": 1,
"x": 11
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndReplace_hint",
"query": {
"_id": 1
},
"update": {
"x": 33
},
"hint": "_id_"
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 33
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndReplace with hint document",
"operations": [
{
"object": "collection",
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": {
"_id": 1
}
},
"result": {
"_id": 1,
"x": 11
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndReplace_hint",
"query": {
"_id": 1
},
"update": {
"x": 33
},
"hint": {
"_id": 1
}
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 33
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,94 +0,0 @@
{
"runOn": [
{
"maxServerVersion": "4.0.99"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "findOneAndUpdate_hint",
"tests": [
{
"description": "FindOneAndUpdate with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndUpdate with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,131 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.2.0",
"maxServerVersion": "4.3.0"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "findOneAndUpdate_hint",
"tests": [
{
"description": "FindOneAndUpdate with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndUpdate_hint",
"query": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndUpdate with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndUpdate_hint",
"query": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,136 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.3.1"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "findOneAndUpdate_hint",
"tests": [
{
"description": "FindOneAndUpdate with hint string",
"operations": [
{
"object": "collection",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"result": {
"_id": 1,
"x": 11
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndUpdate_hint",
"query": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 12
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndUpdate with hint document",
"operations": [
{
"object": "collection",
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"result": {
"_id": 1,
"x": 11
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndUpdate_hint",
"query": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 12
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,146 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.2.0"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "test_replaceone_hint",
"tests": [
{
"description": "ReplaceOne with hint string",
"operations": [
{
"object": "collection",
"name": "replaceOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 111
},
"hint": "_id_"
},
"result": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_replaceone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"x": 111
},
"hint": "_id_"
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 111
}
]
}
}
},
{
"description": "ReplaceOne with hint document",
"operations": [
{
"object": "collection",
"name": "replaceOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 111
},
"hint": {
"_id": 1
}
},
"result": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_replaceone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"x": 111
},
"hint": {
"_id": 1
}
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 111
}
]
}
}
}
]
}

View File

@ -1,41 +0,0 @@
{
"data": [
{
"_id": 1,
"x": 11
}
],
"tests": [
{
"description": "ReplaceOne prohibits atomic modifiers",
"operations": [
{
"object": "collection",
"name": "replaceOne",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"$set": {
"x": 22
}
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
}
]
}
}
}
]
}

View File

@ -1,105 +0,0 @@
{
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"collection_name": "DeleteMany_hint",
"tests": [
{
"description": "Unacknowledged deleteMany with hint string fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "Unacknowledged deleteMany with hint document fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
}
]
}

View File

@ -1,89 +0,0 @@
{
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "DeleteOne_hint",
"tests": [
{
"description": "Unacknowledged deleteOne with hint string fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "Unacknowledged deleteOne with hint document fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,89 +0,0 @@
{
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "findOneAndDelete_hint",
"tests": [
{
"description": "Unacknowledged findOneAndDelete with hint string fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "Unacknowledged findOneAndDelete with hint document fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,95 +0,0 @@
{
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "FindOneAndReplace_hint",
"tests": [
{
"description": "Unacknowledged findOneAndReplace with hint string fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "Unacknowledged findOneAndReplace with hint document fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,99 +0,0 @@
{
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "FindOneAndUpdate_hint",
"tests": [
{
"description": "Unacknowledged findOneAndUpdate with hint string fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "Unacknowledged findOneAndUpdate with hint document fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,99 +0,0 @@
{
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "ReplaceOne_hint",
"tests": [
{
"description": "Unacknowledged ReplaceOne with hint string fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "replaceOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 111
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "Unacknowledged ReplaceOne with hint document fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "replaceOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 111
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,115 +0,0 @@
{
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"collection_name": "Updatemany_hint",
"tests": [
{
"description": "Unacknowledged updateMany with hint string fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "Unacknowledged updateMany with hint document fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
}
]
}

View File

@ -1,103 +0,0 @@
{
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "UpdateOne_hint",
"tests": [
{
"description": "Unacknowledged updateOne with hint string fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "Unacknowledged updateOne with hint document fails with client-side error",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,161 +0,0 @@
{
"runOn": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.1.9"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"collection_name": "test_updatemany_hint",
"tests": [
{
"description": "UpdateMany with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_updatemany_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": "_id_"
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "UpdateMany with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_updatemany_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": {
"_id": 1
}
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
}
]
}

View File

@ -1,168 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.2.0"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"collection_name": "test_updatemany_hint",
"tests": [
{
"description": "UpdateMany with hint string",
"operations": [
{
"object": "collection",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"result": {
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_updatemany_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": "_id_"
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 23
},
{
"_id": 3,
"x": 34
}
]
}
}
},
{
"description": "UpdateMany with hint document",
"operations": [
{
"object": "collection",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"result": {
"matchedCount": 2,
"modifiedCount": 2,
"upsertedCount": 0
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_updatemany_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": {
"_id": 1
}
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 23
},
{
"_id": 3,
"x": 34
}
]
}
}
}
]
}

View File

@ -1,57 +0,0 @@
{
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"tests": [
{
"description": "UpdateOne requires atomic modifiers",
"operations": [
{
"object": "collection",
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"x": 44
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
}
]
}

View File

@ -1,98 +0,0 @@
{
"runOn": [
{
"maxServerVersion": "3.3.99"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "test_updateone_hint",
"tests": [
{
"description": "UpdateOne with hint string unsupported (client-side error)",
"operations": [
{
"object": "collection",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "UpdateOne with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,147 +0,0 @@
{
"runOn": [
{
"minServerVersion": "3.4.0",
"maxServerVersion": "4.1.9"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "test_updateone_hint",
"tests": [
{
"description": "UpdateOne with hint string unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_updateone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "UpdateOne with hint document unsupported (server-side error)",
"operations": [
{
"object": "collection",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"error": true
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_updateone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}

View File

@ -1,154 +0,0 @@
{
"runOn": [
{
"minServerVersion": "4.2.0"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "test_updateone_hint",
"tests": [
{
"description": "UpdateOne with hint string",
"operations": [
{
"object": "collection",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
},
"result": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_updateone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 23
}
]
}
}
},
{
"description": "UpdateOne with hint document",
"operations": [
{
"object": "collection",
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
},
"result": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "test_updateone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
]
}
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 23
}
]
}
}
}
]
}

View File

@ -1,39 +0,0 @@
{
"data": [
{
"_id": 1,
"x": 11
}
],
"tests": [
{
"description": "UpdateOne requires atomic modifiers",
"operations": [
{
"object": "collection",
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"x": 22
}
},
"error": true
}
],
"expectations": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
}
]
}
}
}
]
}

Some files were not shown because too many files have changed in this diff Show More