From 7bf791d3d1dbb76c29c79f329c2a8ada3ef7a6f0 Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Fri, 27 Jun 2025 20:05:03 -0400 Subject: [PATCH 01/10] WIP --- .../tests/listCollections-rawdata.json | 91 +++++++++ .../crud/tests/unified/aggregate-rawdata.json | 116 +++++++++++ .../unified/bulkWrite-deleteMany-rawdata.json | 122 +++++++++++ .../unified/bulkWrite-deleteOne-rawdata.json | 122 +++++++++++ .../unified/bulkWrite-replaceOne-rawdata.json | 136 +++++++++++++ .../unified/bulkWrite-updateMany-rawdata.json | 157 ++++++++++++++ .../unified/bulkWrite-updateOne-rawdata.json | 161 +++++++++++++++ .../client-bulkWrite-delete-rawdata.json | 167 +++++++++++++++ .../client-bulkWrite-replaceOne-rawdata.json | 166 +++++++++++++++ .../client-bulkWrite-update-rawdata.json | 191 ++++++++++++++++++ source/crud/tests/unified/count-rawdata.json | 100 +++++++++ .../tests/unified/countDocuments-rawdata.json | 128 ++++++++++++ .../tests/unified/deleteMany-rawdata.json | 110 ++++++++++ .../crud/tests/unified/deleteOne-rawdata.json | 110 ++++++++++ .../crud/tests/unified/distinct-rawdata.json | 104 ++++++++++ .../estimatedDocumentCount-rawdata.json | 100 +++++++++ source/crud/tests/unified/find-rawdata.json | 100 +++++++++ .../unified/findOneAndDelete-rawdata.json | 102 ++++++++++ .../unified/findOneAndReplace-rawdata.json | 112 ++++++++++ .../unified/findOneAndUpdate-rawdata.json | 129 ++++++++++++ .../tests/unified/insertMany-rawdata.json | 120 +++++++++++ .../crud/tests/unified/insertOne-rawdata.json | 116 +++++++++++ .../tests/unified/replaceOne-rawdata.json | 132 ++++++++++++ .../tests/unified/updateMany-rawdata.json | 136 +++++++++++++ .../crud/tests/unified/updateOne-rawdata.json | 140 +++++++++++++ .../index-management/tests/index-rawdata.json | 186 +++++++++++++++++ 26 files changed, 3354 insertions(+) create mode 100644 source/collection-management/tests/listCollections-rawdata.json create mode 100644 source/crud/tests/unified/aggregate-rawdata.json create mode 100644 source/crud/tests/unified/bulkWrite-deleteMany-rawdata.json create mode 100644 source/crud/tests/unified/bulkWrite-deleteOne-rawdata.json create mode 100644 source/crud/tests/unified/bulkWrite-replaceOne-rawdata.json create mode 100644 source/crud/tests/unified/bulkWrite-updateMany-rawdata.json create mode 100644 source/crud/tests/unified/bulkWrite-updateOne-rawdata.json create mode 100644 source/crud/tests/unified/client-bulkWrite-delete-rawdata.json create mode 100644 source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json create mode 100644 source/crud/tests/unified/client-bulkWrite-update-rawdata.json create mode 100644 source/crud/tests/unified/count-rawdata.json create mode 100644 source/crud/tests/unified/countDocuments-rawdata.json create mode 100644 source/crud/tests/unified/deleteMany-rawdata.json create mode 100644 source/crud/tests/unified/deleteOne-rawdata.json create mode 100644 source/crud/tests/unified/distinct-rawdata.json create mode 100644 source/crud/tests/unified/estimatedDocumentCount-rawdata.json create mode 100644 source/crud/tests/unified/find-rawdata.json create mode 100644 source/crud/tests/unified/findOneAndDelete-rawdata.json create mode 100644 source/crud/tests/unified/findOneAndReplace-rawdata.json create mode 100644 source/crud/tests/unified/findOneAndUpdate-rawdata.json create mode 100644 source/crud/tests/unified/insertMany-rawdata.json create mode 100644 source/crud/tests/unified/insertOne-rawdata.json create mode 100644 source/crud/tests/unified/replaceOne-rawdata.json create mode 100644 source/crud/tests/unified/updateMany-rawdata.json create mode 100644 source/crud/tests/unified/updateOne-rawdata.json create mode 100644 source/index-management/tests/index-rawdata.json diff --git a/source/collection-management/tests/listCollections-rawdata.json b/source/collection-management/tests/listCollections-rawdata.json new file mode 100644 index 0000000000..f24c8e1a3c --- /dev/null +++ b/source/collection-management/tests/listCollections-rawdata.json @@ -0,0 +1,91 @@ +{ + "description": "listCollections-rawData", + "schemaVersion": "1.4", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "database0" + } + } + ], + "tests": [ + { + "description": "listCollections with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "listCollections", + "object": "database0", + "arguments": { + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1, + "filter": {}, + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "listCollections with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "listCollections", + "object": "database0", + "arguments": { + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1, + "filter": {}, + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/aggregate-rawdata.json b/source/crud/tests/unified/aggregate-rawdata.json new file mode 100644 index 0000000000..d34a359f9d --- /dev/null +++ b/source/crud/tests/unified/aggregate-rawdata.json @@ -0,0 +1,116 @@ +{ + "description": "aggregate-rawData", + "schemaVersion": "1.4", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "Aggregate with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": {} + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll0", + "pipeline": [ + { + "$match": {} + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "Aggregate with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": {} + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll0", + "pipeline": [ + { + "$match": {} + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/bulkWrite-deleteMany-rawdata.json b/source/crud/tests/unified/bulkWrite-deleteMany-rawdata.json new file mode 100644 index 0000000000..a74149e979 --- /dev/null +++ b/source/crud/tests/unified/bulkWrite-deleteMany-rawdata.json @@ -0,0 +1,122 @@ +{ + "description": "BulkWrite deleteMany-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "BulkWrite deleteMany with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "object": "collection0", + "name": "bulkWrite", + "arguments": { + "requests": [ + { + "deleteMany": { + "filter": {} + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "delete": "coll0", + "deletes": [ + { + "q": {}, + "limit": 0 + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "BulkWrite deleteMany with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "object": "collection0", + "name": "bulkWrite", + "arguments": { + "requests": [ + { + "deleteMany": { + "filter": {} + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "delete": "coll0", + "deletes": [ + { + "q": {}, + "limit": 0 + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/bulkWrite-deleteOne-rawdata.json b/source/crud/tests/unified/bulkWrite-deleteOne-rawdata.json new file mode 100644 index 0000000000..534e62c9e8 --- /dev/null +++ b/source/crud/tests/unified/bulkWrite-deleteOne-rawdata.json @@ -0,0 +1,122 @@ +{ + "description": "BulkWrite deleteOne-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "BulkWrite deleteOne with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "object": "collection0", + "name": "bulkWrite", + "arguments": { + "requests": [ + { + "deleteOne": { + "filter": {} + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "delete": "coll0", + "deletes": [ + { + "q": {}, + "limit": 1 + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "BulkWrite deleteOne with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "object": "collection0", + "name": "bulkWrite", + "arguments": { + "requests": [ + { + "deleteOne": { + "filter": {} + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "delete": "coll0", + "deletes": [ + { + "q": {}, + "limit": 1 + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/bulkWrite-replaceOne-rawdata.json b/source/crud/tests/unified/bulkWrite-replaceOne-rawdata.json new file mode 100644 index 0000000000..50403fc5c3 --- /dev/null +++ b/source/crud/tests/unified/bulkWrite-replaceOne-rawdata.json @@ -0,0 +1,136 @@ +{ + "description": "BulkWrite replaceOne-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "BulkWrite replaceOne with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "object": "collection0", + "name": "bulkWrite", + "arguments": { + "requests": [ + { + "replaceOne": { + "filter": {}, + "replacement": {} + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": {}, + "multi": { + "$$unsetOrMatches": false + }, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "BulkWrite replaceOne with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "object": "collection0", + "name": "bulkWrite", + "arguments": { + "requests": [ + { + "replaceOne": { + "filter": {}, + "replacement": {} + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": {}, + "multi": { + "$$unsetOrMatches": false + }, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/bulkWrite-updateMany-rawdata.json b/source/crud/tests/unified/bulkWrite-updateMany-rawdata.json new file mode 100644 index 0000000000..4f807ae42a --- /dev/null +++ b/source/crud/tests/unified/bulkWrite-updateMany-rawdata.json @@ -0,0 +1,157 @@ +{ + "description": "BulkWrite updateMany-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "BulkWrite updateMany with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "object": "collection0", + "name": "bulkWrite", + "arguments": { + "requests": [ + { + "updateMany": { + "filter": {}, + "update": [ + { + "$set": { + "x": 1 + } + } + ] + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": [ + { + "$set": { + "x": 1 + } + } + ], + "multi": true, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "BulkWrite updateMany with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "minServerVersion": "4.2.0", + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "object": "collection0", + "name": "bulkWrite", + "arguments": { + "requests": [ + { + "updateMany": { + "filter": {}, + "update": [ + { + "$set": { + "x": 1 + } + } + ] + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": [ + { + "$set": { + "x": 1 + } + } + ], + "multi": true, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/bulkWrite-updateOne-rawdata.json b/source/crud/tests/unified/bulkWrite-updateOne-rawdata.json new file mode 100644 index 0000000000..32b53cbf29 --- /dev/null +++ b/source/crud/tests/unified/bulkWrite-updateOne-rawdata.json @@ -0,0 +1,161 @@ +{ + "description": "BulkWrite updateOne-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "BulkWrite updateOne with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "object": "collection0", + "name": "bulkWrite", + "arguments": { + "requests": [ + { + "updateOne": { + "filter": {}, + "update": [ + { + "$set": { + "x": 1 + } + } + ] + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": [ + { + "$set": { + "x": 1 + } + } + ], + "multi": { + "$$unsetOrMatches": false + }, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "BulkWrite updateOne with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "minServerVersion": "4.2.0", + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "object": "collection0", + "name": "bulkWrite", + "arguments": { + "requests": [ + { + "updateOne": { + "filter": {}, + "update": [ + { + "$set": { + "x": 1 + } + } + ] + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": [ + { + "$set": { + "x": 1 + } + } + ], + "multi": { + "$$unsetOrMatches": false + }, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json new file mode 100644 index 0000000000..7ad35ea2a4 --- /dev/null +++ b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json @@ -0,0 +1,167 @@ +{ + "description": "client bulkWrite delete-rawData", + "schemaVersion": "1.4", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "client bulk write delete with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0", + "serverless": "forbid" + } + ], + "operations": [ + { + "object": "client0", + "name": "clientBulkWrite", + "arguments": { + "models": [ + { + "deleteOne": { + "namespace": "crud-tests.coll0", + "filter": {} + } + }, + { + "deleteMany": { + "namespace": "crud-tests.coll0", + "filter": {} + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "commandName": "bulkWrite", + "databaseName": "admin", + "command": { + "bulkWrite": 1, + "ordered": true, + "ops": [ + { + "delete": 0, + "filter": {}, + "multi": false + }, + { + "delete": 0, + "filter": {}, + "multi": true + } + ], + "nsInfo": [ + { + "ns": "crud-tests.coll0" + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "client bulk write delete with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "minServerVersion": "8.0", + "maxServerVersion": "8.1.99", + "serverless": "forbid" + } + ], + "operations": [ + { + "object": "client0", + "name": "clientBulkWrite", + "arguments": { + "models": [ + { + "deleteOne": { + "namespace": "crud-tests.coll0", + "filter": {} + } + }, + { + "deleteMany": { + "namespace": "crud-tests.coll0", + "filter": {} + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "commandName": "bulkWrite", + "databaseName": "admin", + "command": { + "bulkWrite": 1, + "ordered": true, + "ops": [ + { + "delete": 0, + "filter": {}, + "multi": false + }, + { + "delete": 0, + "filter": {}, + "multi": true + } + ] + }, + "nsInfo": [ + { + "ns": "crud-tests.coll0" + } + ], + "rawData": { + "$$exists": false + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json new file mode 100644 index 0000000000..4bc4f5569e --- /dev/null +++ b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json @@ -0,0 +1,166 @@ +{ + "description": "client bulkWrite replaceOne-rawData", + "schemaVersion": "1.4", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "client bulkWrite replaceOne with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0", + "serverless": "forbid" + } + ], + "operations": [ + { + "object": "client0", + "name": "clientBulkWrite", + "arguments": { + "models": [ + { + "replaceOne": { + "namespace": "crud-tests.coll0", + "filter": {}, + "replacement": { + "x": 1 + } + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "commandName": "bulkWrite", + "databaseName": "admin", + "command": { + "bulkWrite": 1, + "ops": [ + { + "update": 0, + "filter": {}, + "updateMods": { + "x": 1 + }, + "multi": { + "$$unsetOrMatches": false + }, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "nsInfo": [ + { + "ns": "crud-tests.coll0" + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "client bulk write replaceOne with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "minServerVersion": "8.0", + "maxServerVersion": "8.1.99", + "serverless": "forbid" + } + ], + "operations": [ + { + "object": "client0", + "name": "clientBulkWrite", + "arguments": { + "models": [ + { + "replaceOne": { + "namespace": "crud-tests.coll0", + "filter": {}, + "replacement": { + "x": 1 + } + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "commandName": "bulkWrite", + "databaseName": "admin", + "command": { + "bulkWrite": 1, + "ordered": true, + "ops": [ + { + "update": 0, + "filter": {}, + "updateMods": { + "x": 1 + }, + "multi": { + "$$unsetOrMatches": false + }, + "upsert": { + "$$unsetOrMatches": false + } + } + ] + }, + "nsInfo": [ + { + "ns": "crud-tests.coll0" + } + ], + "rawData": { + "$$exists": false + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/client-bulkWrite-update-rawdata.json b/source/crud/tests/unified/client-bulkWrite-update-rawdata.json new file mode 100644 index 0000000000..3fd7741c90 --- /dev/null +++ b/source/crud/tests/unified/client-bulkWrite-update-rawdata.json @@ -0,0 +1,191 @@ +{ + "description": "client bulkWrite update-rawData", + "schemaVersion": "1.4", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "client bulk write update with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0", + "serverless": "forbid" + } + ], + "operations": [ + { + "object": "client0", + "name": "clientBulkWrite", + "arguments": { + "models": [ + { + "updateOne": { + "namespace": "crud-tests.coll0", + "filter": {}, + "update": { + "$set": {} + } + } + }, + { + "updateMany": { + "namespace": "crud-tests.coll0", + "filter": {}, + "update": { + "$set": {} + } + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "commandName": "bulkWrite", + "databaseName": "admin", + "command": { + "bulkWrite": 1, + "ordered": true, + "ops": [ + { + "update": 0, + "filter": {}, + "updateMods": { + "$set": {} + }, + "multi": false + }, + { + "update": 0, + "filter": {}, + "updateMods": { + "$set": {} + }, + "multi": true + } + ], + "nsInfo": [ + { + "ns": "crud-tests.coll0" + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "client bulk write update with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "minServerVersion": "8.0", + "maxServerVersion": "8.1.99", + "serverless": "forbid" + } + ], + "operations": [ + { + "object": "client0", + "name": "clientBulkWrite", + "arguments": { + "models": [ + { + "updateOne": { + "namespace": "crud-tests.coll0", + "filter": {}, + "update": { + "$set": {} + } + } + }, + { + "updateMany": { + "namespace": "crud-tests.coll0", + "filter": {}, + "update": { + "$set": {} + } + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "commandName": "bulkWrite", + "databaseName": "admin", + "command": { + "bulkWrite": 1, + "ordered": true, + "ops": [ + { + "update": 0, + "filter": {}, + "updateMods": { + "$set": {} + }, + "multi": false + }, + { + "update": 0, + "filter": {}, + "updateMods": { + "$set": {} + }, + "multi": true + } + ] + }, + "nsInfo": [ + { + "ns": "crud-tests.coll0" + } + ], + "rawData": { + "$$exists": false + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/count-rawdata.json b/source/crud/tests/unified/count-rawdata.json new file mode 100644 index 0000000000..44772d40fb --- /dev/null +++ b/source/crud/tests/unified/count-rawdata.json @@ -0,0 +1,100 @@ +{ + "description": "count-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "Deprecated count with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll0", + "rawData": true + }, + "databaseName": "crud-tests" + } + } + ] + } + ] + }, + { + "description": "Deprecated count with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll0", + "rawData": { + "$$exists": false + } + }, + "databaseName": "crud-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/countDocuments-rawdata.json b/source/crud/tests/unified/countDocuments-rawdata.json new file mode 100644 index 0000000000..1651a7fe2d --- /dev/null +++ b/source/crud/tests/unified/countDocuments-rawdata.json @@ -0,0 +1,128 @@ +{ + "description": "countDocuments-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "Count documents with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll0", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ], + "rawData": true + }, + "commandName": "aggregate", + "databaseName": "crud-tests" + } + } + ] + } + ] + }, + { + "description": "Count documents with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll0", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ], + "rawData": { + "$$exists": false + } + }, + "commandName": "aggregate", + "databaseName": "crud-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/deleteMany-rawdata.json b/source/crud/tests/unified/deleteMany-rawdata.json new file mode 100644 index 0000000000..fbdc852708 --- /dev/null +++ b/source/crud/tests/unified/deleteMany-rawdata.json @@ -0,0 +1,110 @@ +{ + "description": "deleteMany-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "deleteMany with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "deleteMany", + "object": "collection0", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "delete": "coll0", + "deletes": [ + { + "q": {}, + "limit": 0 + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "deleteMany with with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "deleteMany", + "object": "collection0", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "delete": "coll0", + "deletes": [ + { + "q": {}, + "limit": 0 + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/deleteOne-rawdata.json b/source/crud/tests/unified/deleteOne-rawdata.json new file mode 100644 index 0000000000..4347548583 --- /dev/null +++ b/source/crud/tests/unified/deleteOne-rawdata.json @@ -0,0 +1,110 @@ +{ + "description": "deleteOne-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "deleteOne with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "deleteOne", + "object": "collection0", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "delete": "coll0", + "deletes": [ + { + "q": {}, + "limit": 1 + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "deleteOne with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "deleteOne", + "object": "collection0", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "delete": "coll0", + "deletes": [ + { + "q": {}, + "limit": 1 + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/distinct-rawdata.json b/source/crud/tests/unified/distinct-rawdata.json new file mode 100644 index 0000000000..d1a4abc7f7 --- /dev/null +++ b/source/crud/tests/unified/distinct-rawdata.json @@ -0,0 +1,104 @@ +{ + "description": "distinct-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "distinct with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "distinct", + "object": "collection0", + "arguments": { + "fieldName": "x", + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll0", + "key": "x", + "query": {}, + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "distinct with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "distinct", + "object": "collection0", + "arguments": { + "fieldName": "x", + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll0", + "key": "x", + "query": {}, + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/estimatedDocumentCount-rawdata.json b/source/crud/tests/unified/estimatedDocumentCount-rawdata.json new file mode 100644 index 0000000000..4c79863e98 --- /dev/null +++ b/source/crud/tests/unified/estimatedDocumentCount-rawdata.json @@ -0,0 +1,100 @@ +{ + "description": "estimatedDocumentCount-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "Estimated document count with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "object": "collection0", + "name": "estimatedDocumentCount", + "arguments": { + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll0", + "rawData": true + }, + "commandName": "count", + "databaseName": "crud-tests" + } + } + ] + } + ] + }, + { + "description": "Estimated document count with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "object": "collection0", + "name": "estimatedDocumentCount", + "arguments": { + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll0", + "rawData": { + "$$exists": false + } + }, + "commandName": "count", + "databaseName": "crud-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/find-rawdata.json b/source/crud/tests/unified/find-rawdata.json new file mode 100644 index 0000000000..778e289880 --- /dev/null +++ b/source/crud/tests/unified/find-rawdata.json @@ -0,0 +1,100 @@ +{ + "description": "find-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "Find with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll0", + "filter": {}, + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "Find with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll0", + "filter": {}, + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/findOneAndDelete-rawdata.json b/source/crud/tests/unified/findOneAndDelete-rawdata.json new file mode 100644 index 0000000000..1ace780b74 --- /dev/null +++ b/source/crud/tests/unified/findOneAndDelete-rawdata.json @@ -0,0 +1,102 @@ +{ + "description": "findOneAndDelete-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "findOneAndDelete with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "findOneAndDelete", + "object": "collection0", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "findAndModify": "coll0", + "query": {}, + "remove": true, + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "findOneAndDelete with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "findOneAndDelete", + "object": "collection0", + "arguments": { + "filter": {}, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "findAndModify": "coll0", + "query": {}, + "remove": true, + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/findOneAndReplace-rawdata.json b/source/crud/tests/unified/findOneAndReplace-rawdata.json new file mode 100644 index 0000000000..b48a2a4210 --- /dev/null +++ b/source/crud/tests/unified/findOneAndReplace-rawdata.json @@ -0,0 +1,112 @@ +{ + "description": "findOneAndReplace-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "findOneAndReplace with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "findOneAndReplace", + "object": "collection0", + "arguments": { + "filter": {}, + "replacement": { + "x": "x" + }, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "findAndModify": "coll0", + "query": {}, + "update": { + "x": "x" + }, + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "findOneAndReplace with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "findOneAndReplace", + "object": "collection0", + "arguments": { + "filter": {}, + "replacement": { + "x": "x" + }, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "findAndModify": "coll0", + "query": {}, + "update": { + "x": "x" + }, + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/findOneAndUpdate-rawdata.json b/source/crud/tests/unified/findOneAndUpdate-rawdata.json new file mode 100644 index 0000000000..a689e73f7b --- /dev/null +++ b/source/crud/tests/unified/findOneAndUpdate-rawdata.json @@ -0,0 +1,129 @@ +{ + "description": "findOneAndUpdate-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "findOneAndUpdate with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": {}, + "update": [ + { + "$set": { + "x": 1 + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "findAndModify": "coll0", + "query": {}, + "update": [ + { + "$set": { + "x": 1 + } + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "findOneAndUpdate with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "minServerVersion": "4.2.0", + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": {}, + "update": [ + { + "$set": { + "x": 1 + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "findAndModify": "coll0", + "query": {}, + "update": [ + { + "$set": { + "x": 1 + } + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/insertMany-rawdata.json b/source/crud/tests/unified/insertMany-rawdata.json new file mode 100644 index 0000000000..50852592df --- /dev/null +++ b/source/crud/tests/unified/insertMany-rawdata.json @@ -0,0 +1,120 @@ +{ + "description": "insertMany-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "insertMany with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "insertMany", + "object": "collection0", + "arguments": { + "documents": [ + { + "_id": 2, + "x": 22 + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "coll0", + "documents": [ + { + "_id": 2, + "x": 22 + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "insertMany with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "insertMany", + "object": "collection0", + "arguments": { + "documents": [ + { + "_id": 2, + "x": 22 + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "coll0", + "documents": [ + { + "_id": 2, + "x": 22 + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/insertOne-rawdata.json b/source/crud/tests/unified/insertOne-rawdata.json new file mode 100644 index 0000000000..d010c2daac --- /dev/null +++ b/source/crud/tests/unified/insertOne-rawdata.json @@ -0,0 +1,116 @@ +{ + "description": "insertOne-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "insertOne with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 2, + "x": 22 + }, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "coll0", + "documents": [ + { + "_id": 2, + "x": 22 + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "insertOne with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 2, + "x": 22 + }, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "coll0", + "documents": [ + { + "_id": 2, + "x": 22 + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/replaceOne-rawdata.json b/source/crud/tests/unified/replaceOne-rawdata.json new file mode 100644 index 0000000000..632404491c --- /dev/null +++ b/source/crud/tests/unified/replaceOne-rawdata.json @@ -0,0 +1,132 @@ +{ + "description": "replaceOne-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "ReplaceOne with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "object": "collection0", + "name": "replaceOne", + "arguments": { + "filter": {}, + "replacement": { + "x": 22 + }, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": { + "x": 22 + }, + "multi": { + "$$unsetOrMatches": false + }, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "ReplaceOne with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "object": "collection0", + "name": "replaceOne", + "arguments": { + "filter": {}, + "replacement": { + "x": 22 + }, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": { + "x": 22 + }, + "multi": { + "$$unsetOrMatches": false + }, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/updateMany-rawdata.json b/source/crud/tests/unified/updateMany-rawdata.json new file mode 100644 index 0000000000..20417e0770 --- /dev/null +++ b/source/crud/tests/unified/updateMany-rawdata.json @@ -0,0 +1,136 @@ +{ + "description": "updateMany-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "updateMany with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "updateMany", + "object": "collection0", + "arguments": { + "filter": {}, + "update": { + "$set": { + "x": 1 + } + }, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": { + "$set": { + "x": 1 + } + }, + "multi": true, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "updateMany with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "updateMany", + "object": "collection0", + "arguments": { + "filter": {}, + "update": { + "$set": { + "x": 1 + } + }, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": { + "$set": { + "x": 1 + } + }, + "multi": true, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/crud/tests/unified/updateOne-rawdata.json b/source/crud/tests/unified/updateOne-rawdata.json new file mode 100644 index 0000000000..8f703d9a40 --- /dev/null +++ b/source/crud/tests/unified/updateOne-rawdata.json @@ -0,0 +1,140 @@ +{ + "description": "updateOne-rawData", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "UpdateOne with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "name": "updateOne", + "object": "collection0", + "arguments": { + "filter": {}, + "update": { + "$set": { + "x": 1 + } + }, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": { + "$set": { + "x": 1 + } + }, + "multi": { + "$$unsetOrMatches": false + }, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "UpdateOne with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "name": "updateOne", + "object": "collection0", + "arguments": { + "filter": {}, + "update": { + "$set": { + "x": 1 + } + }, + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "update": "coll0", + "updates": [ + { + "q": {}, + "u": { + "$set": { + "x": 1 + } + }, + "multi": { + "$$unsetOrMatches": false + }, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} diff --git a/source/index-management/tests/index-rawdata.json b/source/index-management/tests/index-rawdata.json new file mode 100644 index 0000000000..791a643a0f --- /dev/null +++ b/source/index-management/tests/index-rawdata.json @@ -0,0 +1,186 @@ +{ + "description": "index management-rawData", + "schemaVersion": "1.4", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "database0" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "collection0" + } + } + ], + "tests": [ + { + "description": "index management with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0" + } + ], + "operations": [ + { + "object": "collection0", + "name": "createIndex", + "arguments": { + "keys": { + "x": 1 + }, + "rawData": true + } + }, + { + "object": "collection0", + "name": "listIndexes", + "arguments": { + "rawData": true + } + }, + { + "object": "collection0", + "name": "dropIndex", + "arguments": { + "name": "x_1", + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "createIndexes": "collection0", + "indexes": [ + { + "name": "x_1", + "key": { + "x": 1 + } + } + ], + "rawData": true + } + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "collection0", + "rawData": true + } + } + }, + { + "commandStartedEvent": { + "command": { + "dropIndexes": "collection0", + "index": "x_1", + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "index management with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99" + } + ], + "operations": [ + { + "object": "collection0", + "name": "createIndex", + "arguments": { + "keys": { + "x": 1 + }, + "rawData": true + } + }, + { + "object": "collection0", + "name": "listIndexes", + "arguments": { + "rawData": true + } + }, + { + "object": "collection0", + "name": "dropIndex", + "arguments": { + "name": "x_1", + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "createIndexes": "collection0", + "indexes": [ + { + "name": "x_1", + "key": { + "x": 1 + } + } + ], + "rawData": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "collection0", + "rawData": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "dropIndexes": "collection0", + "index": "x_1", + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} From 43316671bc9c072e2a891cd2adc476977c6ae298 Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Fri, 27 Jun 2025 23:45:59 -0400 Subject: [PATCH 02/10] WIP --- .../tests/listCollections-rawdata.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/collection-management/tests/listCollections-rawdata.json b/source/collection-management/tests/listCollections-rawdata.json index f24c8e1a3c..4af5650d37 100644 --- a/source/collection-management/tests/listCollections-rawdata.json +++ b/source/collection-management/tests/listCollections-rawdata.json @@ -23,7 +23,8 @@ "description": "listCollections with rawData option", "runOnRequirements": [ { - "minServerVersion": "8.2.0" + "minServerVersion": "8.2.0", + "auth": false } ], "operations": [ @@ -56,7 +57,8 @@ "description": "listCollections with rawData option on less than 8.2.0 - ignore argument", "runOnRequirements": [ { - "maxServerVersion": "8.1.99" + "maxServerVersion": "8.1.99", + "auth": false } ], "operations": [ From 1f949a652e16a81ebbc731d9d9b73fd3180a2c89 Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Wed, 2 Jul 2025 19:16:43 -0400 Subject: [PATCH 03/10] add yaml files --- .../tests/listCollections-rawdata.yml | 49 +++++++ source/crud/bulk-write.md | 12 ++ source/crud/crud.md | 128 ++++++++++++++++++ .../crud/tests/unified/aggregate-rawdata.yml | 55 ++++++++ .../unified/bulkWrite-deleteMany-rawdata.yml | 61 +++++++++ .../unified/bulkWrite-deleteOne-rawdata.yml | 61 +++++++++ .../unified/bulkWrite-replaceOne-rawdata.yml | 71 ++++++++++ .../unified/bulkWrite-updateMany-rawdata.yml | 72 ++++++++++ .../unified/bulkWrite-updateOne-rawdata.yml | 76 +++++++++++ .../client-bulkWrite-delete-rawdata.json | 2 +- .../client-bulkWrite-delete-rawdata.yml | 94 +++++++++++++ .../client-bulkWrite-replaceOne-rawdata.json | 2 +- .../client-bulkWrite-replaceOne-rawdata.yml | 92 +++++++++++++ .../client-bulkWrite-update-rawdata.json | 2 +- .../client-bulkWrite-update-rawdata.yml | 103 ++++++++++++++ source/crud/tests/unified/count-rawdata.yml | 53 ++++++++ .../tests/unified/countDocuments-rawdata.yml | 61 +++++++++ .../crud/tests/unified/deleteMany-rawdata.yml | 57 ++++++++ .../crud/tests/unified/deleteOne-rawdata.yml | 57 ++++++++ .../crud/tests/unified/distinct-rawdata.yml | 57 ++++++++ .../estimatedDocumentCount-rawdata.yml | 53 ++++++++ source/crud/tests/unified/find-rawdata.yml | 53 ++++++++ .../unified/findOneAndDelete-rawdata.yml | 55 ++++++++ .../unified/findOneAndReplace-rawdata.yml | 57 ++++++++ .../unified/findOneAndUpdate-rawdata.yml | 57 ++++++++ .../crud/tests/unified/insertMany-rawdata.yml | 53 ++++++++ .../crud/tests/unified/insertOne-rawdata.yml | 53 ++++++++ .../crud/tests/unified/replaceOne-rawdata.yml | 67 +++++++++ .../crud/tests/unified/updateMany-rawdata.yml | 65 +++++++++ .../crud/tests/unified/updateOne-rawdata.yml | 67 +++++++++ source/index-management/index-management.md | 29 ++++ .../index-management/tests/index-rawdata.yml | 95 +++++++++++++ 32 files changed, 1866 insertions(+), 3 deletions(-) create mode 100644 source/collection-management/tests/listCollections-rawdata.yml create mode 100644 source/crud/tests/unified/aggregate-rawdata.yml create mode 100644 source/crud/tests/unified/bulkWrite-deleteMany-rawdata.yml create mode 100644 source/crud/tests/unified/bulkWrite-deleteOne-rawdata.yml create mode 100644 source/crud/tests/unified/bulkWrite-replaceOne-rawdata.yml create mode 100644 source/crud/tests/unified/bulkWrite-updateMany-rawdata.yml create mode 100644 source/crud/tests/unified/bulkWrite-updateOne-rawdata.yml create mode 100644 source/crud/tests/unified/client-bulkWrite-delete-rawdata.yml create mode 100644 source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.yml create mode 100644 source/crud/tests/unified/client-bulkWrite-update-rawdata.yml create mode 100644 source/crud/tests/unified/count-rawdata.yml create mode 100644 source/crud/tests/unified/countDocuments-rawdata.yml create mode 100644 source/crud/tests/unified/deleteMany-rawdata.yml create mode 100644 source/crud/tests/unified/deleteOne-rawdata.yml create mode 100644 source/crud/tests/unified/distinct-rawdata.yml create mode 100644 source/crud/tests/unified/estimatedDocumentCount-rawdata.yml create mode 100644 source/crud/tests/unified/find-rawdata.yml create mode 100644 source/crud/tests/unified/findOneAndDelete-rawdata.yml create mode 100644 source/crud/tests/unified/findOneAndReplace-rawdata.yml create mode 100644 source/crud/tests/unified/findOneAndUpdate-rawdata.yml create mode 100644 source/crud/tests/unified/insertMany-rawdata.yml create mode 100644 source/crud/tests/unified/insertOne-rawdata.yml create mode 100644 source/crud/tests/unified/replaceOne-rawdata.yml create mode 100644 source/crud/tests/unified/updateMany-rawdata.yml create mode 100644 source/crud/tests/unified/updateOne-rawdata.yml create mode 100644 source/index-management/tests/index-rawdata.yml diff --git a/source/collection-management/tests/listCollections-rawdata.yml b/source/collection-management/tests/listCollections-rawdata.yml new file mode 100644 index 0000000000..05e63dc69f --- /dev/null +++ b/source/collection-management/tests/listCollections-rawdata.yml @@ -0,0 +1,49 @@ +description: "listCollections-rawData" + +schemaVersion: "1.4" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name database0 + +tests: + - description: "listCollections with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + auth: false + operations: + - name: listCollections + object: *database0 + arguments: + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + listCollections: 1 + filter: {} + rawData: *rawdata + - description: "listCollections with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + auth: false + operations: + - name: listCollections + object: *database0 + arguments: + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + listCollections: 1 + filter: {} + rawData: + $$exists: false diff --git a/source/crud/bulk-write.md b/source/crud/bulk-write.md index 285a5bb338..1d35969c91 100644 --- a/source/crud/bulk-write.md +++ b/source/crud/bulk-write.md @@ -309,6 +309,15 @@ class BulkWriteOptions { */ comment: Optional; + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; + /** * Whether detailed results for each successful operation should be included in the returned * BulkWriteResult. @@ -538,6 +547,7 @@ The `bulkWrite` server command has the following format: "bypassDocumentValidation": Optional, "comment": Optional, "let": Optional, + "rawData": Optional, ...additional operation-agnostic fields } ``` @@ -917,6 +927,8 @@ error in this specific situation does not seem helpful enough to require size ch ## **Changelog** +- 2025-06-27: Added `rawData` option. + - 2024-11-05: Updated the requirements regarding the size validation. - 2024-10-07: Error if `w:0` is used with `ordered=true` or `verboseResults=true`. diff --git a/source/crud/crud.md b/source/crud/crud.md index 91de6b2e96..bec8177915 100644 --- a/source/crud/crud.md +++ b/source/crud/crud.md @@ -319,6 +319,15 @@ class AggregateOptions { * @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ */ let: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } class CountOptions { @@ -371,6 +380,15 @@ class CountOptions { * and providing one will result in a server-side error. */ comment: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } class EstimatedDocumentCountOptions { @@ -395,6 +413,15 @@ class EstimatedDocumentCountOptions { * comment may result in a server-side error. */ comment: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } class DistinctOptions { @@ -439,6 +466,15 @@ class DistinctOptions { * @see https://www.mongodb.com/docs/manual/reference/command/find/ */ hint: Optional<(String | Document)>; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } enum CursorType { @@ -713,6 +749,15 @@ class FindOptions { * @see https://www.mongodb.com/docs/manual/reference/command/find/ */ let: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } type FindOneOptions = Omit; @@ -985,6 +1030,15 @@ class BulkWriteOptions { * The value of let will be passed to all update and delete, but not insert, commands. */ let: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } class InsertOneOptions { @@ -1007,6 +1061,15 @@ class InsertOneOptions { * and providing one will result in a server-side error. */ comment: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } class InsertManyOptions { @@ -1036,6 +1099,15 @@ class InsertManyOptions { * and providing one will result in a server-side error. */ comment: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } class UpdateOptions { @@ -1127,6 +1199,15 @@ class UpdateOptions { * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ sort: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } class ReplaceOptions { @@ -1206,6 +1287,15 @@ class ReplaceOptions { * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ sort: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } class DeleteOptions { @@ -1256,6 +1346,15 @@ class DeleteOptions { * and providing one will result in a server-side error. */ comment: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } ``` @@ -2009,6 +2108,15 @@ class FindOneAndDeleteOptions { * and providing one will result in a server-side error. */ comment: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } class FindOneAndReplaceOptions { @@ -2117,6 +2225,15 @@ class FindOneAndReplaceOptions { * and providing one will result in a server-side error. */ comment: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } class FindOneAndUpdateOptions { @@ -2234,6 +2351,15 @@ class FindOneAndUpdateOptions { * and providing one will result in a server-side error. */ comment: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } ``` @@ -2512,6 +2638,8 @@ aforementioned allowance in the SemVer spec. ## Changelog +- 2025-06-27: Added `rawData` options. + - 2024-11-13: Define `findOne` operation as optional, and add guidance on `limit` and `batchSize` for `find` operations. - 2024-11-04: Always send a value for `bypassDocumentValidation` if it was specified. diff --git a/source/crud/tests/unified/aggregate-rawdata.yml b/source/crud/tests/unified/aggregate-rawdata.yml new file mode 100644 index 0000000000..11a398e08a --- /dev/null +++ b/source/crud/tests/unified/aggregate-rawdata.yml @@ -0,0 +1,55 @@ +description: "aggregate-rawData" + +schemaVersion: "1.4" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "Aggregate with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: aggregate + object: *collection0 + arguments: + pipeline: &pipeline0 + - $match: {} + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + aggregate: *collection0Name + pipeline: *pipeline0 + rawData: *rawdata + - description: "Aggregate with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - name: aggregate + object: *collection0 + arguments: + pipeline: &pipeline0 + - $match: {} + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + aggregate: *collection0Name + pipeline: *pipeline0 + rawData: + $$exists: false diff --git a/source/crud/tests/unified/bulkWrite-deleteMany-rawdata.yml b/source/crud/tests/unified/bulkWrite-deleteMany-rawdata.yml new file mode 100644 index 0000000000..f1722058af --- /dev/null +++ b/source/crud/tests/unified/bulkWrite-deleteMany-rawdata.yml @@ -0,0 +1,61 @@ +description: "BulkWrite deleteMany-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "BulkWrite deleteMany with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - object: *collection0 + name: bulkWrite + arguments: + requests: + - deleteMany: + filter: &filter {} + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + delete: *collection0Name + deletes: + - q: *filter + limit: 0 + rawData: *rawdata + - description: "BulkWrite deleteMany with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - object: *collection0 + name: bulkWrite + arguments: + requests: + - deleteMany: + filter: &filter {} + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + delete: *collection0Name + deletes: + - q: *filter + limit: 0 + rawData: + $$exists: false diff --git a/source/crud/tests/unified/bulkWrite-deleteOne-rawdata.yml b/source/crud/tests/unified/bulkWrite-deleteOne-rawdata.yml new file mode 100644 index 0000000000..75a66bf851 --- /dev/null +++ b/source/crud/tests/unified/bulkWrite-deleteOne-rawdata.yml @@ -0,0 +1,61 @@ +description: "BulkWrite deleteOne-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "BulkWrite deleteOne with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - object: *collection0 + name: bulkWrite + arguments: + requests: + - deleteOne: + filter: &filter {} + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + delete: *collection0Name + deletes: + - q: *filter + limit: 1 + rawData: *rawdata + - description: "BulkWrite deleteOne with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - object: *collection0 + name: bulkWrite + arguments: + requests: + - deleteOne: + filter: &filter {} + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + delete: *collection0Name + deletes: + - q: *filter + limit: 1 + rawData: + $$exists: false diff --git a/source/crud/tests/unified/bulkWrite-replaceOne-rawdata.yml b/source/crud/tests/unified/bulkWrite-replaceOne-rawdata.yml new file mode 100644 index 0000000000..60f3af8c9b --- /dev/null +++ b/source/crud/tests/unified/bulkWrite-replaceOne-rawdata.yml @@ -0,0 +1,71 @@ +description: "BulkWrite replaceOne-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "BulkWrite replaceOne with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - object: *collection0 + name: bulkWrite + arguments: + requests: + - replaceOne: + filter: &filter {} + replacement: &replacement {} + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: *filter + u: *replacement + multi: + $$unsetOrMatches: false + upsert: + $$unsetOrMatches: false + rawData: *rawdata + - description: "BulkWrite replaceOne with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - object: *collection0 + name: bulkWrite + arguments: + requests: + - replaceOne: + filter: &filter {} + replacement: &replacement {} + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: *filter + u: *replacement + multi: + $$unsetOrMatches: false + upsert: + $$unsetOrMatches: false + rawData: + $$exists: false diff --git a/source/crud/tests/unified/bulkWrite-updateMany-rawdata.yml b/source/crud/tests/unified/bulkWrite-updateMany-rawdata.yml new file mode 100644 index 0000000000..ac5d67fb45 --- /dev/null +++ b/source/crud/tests/unified/bulkWrite-updateMany-rawdata.yml @@ -0,0 +1,72 @@ +description: "BulkWrite updateMany-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "BulkWrite updateMany with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - object: *collection0 + name: bulkWrite + arguments: + requests: + - updateMany: + filter: &filter {} + update: &update + - $set: + x: 1 + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: *filter + u: *update + multi: true + upsert: { $$unsetOrMatches: false } + rawData: *rawdata + - description: "BulkWrite updateMany with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - minServerVersion: "4.2.0" + maxServerVersion: "8.1.99" + operations: + - object: *collection0 + name: bulkWrite + arguments: + requests: + - updateMany: + filter: &filter {} + update: &update + - $set: + x: 1 + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: *filter + u: *update + multi: true + upsert: { $$unsetOrMatches: false } + rawData: + $$exists: false diff --git a/source/crud/tests/unified/bulkWrite-updateOne-rawdata.yml b/source/crud/tests/unified/bulkWrite-updateOne-rawdata.yml new file mode 100644 index 0000000000..86415a5412 --- /dev/null +++ b/source/crud/tests/unified/bulkWrite-updateOne-rawdata.yml @@ -0,0 +1,76 @@ +description: "BulkWrite updateOne-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "BulkWrite updateOne with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - object: *collection0 + name: bulkWrite + arguments: + requests: + - updateOne: + filter: &filter {} + update: &update + - $set: + x: 1 + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: *filter + u: *update + multi: + $$unsetOrMatches: false + upsert: + $$unsetOrMatches: false + rawData: *rawdata + - description: "BulkWrite updateOne with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - minServerVersion: "4.2.0" + maxServerVersion: "8.1.99" + operations: + - object: *collection0 + name: bulkWrite + arguments: + requests: + - updateOne: + filter: &filter {} + update: &update + - $set: + x: 1 + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: *filter + u: *update + multi: + $$unsetOrMatches: false + upsert: + $$unsetOrMatches: false + rawData: + $$exists: false diff --git a/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json index 7ad35ea2a4..54cb8c3283 100644 --- a/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json +++ b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json @@ -44,7 +44,7 @@ "deleteOne": { "namespace": "crud-tests.coll0", "filter": {} - } + } }, { "deleteMany": { diff --git a/source/crud/tests/unified/client-bulkWrite-delete-rawdata.yml b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.yml new file mode 100644 index 0000000000..06d6c9d482 --- /dev/null +++ b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.yml @@ -0,0 +1,94 @@ +description: "client bulkWrite delete-rawData" + +schemaVersion: "1.4" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +_yamlAnchors: + namespace: &namespace "crud-tests.coll0" + filter: &filter {} + +tests: + - description: "client bulk write delete with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + serverless: forbid + operations: + - object: *client0 + name: clientBulkWrite + arguments: + models: + - deleteOne: + namespace: *namespace + filter: *filter + - deleteMany: + namespace: *namespace + filter: *filter + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + commandName: bulkWrite + databaseName: admin + command: + bulkWrite: 1 + ordered: true + ops: + - delete: 0 + filter: *filter + multi: false + - delete: 0 + filter: *filter + multi: true + nsInfo: + - ns: *namespace + rawData: *rawdata + - description: "client bulk write delete with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - minServerVersion: "8.0" + maxServerVersion: "8.1.99" + serverless: forbid + operations: + - object: *client0 + name: clientBulkWrite + arguments: + models: + - deleteOne: + namespace: *namespace + filter: *filter + - deleteMany: + namespace: *namespace + filter: *filter + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + commandName: bulkWrite + databaseName: admin + command: + bulkWrite: 1 + ordered: true + ops: + - delete: 0 + filter: *filter + multi: false + - delete: 0 + filter: *filter + multi: true + nsInfo: + - ns: *namespace + rawData: + $$exists: false diff --git a/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json index 4bc4f5569e..9f820abf21 100644 --- a/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json +++ b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json @@ -146,7 +146,7 @@ "$$unsetOrMatches": false } } - ] + ] }, "nsInfo": [ { diff --git a/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.yml b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.yml new file mode 100644 index 0000000000..265f0f787d --- /dev/null +++ b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.yml @@ -0,0 +1,92 @@ +description: "client bulkWrite replaceOne-rawData" + +schemaVersion: "1.4" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +_yamlAnchors: + namespace: &namespace "crud-tests.coll0" + +tests: + - description: "client bulkWrite replaceOne with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + serverless: forbid + operations: + - object: *client0 + name: clientBulkWrite + arguments: + models: + - replaceOne: + namespace: *namespace + filter: &filter {} + replacement: &replacement + x: 1 + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + commandName: bulkWrite + databaseName: admin + command: + bulkWrite: 1 + ops: + - update: 0 + filter: *filter + updateMods: *replacement + multi: + $$unsetOrMatches: false + upsert: + $$unsetOrMatches: false + nsInfo: + - ns: *namespace + rawData: *rawdata + - description: "client bulk write replaceOne with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - minServerVersion: "8.0" + maxServerVersion: "8.1.99" + serverless: forbid + operations: + - object: *client0 + name: clientBulkWrite + arguments: + models: + - replaceOne: + namespace: *namespace + filter: &filter {} + replacement: &replacement + x: 1 + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + commandName: bulkWrite + databaseName: admin + command: + bulkWrite: 1 + ordered: true + ops: + - update: 0 + filter: *filter + updateMods: *replacement + multi: + $$unsetOrMatches: false + upsert: + $$unsetOrMatches: false + nsInfo: + - ns: *namespace + rawData: + $$exists: false diff --git a/source/crud/tests/unified/client-bulkWrite-update-rawdata.json b/source/crud/tests/unified/client-bulkWrite-update-rawdata.json index 3fd7741c90..837d7b85bb 100644 --- a/source/crud/tests/unified/client-bulkWrite-update-rawdata.json +++ b/source/crud/tests/unified/client-bulkWrite-update-rawdata.json @@ -171,7 +171,7 @@ }, "multi": true } - ] + ] }, "nsInfo": [ { diff --git a/source/crud/tests/unified/client-bulkWrite-update-rawdata.yml b/source/crud/tests/unified/client-bulkWrite-update-rawdata.yml new file mode 100644 index 0000000000..2b4881b504 --- /dev/null +++ b/source/crud/tests/unified/client-bulkWrite-update-rawdata.yml @@ -0,0 +1,103 @@ +description: "client bulkWrite update-rawData" +schemaVersion: "1.4" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +_yamlAnchors: + namespace: &namespace "crud-tests.coll0" + filter: &filter {} + update: &update + $set: {} + +tests: + - description: "client bulk write update with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + serverless: forbid + operations: + - object: *client0 + name: clientBulkWrite + arguments: + models: + - updateOne: + namespace: *namespace + filter: *filter + update: *update + - updateMany: + namespace: *namespace + filter: *filter + update: *update + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + commandName: bulkWrite + databaseName: admin + command: + bulkWrite: 1 + ordered: true + ops: + - update: 0 + filter: *filter + updateMods: *update + multi: false + - update: 0 + filter: *filter + updateMods: *update + multi: true + nsInfo: + - ns: *namespace + rawData: *rawdata + - description: "client bulk write update with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - minServerVersion: "8.0" + maxServerVersion: "8.1.99" + serverless: forbid + operations: + - object: *client0 + name: clientBulkWrite + arguments: + models: + - updateOne: + namespace: *namespace + filter: *filter + update: *update + - updateMany: + namespace: *namespace + filter: *filter + update: *update + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + commandName: bulkWrite + databaseName: admin + command: + bulkWrite: 1 + ordered: true + ops: + - update: 0 + filter: *filter + updateMods: *update + multi: false + - update: 0 + filter: *filter + updateMods: *update + multi: true + nsInfo: + - ns: *namespace + rawData: + $$exists: false diff --git a/source/crud/tests/unified/count-rawdata.yml b/source/crud/tests/unified/count-rawdata.yml new file mode 100644 index 0000000000..845606c9dd --- /dev/null +++ b/source/crud/tests/unified/count-rawdata.yml @@ -0,0 +1,53 @@ +description: "count-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "Deprecated count with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - object: *collection0 + name: count + arguments: + filter: {} + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + count: *collection0Name + rawData: *rawdata + databaseName: *database0Name + - description: "Deprecated count with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - object: *collection0 + name: count + arguments: + filter: {} + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + count: *collection0Name + rawData: + $$exists: false + databaseName: *database0Name diff --git a/source/crud/tests/unified/countDocuments-rawdata.yml b/source/crud/tests/unified/countDocuments-rawdata.yml new file mode 100644 index 0000000000..b0a7408267 --- /dev/null +++ b/source/crud/tests/unified/countDocuments-rawdata.yml @@ -0,0 +1,61 @@ +description: "countDocuments-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "Count documents with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - object: *collection0 + name: countDocuments + arguments: + filter: {} + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + aggregate: *collection0Name + pipeline: + - $match: {} + - $group: { _id: 1, n: { $sum: 1 } } + rawData: *rawdata + commandName: aggregate + databaseName: *database0Name + - description: "Count documents with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - object: *collection0 + name: countDocuments + arguments: + filter: {} + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + aggregate: *collection0Name + pipeline: + - $match: {} + - $group: { _id: 1, n: { $sum: 1 } } + rawData: + $$exists: false + commandName: aggregate + databaseName: *database0Name diff --git a/source/crud/tests/unified/deleteMany-rawdata.yml b/source/crud/tests/unified/deleteMany-rawdata.yml new file mode 100644 index 0000000000..d6c1f33478 --- /dev/null +++ b/source/crud/tests/unified/deleteMany-rawdata.yml @@ -0,0 +1,57 @@ +description: "deleteMany-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "deleteMany with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: deleteMany + object: *collection0 + arguments: + filter: {} + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + delete: *collection0Name + deletes: + - q: {} + limit: 0 + rawData: *rawdata + - description: "deleteMany with with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - name: deleteMany + object: *collection0 + arguments: + filter: {} + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + delete: *collection0Name + deletes: + - q: {} + limit: 0 + rawData: + $$exists: false diff --git a/source/crud/tests/unified/deleteOne-rawdata.yml b/source/crud/tests/unified/deleteOne-rawdata.yml new file mode 100644 index 0000000000..6d9eb72f82 --- /dev/null +++ b/source/crud/tests/unified/deleteOne-rawdata.yml @@ -0,0 +1,57 @@ +description: "deleteOne-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "deleteOne with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: deleteOne + object: *collection0 + arguments: + filter: {} + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + delete: *collection0Name + deletes: + - q: {} + limit: 1 + rawData: *rawdata + - description: "deleteOne with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - name: deleteOne + object: *collection0 + arguments: + filter: {} + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + delete: *collection0Name + deletes: + - q: {} + limit: 1 + rawData: + $$exists: false diff --git a/source/crud/tests/unified/distinct-rawdata.yml b/source/crud/tests/unified/distinct-rawdata.yml new file mode 100644 index 0000000000..b6eeab9552 --- /dev/null +++ b/source/crud/tests/unified/distinct-rawdata.yml @@ -0,0 +1,57 @@ +description: "distinct-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "distinct with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: distinct + object: *collection0 + arguments: + fieldName: &fieldName x + filter: &filter {} + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + distinct: *collection0Name + key: *fieldName + query: *filter + rawData: *rawdata + - description: "distinct with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - name: distinct + object: *collection0 + arguments: + fieldName: &fieldName x + filter: &filter {} + rawData: true + expectEvents: + - client: client0 + events: + - commandStartedEvent: + command: + distinct: *collection0Name + key: *fieldName + query: *filter + rawData: + $$exists: false diff --git a/source/crud/tests/unified/estimatedDocumentCount-rawdata.yml b/source/crud/tests/unified/estimatedDocumentCount-rawdata.yml new file mode 100644 index 0000000000..7c07a56990 --- /dev/null +++ b/source/crud/tests/unified/estimatedDocumentCount-rawdata.yml @@ -0,0 +1,53 @@ +description: "estimatedDocumentCount-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "Estimated document count with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - object: *collection0 + name: estimatedDocumentCount + arguments: + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + count: *collection0Name + rawData: *rawdata + commandName: count + databaseName: *database0Name + - description: "Estimated document count with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - object: *collection0 + name: estimatedDocumentCount + arguments: + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + count: *collection0Name + rawData: + $$exists: false + commandName: count + databaseName: *database0Name diff --git a/source/crud/tests/unified/find-rawdata.yml b/source/crud/tests/unified/find-rawdata.yml new file mode 100644 index 0000000000..f260d33943 --- /dev/null +++ b/source/crud/tests/unified/find-rawdata.yml @@ -0,0 +1,53 @@ +description: "find-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "Find with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: find + object: *collection0 + arguments: + filter: {} + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + find: *collection0Name + filter: {} + rawData: *rawdata + - description: "Find with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - name: find + object: *collection0 + arguments: + filter: {} + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + find: *collection0Name + filter: {} + rawData: + $$exists: false diff --git a/source/crud/tests/unified/findOneAndDelete-rawdata.yml b/source/crud/tests/unified/findOneAndDelete-rawdata.yml new file mode 100644 index 0000000000..27f52321ed --- /dev/null +++ b/source/crud/tests/unified/findOneAndDelete-rawdata.yml @@ -0,0 +1,55 @@ +description: "findOneAndDelete-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "findOneAndDelete with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: findOneAndDelete + object: *collection0 + arguments: + filter: {} + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + findAndModify: *collection0Name + query: {} + remove: true + rawData: *rawdata + - description: "findOneAndDelete with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - name: findOneAndDelete + object: *collection0 + arguments: + filter: {} + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + findAndModify: *collection0Name + query: {} + remove: true + rawData: + $$exists: false diff --git a/source/crud/tests/unified/findOneAndReplace-rawdata.yml b/source/crud/tests/unified/findOneAndReplace-rawdata.yml new file mode 100644 index 0000000000..4007a0fe53 --- /dev/null +++ b/source/crud/tests/unified/findOneAndReplace-rawdata.yml @@ -0,0 +1,57 @@ +description: "findOneAndReplace-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "findOneAndReplace with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: findOneAndReplace + object: *collection0 + arguments: + filter: {} + replacement: &replacement { x: x } + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + findAndModify: *collection0Name + query: {} + update: *replacement + rawData: *rawdata + - description: "findOneAndReplace with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - name: findOneAndReplace + object: *collection0 + arguments: + filter: {} + replacement: &replacement { x: x } + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + findAndModify: *collection0Name + query: {} + update: *replacement + rawData: + $$exists: false diff --git a/source/crud/tests/unified/findOneAndUpdate-rawdata.yml b/source/crud/tests/unified/findOneAndUpdate-rawdata.yml new file mode 100644 index 0000000000..fb99905e2d --- /dev/null +++ b/source/crud/tests/unified/findOneAndUpdate-rawdata.yml @@ -0,0 +1,57 @@ +description: "findOneAndUpdate-rawData" +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "findOneAndUpdate with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: findOneAndUpdate + object: *collection0 + arguments: + filter: {} + update: &update [ $set: { x: 1 } ] + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + findAndModify: *collection0Name + query: {} + update: *update + rawData: *rawdata + - description: "findOneAndUpdate with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - minServerVersion: "4.2.0" + maxServerVersion: "8.1.99" + operations: + - name: findOneAndUpdate + object: *collection0 + arguments: + filter: {} + update: &update [ $set: { x: 1 } ] + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + findAndModify: *collection0Name + query: {} + update: *update + rawData: + $$exists: false diff --git a/source/crud/tests/unified/insertMany-rawdata.yml b/source/crud/tests/unified/insertMany-rawdata.yml new file mode 100644 index 0000000000..562be344d8 --- /dev/null +++ b/source/crud/tests/unified/insertMany-rawdata.yml @@ -0,0 +1,53 @@ +description: "insertMany-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "insertMany with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: insertMany + object: *collection0 + arguments: + documents: &documents [ { _id: 2, x: 22 } ] + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collection0Name + documents: *documents + rawData: *rawdata + - description: "insertMany with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - name: insertMany + object: *collection0 + arguments: + documents: &documents [ { _id: 2, x: 22 } ] + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collection0Name + documents: *documents + rawData: + $$exists: false diff --git a/source/crud/tests/unified/insertOne-rawdata.yml b/source/crud/tests/unified/insertOne-rawdata.yml new file mode 100644 index 0000000000..7b14fd6e28 --- /dev/null +++ b/source/crud/tests/unified/insertOne-rawdata.yml @@ -0,0 +1,53 @@ +description: "insertOne-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "insertOne with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: insertOne + object: *collection0 + arguments: + document: &document { _id: 2, x: 22 } + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collection0Name + documents: [ *document ] + rawData: *rawdata + - description: "insertOne with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - name: insertOne + object: *collection0 + arguments: + document: &document { _id: 2, x: 22 } + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collection0Name + documents: [ *document ] + rawData: + $$exists: false diff --git a/source/crud/tests/unified/replaceOne-rawdata.yml b/source/crud/tests/unified/replaceOne-rawdata.yml new file mode 100644 index 0000000000..1b81c1f3f6 --- /dev/null +++ b/source/crud/tests/unified/replaceOne-rawdata.yml @@ -0,0 +1,67 @@ +description: "replaceOne-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "ReplaceOne with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - object: *collection0 + name: replaceOne + arguments: + filter: {} + replacement: &replacement { x: 22 } + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: {} + u: *replacement + multi: + $$unsetOrMatches: false + upsert: + $$unsetOrMatches: false + rawData: *rawdata + - description: "ReplaceOne with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - object: *collection0 + name: replaceOne + arguments: + filter: {} + replacement: &replacement { x: 22 } + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: {} + u: *replacement + multi: + $$unsetOrMatches: false + upsert: + $$unsetOrMatches: false + rawData: + $$exists: false diff --git a/source/crud/tests/unified/updateMany-rawdata.yml b/source/crud/tests/unified/updateMany-rawdata.yml new file mode 100644 index 0000000000..75b2587fa3 --- /dev/null +++ b/source/crud/tests/unified/updateMany-rawdata.yml @@ -0,0 +1,65 @@ +description: "updateMany-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "updateMany with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: updateMany + object: *collection0 + arguments: + filter: {} + update: &update { $set: {x: 1} } + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: {} + u: *update + multi: true + upsert: + $$unsetOrMatches: false + rawData: *rawdata + - description: "updateMany with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - name: updateMany + object: *collection0 + arguments: + filter: {} + update: &update { $set: {x: 1} } + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: {} + u: *update + multi: true + upsert: + $$unsetOrMatches: false + rawData: + $$exists: false diff --git a/source/crud/tests/unified/updateOne-rawdata.yml b/source/crud/tests/unified/updateOne-rawdata.yml new file mode 100644 index 0000000000..a22110d376 --- /dev/null +++ b/source/crud/tests/unified/updateOne-rawdata.yml @@ -0,0 +1,67 @@ +description: "updateOne-rawData" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +tests: + - description: "UpdateOne with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - name: updateOne + object: *collection0 + arguments: + filter: {} + update: &update { $set: { x: 1 } } + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: {} + u: *update + multi: + $$unsetOrMatches: false + upsert: + $$unsetOrMatches: false + rawData: *rawdata + - description: "UpdateOne with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - name: updateOne + object: *collection0 + arguments: + filter: {} + update: &update { $set: { x: 1 } } + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + update: *collection0Name + updates: + - q: {} + u: *update + multi: + $$unsetOrMatches: false + upsert: + $$unsetOrMatches: false + rawData: + $$exists: false diff --git a/source/index-management/index-management.md b/source/index-management/index-management.md index 3d6b87c73e..2543c4736c 100644 --- a/source/index-management/index-management.md +++ b/source/index-management/index-management.md @@ -214,6 +214,15 @@ interface CreateIndexOptions { */ maxTimeMS: Optional; + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; + /** * Enables users to specify an arbitrary comment to help trace the operation through * the database profiler, currentOp and logs. The default is to not send a value. @@ -238,6 +247,15 @@ interface DropIndexOptions { maxTimeMS: Optional; /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; + +/** * Enables users to specify an arbitrary comment to help trace the operation through * the database profiler, currentOp and logs. The default is to not send a value. * @@ -803,6 +821,15 @@ interface ListIndexesOptions { * @note drivers MAY chose to support batchSize on the ListIndexesOptions. */ batchSize: Optional; + + /** + * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * + * @note This option will not be sent when connected to pre-9.0 servers. + * + * @since MongoDB 8.2 + */ + rawData: Optional; } ``` @@ -1147,6 +1174,8 @@ from mistakenly specifying this option, drivers manually verify it is only sent #### Changelog +- 2025-06-27: Added `rawData` option to CreateIndexOptions, DropIndexOptions and ListIndexesOptions. + - 2024-09-05: Moved options in SearchIndexModel to SearchIndexOptions for consistency with IndexModel and IndexOptions. - 2024-03-06: Added `type` option to SearchIndexOptions. diff --git a/source/index-management/tests/index-rawdata.yml b/source/index-management/tests/index-rawdata.yml new file mode 100644 index 0000000000..b0b692b664 --- /dev/null +++ b/source/index-management/tests/index-rawdata.yml @@ -0,0 +1,95 @@ +description: "index management-rawData" + +schemaVersion: "1.4" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name database0 + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name collection0 + +tests: + - description: "index management with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + operations: + - object: *collection0 + name: createIndex + arguments: + keys: &key { x: 1 } + rawData: true + - object: *collection0 + name: listIndexes + arguments: + rawData: true + - object: *collection0 + name: dropIndex + arguments: + name: &name x_1 + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + createIndexes: *collection0 + indexes: + - name: x_1 + key: *key + rawData: true + - commandStartedEvent: + command: + listIndexes: *collection0 + rawData: true + - commandStartedEvent: + command: + dropIndexes: *collection0 + index: *name + rawData: true + - description: "index management with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + operations: + - object: *collection0 + name: createIndex + arguments: + keys: &key { x: 1 } + rawData: true + - object: *collection0 + name: listIndexes + arguments: + rawData: true + - object: *collection0 + name: dropIndex + arguments: + name: &name x_1 + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + createIndexes: *collection0 + indexes: + - name: x_1 + key: *key + rawData: + $$exists: false + - commandStartedEvent: + command: + listIndexes: *collection0 + rawData: + $$exists: false + - commandStartedEvent: + command: + dropIndexes: *collection0 + index: *name + rawData: + $$exists: false From 03a39137760e59dcd6a48fbd3a56887c76e5ea4a Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Wed, 2 Jul 2025 19:56:29 -0400 Subject: [PATCH 04/10] fixes --- .../unified/client-bulkWrite-delete-rawdata.json | 16 ++++++++-------- .../unified/client-bulkWrite-delete-rawdata.yml | 8 ++++---- .../client-bulkWrite-replaceOne-rawdata.json | 16 ++++++++-------- .../client-bulkWrite-replaceOne-rawdata.yml | 8 ++++---- .../unified/client-bulkWrite-update-rawdata.json | 16 ++++++++-------- .../unified/client-bulkWrite-update-rawdata.yml | 8 ++++---- 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json index 54cb8c3283..608fda4048 100644 --- a/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json +++ b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json @@ -147,15 +147,15 @@ "filter": {}, "multi": true } - ] - }, - "nsInfo": [ - { - "ns": "crud-tests.coll0" + ], + "nsInfo": [ + { + "ns": "crud-tests.coll0" + } + ], + "rawData": { + "$$exists": false } - ], - "rawData": { - "$$exists": false } } } diff --git a/source/crud/tests/unified/client-bulkWrite-delete-rawdata.yml b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.yml index 06d6c9d482..9c7e9dc3aa 100644 --- a/source/crud/tests/unified/client-bulkWrite-delete-rawdata.yml +++ b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.yml @@ -88,7 +88,7 @@ tests: - delete: 0 filter: *filter multi: true - nsInfo: - - ns: *namespace - rawData: - $$exists: false + nsInfo: + - ns: *namespace + rawData: + $$exists: false diff --git a/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json index 9f820abf21..818cc0824c 100644 --- a/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json +++ b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json @@ -146,15 +146,15 @@ "$$unsetOrMatches": false } } - ] - }, - "nsInfo": [ - { - "ns": "crud-tests.coll0" + ], + "nsInfo": [ + { + "ns": "crud-tests.coll0" + } + ], + "rawData": { + "$$exists": false } - ], - "rawData": { - "$$exists": false } } } diff --git a/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.yml b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.yml index 265f0f787d..c0cd568194 100644 --- a/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.yml +++ b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.yml @@ -86,7 +86,7 @@ tests: $$unsetOrMatches: false upsert: $$unsetOrMatches: false - nsInfo: - - ns: *namespace - rawData: - $$exists: false + nsInfo: + - ns: *namespace + rawData: + $$exists: false diff --git a/source/crud/tests/unified/client-bulkWrite-update-rawdata.json b/source/crud/tests/unified/client-bulkWrite-update-rawdata.json index 837d7b85bb..80b1ad23c5 100644 --- a/source/crud/tests/unified/client-bulkWrite-update-rawdata.json +++ b/source/crud/tests/unified/client-bulkWrite-update-rawdata.json @@ -171,15 +171,15 @@ }, "multi": true } - ] - }, - "nsInfo": [ - { - "ns": "crud-tests.coll0" + ], + "nsInfo": [ + { + "ns": "crud-tests.coll0" + } + ], + "rawData": { + "$$exists": false } - ], - "rawData": { - "$$exists": false } } } diff --git a/source/crud/tests/unified/client-bulkWrite-update-rawdata.yml b/source/crud/tests/unified/client-bulkWrite-update-rawdata.yml index 2b4881b504..f53f7c958c 100644 --- a/source/crud/tests/unified/client-bulkWrite-update-rawdata.yml +++ b/source/crud/tests/unified/client-bulkWrite-update-rawdata.yml @@ -97,7 +97,7 @@ tests: filter: *filter updateMods: *update multi: true - nsInfo: - - ns: *namespace - rawData: - $$exists: false + nsInfo: + - ns: *namespace + rawData: + $$exists: false From c4d6dccec0942d7980f49513419b5244022defad Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Thu, 3 Jul 2025 19:41:36 -0400 Subject: [PATCH 05/10] add db aggregate --- .../tests/unified/db-aggregate-rawdata.json | 177 ++++++++++++++++++ .../tests/unified/db-aggregate-rawdata.yml | 64 +++++++ 2 files changed, 241 insertions(+) create mode 100644 source/crud/tests/unified/db-aggregate-rawdata.json create mode 100644 source/crud/tests/unified/db-aggregate-rawdata.yml diff --git a/source/crud/tests/unified/db-aggregate-rawdata.json b/source/crud/tests/unified/db-aggregate-rawdata.json new file mode 100644 index 0000000000..76f3cc61fa --- /dev/null +++ b/source/crud/tests/unified/db-aggregate-rawdata.json @@ -0,0 +1,177 @@ +{ + "description": "db-aggregate-rawdata", + "schemaVersion": "1.4", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "admin" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "crud-v2" + } + } + ], + "tests": [ + { + "description": "Aggregate with rawData option", + "runOnRequirements": [ + { + "minServerVersion": "8.2.0", + "topologies": [ + "replicaset" + ], + "serverless": "forbid" + } + ], + "operations": [ + { + "object": "database0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$listLocalSessions": {} + }, + { + "$limit": 1 + }, + { + "$addFields": { + "dummy": "dummy field" + } + }, + { + "$project": { + "_id": 0, + "dummy": 1 + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "pipeline": [ + { + "$listLocalSessions": {} + }, + { + "$limit": 1 + }, + { + "$addFields": { + "dummy": "dummy field" + } + }, + { + "$project": { + "_id": 0, + "dummy": 1 + } + } + ], + "rawData": true + } + } + } + ] + } + ] + }, + { + "description": "Aggregate with rawData option on less than 8.2.0 - ignore argument", + "runOnRequirements": [ + { + "maxServerVersion": "8.1.99", + "serverless": "forbid" + } + ], + "operations": [ + { + "object": "database0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$listLocalSessions": {} + }, + { + "$limit": 1 + }, + { + "$addFields": { + "dummy": "dummy field" + } + }, + { + "$project": { + "_id": 0, + "dummy": 1 + } + } + ], + "rawData": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "pipeline": [ + { + "$listLocalSessions": {} + }, + { + "$limit": 1 + }, + { + "$addFields": { + "dummy": "dummy field" + } + }, + { + "$project": { + "_id": 0, + "dummy": 1 + } + } + ], + "rawData": { + "$$exists": false + } + } + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/source/crud/tests/unified/db-aggregate-rawdata.yml b/source/crud/tests/unified/db-aggregate-rawdata.yml new file mode 100644 index 0000000000..1a6b21ca29 --- /dev/null +++ b/source/crud/tests/unified/db-aggregate-rawdata.yml @@ -0,0 +1,64 @@ +description: "db-aggregate-rawdata" + +schemaVersion: "1.4" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name admin + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collectionName crud-v2 + +tests: + - description: "Aggregate with rawData option" + runOnRequirements: + - minServerVersion: "8.2.0" + topologies: [ replicaset ] + serverless: forbid + operations: + - object: *database0 + name: aggregate + arguments: + pipeline: &pipeline + - { $listLocalSessions: {} } + - { $limit: 1 } + - { $addFields: { dummy: 'dummy field' } } + - { $project: { _id: 0, dummy: 1 } } + rawData: &rawdata true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + aggregate: 1 + pipeline: *pipeline + rawData: *rawdata + - description: "Aggregate with rawData option on less than 8.2.0 - ignore argument" + runOnRequirements: + - maxServerVersion: "8.1.99" + serverless: forbid + operations: + - object: *database0 + name: aggregate + arguments: + pipeline: &pipeline + - { $listLocalSessions: {} } + - { $limit: 1 } + - { $addFields: { dummy: 'dummy field' } } + - { $project: { _id: 0, dummy: 1 } } + rawData: true + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + aggregate: 1 + pipeline: *pipeline + rawData: + $$exists: false From 00bdec408fcc444f901d493dab3462e6ad8f5226 Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Mon, 7 Jul 2025 15:37:29 -0400 Subject: [PATCH 06/10] update comments --- source/crud/bulk-write.md | 5 +- source/crud/crud.md | 70 ++++++++++++--------- source/index-management/index-management.md | 15 +++-- 3 files changed, 54 insertions(+), 36 deletions(-) diff --git a/source/crud/bulk-write.md b/source/crud/bulk-write.md index 1d35969c91..28c5b847fd 100644 --- a/source/crud/bulk-write.md +++ b/source/crud/bulk-write.md @@ -310,9 +310,10 @@ class BulkWriteOptions { comment: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ diff --git a/source/crud/crud.md b/source/crud/crud.md index bec8177915..e3cb258d27 100644 --- a/source/crud/crud.md +++ b/source/crud/crud.md @@ -321,9 +321,10 @@ class AggregateOptions { let: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -382,9 +383,10 @@ class CountOptions { comment: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -415,9 +417,10 @@ class EstimatedDocumentCountOptions { comment: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -468,9 +471,10 @@ class DistinctOptions { hint: Optional<(String | Document)>; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -751,9 +755,10 @@ class FindOptions { let: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -1032,9 +1037,10 @@ class BulkWriteOptions { let: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -1063,9 +1069,10 @@ class InsertOneOptions { comment: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -1101,9 +1108,10 @@ class InsertManyOptions { comment: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -1201,9 +1209,10 @@ class UpdateOptions { sort: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -1289,9 +1298,10 @@ class ReplaceOptions { sort: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -1348,9 +1358,10 @@ class DeleteOptions { comment: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -2110,9 +2121,10 @@ class FindOneAndDeleteOptions { comment: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -2227,9 +2239,10 @@ class FindOneAndReplaceOptions { comment: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -2353,9 +2366,10 @@ class FindOneAndUpdateOptions { comment: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ diff --git a/source/index-management/index-management.md b/source/index-management/index-management.md index 2543c4736c..2bdb13bcdc 100644 --- a/source/index-management/index-management.md +++ b/source/index-management/index-management.md @@ -215,9 +215,10 @@ interface CreateIndexOptions { maxTimeMS: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -247,9 +248,10 @@ interface DropIndexOptions { maxTimeMS: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ @@ -823,9 +825,10 @@ interface ListIndexesOptions { batchSize: Optional; /** - * This option allows operations to function on the bucket-level data while accessing the primary namespace (not system.buckets). + * This option MAY be implemented by drivers that need to grant access to underlying namespaces + * for time-series collections. Drivers SHOULD NOT implement this option unless asked to do so. * - * @note This option will not be sent when connected to pre-9.0 servers. + * @note This option MUST NOT be sent when connected to pre-8.2 servers. * * @since MongoDB 8.2 */ From d9dd2fd22f702f0dfd8e71b0280aa42bd4194307 Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Mon, 7 Jul 2025 15:39:50 -0400 Subject: [PATCH 07/10] remove auth requirements for listCollections --- .../tests/listCollections-rawdata.json | 6 ++---- .../collection-management/tests/listCollections-rawdata.yml | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/source/collection-management/tests/listCollections-rawdata.json b/source/collection-management/tests/listCollections-rawdata.json index 4af5650d37..f24c8e1a3c 100644 --- a/source/collection-management/tests/listCollections-rawdata.json +++ b/source/collection-management/tests/listCollections-rawdata.json @@ -23,8 +23,7 @@ "description": "listCollections with rawData option", "runOnRequirements": [ { - "minServerVersion": "8.2.0", - "auth": false + "minServerVersion": "8.2.0" } ], "operations": [ @@ -57,8 +56,7 @@ "description": "listCollections with rawData option on less than 8.2.0 - ignore argument", "runOnRequirements": [ { - "maxServerVersion": "8.1.99", - "auth": false + "maxServerVersion": "8.1.99" } ], "operations": [ diff --git a/source/collection-management/tests/listCollections-rawdata.yml b/source/collection-management/tests/listCollections-rawdata.yml index 05e63dc69f..6c931da0c3 100644 --- a/source/collection-management/tests/listCollections-rawdata.yml +++ b/source/collection-management/tests/listCollections-rawdata.yml @@ -15,7 +15,6 @@ tests: - description: "listCollections with rawData option" runOnRequirements: - minServerVersion: "8.2.0" - auth: false operations: - name: listCollections object: *database0 @@ -32,7 +31,6 @@ tests: - description: "listCollections with rawData option on less than 8.2.0 - ignore argument" runOnRequirements: - maxServerVersion: "8.1.99" - auth: false operations: - name: listCollections object: *database0 From 1c423587e3c3a9544095d94a2d3f725fac1a94b5 Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Mon, 7 Jul 2025 15:41:57 -0400 Subject: [PATCH 08/10] minor change --- source/crud/tests/unified/db-aggregate-rawdata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/crud/tests/unified/db-aggregate-rawdata.json b/source/crud/tests/unified/db-aggregate-rawdata.json index 76f3cc61fa..61e22b9fbe 100644 --- a/source/crud/tests/unified/db-aggregate-rawdata.json +++ b/source/crud/tests/unified/db-aggregate-rawdata.json @@ -174,4 +174,4 @@ ] } ] -} \ No newline at end of file +} From a7519b5bf4203484b7002bc67ec51bfda4dda7b9 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 8 Jul 2025 14:23:15 +0200 Subject: [PATCH 09/10] Regenerate test files --- .../tests/unified/client-bulkWrite-delete-rawdata.json | 4 ++++ .../tests/unified/client-bulkWrite-replaceOne-rawdata.json | 3 +++ .../tests/unified/client-bulkWrite-update-rawdata.json | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json index 608fda4048..a9f476cfa4 100644 --- a/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json +++ b/source/crud/tests/unified/client-bulkWrite-delete-rawdata.json @@ -25,6 +25,10 @@ } } ], + "_yamlAnchors": { + "namespace": "crud-tests.coll0", + "filter": {} + }, "tests": [ { "description": "client bulk write delete with rawData option", diff --git a/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json index 818cc0824c..22da494366 100644 --- a/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json +++ b/source/crud/tests/unified/client-bulkWrite-replaceOne-rawdata.json @@ -25,6 +25,9 @@ } } ], + "_yamlAnchors": { + "namespace": "crud-tests.coll0" + }, "tests": [ { "description": "client bulkWrite replaceOne with rawData option", diff --git a/source/crud/tests/unified/client-bulkWrite-update-rawdata.json b/source/crud/tests/unified/client-bulkWrite-update-rawdata.json index 80b1ad23c5..63f86f19d9 100644 --- a/source/crud/tests/unified/client-bulkWrite-update-rawdata.json +++ b/source/crud/tests/unified/client-bulkWrite-update-rawdata.json @@ -25,6 +25,13 @@ } } ], + "_yamlAnchors": { + "namespace": "crud-tests.coll0", + "filter": {}, + "update": { + "$set": {} + } + }, "tests": [ { "description": "client bulk write update with rawData option", From 42b4f9e85f50c981ab1da56bedb2c2bd91d2f533 Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Thu, 17 Jul 2025 10:16:16 -0400 Subject: [PATCH 10/10] compatibility updates --- .../tests/listCollections-rawdata.json | 14 ++++++++++---- .../tests/listCollections-rawdata.yml | 6 ++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/source/collection-management/tests/listCollections-rawdata.json b/source/collection-management/tests/listCollections-rawdata.json index f24c8e1a3c..ec09ec31db 100644 --- a/source/collection-management/tests/listCollections-rawdata.json +++ b/source/collection-management/tests/listCollections-rawdata.json @@ -23,7 +23,8 @@ "description": "listCollections with rawData option", "runOnRequirements": [ { - "minServerVersion": "8.2.0" + "minServerVersion": "8.2.0", + "auth": false } ], "operations": [ @@ -43,7 +44,9 @@ "commandStartedEvent": { "command": { "listCollections": 1, - "filter": {}, + "filter": { + "$$unsetOrMatches": {} + }, "rawData": true } } @@ -56,7 +59,8 @@ "description": "listCollections with rawData option on less than 8.2.0 - ignore argument", "runOnRequirements": [ { - "maxServerVersion": "8.1.99" + "maxServerVersion": "8.1.99", + "auth": false } ], "operations": [ @@ -76,7 +80,9 @@ "commandStartedEvent": { "command": { "listCollections": 1, - "filter": {}, + "filter": { + "$$unsetOrMatches": {} + }, "rawData": { "$$exists": false } diff --git a/source/collection-management/tests/listCollections-rawdata.yml b/source/collection-management/tests/listCollections-rawdata.yml index 6c931da0c3..0a9f24cfac 100644 --- a/source/collection-management/tests/listCollections-rawdata.yml +++ b/source/collection-management/tests/listCollections-rawdata.yml @@ -15,6 +15,7 @@ tests: - description: "listCollections with rawData option" runOnRequirements: - minServerVersion: "8.2.0" + auth: false operations: - name: listCollections object: *database0 @@ -26,11 +27,12 @@ tests: - commandStartedEvent: command: listCollections: 1 - filter: {} + filter: { $$unsetOrMatches: {} } rawData: *rawdata - description: "listCollections with rawData option on less than 8.2.0 - ignore argument" runOnRequirements: - maxServerVersion: "8.1.99" + auth: false operations: - name: listCollections object: *database0 @@ -42,6 +44,6 @@ tests: - commandStartedEvent: command: listCollections: 1 - filter: {} + filter: { $$unsetOrMatches: {} } rawData: $$exists: false