Skip to content

DRIVERS-3064 Add support for the rawData command option #1814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions source/collection-management/tests/listCollections-rawdata.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions source/collection-management/tests/listCollections-rawdata.yml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do these tests require authentication to be disabled? My impression is that they should work just fine with or without auth. If so, let's remove the requirement, or alternatively document why this is necessary in a comment for future reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8.2 does not support the rawDate with listCollections:

(Unauthorized) not authorized on database0 to execute command

operations:
- name: listCollections
object: *database0
arguments:
rawData: &rawdata true
expectEvents:
- client: *client0
events:
- commandStartedEvent:
command:
listCollections: 1
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
arguments:
rawData: true
expectEvents:
- client: *client0
events:
- commandStartedEvent:
command:
listCollections: 1
filter: { $$unsetOrMatches: {} }
rawData:
$$exists: false
13 changes: 13 additions & 0 deletions source/crud/bulk-write.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,16 @@ class BulkWriteOptions {
*/
comment: Optional<BSON value>;

/**
* 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 MUST NOT be sent when connected to pre-8.2 servers.
*
* @since MongoDB 8.2
*/
rawData: Optional<Boolean>;

/**
* Whether detailed results for each successful operation should be included in the returned
* BulkWriteResult.
Expand Down Expand Up @@ -538,6 +548,7 @@ The `bulkWrite` server command has the following format:
"bypassDocumentValidation": Optional<Boolean>,
"comment": Optional<BSON value>,
"let": Optional<Document>,
"rawData": Optional<Boolean>,
...additional operation-agnostic fields
}
```
Expand Down Expand Up @@ -917,6 +928,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`.
Expand Down
Loading
Loading