Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
91 changes: 91 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.

47 changes: 47 additions & 0 deletions source/collection-management/tests/listCollections-rawdata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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"
operations:
- name: listCollections
object: *database0
arguments:
rawData: &rawdata true
expectEvents:
- client: *client0
events:
- commandStartedEvent:
command:
listCollections: 1
filter: {}
Copy link
Member

Choose a reason for hiding this comment

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

While testing for a potential auth failure with PHP, I noticed that this test initially failed because PHP does not send an empty filter field in the command. Since we're not testing for any filters, consider removing this line here and in the test below. Alternatively, use $unsetOrMatches as both are equivalent.

Copy link
Member

Choose a reason for hiding this comment

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

I'm in support of the above change. Although our CRUD spec denotes that find() takes a required filter parameter, it says nothing about the outgoing command. And if we consult the find command docs we'll see:

Optional. The query predicate. If unspecified, then all documents in the collection will match the predicate.

I think $$unsetOrMatches: {} makes sense in this case.

rawData: *rawdata
- 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
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