PHPLIB-539: Sync CRUD spec tests

parent f6727da7
...@@ -45,7 +45,7 @@ class Delete implements Executable, Explainable ...@@ -45,7 +45,7 @@ class Delete implements Executable, Explainable
private static $wireVersionForCollation = 5; private static $wireVersionForCollation = 5;
/** @var int */ /** @var int */
private static $wireVersionForHint = 9; private static $wireVersionForHintServerSideError = 5;
/** @var string */ /** @var string */
private $databaseName; private $databaseName;
...@@ -145,7 +145,10 @@ class Delete implements Executable, Explainable ...@@ -145,7 +145,10 @@ class Delete implements Executable, Explainable
throw UnsupportedException::collationNotSupported(); throw UnsupportedException::collationNotSupported();
} }
if (isset($this->options['hint']) && ! server_supports_feature($server, self::$wireVersionForHint)) { /* Server versions >= 3.4.0 raise errors for unknown update
* options. For previous versions, the CRUD spec requires a client-side
* error. */
if (isset($this->options['hint']) && ! server_supports_feature($server, self::$wireVersionForHintServerSideError)) {
throw UnsupportedException::hintNotSupported(); throw UnsupportedException::hintNotSupported();
} }
......
...@@ -73,7 +73,7 @@ class CrudSpecTest extends FunctionalTestCase ...@@ -73,7 +73,7 @@ class CrudSpecTest extends FunctionalTestCase
} }
if (isset($test->expectations)) { if (isset($test->expectations)) {
$commandExpectations = CommandExpectations::fromCrud($test->expectations); $commandExpectations = CommandExpectations::fromCrud((array) $test->expectations);
$commandExpectations->startMonitoring(); $commandExpectations->startMonitoring();
} }
......
{
"runOn": [
{
"maxServerVersion": "3.3.99"
}
],
"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 (client-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": [],
"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 (client-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": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"runOn": [
{
"maxServerVersion": "3.3.99"
}
],
"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 (client-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": [],
"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 (client-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": [],
"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 (client-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": [],
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"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
}
]
}
}
}
]
}
{
"runOn": [
{
"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": "Unacknowledged bulkWrite deleteOne with hints fails with client-side error on server < 4.4",
"operations": [
{
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"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": {},
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
},
{
"description": "Unacknowledged bulkWrite deleteMany with hints fails with client-side error on server < 4.4",
"operations": [
{
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"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": {},
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
}
]
}
{
"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": "Unacknowledged bulkWrite deleteOne with hints succeeds on server >= 4.4",
"operations": [
{
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"arguments": {
"requests": [
{
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
}
},
{
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 2
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": 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": {}
},
{
"description": "Unacknowledged bulkWrite deleteMany with hints succeeds on server >= 4.4",
"operations": [
{
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"arguments": {
"requests": [
{
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$lt": 3
}
},
"hint": "_id_"
}
},
{
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gte": 4
}
},
"hint": {
"_id": 1
}
}
}
],
"options": {
"ordered": 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": {}
}
]
}
{
"runOn": [
{
"maxServerVersion": "4.1.9"
}
],
"data": [
{
"_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 on server < 4.2",
"operations": [
{
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"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": {},
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
},
{
"description": "Unacknowledged bulkWrite updateMany with hints fails with client-side error on server < 4.2",
"operations": [
{
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"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": {},
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
},
{
"description": "Unacknowledged bulkWrite replaceOne with hints unsupported (client-side error)",
"operations": [
{
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"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": {},
"outcome": {
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
},
{
"_id": 4,
"x": 44
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.2.0"
}
],
"data": [
{
"_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 update hint succeeds on server >= 4.2",
"operations": [
{
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"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
}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "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": {}
},
{
"description": "Unacknowledged bulkWrite updateMany with update hint succeeds on server >= 4.2",
"operations": [
{
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"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
}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "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": {}
},
{
"description": "Unacknowledged bulkWrite replaceOne with update hints",
"operations": [
{
"name": "bulkWrite",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"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
}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "BulkWrite_update_hint",
"updates": [
{
"q": {
"_id": 3
},
"u": {
"x": 333
},
"hint": "_id_"
},
{
"q": {
"_id": 4
},
"u": {
"x": 444
},
"hint": {
"_id": 1
}
}
],
"ordered": true
}
}
}
],
"outcome": {}
}
]
}
{
"runOn": [
{
"maxServerVersion": "4.3.3"
}
],
"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 on server < 4.4",
"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 on server < 4.4",
"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
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.4"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"collection_name": "DeleteMany_hint",
"tests": [
{
"description": "Unacknowledged deleteMany with hint string succeeds on server >= 4.4",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": "_id_"
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteMany_hint",
"deletes": [
{
"q": {
"_id": {
"$gt": 1
}
},
"hint": "_id_",
"limit": 0
}
]
}
}
}
],
"outcome": {}
},
{
"description": "Unacknowledged deleteMany with hint document succeeds on server >= 4.4",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "deleteMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteMany_hint",
"deletes": [
{
"q": {
"_id": {
"$gt": 1
}
},
"hint": {
"_id": 1
},
"limit": 0
}
]
}
}
}
],
"outcome": {}
}
]
}
{
"runOn": [
{
"maxServerVersion": "4.3.3"
}
],
"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 on server < 4.4",
"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 on server < 4.4",
"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
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.4"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "DeleteOne_hint",
"tests": [
{
"description": "Unacknowledged deleteOne with hint string succeeds on server >= 4.4",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteOne_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": "_id_",
"limit": 1
}
]
}
}
}
],
"outcome": {}
},
{
"description": "Unacknowledged deleteOne with hint document succeeds on server >= 4.4",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "DeleteOne_hint",
"deletes": [
{
"q": {
"_id": 1
},
"hint": {
"_id": 1
},
"limit": 1
}
]
}
}
}
],
"outcome": {}
}
]
}
{
"runOn": [
{
"maxServerVersion": "4.3.3"
}
],
"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 on server < 4.4",
"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 on server < 4.4",
"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
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.4"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "findOneAndDelete_hint",
"tests": [
{
"description": "Unacknowledged findOneAndDelete with hint string succeeds on server >= 4.4",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": "_id_"
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndDelete_hint",
"query": {
"_id": 1
},
"hint": "_id_",
"remove": true
}
}
}
],
"outcome": {}
},
{
"description": "Unacknowledged findOneAndDelete with hint document succeeds on server >= 4.4",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndDelete",
"arguments": {
"filter": {
"_id": 1
},
"hint": {
"_id": 1
}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "findOneAndDelete_hint",
"query": {
"_id": 1
},
"hint": {
"_id": 1
},
"remove": true
}
}
}
],
"outcome": {}
}
]
}
{
"runOn": [
{
"maxServerVersion": "4.3.3"
}
],
"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 on server < 4.4",
"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 on server < 4.4",
"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
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.4"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "FindOneAndReplace_hint",
"tests": [
{
"description": "Unacknowledged findOneAndReplace with hint string succeeds on server >= 4.4",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": "_id_"
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "FindOneAndReplace_hint",
"query": {
"_id": 1
},
"update": {
"x": 33
},
"hint": "_id_"
}
}
}
],
"outcome": {}
},
{
"description": "Unacknowledged findOneAndReplace with hint document succeeds on server >= 4.4",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"x": 33
},
"hint": {
"_id": 1
}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "FindOneAndReplace_hint",
"query": {
"_id": 1
},
"update": {
"x": 33
}
}
}
}
],
"outcome": {}
}
]
}
{
"runOn": [
{
"maxServerVersion": "4.3.3"
}
],
"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 on server < 4.4",
"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 on server < 4.4",
"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
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.4"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "FindOneAndUpdate_hint",
"tests": [
{
"description": "Unacknowledged findOneAndUpdate with hint string succeeds on server >= 4.4",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "FindOneAndUpdate_hint",
"query": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
}
}
],
"outcome": {}
},
{
"description": "Unacknowledged findOneAndUpdate with hint document succeeds on server >= 4.4",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "FindOneAndUpdate_hint",
"query": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
}
],
"outcome": {}
}
]
}
{
"runOn": [
{
"maxServerVersion": "4.1.9"
}
],
"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 on server < 4.2",
"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 on server < 4.2",
"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
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.2.0"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "Replaceone_hint",
"tests": [
{
"description": "Unacknowledged replaceOne with hint string succeeds on server >= 4.2",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "replaceOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 111
},
"hint": "_id_"
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "Replaceone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"x": 111
},
"hint": "_id_"
}
]
}
}
}
],
"outcome": {}
},
{
"description": "Unacknowledged replaceOne with hint document succeeds on server >= 4.2",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "replaceOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"replacement": {
"x": 111
},
"hint": {
"_id": 1
}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "Replaceone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"x": 111
},
"hint": {
"_id": 1
}
}
]
}
}
}
],
"outcome": {}
}
]
}
{
"runOn": [
{
"maxServerVersion": "4.1.9"
}
],
"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 on server < 4.2",
"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 on server < 4.2",
"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
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.2.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 succeeds on server >= 4.2",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "UpdateMany_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": "_id_"
}
]
}
}
}
],
"outcome": {}
},
{
"description": "Unacknowledged updateMany with hint document succeeds on server >= 4.2",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "updateMany",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "UpdateMany_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"multi": true,
"hint": {
"_id": 1
}
}
]
}
}
}
],
"outcome": {}
}
]
}
{
"runOn": [
{
"maxServerVersion": "4.1.9"
}
],
"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 on server < 4.2",
"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 on server < 4.2",
"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
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.2.0"
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"collection_name": "updateone_hint",
"tests": [
{
"description": "Unacknowledged updateOne with hint string succeeds on server >= 4.2",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "updateone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"hint": "_id_"
}
]
}
}
}
],
"outcome": {}
},
{
"description": "Unacknowledged updateOne with hint document succeeds on server >= 4.2",
"operations": [
{
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": 0
}
},
"name": "updateOne",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"update": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"update": "updateone_hint",
"updates": [
{
"q": {
"_id": {
"$gt": 1
}
},
"u": {
"$inc": {
"x": 1
}
},
"hint": {
"_id": 1
}
}
]
}
}
}
],
"outcome": {}
}
]
}
{
"runOn": [
{
"maxServerVersion": "3.3.99"
}
],
"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 (client-side error)",
"operations": [
{
"object": "collection",
"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": "UpdateMany with hint document unsupported (client-side error)",
"operations": [
{
"object": "collection",
"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
}
]
}
}
}
]
}
This diff is collapsed.
{
"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
}
]
}
}
}
]
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment