From d637a42f6bb582a3ebd9b7bca2386051cd6f743c Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Wed, 10 Dec 2014 16:42:57 -0800 Subject: [PATCH 001/321] PHP-1327: Initial commit of PHongo CRUD docs --- source/index.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ source/pretty.js | 5 ++++ 2 files changed, 72 insertions(+) create mode 100644 source/index.md create mode 100644 source/pretty.js diff --git a/source/index.md b/source/index.md new file mode 100644 index 00000000..dad5f8a2 --- /dev/null +++ b/source/index.md @@ -0,0 +1,67 @@ +# Welcome to PHongo CRUD + +PHongo CRUD is an CRUD API ontop of [Phongo](https://github.com/bjori/phongo). +Its purpose is to provide standard MongoDB API and follows the MongoDB CRUD API Specification[1] +that all [MongoDB](http://mongodb.com) supported drivers follow. + +PHongo CRUD provides several convenience methods that abstract the core PHongo extension. +The methods include functionality to insert a single document, counting all documents in +an collection, and delete documents from a collection. + + +# Installation + +As PHongo CRUD is an abstraction layer for PHongo, it naturally requires [PHongo to be +installed](http://bjori.github.io/phongo/#installation): + + $ wget https://github.com/bjori/phongo/releases/download/0.1.2/phongo-0.1.2.tgz + $ pecl install phongo-0.1.2.tgz + $ echo "extension=phongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` + +The best way to then install PHongo CRUD is via [composer](https://getcomposer.org/) +by adding the following to +[composer.json](https://getcomposer.org/doc/01-basic-usage.md#composer-json-project-setup): + +```json + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/bjori/phongo-crud" + } + ], + "require": { + "ext-phongo": ">=0.1.2", + "bjori/phongo-crud": "dev-master" + } +``` + +and then running + +```shell +$ composer install +``` + + + +## Generated API Docs + +If you are just interested in looking at the API provided, checkout the apidoc generated +documentation on: [http://bjori.github.io/phongo-crud/api/class-MongoDB.Collection.html](http://bjori.github.io/phongo-crud/api/class-MongoDB.Collection.html) + + + +## MongoDB Tutorial + +MongoDB first-timer? +Checkout these links to get a quick understanding what MongoDB is, how it works, and +what the most common terms used with MongoDB mean. + + - [MongoDB CRUD Introduction](http://docs.mongodb.org/manual/core/crud-introduction/) + - [What is a MongoDB Document](http://docs.mongodb.org/manual/core/document/) + - [MongoDB `dot notation`](http://docs.mongodb.org/manual/core/document/#dot-notation) + - [MongoDB ObjectId](http://docs.mongodb.org/manual/reference/object-id/) + + + +[1] The specification has not been published yet - it is still a Work In Progress + diff --git a/source/pretty.js b/source/pretty.js new file mode 100644 index 00000000..3e70609f --- /dev/null +++ b/source/pretty.js @@ -0,0 +1,5 @@ + +$( document ).ready(function() { + $('pre code').parent().addClass('prettyprint well'); + prettyPrint(); +}); From d04d7b074eef36cd8b5ff7ccd6dcdba6edd68721 Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Thu, 11 Dec 2014 10:45:03 -0800 Subject: [PATCH 002/321] Importing json, finding one document --- source/data.md | 35 +++++++++++++++++++++++++++++++++++ source/usage.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 source/data.md create mode 100644 source/usage.md diff --git a/source/data.md b/source/data.md new file mode 100644 index 00000000..929ad941 --- /dev/null +++ b/source/data.md @@ -0,0 +1,35 @@ +# Example data + +For the purpose of this documentation we will be using the +[zips.json](http://media.mongodb.org/zips.json) in our examples. + +Importing the dataset into the database can be done in several ways, +for example using the following script: + +```php +insert($document); +} + +$manager = new MongoDB\Manager("mongodb://localhost"); + +$result = $manager->executeWriteBatch("examples.zips", $batch); +printf("Inserted %d documents\n", $result->getInsertedCount()); + +?> +``` + +Outputs + +``` +Inserted 29353 documents +``` diff --git a/source/usage.md b/source/usage.md new file mode 100644 index 00000000..a75040f3 --- /dev/null +++ b/source/usage.md @@ -0,0 +1,49 @@ +# Usage + + +# MongoDB\Collection + +MongoDB\Collection is the main object of this component. +It has convenience methods for most of the _usual suspects_ tasks, such as inserting +documents, querying, updating, counting, and so on. + +Constructing a MongoDB\Collection requires a MongoDB\Manager and then namespace to operate +on. A [MongoDB namespace](http://docs.mongodb.org/manual/faq/developers/#faq-dev-namespace) +is in the form of "databaseName.collectionName", for example: `examples.zips`. +A [WriteConcern](http://docs.mongodb.org/manual/core/write-concern/) and +[ReadPreference](http://docs.mongodb.org/manual/core/read-preference/) can also optionally +be provided, if omitted the default values from the MongoDB\Manager will be used. + + +## finding a specific document +``` +findOne(array("_id" => "94086")); +var_dump($sunnyvale); + +?> +``` +Outputs +``` +array(5) { + ["_id"]=> + string(5) "94086" + ["city"]=> + string(9) "SUNNYVALE" + ["loc"]=> + array(2) { + [0]=> + float(-122.023771) + [1]=> + float(37.376407) + } + ["pop"]=> + int(56215) + ["state"]=> + string(2) "CA" +} +``` From 00970dba2b40a6b3e44351bb1093f8f37dfa8490 Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Fri, 12 Dec 2014 11:40:46 -0800 Subject: [PATCH 003/321] Update links after moving the repo from bjori to 10gen-labs --- source/index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/index.md b/source/index.md index dad5f8a2..d54a1421 100644 --- a/source/index.md +++ b/source/index.md @@ -1,6 +1,6 @@ -# Welcome to PHongo CRUD +# Welcome to phongo libraries! -PHongo CRUD is an CRUD API ontop of [Phongo](https://github.com/bjori/phongo). +phongo libraries is a CRUD API ontop of [Phongo](https://github.com/10gen-labs/mongo-php-driver-prototype). Its purpose is to provide standard MongoDB API and follows the MongoDB CRUD API Specification[1] that all [MongoDB](http://mongodb.com) supported drivers follow. @@ -12,9 +12,9 @@ an collection, and delete documents from a collection. # Installation As PHongo CRUD is an abstraction layer for PHongo, it naturally requires [PHongo to be -installed](http://bjori.github.io/phongo/#installation): +installed](http://10gen-labs.github.io/mongo-php-driver-prototype/#installation): - $ wget https://github.com/bjori/phongo/releases/download/0.1.2/phongo-0.1.2.tgz + $ wget https://github.com/10gen-labs/mongo-php-driver-prototype/releases/download/0.1.2/phongo-0.1.2.tgz $ pecl install phongo-0.1.2.tgz $ echo "extension=phongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` @@ -26,12 +26,12 @@ by adding the following to "repositories": [ { "type": "vcs", - "url": "https://github.com/bjori/phongo-crud" + "url": "https://github.com/10gen-labs/mongo-php-library-prototype" } ], "require": { "ext-phongo": ">=0.1.2", - "bjori/phongo-crud": "dev-master" + "10gen-labs/mongo-php-library-prototype": "dev-master" } ``` @@ -46,7 +46,7 @@ $ composer install ## Generated API Docs If you are just interested in looking at the API provided, checkout the apidoc generated -documentation on: [http://bjori.github.io/phongo-crud/api/class-MongoDB.Collection.html](http://bjori.github.io/phongo-crud/api/class-MongoDB.Collection.html) +documentation on: [http://10gen-labs.github.io/mongo-php-library-prototype/api/class-MongoDB.Collection.html](http://10gen-labs.github.io/mongo-php-library-prototype/api/class-MongoDB.Collection.html) From 948dc432c2697dbe37cfdb1b27813f6e9ea99d7a Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 23 Mar 2015 23:23:01 -0400 Subject: [PATCH 004/321] Update documentation for PECL mongodb-0.2.0 --- source/data.md | 32 ++++++++++++------- source/index.md | 82 +++++++++++++++++++----------------------------- source/pretty.js | 5 ++- source/usage.md | 34 +++++++++++--------- 4 files changed, 73 insertions(+), 80 deletions(-) diff --git a/source/data.md b/source/data.md index 929ad941..18727695 100644 --- a/source/data.md +++ b/source/data.md @@ -1,35 +1,43 @@ -# Example data +# Example Data -For the purpose of this documentation we will be using the -[zips.json](http://media.mongodb.org/zips.json) in our examples. +Usage examples in this documentation will use +[zips.json](http://media.mongodb.org/zips.json). This is a dataset comprised of +United States postal codes, populations, and geographic locations. -Importing the dataset into the database can be done in several ways, -for example using the following script: +Importing the dataset into MongoDB can be done in several ways. The following +examples uses the low-level `mongodb` PHP driver: ```php insert($document); + $bulk->insert($document); } -$manager = new MongoDB\Manager("mongodb://localhost"); +$manager = new MongoDB\Driver\Manager("mongodb://localhost"); -$result = $manager->executeWriteBatch("examples.zips", $batch); +$result = $manager->executeBulkWrite("test.zips", $bulk); printf("Inserted %d documents\n", $result->getInsertedCount()); ?> ``` -Outputs +Executing this script should yield the following output: ``` Inserted 29353 documents ``` + +You may also import the dataset using the +[`mongoimport`](http://docs.mongodb.org/manual/reference/program/mongoimport/) +command, which is included with MongoDB: + +``` +$ mongoimport --db examples --collection zips --file zips.json +``` diff --git a/source/index.md b/source/index.md index d54a1421..21fd8ed5 100644 --- a/source/index.md +++ b/source/index.md @@ -1,67 +1,49 @@ -# Welcome to phongo libraries! +# MongoDB PHP Library -phongo libraries is a CRUD API ontop of [Phongo](https://github.com/10gen-labs/mongo-php-driver-prototype). -Its purpose is to provide standard MongoDB API and follows the MongoDB CRUD API Specification[1] -that all [MongoDB](http://mongodb.com) supported drivers follow. +This library provides a high-level abstraction around the lower-level +[PHP driver](https://github.com/10gen-labs/mongo-php-driver-prototype) (i.e. the +`mongodb` extension). -PHongo CRUD provides several convenience methods that abstract the core PHongo extension. -The methods include functionality to insert a single document, counting all documents in -an collection, and delete documents from a collection. +While the extension provides a limited API for executing commands, queries, and +write operations, this library implements an API similar to that of the +[legacy PHP driver](http://php.net/manual/en/book.mongo.php). It contains +abstractions for client, database, and collection objects, and provides methods +for CRUD operations and common commands (e.g. index and collection management). +If you are developing an application with MongoDB, you should consider using +this library, or another high-level abstraction, instead of the extension alone. -# Installation - -As PHongo CRUD is an abstraction layer for PHongo, it naturally requires [PHongo to be -installed](http://10gen-labs.github.io/mongo-php-driver-prototype/#installation): - - $ wget https://github.com/10gen-labs/mongo-php-driver-prototype/releases/download/0.1.2/phongo-0.1.2.tgz - $ pecl install phongo-0.1.2.tgz - $ echo "extension=phongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` +For further information about the architecture of this library and the `mongodb` +extension, see: -The best way to then install PHongo CRUD is via [composer](https://getcomposer.org/) -by adding the following to -[composer.json](https://getcomposer.org/doc/01-basic-usage.md#composer-json-project-setup): + - http://www.mongodb.com/blog/post/call-feedback-new-php-and-hhvm-drivers -```json - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/10gen-labs/mongo-php-library-prototype" - } - ], - "require": { - "ext-phongo": ">=0.1.2", - "10gen-labs/mongo-php-library-prototype": "dev-master" - } -``` +# Installation -and then running +As a high-level abstraction for the driver, this library naturally requires that +the [`mongodb` extension be installed](http://10gen-labs.github.io/mongo-php-driver-prototype/#installation): -```shell -$ composer install -``` + $ pecl install mongodb-alpha + $ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` +The preferred method of installing this library is with +[Composer](https://getcomposer.org/) by running the following from your project +root: + $ composer require "mongodb/mongodb=0.2.x-dev" ## Generated API Docs -If you are just interested in looking at the API provided, checkout the apidoc generated -documentation on: [http://10gen-labs.github.io/mongo-php-library-prototype/api/class-MongoDB.Collection.html](http://10gen-labs.github.io/mongo-php-library-prototype/api/class-MongoDB.Collection.html) - - +If you are just interested in referencing the API provided by this library, you +can view generated API documentation [here](./api). ## MongoDB Tutorial -MongoDB first-timer? -Checkout these links to get a quick understanding what MongoDB is, how it works, and -what the most common terms used with MongoDB mean. - - - [MongoDB CRUD Introduction](http://docs.mongodb.org/manual/core/crud-introduction/) - - [What is a MongoDB Document](http://docs.mongodb.org/manual/core/document/) - - [MongoDB `dot notation`](http://docs.mongodb.org/manual/core/document/#dot-notation) - - [MongoDB ObjectId](http://docs.mongodb.org/manual/reference/object-id/) - - - -[1] The specification has not been published yet - it is still a Work In Progress +If you are a new MongoDB user, these links should help you become more familiar +with MongoDB and introduce some of the concepts and terms you will encounter in +this documentation: + - [Introduction to CRUD operations in MongoDB](http://docs.mongodb.org/manual/core/crud-introduction/) + - [What is a MongoDB document?](http://docs.mongodb.org/manual/core/document/) + - [MongoDB's *dot notation* for accessing document properties](http://docs.mongodb.org/manual/core/document/#dot-notation) + - [ObjectId: MongoDB's document identifier](http://docs.mongodb.org/manual/reference/object-id/) diff --git a/source/pretty.js b/source/pretty.js index 3e70609f..cd0aa1e1 100644 --- a/source/pretty.js +++ b/source/pretty.js @@ -1,5 +1,4 @@ - -$( document ).ready(function() { - $('pre code').parent().addClass('prettyprint well'); +$(document).ready(function() { + $('pre code').parent().addClass('prettyprint well'); prettyPrint(); }); diff --git a/source/usage.md b/source/usage.md index a75040f3..b8877cd2 100644 --- a/source/usage.md +++ b/source/usage.md @@ -1,33 +1,37 @@ # Usage +## Collection class -# MongoDB\Collection +`MongoDB\Collection` is perhaps the most useful class in this library. It +provides methods for common operations on a collection, such as inserting +documents, querying, updating, counting, etc. -MongoDB\Collection is the main object of this component. -It has convenience methods for most of the _usual suspects_ tasks, such as inserting -documents, querying, updating, counting, and so on. +Constructing a `MongoDB\Collection` requires a `MongoDB\Manager` and a namespace +for the collection. A [MongoDB namespace](http://docs.mongodb.org/manual/faq/developers/#faq-dev-namespace) +consists of a database name and collection name joined by a dot. `examples.zips` +is on example of a namespace. A [write concern](http://docs.mongodb.org/manual/core/write-concern/) +and [read preference](http://docs.mongodb.org/manual/core/read-preference/) may +also be provided when constructing a Collection (if omitted, the Collection will +use the Manager's values as its defaults). -Constructing a MongoDB\Collection requires a MongoDB\Manager and then namespace to operate -on. A [MongoDB namespace](http://docs.mongodb.org/manual/faq/developers/#faq-dev-namespace) -is in the form of "databaseName.collectionName", for example: `examples.zips`. -A [WriteConcern](http://docs.mongodb.org/manual/core/write-concern/) and -[ReadPreference](http://docs.mongodb.org/manual/core/read-preference/) can also optionally -be provided, if omitted the default values from the MongoDB\Manager will be used. +## Finding a specific document - -## finding a specific document ``` findOne(array("_id" => "94086")); var_dump($sunnyvale); ?> ``` -Outputs + +Executing this script should yield the following output: + ``` array(5) { ["_id"]=> From bcd12131583cbd0e9f73fab688ad09caf55cf888 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 23 Mar 2015 23:28:39 -0400 Subject: [PATCH 005/321] Fix database name in example docs --- source/data.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/data.md b/source/data.md index 18727695..96333ec4 100644 --- a/source/data.md +++ b/source/data.md @@ -22,7 +22,7 @@ foreach ($zips as $string) { $manager = new MongoDB\Driver\Manager("mongodb://localhost"); -$result = $manager->executeBulkWrite("test.zips", $bulk); +$result = $manager->executeBulkWrite("examples.zips", $bulk); printf("Inserted %d documents\n", $result->getInsertedCount()); ?> From 98b1fa5e08305432450b77ecbe586167a2ffbc92 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 12 May 2015 16:24:59 -0400 Subject: [PATCH 006/321] Update docs for 0.2 --- source/index.md | 2 +- source/usage.md | 36 ++++++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/source/index.md b/source/index.md index 21fd8ed5..79228093 100644 --- a/source/index.md +++ b/source/index.md @@ -30,7 +30,7 @@ The preferred method of installing this library is with [Composer](https://getcomposer.org/) by running the following from your project root: - $ composer require "mongodb/mongodb=0.2.x-dev" + $ composer require "mongodb/mongodb=^0.2.0" ## Generated API Docs diff --git a/source/usage.md b/source/usage.md index b8877cd2..744046eb 100644 --- a/source/usage.md +++ b/source/usage.md @@ -1,20 +1,33 @@ # Usage +## Client class + +`MongoDB\Client` serves as an entry point for the library and driver. It is +constructed with the same arguments as the driver's `MongoDB\Driver\Manager` +class, which it composes. The Client class provides methods for creating a +Database or Collection class (from the internal manager instance), as well as +top-level operations, such as enumerating and dropping databases. + ## Collection class `MongoDB\Collection` is perhaps the most useful class in this library. It provides methods for common operations on a collection, such as inserting documents, querying, updating, counting, etc. -Constructing a `MongoDB\Collection` requires a `MongoDB\Manager` and a namespace -for the collection. A [MongoDB namespace](http://docs.mongodb.org/manual/faq/developers/#faq-dev-namespace) +Constructing a `MongoDB\Collection` requires a `MongoDB\Driver\Manager` and a +namespace for the collection. A [MongoDB namespace](http://docs.mongodb.org/manual/faq/developers/#faq-dev-namespace) consists of a database name and collection name joined by a dot. `examples.zips` -is on example of a namespace. A [write concern](http://docs.mongodb.org/manual/core/write-concern/) +is one example of a namespace. Through normal use of the library, a Collection +will typically be created via the `selectCollection()` method on the Manager or +Database classes. + +A [write concern](http://docs.mongodb.org/manual/core/write-concern/) and [read preference](http://docs.mongodb.org/manual/core/read-preference/) may -also be provided when constructing a Collection (if omitted, the Collection will -use the Manager's values as its defaults). +also be provided when constructing a Collection. If these options are omitted, +the Collection will inherit them from the parent through which it was selected, +or the Manager. -## Finding a specific document +### Finding a specific document ``` Date: Thu, 14 May 2015 00:55:29 +0300 Subject: [PATCH 007/321] Update data.md --- source/data.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/data.md b/source/data.md index 96333ec4..fb97c1ef 100644 --- a/source/data.md +++ b/source/data.md @@ -13,7 +13,7 @@ examples uses the low-level `mongodb` PHP driver: $file = "http://media.mongodb.org/zips.json"; $zips = file($file, FILE_IGNORE_NEW_LINES); -$bulk = new MongoDB\Driver\BulkWrite()); +$bulk = new MongoDB\Driver\BulkWrite(); foreach ($zips as $string) { $document = json_decode($string); From 6e95b57825888dd029829f94c07b9798f08b102e Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 7 Oct 2015 14:51:32 -0400 Subject: [PATCH 008/321] Update installation instructions in docs --- source/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/index.md b/source/index.md index 79228093..5287f0cd 100644 --- a/source/index.md +++ b/source/index.md @@ -30,7 +30,7 @@ The preferred method of installing this library is with [Composer](https://getcomposer.org/) by running the following from your project root: - $ composer require "mongodb/mongodb=^0.2.0" + $ composer require "mongodb/mongodb=^1.0.0@alpha" ## Generated API Docs From 0eea745d84851519a79fbb7ace2147611bee4d85 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 7 Oct 2015 15:08:43 -0400 Subject: [PATCH 009/321] Update extension installation docs for PHP and HHVM --- source/index.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/index.md b/source/index.md index 5287f0cd..425032ef 100644 --- a/source/index.md +++ b/source/index.md @@ -20,12 +20,15 @@ extension, see: # Installation -As a high-level abstraction for the driver, this library naturally requires that -the [`mongodb` extension be installed](http://10gen-labs.github.io/mongo-php-driver-prototype/#installation): +Since this library is only a high-level abstraction for the driver, it requires +that the [`mongodb` extension be installed](http://10gen-labs.github.io/mongo-php-driver-prototype/#installation): - $ pecl install mongodb-alpha + $ pecl install mongodb-beta $ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` +Instructions for installing the `mongodb` extension on HHVM may be found in the +[HHVM driver's README](https://github.com/mongodb-labs/mongo-hhvm-driver-prototype/blob/master/README.rst). + The preferred method of installing this library is with [Composer](https://getcomposer.org/) by running the following from your project root: From 75721ae6d2eeb395fbf7a0cda65649e41f01ed5e Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Fri, 23 Oct 2015 10:06:41 -0400 Subject: [PATCH 010/321] Update GitHub URLs in docs --- source/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/index.md b/source/index.md index 425032ef..fa48c2b8 100644 --- a/source/index.md +++ b/source/index.md @@ -1,8 +1,8 @@ # MongoDB PHP Library This library provides a high-level abstraction around the lower-level -[PHP driver](https://github.com/10gen-labs/mongo-php-driver-prototype) (i.e. the -`mongodb` extension). +[PHP driver](https://github.com/mongodb/mongo-php-driver) (i.e. the `mongodb` +extension). While the extension provides a limited API for executing commands, queries, and write operations, this library implements an API similar to that of the @@ -21,13 +21,13 @@ extension, see: # Installation Since this library is only a high-level abstraction for the driver, it requires -that the [`mongodb` extension be installed](http://10gen-labs.github.io/mongo-php-driver-prototype/#installation): +that the [`mongodb` extension be installed](http://mongodb.github.io/mongo-php-driver/#installation): $ pecl install mongodb-beta $ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` Instructions for installing the `mongodb` extension on HHVM may be found in the -[HHVM driver's README](https://github.com/mongodb-labs/mongo-hhvm-driver-prototype/blob/master/README.rst). +[HHVM driver's README](https://github.com/mongodb/mongo-hhvm-driver/blob/master/README.rst). The preferred method of installing this library is with [Composer](https://getcomposer.org/) by running the following from your project From 3c044bffdcf225b224e5d073c3af399abc366353 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 2 Nov 2015 16:27:14 -0500 Subject: [PATCH 011/321] Update install docs for PHPC stable and PHPLIB beta --- source/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/index.md b/source/index.md index fa48c2b8..6e00f5c1 100644 --- a/source/index.md +++ b/source/index.md @@ -23,7 +23,7 @@ extension, see: Since this library is only a high-level abstraction for the driver, it requires that the [`mongodb` extension be installed](http://mongodb.github.io/mongo-php-driver/#installation): - $ pecl install mongodb-beta + $ pecl install mongodb $ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` Instructions for installing the `mongodb` extension on HHVM may be found in the @@ -33,7 +33,7 @@ The preferred method of installing this library is with [Composer](https://getcomposer.org/) by running the following from your project root: - $ composer require "mongodb/mongodb=^1.0.0@alpha" + $ composer require "mongodb/mongodb=^1.0.0@beta" ## Generated API Docs From 22074ca1dd47af9e912da7de85c24f095137daad Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 21 Jan 2016 09:48:49 -0500 Subject: [PATCH 012/321] Rewrite documentation for 1.0.0 --- source/classes/client.md | 131 +++++++++++++++++ source/classes/collection.md | 212 +++++++++++++++++++++++++++ source/classes/database.md | 215 ++++++++++++++++++++++++++++ source/{data.md => example-data.md} | 20 ++- source/getting-started.md | 50 +++++++ source/index.md | 44 +++--- source/usage.md | 77 ---------- 7 files changed, 632 insertions(+), 117 deletions(-) create mode 100644 source/classes/client.md create mode 100644 source/classes/collection.md create mode 100644 source/classes/database.md rename source/{data.md => example-data.md} (63%) create mode 100644 source/getting-started.md delete mode 100644 source/usage.md diff --git a/source/classes/client.md b/source/classes/client.md new file mode 100644 index 00000000..5fa72647 --- /dev/null +++ b/source/classes/client.md @@ -0,0 +1,131 @@ +# MongoDB\Client + +`MongoDB\Client` serves as an entry point for the library and driver. It is +constructed with the same arguments as the driver's `MongoDB\Driver\Manager` +class, which it composes. Additional reference may be found in the +[`MongoDB\Driver\Manager::__construct`](http://php.net/manual/en/mongodb-driver-manager.construct.php]) +and +[Connection String](https://docs.mongodb.org/manual/reference/connection-string/) +documentation. + +``` +/* By default, the driver connects to mongodb://localhost:27017 */ +$client = new MongoDB\Client; + +/* Any URI options will be merged into the URI string */ +$client = new MongoDB\Client( + 'mongodb://rs1.example.com,rs2.example.com/?replicaSet=myReplicaSet', + ['readPreference' => 'secondaryPreferred'] +); +``` + +Driver options may be provided as the third argument. In addition to options +supported by the extension, the PHP library allows you to specify a default +type map to apply to the cursors it creates. A more thorough description of type +maps may be found in the driver's +[Persistence documentation](http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps). + +``` +/* This example instructs the library to unserialize root and embedded BSON + * documents as PHP arrays, like the legacy driver (i.e. ext-mongo). */ +$client = new MongoDB\Client(null, [], [ + 'typeMap' => ['root' => 'array', 'document' => 'array'], +); +``` + +By default, the library will unserialize BSON documents and arrays as +`MongoDB\Model\BSONDocument` and `MongoDB\Model\BSONArray` objects, +respectively. Each of these model classes extends PHP's +[`ArrayObject`](http://php.net/arrayobject) class and implements the driver's +[`MongoDB\BSON\Serializable`](http://php.net/mongodb-bson-serializable) and +[`MongoDB\BSON\Unserializable`](http://php.net/mongodb-bson-unserializable) +interfaces. + +## Selecting Databases and Collections + +The Client class provides methods for creating Database or Collection instances +(using its internal Manager instance). When selecting a Database or Collection, +the child will inherit options (e.g. read preference, type map) from the Client. +New options may also be provided to the `selectDatabase()` and +`selectCollection()` methods. + +``` +$client = new MongoDB\Client; + +/* Select the "demo" database */ +$db = $client->selectDatabase('demo'); + +/* Select the "demo.users" collection */ +$collection = $client->selectCollection('demo', 'users'); + +/* selectDatabase() and selectCollection() also take an options array, which can + * override any options inherited from the Client. */ +$db = $client->selectDatabase('demo', [ + 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), +]); + +/* The property accessor may also be used to select a database without + * specifying additional options. PHP's complex syntax may be used for selecting + * databases whose names contain special characters (e.g. "-"). */ +$db = $client->demo; +$db = $client->{'another-app'}; +``` + +## Database Management + +The Client class has several methods for managing databases. + +### Dropping Databases + +``` +$client = new MongoDB\Client; + +$result = $client->dropDatabase('demo'); +var_dump($result); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#8 (1) { + ["storage":"ArrayObject":private]=> + array(2) { + ["dropped"]=> + string(4) "demo" + ["ok"]=> + float(1) + } +} +``` + +### Enumerating Databases + +``` +$client = new MongoDB\Client; + +/* listDatabases() returns an iterator of MongoDB\Model\DatabaseInfo objects */ +foreach ($client->listDatabases() as $databaseInfo) { + var_dump($databaseInfo); +} +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\DatabaseInfo)#4 (3) { + ["name"]=> + string(5) "local" + ["sizeOnDisk"]=> + float(65536) + ["empty"]=> + bool(false) +} +object(MongoDB\Model\DatabaseInfo)#7 (3) { + ["name"]=> + string(4) "test" + ["sizeOnDisk"]=> + float(32768) + ["empty"]=> + bool(false) +} +``` diff --git a/source/classes/collection.md b/source/classes/collection.md new file mode 100644 index 00000000..f20ee827 --- /dev/null +++ b/source/classes/collection.md @@ -0,0 +1,212 @@ +# MongoDB\Collection + +`MongoDB\Collection` is perhaps the most useful class in this library. It +provides methods for common operations on a collection, such as inserting +documents, querying, updating, counting, etc. + +A Collection may be constructed directly (using the extension's Manager class) +or selected from the library's Client class. It supports the following options: + + * [readConcern](http://php.net/mongodb-driver-readconcern) + * [readPreference](http://php.net/mongodb-driver-readpreference) + * [typeMap](http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps) + * [writeConcern](http://php.net/mongodb-driver-writeconcern) + +If any options are omitted, they will be inherited from the Manager constructor +argument or object from which the Collection was selected. + +Operations within the Collection class (e.g. `find()`, `insertOne()`) will +generally inherit the Collection's options. One notable exception to this rule +is that `aggregate()` (when not using a cursor) and the `findAndModify` variants +do not yet support a type map option due to a driver limitation. This means that +they will return BSON documents and arrays as `stdClass` objects and PHP arrays, +respectively. + +## Collection-level Operations + +The Collection class has methods for collection-level operations, such as +dropping the collection, CRUD operations, or managing the collection's indexes. + +### Dropping the Collection + +``` +$collection = (new MongoDB\Client)->demo->zips; + +$result = $collection->drop(); +var_dump($result); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#11 (1) { + ["storage":"ArrayObject":private]=> + array(3) { + ["ns"]=> + string(9) "demo.zips" + ["nIndexesWas"]=> + int(1) + ["ok"]=> + float(1) + } +} +``` + +## CRUD Operations + +CRUD is an acronym for Create, Read, Update, and Delete. The Collection class +implements MongoDB's cross-driver +[CRUD specification](https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst), +which defines a common API for collection-level read and write methods. + +Each method on the Collection class corresponds to a particular Operation class +within the library. The Collection's method merely merges in relevant options +(e.g. read preferences, type maps). Documentation for each CRUD method and its +options may be found in either the CRUD specification or those Operation +classes. + +### API Differences from the Legacy Driver + +The CRUD API has some notable differences from the legacy driver's +[MongoCollection](http://php.net/mongocollection) class: + + * `insert()` and `batchInsert()` have been renamed to `insertOne()` and + `insertMany()`, respectively. + * `update()` has been split into `updateOne()`, `updateMany()`, and + `replaceOne()`. + * `remove()` has been split into `deleteOne()` and `deleteMany()`. + * `findAndModify()` has been split into `findOneAndDelete()`, + `findOneAndReplace()`, and `findOneAndUpdate()`. + * `save()`, which was syntactic sugar for an insert or upsert operation, has + been removed in favor of explicitly using `insertOne()` or `replaceOne()` + (with the `upsert` option). + * `aggregate()` and `aggregateCursor()` have been consolidated into a single + `aggregate()` method. + * A general-purpose `bulkWrite()` method replaces the legacy driver's + [`MongoWriteBatch`](http://php.net/mongowritebatch) class. + +The general rule in designing our new API was that explicit method names were +preferable to overloaded terms found in the old API. For instance, `save()` and +`findAndModify()` had two or three very different modes of operation, depending +on their arguments. These new methods names also distinguish between +[updating specific fields](https://docs.mongodb.org/manual/tutorial/modify-documents/#update-specific-fields-in-a-document) +and [full-document replacement](https://docs.mongodb.org/manual/tutorial/modify-documents/#replace-the-document). + +### Finding One or More Document(s) + +The `findOne()` and `find()` methods may be used to query for one or multiple +documents. + +``` +$collection = (new MongoDB\Client)->demo->zips; + +$document = $collection->findOne(['_id' => '94301']); +var_dump($document); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#13 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + ["_id"]=> + string(5) "94301" + ["city"]=> + string(9) "PALO ALTO" + ["loc"]=> + object(MongoDB\Model\BSONArray)#12 (1) { + ["storage":"ArrayObject":private]=> + array(2) { + [0]=> + float(-122.149685) + [1]=> + float(37.444324) + } + } + ["pop"]=> + int(15965) + ["state"]=> + string(2) "CA" + } +} +``` + +The `find()` method returns a +[`MongoDB\Driver\Cursor`](http://php.net/mongodb-driver-cursor) object, which +may be iterated upon to access all matched documents. + +## Index Management + +The Collection class implements MongoDB's cross-driver +[Index Management](https://github.com/mongodb/specifications/blob/master/source/index-management.rst) +and +[Enumerating Indexes](https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst) +specifications, which defines a common API for index-related methods. + +### Creating Indexes + +``` +$collection = (new MongoDB\Client)->demo->zips; + +$result = $collection->createIndex(['state' => 1]); +var_dump($result); +``` + +The above example would output something similar to: + +``` +string(7) "state_1" +``` + +### Dropping Indexes + +``` +$collection = (new MongoDB\Client)->demo->zips; + +$result = $collection->dropIndex('state_1'); +var_dump($result); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#11 (1) { + ["storage":"ArrayObject":private]=> + array(2) { + ["nIndexesWas"]=> + int(2) + ["ok"]=> + float(1) + } +} +``` + +### Enumerating Indexes + +``` +/* listIndexes() returns an iterator of MongoDB\Model\IndexInfo objects */ +$collection = (new MongoDB\Client)->demo->zips; + +foreach ($collection->listIndexes() as $indexInfo) { + var_dump($indexInfo); +} +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\IndexInfo)#4 (4) { + ["v"]=> + int(1) + ["key"]=> + array(1) { + ["_id"]=> + int(1) + } + ["name"]=> + string(4) "_id_" + ["ns"]=> + string(9) "demo.zips" +} +``` diff --git a/source/classes/database.md b/source/classes/database.md new file mode 100644 index 00000000..1fd04621 --- /dev/null +++ b/source/classes/database.md @@ -0,0 +1,215 @@ +# MongoDB\Database + +`MongoDB\Database` provides methods for common operations on a database, such +as creating, enumerating, and dropping collections. + +A Database may be constructed directly (using the extension's Manager class) or +selected from the library's Client class. It supports the following options: + + * [readConcern](http://php.net/mongodb-driver-readconcern) + * [readPreference](http://php.net/mongodb-driver-readpreference) + * [typeMap](http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps) + * [writeConcern](http://php.net/mongodb-driver-writeconcern) + +If any options are omitted, they will be inherited from the Manager constructor +argument or object from which the Database was selected. + +Operations within the Database class (e.g. `command()`) will generally inherit +the Database's options. + +### Selecting Collections + +The Database class provides methods for creating Collection instances (using its +internal Manager instance). When selecting a Collection, the child will inherit +options (e.g. read preference, type map) from the Database. New options may also +be provided to the `selectCollection()` method. + +``` +$db = (new MongoDB\Client)->demo; + +/* Select the "users" collection */ +$collection = $db->selectCollection('users'); + +/* selectCollection() also takes an options array, which can override any + * options inherited from the Database. */ +$collection = $client->selectCollection('users', [ + 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), +]); + +/* The property accessor may also be used to select a collection without + * specifying additional options. PHP's complex syntax may be used for selecting + * collection whose names contain special characters (e.g. "."). */ +$collection = $db->users; +$collection = $db->{'system.profile'}; +``` + +## Database-level Operations + +The Database class has methods for database-level operations, such as dropping +the database, executing a command, or managing the database's collections. + +### Dropping the Database + +``` +$db = (new MongoDB\Client)->demo; + +$result = $db->drop(); +var_dump($result); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#11 (1) { + ["storage":"ArrayObject":private]=> + array(2) { + ["dropped"]=> + string(4) "demo" + ["ok"]=> + float(1) + } +} +``` + +### Executing a Command + +While the library provides helpers for some common database commands, it is far +from an [exhaustive list](https://docs.mongodb.org/manual/reference/command/). +The following example demonstrates how the +[createUser](https://docs.mongodb.org/manual/reference/command/createUser/) +command might be invoked: + +``` +$db = (new MongoDB\Client)->demo; + +/* Define a command document for creating a new database user */ +$createUserCmd = [ + 'createUser' => 'username', + 'pwd' => 'password', + 'roles' => [ 'readWrite' ], +]; + +/* It doesn't hurt to specify an explicit read preference for the command, in + * case the Database was created with a different read preference. This isn't + * required for other command helpers, as the library knows which commands might + * require a primary; however, the Database::command() method is generic. */ +$cursor = $db->command($createUserCmd, [ + 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY), +]); + +/* The command result will be the first and only document in the cursor */ +var_dump($cursor->toArray()[0]); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#8 (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["ok"]=> + float(1) + } +} +``` + +## Collection Management + +The Database class has several methods for managing collections. + +### Creating Collections + +MongoDB already creates collections implicitly when they are first referenced in +commands (e.g. inserting a document into a new collection); however, collections +may also be explicitly created with specific options. This is useful for +creating +[capped collections](https://docs.mongodb.org/manual/core/capped-collections/), +enabling +[document validation](https://docs.mongodb.org/manual/core/document-validation/), +or supplying storage engine options. + +``` +$db = (new MongoDB\Client)->demo; + +$result = $db->createCollection('users', [ + 'validator' => [ + 'username' => ['$type' => 'string'], + 'email' => ['$regex' => '@mongodb\.com$'], + ], +]); +var_dump($result); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#11 (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["ok"]=> + float(1) + } +} +``` + +### Dropping Collections + +``` +$db = (new MongoDB\Client)->demo; + +$result = $db->dropCollection('users'); +var_dump($result); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#11 (1) { + ["storage":"ArrayObject":private]=> + array(3) { + ["ns"]=> + string(10) "demo.users" + ["nIndexesWas"]=> + int(1) + ["ok"]=> + float(1) + } +} +``` + +### Enumerating Collections + +The Database class implements MongoDB's +[Enumerating Collections specification](https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst). + +``` +$db = (new MongoDB\Client)->demo; + +/* listCollections() returns an iterator of MongoDB\Model\CollectionInfo objects */ +foreach ($db->listCollections() as $collectionInfo) { + var_dump($collectionInfo); +} +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\CollectionInfo)#8 (2) { + ["name"]=> + string(5) "users" + ["options"]=> + array(0) { + } +} +object(MongoDB\Model\CollectionInfo)#13 (2) { + ["name"]=> + string(14) "system.profile" + ["options"]=> + array(2) { + ["capped"]=> + bool(true) + ["size"]=> + int(1048576) + } +} +``` diff --git a/source/data.md b/source/example-data.md similarity index 63% rename from source/data.md rename to source/example-data.md index fb97c1ef..0d873bd5 100644 --- a/source/data.md +++ b/source/example-data.md @@ -1,31 +1,27 @@ # Example Data -Usage examples in this documentation will use +Some examples in this documentation use example data fixtures from [zips.json](http://media.mongodb.org/zips.json). This is a dataset comprised of United States postal codes, populations, and geographic locations. Importing the dataset into MongoDB can be done in several ways. The following -examples uses the low-level `mongodb` PHP driver: +example uses [PHP driver](http://php.net/mongodb) (i.e. `mongodb` extension). -```php -insert($document); } -$manager = new MongoDB\Driver\Manager("mongodb://localhost"); +$manager = new MongoDB\Driver\Manager('mongodb://localhost'); -$result = $manager->executeBulkWrite("examples.zips", $bulk); +$result = $manager->executeBulkWrite('demo.zips', $bulk); printf("Inserted %d documents\n", $result->getInsertedCount()); - -?> ``` Executing this script should yield the following output: @@ -39,5 +35,5 @@ You may also import the dataset using the command, which is included with MongoDB: ``` -$ mongoimport --db examples --collection zips --file zips.json +$ mongoimport --db demo --collection zips --file zips.json --drop ``` diff --git a/source/getting-started.md b/source/getting-started.md new file mode 100644 index 00000000..028757c0 --- /dev/null +++ b/source/getting-started.md @@ -0,0 +1,50 @@ +# Getting Started + +### Requirements + +Since this library is only a high-level abstraction for the driver, it requires +that the `mongodb` extension be installed: + +``` +$ pecl install mongodb +$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` +``` + +Instructions for installing the `mongodb` extension on HHVM may be found in the +[Installation with HHVM](http://php.net/manual/en/mongodb.tutorial.install.hhvm.php) +article in the driver documentation. + +### Installation + +The preferred method of installing this library is with +[Composer](https://getcomposer.org/) by running the following from your project +root: + +``` +$ composer require "mongodb/mongodb=^1.0.0" +``` + +While not recommended, the package may also be installed manually via source +tarballs attached to +[GitHub releases](https://github.com/mongodb/mongo-php-library/releases). + +### Configure Autoloading + +Once the library is installed, ensure that your application includes Composer's +autoloader. + +``` +// This path should point to Composer's autoloader +require_once __DIR__ . "/vendor/autoload.php"; +``` + +More information on this setup may be found in Composer's +[autoloading documentation](https://getcomposer.org/doc/01-basic-usage.md#autoloading). + +If you have installed the package manually (e.g. from a source tarball), you +will likely need configure autoloading manually: + + * Map the top-level `MongoDB\` namespace to the `src/` directory using your + preferred autoloader implementation + * Manually require the `src/functions.php` file, since PHP does not yet support + function autoloading diff --git a/source/index.md b/source/index.md index 6e00f5c1..e770a36a 100644 --- a/source/index.md +++ b/source/index.md @@ -1,44 +1,32 @@ # MongoDB PHP Library This library provides a high-level abstraction around the lower-level -[PHP driver](https://github.com/mongodb/mongo-php-driver) (i.e. the `mongodb` -extension). +[PHP driver](https://php.net/mongodb) (i.e. the `mongodb` extension). While the extension provides a limited API for executing commands, queries, and write operations, this library implements an API similar to that of the [legacy PHP driver](http://php.net/manual/en/book.mongo.php). It contains abstractions for client, database, and collection objects, and provides methods for CRUD operations and common commands (e.g. index and collection management). +Support for GridFS is forthcoming. If you are developing an application with MongoDB, you should consider using this library, or another high-level abstraction, instead of the extension alone. -For further information about the architecture of this library and the `mongodb` -extension, see: +For additional information about this library and the ``mongodb`` extension, +see the [Architecture Overview](http://php.net/manual/en/mongodb.overview.php) +article in the driver documentation. [Derick Rethans](http://derickrethans.nl/) +has also written a series of blog posts entitled *New MongoDB Drivers for PHP +and HHVM*: - - http://www.mongodb.com/blog/post/call-feedback-new-php-and-hhvm-drivers + * [Part One: History](http://derickrethans.nl/new-drivers.html) + * [Part Two: Architecture](http://derickrethans.nl/new-drivers-part2.html) -# Installation +## API Documentation -Since this library is only a high-level abstraction for the driver, it requires -that the [`mongodb` extension be installed](http://mongodb.github.io/mongo-php-driver/#installation): +Generated API documentation for the library is available at: - $ pecl install mongodb - $ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` - -Instructions for installing the `mongodb` extension on HHVM may be found in the -[HHVM driver's README](https://github.com/mongodb/mongo-hhvm-driver/blob/master/README.rst). - -The preferred method of installing this library is with -[Composer](https://getcomposer.org/) by running the following from your project -root: - - $ composer require "mongodb/mongodb=^1.0.0@beta" - -## Generated API Docs - -If you are just interested in referencing the API provided by this library, you -can view generated API documentation [here](./api). + * [http://mongodb.github.io/mongo-php-library/api](http://mongodb.github.io/mongo-php-library/api) ## MongoDB Tutorial @@ -46,7 +34,7 @@ If you are a new MongoDB user, these links should help you become more familiar with MongoDB and introduce some of the concepts and terms you will encounter in this documentation: - - [Introduction to CRUD operations in MongoDB](http://docs.mongodb.org/manual/core/crud-introduction/) - - [What is a MongoDB document?](http://docs.mongodb.org/manual/core/document/) - - [MongoDB's *dot notation* for accessing document properties](http://docs.mongodb.org/manual/core/document/#dot-notation) - - [ObjectId: MongoDB's document identifier](http://docs.mongodb.org/manual/reference/object-id/) + * [Introduction to CRUD operations in MongoDB](http://docs.mongodb.org/manual/core/crud-introduction/) + * [What is a MongoDB document?](http://docs.mongodb.org/manual/core/document/) + * [MongoDB's *dot notation* for accessing document properties](http://docs.mongodb.org/manual/core/document/#dot-notation) + * [ObjectId: MongoDB's document identifier](http://docs.mongodb.org/manual/reference/object-id/) diff --git a/source/usage.md b/source/usage.md deleted file mode 100644 index 744046eb..00000000 --- a/source/usage.md +++ /dev/null @@ -1,77 +0,0 @@ -# Usage - -## Client class - -`MongoDB\Client` serves as an entry point for the library and driver. It is -constructed with the same arguments as the driver's `MongoDB\Driver\Manager` -class, which it composes. The Client class provides methods for creating a -Database or Collection class (from the internal manager instance), as well as -top-level operations, such as enumerating and dropping databases. - -## Collection class - -`MongoDB\Collection` is perhaps the most useful class in this library. It -provides methods for common operations on a collection, such as inserting -documents, querying, updating, counting, etc. - -Constructing a `MongoDB\Collection` requires a `MongoDB\Driver\Manager` and a -namespace for the collection. A [MongoDB namespace](http://docs.mongodb.org/manual/faq/developers/#faq-dev-namespace) -consists of a database name and collection name joined by a dot. `examples.zips` -is one example of a namespace. Through normal use of the library, a Collection -will typically be created via the `selectCollection()` method on the Manager or -Database classes. - -A [write concern](http://docs.mongodb.org/manual/core/write-concern/) -and [read preference](http://docs.mongodb.org/manual/core/read-preference/) may -also be provided when constructing a Collection. If these options are omitted, -the Collection will inherit them from the parent through which it was selected, -or the Manager. - -### Finding a specific document - -``` -findOne(array("_id" => "94086")); -var_dump($sunnyvale); - -?> -``` - -Executing this script should yield the following output: - -``` -array(5) { - ["_id"]=> - string(5) "94086" - ["city"]=> - string(9) "SUNNYVALE" - ["loc"]=> - array(2) { - [0]=> - float(-122.023771) - [1]=> - float(37.376407) - } - ["pop"]=> - int(56215) - ["state"]=> - string(2) "CA" -} -``` - -## Database class - -`MongoDB\Database` provides methods for common operations on a database, such -as creating, enumerating, and dropping collections. - -A [write concern](http://docs.mongodb.org/manual/core/write-concern/) -and [read preference](http://docs.mongodb.org/manual/core/read-preference/) may -also be provided when constructing a Database. If these options are omitted, -the Database will inherit them from the Client through which it was selected, -or the Manager. From c4edb09b3f16f900905a3a187b620d670f52c5f2 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 16 Mar 2016 16:25:44 +0000 Subject: [PATCH 013/321] Added part 3 of my article series --- source/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/source/index.md b/source/index.md index e770a36a..27030b10 100644 --- a/source/index.md +++ b/source/index.md @@ -21,6 +21,7 @@ and HHVM*: * [Part One: History](http://derickrethans.nl/new-drivers.html) * [Part Two: Architecture](http://derickrethans.nl/new-drivers-part2.html) + * [Part Three: Cursor Behaviour](https://derickrethans.nl/new-drivers-part3-cursor.html) ## API Documentation From 9167fc1a252843b4574ad75db0090b87db9ee966 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 23 Mar 2016 16:19:15 -0400 Subject: [PATCH 014/321] Split Collection docs into API, tutorial, and upgrade guide --- source/classes/collection.md | 1002 +++++++++++++++++++++---- source/img/save-flowchart.png | Bin 0 -> 47851 bytes source/tutorial/crud.md | 139 ++++ source/{ => tutorial}/example-data.md | 20 +- source/tutorial/indexes.md | 122 +++ source/upgrade-guide.md | 162 ++++ 6 files changed, 1309 insertions(+), 136 deletions(-) create mode 100644 source/img/save-flowchart.png create mode 100644 source/tutorial/crud.md rename source/{ => tutorial}/example-data.md (62%) create mode 100644 source/tutorial/indexes.md create mode 100644 source/upgrade-guide.md diff --git a/source/classes/collection.md b/source/classes/collection.md index f20ee827..256d7254 100644 --- a/source/classes/collection.md +++ b/source/classes/collection.md @@ -1,38 +1,395 @@ # MongoDB\Collection -`MongoDB\Collection` is perhaps the most useful class in this library. It -provides methods for common operations on a collection, such as inserting -documents, querying, updating, counting, etc. +The MongoDB\Collection class provides methods for common operations on a +collection and its documents. This includes, but is not limited to, CRUD +operations (e.g. inserting, querying, counting) and managing indexes. -A Collection may be constructed directly (using the extension's Manager class) -or selected from the library's Client class. It supports the following options: +A Collection may be constructed directly (using the extension's Manager class), +selected from the library's [Client](client.md) or [Database](database.md) +classes, or cloned from an existing Collection via +[withOptions()](#withoptions). It supports the following options: * [readConcern](http://php.net/mongodb-driver-readconcern) * [readPreference](http://php.net/mongodb-driver-readpreference) * [typeMap](http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps) * [writeConcern](http://php.net/mongodb-driver-writeconcern) -If any options are omitted, they will be inherited from the Manager constructor -argument or object from which the Collection was selected. +Operations within the Collection class (e.g. [find()](#find), +[insertOne()](#insertone)) will generally inherit the Collection's options. One +notable exception to this rule is that [aggregate()](#aggregate) (when not using +a cursor), [distinct()](#distinct), and the [findAndModify][findandmodify] +helpers do not yet support a "typeMap" option due to a driver limitation. This +means that they will always return BSON documents and arrays as stdClass objects +and arrays, respectively. -Operations within the Collection class (e.g. `find()`, `insertOne()`) will -generally inherit the Collection's options. One notable exception to this rule -is that `aggregate()` (when not using a cursor) and the `findAndModify` variants -do not yet support a type map option due to a driver limitation. This means that -they will return BSON documents and arrays as `stdClass` objects and PHP arrays, -respectively. +[findandmodify]: http://docs.mongodb.org/manual/reference/command/findAndModify/ -## Collection-level Operations +--- -The Collection class has methods for collection-level operations, such as -dropping the collection, CRUD operations, or managing the collection's indexes. +## __construct() -### Dropping the Collection +```php +function __construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = []) +``` + +If the Collection is constructed explicitly, any omitted options will be +inherited from the Manager object. If the Collection is selected from a +[Client](client.md) or [Database](database.md) object, options will be +inherited from that object. + +### Supported Options + +readConcern (MongoDB\Driver\ReadConcern) +: The default read concern to use for collection operations. Defaults to the + Manager's read concern. + +readPreference (MongoDB\Driver\ReadPreference) +: The default read preference to use for collection operations. Defaults to + the Manager's read preference. + +typeMap (array) +: Default type map for cursors and BSON documents. + +writeConcern (MongoDB\Driver\WriteConcern) +: The default write concern to use for collection operations. Defaults to the + Manager's write concern. + +### See Also + + * [MongoDB\Collection::withOptions()](#withoptions) + +--- + +## aggregate() + +```php +function aggregate(array $pipeline, array $options = []): Traversable +``` + +Executes an aggregation framework pipeline on the collection. + +This method's return value depends on the MongoDB server version and the +"useCursor" option. If "useCursor" is true, a MongoDB\Driver\Cursor will be +returned; otherwise, an ArrayIterator is returned, which wraps the "result" +array from the command response document. + +**Note:** BSON deserialization of inline aggregation results (i.e. not using a +command cursor) does not yet support a custom type map. Support is pending new +functionality in the driver. + +### Supported Options + +allowDiskUse (boolean) +: Enables writing to temporary files. When set to true, aggregation stages can + write data to the _tmp sub-directory in the dbPath directory. The default is + false. + +batchSize (integer) +: The number of documents to return per batch. + +bypassDocumentValidation (boolean) +: If true, allows the write to opt out of document level validation. This only + applies when the $out stage is specified. +

+ For servers < 3.2, this option is ignored as document level validation is + not available. + +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. + +readConcern (MongoDB\Driver\ReadConcern) +: Read concern. Note that a "majority" read concern is not compatible with the + $out stage. +

+ For servers < 3.2, this option is ignored as read concern is not available. + +readPreference (MongoDB\Driver\ReadPreference) +: Read preference. + +typeMap (array) +: Type map for BSON deserialization. This will be applied to the returned + Cursor (it is not sent to the server). +

+ This is currently not supported for inline aggregation results (i.e. + useCursor option is false or the server versions < 2.6). + +useCursor (boolean) +: Indicates whether the command will request that the server provide results + using a cursor. The default is true. +

+ For servers < 2.6, this option is ignored as aggregation cursors are not + available. +

+ For servers >= 2.6, this option allows users to turn off cursors if + necessary to aid in mongod/mongos upgrades. + +### See Also + + * [MongoDB Manual: aggregate command](http://docs.mongodb.org/manual/reference/command/aggregate/) + +--- + +## bulkWrite() + +```php +function bulkWrite(array $operations, array $options = []): MongoDB\BulkWriteResult +``` + +Executes multiple write operations. + +### Operations Example + +Example array structure for all supported operation types: + +```php +[ + [ 'deleteMany' => [ $filter ] ], + [ 'deleteOne' => [ $filter ] ], + [ 'insertOne' => [ $document ] ], + [ 'replaceOne' => [ $filter, $replacement, $options ] ], + [ 'updateMany' => [ $filter, $update, $options ] ], + [ 'updateOne' => [ $filter, $update, $options ] ], +] +``` +Arguments correspond to the respective operation methods; however, the +"writeConcern" option is specified for the top-level bulk write operation +instead of each individual operation. + +### Supported Options + +bypassDocumentValidation (boolean) +: If true, allows the write to opt out of document level validation. +ordered (boolean) +: If true, when an insert fails, return without performing the remaining + writes. If false, when a write fails, continue with the remaining writes, if + any. The default is true. + +writeConcern (MongoDB\Driver\WriteConcern) +: Write concern. + +### See Also + + * [MongoDB\Collection::deleteMany()](#deletemany) + * [MongoDB\Collection::deleteOne()](#deleteone) + * [MongoDB\Collection::insertOne()](#insertone) + * [MongoDB\Collection::replaceOne()](#replaceone) + * [MongoDB\Collection::updateMany()](#updatemany) + * [MongoDB\Collection::updateOne()](#updateone) + * [Tutorial: CRUD Operations](../tutorial/crud.md) + +--- + +## count() + +```php +function count($filter = [], array $options = []): integer +``` + +Gets the number of documents matching the filter. Returns the number of matched +documents as an integer. + +### Supported Options + +hint (string|document) +: The index to use. If a document, it will be interpretted as an index + specification and a name will be generated. + +limit (integer) +: The maximum number of documents to count. + +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. + +readConcern (MongoDB\Driver\ReadConcern) +: Read concern. +

+ For servers < 3.2, this option is ignored as read concern is not available. + +readPreference (MongoDB\Driver\ReadPreference) +: Read preference. + +skip (integer) +: The number of documents to skip before returning the documents. + +### See Also + + * [MongoDB Manual: count command](http://docs.mongodb.org/manual/reference/command/count/) + +--- + +## createIndex() + +```php +function createIndex($key, array $options = []): string +``` + +Create a single index for the collection. Returns the name of the created index +as a string. + +### Key Example + +The `$key` argument must be a document containing one or more fields mapped to +an order or type. For example: + +``` +// Ascending index on the "username" field +$key = [ 'username' => 1 ]; + +// 2dsphere index on the "loc" field with a secondary index on "created_at" +$key = [ 'loc' => '2dsphere', 'created_at' => 1 ]; +``` + +### Supported Options + +Index options are documented in the [MongoDB manual][createIndexes]. + +[createIndexes]: https://docs.mongodb.org/manual/reference/command/createIndexes/ + +### See Also + + * [MongoDB\Collection::createIndexes()](#createindexes) + * [Tutorial: Indexes](../tutorial/indexes.md) + * [MongoDB Manual: createIndexes command][createIndexes] + * [MongoDB Manual: Indexes][indexes] + +[indexes]: https://docs.mongodb.org/manual/indexes/ + +--- + +## createIndexes() + +``` +function createIndexes(array $indexes): string[] ``` + +Create one or more indexes for the collection. Returns the names of the created +indexes as an array of strings. + +### Indexes Array + +Each element in the `$indexes` array must have a "key" document, which contains +fields mapped to an order or type. Other options may follow. For example: + +```php +[ + // Create a unique index on the "username" field + [ 'key' => [ 'username' => 1 ], 'unique' => true ], + // Create a 2dsphere index on the "loc" field with a custom name + [ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo' ], +] +``` +If the "name" option is unspecified, a name will be generated from the "key" +document. + +Index options are documented in the [MongoDB manual][createIndexes]. + +### See Also + + * [MongoDB\Collection::createIndex()](#createindex) + * [Tutorial: Indexes](../tutorial/indexes.md) + * [MongoDB Manual: createIndexes command][createIndexes] + * [MongoDB Manual: Indexes][indexes] + +--- + +## deleteMany() + +```php +function deleteMany($filter, array $options = []): MongoDB\DeleteResult +``` + +Deletes all documents matching the filter. + +### Supported Options + +writeConcern (MongoDB\Driver\WriteConcern) +: Write concern. + +### See Also + + * [MongoDB\Collection::bulkWrite()](#bulkwrite) + * [MongoDB\Collection::deleteOne()](#deleteone) + * [Tutorial: CRUD Operations](../tutorial/crud.md) + * [MongoDB Manual: delete command](https://docs.mongodb.org/manual/reference/command/delete/) + +--- + +## deleteOne() + +```php +function deleteOne($filter, array $options = []): MongoDB\DeleteResult +``` + +Deletes at most one document matching the filter. + +### Supported Options + +writeConcern (MongoDB\Driver\WriteConcern) +: Write concern. + +### See Also + + * [MongoDB\Collection::bulkWrite()](#bulkwrite) + * [MongoDB\Collection::deleteMany()](#deletemany) + * [Tutorial: CRUD Operations](../tutorial/crud.md) + * [MongoDB Manual: delete command](https://docs.mongodb.org/manual/reference/command/delete/) + +--- + +## distinct() + +```php +function distinct($fieldName, $filter = [], array $options = []): mixed[] +``` + +Finds the distinct values for a specified field across the collection. Returns +an array of the distinct values. + +### Supported Options + +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. + +readConcern (MongoDB\Driver\ReadConcern) +: Read concern. +

+ For servers < 3.2, this option is ignored as read concern is not available. + +readPreference (MongoDB\Driver\ReadPreference) +: Read preference. + +### See Also + + * [MongoDB Manual: distinct command](https://docs.mongodb.org/manual/reference/command/distinct/) + +--- + +## drop() + +```php +function drop(array $options = []): array|object +``` + +Drop this collection. Returns the command result document. + +### Supported Options + +typeMap (array) +: Type map for BSON deserialization. This will be used for the returned + command result document. + +### Example + +The following example drops the "demo.zips" collection: + +``` +demo->zips; $result = $collection->drop(); + var_dump($result); ``` @@ -52,161 +409,548 @@ object(MongoDB\Model\BSONDocument)#11 (1) { } ``` -## CRUD Operations +### See Also + + * [MongoDB Manual: drop command](https://docs.mongodb.org/manual/reference/command/drop/) -CRUD is an acronym for Create, Read, Update, and Delete. The Collection class -implements MongoDB's cross-driver -[CRUD specification](https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst), -which defines a common API for collection-level read and write methods. +--- -Each method on the Collection class corresponds to a particular Operation class -within the library. The Collection's method merely merges in relevant options -(e.g. read preferences, type maps). Documentation for each CRUD method and its -options may be found in either the CRUD specification or those Operation -classes. +## dropIndex() + +```php +function dropIndex($indexName, array $options = []): array|object +``` -### API Differences from the Legacy Driver +Drop a single index in the collection. Returns the command result document. -The CRUD API has some notable differences from the legacy driver's -[MongoCollection](http://php.net/mongocollection) class: +### Supported Options - * `insert()` and `batchInsert()` have been renamed to `insertOne()` and - `insertMany()`, respectively. - * `update()` has been split into `updateOne()`, `updateMany()`, and - `replaceOne()`. - * `remove()` has been split into `deleteOne()` and `deleteMany()`. - * `findAndModify()` has been split into `findOneAndDelete()`, - `findOneAndReplace()`, and `findOneAndUpdate()`. - * `save()`, which was syntactic sugar for an insert or upsert operation, has - been removed in favor of explicitly using `insertOne()` or `replaceOne()` - (with the `upsert` option). - * `aggregate()` and `aggregateCursor()` have been consolidated into a single - `aggregate()` method. - * A general-purpose `bulkWrite()` method replaces the legacy driver's - [`MongoWriteBatch`](http://php.net/mongowritebatch) class. +typeMap (array) +: Type map for BSON deserialization. This will be used for the returned + command result document. -The general rule in designing our new API was that explicit method names were -preferable to overloaded terms found in the old API. For instance, `save()` and -`findAndModify()` had two or three very different modes of operation, depending -on their arguments. These new methods names also distinguish between -[updating specific fields](https://docs.mongodb.org/manual/tutorial/modify-documents/#update-specific-fields-in-a-document) -and [full-document replacement](https://docs.mongodb.org/manual/tutorial/modify-documents/#replace-the-document). +### See Also -### Finding One or More Document(s) + * [MongoDB\Collection::dropIndexes()](#dropindexes) + * [Tutorial: Indexes](../tutorial/indexes.md) + * [MongoDB Manual: dropIndexes command](http://docs.mongodb.org/manual/reference/command/dropIndexes/) + * [MongoDB Manual: Indexes][indexes] -The `findOne()` and `find()` methods may be used to query for one or multiple -documents. +--- +## dropIndexes() + +```php +function dropIndexes(array $options = []): array|object ``` -$collection = (new MongoDB\Client)->demo->zips; -$document = $collection->findOne(['_id' => '94301']); -var_dump($document); +Drop all indexes in the collection. Returns the command result document. + +### Supported Options + +typeMap (array) +: Type map for BSON deserialization. This will be used for the returned + command result document. + +### See Also + + * [MongoDB\Collection::dropIndex()](#dropindex) + * [Tutorial: Indexes](../tutorial/indexes.md) + * [MongoDB Manual: dropIndexes command](http://docs.mongodb.org/manual/reference/command/dropIndexes/) + * [MongoDB Manual: Indexes][indexes] + +--- + +## find() + +```php +function find($filter = [], array $options = []): MongoDB\Driver\Cursor ``` -The above example would output something similar to: +Finds documents matching the query. Returns a MongoDB\Driver\Cursor. + +### Supported Options + +allowPartialResults (boolean) +: Get partial results from a mongos if some shards are inaccessible (instead + of throwing an error). + +batchSize (integer) +: The number of documents to return per batch. + +comment (string) +: Attaches a comment to the query. If "$comment" also exists in the modifiers + document, this option will take precedence. + +cursorType (enum) +: Indicates the type of cursor to use. Must be either NON_TAILABLE, TAILABLE, + or TAILABLE_AWAIT. The default is NON_TAILABLE. + +limit (integer) +: The maximum number of documents to return. + +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. If "$maxTimeMS" also + exists in the modifiers document, this option will take precedence. + +modifiers (document) +: Meta-operators modifying the output or behavior of a query. + +noCursorTimeout (boolean) +: The server normally times out idle cursors after an inactivity period (10 + minutes) to prevent excess memory use. Set this option to prevent that. + +oplogReplay (boolean) +: Internal replication use only. The driver should not set this. + +projection (document) +: Limits the fields to return for the matching document. + +readConcern (MongoDB\Driver\ReadConcern) +: Read concern. +

+ For servers < 3.2, this option is ignored as read concern is not + available. +readPreference (MongoDB\Driver\ReadPreference) +: Read preference. + +skip (integer) +: The number of documents to skip before returning. + +sort (document) +: The order in which to return matching documents. If "$orderby" also exists + in the modifiers document, this option will take precedence. + +typeMap (array) +: Type map for BSON deserialization. This will be applied to the returned + Cursor (it is not sent to the server). + +### See Also + + * [MongoDB\Collection::findOne()](#findOne) + * [MongoDB Manual: find command](http://docs.mongodb.org/manual/reference/command/find/) + +--- + +## findOne() + +```php +function findOne($filter = [], array $options = []): array|object ``` -object(MongoDB\Model\BSONDocument)#13 (1) { - ["storage":"ArrayObject":private]=> - array(5) { - ["_id"]=> - string(5) "94301" - ["city"]=> - string(9) "PALO ALTO" - ["loc"]=> - object(MongoDB\Model\BSONArray)#12 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - [0]=> - float(-122.149685) - [1]=> - float(37.444324) - } - } - ["pop"]=> - int(15965) - ["state"]=> - string(2) "CA" - } -} + +Finds a single document matching the query. Returns the matching document or +null. + +### Supported Options + +comment (string) +: Attaches a comment to the query. If "$comment" also exists in the modifiers + document, this option will take precedence. + +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. If "$maxTimeMS" also + exists in the modifiers document, this option will take precedence. + +modifiers (document) +: Meta-operators modifying the output or behavior of a query. + +projection (document) +: Limits the fields to return for the matching document. + +readConcern (MongoDB\Driver\ReadConcern) +: Read concern. +

+ For servers < 3.2, this option is ignored as read concern is not available. + +readPreference (MongoDB\Driver\ReadPreference) +: Read preference. + +skip (integer) +: The number of documents to skip before returning. + +sort (document) +: The order in which to return matching documents. If "$orderby" also exists + in the modifiers document, this option will take precedence. + +typeMap (array) +: Type map for BSON deserialization. + +### See Also + + * [MongoDB\Collection::find()](#find) + * [MongoDB Manual: find command](http://docs.mongodb.org/manual/reference/command/find/) + +--- + +## findOneAndDelete() + +```php +function findOneAndDelete($filter, array $options = []): object|null ``` -The `find()` method returns a -[`MongoDB\Driver\Cursor`](http://php.net/mongodb-driver-cursor) object, which -may be iterated upon to access all matched documents. +Finds a single document and deletes it, returning the original. The document to +return may be null if no document matched the filter. + +**Note:** BSON deserialization of the returned document does not yet support a +custom type map. Support is pending new functionality in the driver. + +### Supported Options -## Index Management +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. -The Collection class implements MongoDB's cross-driver -[Index Management](https://github.com/mongodb/specifications/blob/master/source/index-management.rst) -and -[Enumerating Indexes](https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst) -specifications, which defines a common API for index-related methods. +projection (document) +: Limits the fields to return for the matching document. -### Creating Indexes +sort (document) +: Determines which document the operation modifies if the query selects + multiple documents. +writeConcern (MongoDB\Driver\WriteConcern) +: Write concern. This option is only supported for server versions >= 3.2. + +### See Also + + * [MongoDB\Collection::findOneAndReplace()](#findoneandreplace) + * [MongoDB\Collection::findOneAndUpdate()](#findoneandupdate) + * [MongoDB Manual: findAndModify command][findandmodify] + +--- + +## findOneAndReplace() + +```php +function findOneAndReplace($filter, $replacement, array $options = []): object|null ``` -$collection = (new MongoDB\Client)->demo->zips; -$result = $collection->createIndex(['state' => 1]); -var_dump($result); +Finds a single document and replaces it, returning either the original or the +replaced document. + +The document to return may be null if no document matched the filter. By +default, the original document is returned. Specify +`MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER` for the +"returnDocument" option to return the updated document. + +**Note:** BSON deserialization of the returned document does not yet support a +custom type map. Support is pending new functionality in the driver. + +### Supported Options + +bypassDocumentValidation (boolean) +: If true, allows the write to opt out of document level validation. + +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. + +projection (document) +: Limits the fields to return for the matching document. + +returnDocument (enum) +: Whether to return the document before or after the update is applied. Must + be either `MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE` or + `MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER`. The default is + `MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`. + +sort (document) +: Determines which document the operation modifies if the query selects + multiple documents. + +upsert (boolean) +: When true, a new document is created if no document matches the query. The + default is false. + +writeConcern (MongoDB\Driver\WriteConcern) +: Write concern. This option is only supported for server versions >= 3.2. + +### See Also + + * [MongoDB\Collection::findOneAndDelete()](#findoneanddelete) + * [MongoDB\Collection::findOneAndUpdate()](#findoneandupdate) + * [MongoDB Manual: findAndModify command][findandmodify] + +--- + +## findOneAndUpdate() + +```php +function findOneAndUpdate($filter, $update, array $options = []): object|null ``` -The above example would output something similar to: +Finds a single document and updates it, returning either the original or the +updated document. + +The document to return may be null if no document matched the filter. By +default, the original document is returned. Specify +`MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER` for the +"returnDocument" option to return the updated document. + +**Note:** BSON deserialization of the returned document does not yet support a +custom type map. Support is pending new functionality in the driver. + +### Supported Options + +bypassDocumentValidation (boolean) +: If true, allows the write to opt out of document level validation. + +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. +projection (document) +: Limits the fields to return for the matching document. + +returnDocument (enum) +: Whether to return the document before or after the update is applied. Must + be either `MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE` or + `MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER`. The default is + `MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`. + +sort (document) +: Determines which document the operation modifies if the query selects + multiple documents. + +upsert (boolean) +: When true, a new document is created if no document matches the query. The + default is false. + +writeConcern (MongoDB\Driver\WriteConcern) +: Write concern. This option is only supported for server versions >= 3.2. + +### See Also + + * [MongoDB\Collection::findOneAndDelete()](#findoneanddelete) + * [MongoDB\Collection::findOneAndReplace()](#findoneandreplace) + * [MongoDB Manual: findAndModify command][findandmodify] + +--- + +## getCollectionName() + +```php +function getCollectionName(): string ``` -string(7) "state_1" + +Return the collection name. + +--- + +## getDatabaseName() + +```php +function getDatabaseName(): string ``` -### Dropping Indexes +Return the database name. + +--- + +## getNamespace() +```php +function getNamespace(): string ``` -$collection = (new MongoDB\Client)->demo->zips; -$result = $collection->dropIndex('state_1'); -var_dump($result); +Return the collection namespace. + +### See Also + + * [MongoDB Manual: namespace](https://docs.mongodb.org/manual/reference/glossary/#term-namespace) + +--- + +## insertMany() + +```php +function insertMany(array $documents, array $options = []): MongoDB\InsertManyResult ``` -The above example would output something similar to: +Inserts multiple documents. + +### Supported Options + +bypassDocumentValidation (boolean) +: If true, allows the write to opt out of document level validation. + +ordered (boolean) +: If true, when an insert fails, return without performing the remaining + writes. If false, when a write fails, continue with the remaining writes, if + any. The default is true. + +writeConcern (MongoDB\Driver\WriteConcern) +: Write concern. + +### See Also + + * [MongoDB\Collection::bulkWrite()](#bulkwrite) + * [MongoDB\Collection::insertOne()](#insertone) + * [Tutorial: CRUD Operations](../tutorial/crud.md) + * [MongoDB Manual: insert command](http://docs.mongodb.org/manual/reference/command/insert/) +--- + +## insertOne() + +```php +function insertOne($document, array $options = []): MongoDB\InsertOneResult ``` -object(MongoDB\Model\BSONDocument)#11 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["nIndexesWas"]=> - int(2) - ["ok"]=> - float(1) - } -} + +Inserts one document. + +### Supported Options + +bypassDocumentValidation (boolean) +: If true, allows the write to opt out of document level validation. + +writeConcern (MongoDB\Driver\WriteConcern) +: Write concern. + +### See Also + + * [MongoDB\Collection::bulkWrite()](#bulkwrite) + * [MongoDB\Collection::insertMany()](#insertmany) + * [Tutorial: CRUD Operations](../tutorial/crud.md) + * [MongoDB Manual: insert command](http://docs.mongodb.org/manual/reference/command/insert/) + +--- + +## listIndexes() + +```php +function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator ``` -### Enumerating Indexes +Returns information for all indexes for the collection. Elements in the returned +iterator will be MongoDB\Model\IndexInfo objects. + +### Supported Options +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. + +### See Also + + * [Tutorial: Indexes](../tutorial/indexes.md) + * [MongoDB Manual: listIndexes command](http://docs.mongodb.org/manual/reference/command/listIndexes/) + * [MongoDB Manual: Indexes][indexes] + * [MongoDB Specification: Enumerating Collections](https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst) + +--- + +## replaceOne() + +```php +function replaceOne($filter, $replacement, array $options = []): MongoDB\UpdateResult ``` -/* listIndexes() returns an iterator of MongoDB\Model\IndexInfo objects */ -$collection = (new MongoDB\Client)->demo->zips; -foreach ($collection->listIndexes() as $indexInfo) { - var_dump($indexInfo); -} +Replaces at most one document matching the filter. + +### Supported Options + +bypassDocumentValidation (boolean) +: If true, allows the write to opt out of document level validation. + +upsert (boolean) +: When true, a new document is created if no document matches the query. The + default is false. + +writeConcern (MongoDB\Driver\WriteConcern) +: Write concern. + +### See Also + + * [MongoDB\Collection::bulkWrite()](#bulkwrite) + * [MongoDB\Collection::updateMany()](#updatemany) + * [MongoDB\Collection::updateOne()](#updateone) + * [Tutorial: CRUD Operations](../tutorial/crud.md) + * [MongoDB Manual: update command](http://docs.mongodb.org/manual/reference/command/update/) + +--- + +## updateMany() + +```php +function updateMany($filter, $update, array $options = []): MongoDB\UpdateResult ``` -The above example would output something similar to: +Updates all documents matching the filter. + +### Supported Options + +bypassDocumentValidation (boolean) +: If true, allows the write to opt out of document level validation. +upsert (boolean) +: When true, a new document is created if no document matches the query. The + default is false. + +writeConcern (MongoDB\Driver\WriteConcern) +: Write concern. + +### See Also + + * [MongoDB\Collection::bulkWrite()](#bulkwrite) + * [MongoDB\Collection::replaceOne()](#replaceone) + * [MongoDB\Collection::updateOne()](#updateone) + * [Tutorial: CRUD Operations](../tutorial/crud.md) + * [MongoDB Manual: update command](http://docs.mongodb.org/manual/reference/command/update/) + +--- + +## updateOne() + +```php +function updateOne($filter, $update, array $options = []): MongoDB\UpdateResult ``` -object(MongoDB\Model\IndexInfo)#4 (4) { - ["v"]=> - int(1) - ["key"]=> - array(1) { - ["_id"]=> - int(1) - } - ["name"]=> - string(4) "_id_" - ["ns"]=> - string(9) "demo.zips" -} + +Updates at most one document matching the filter. + +### Supported Options + +bypassDocumentValidation (boolean) +: If true, allows the write to opt out of document level validation. + +upsert (boolean) +: When true, a new document is created if no document matches the query. The + default is false. + +writeConcern (MongoDB\Driver\WriteConcern) +: Write concern. + +### See Also + + * [MongoDB\Collection::bulkWrite()](#bulkwrite) + * [MongoDB\Collection::replaceOne()](#replaceone) + * [MongoDB\Collection::updateMany()](#updatemany) + * [Tutorial: CRUD Operations](../tutorial/crud.md) + * [MongoDB Manual: update command](http://docs.mongodb.org/manual/reference/command/update/) + +--- + +## withOptions() + +```php +function withOptions(array $options = []): MongoDB\Collection ``` + +Returns a clone of this Collection with different options. + +### Supported Options + +readConcern (MongoDB\Driver\ReadConcern) +: The default read concern to use for collection operations. Defaults to the + Manager's read concern. + +readPreference (MongoDB\Driver\ReadPreference) +: The default read preference to use for collection operations. Defaults to + the Manager's read preference. + +typeMap (array) +: Default type map for cursors and BSON documents. + +writeConcern (MongoDB\Driver\WriteConcern) +: The default write concern to use for collection operations. Defaults to the + Manager's write concern. + +### See Also + + * [MongoDB\Collection::__construct()](#__construct) diff --git a/source/img/save-flowchart.png b/source/img/save-flowchart.png new file mode 100644 index 0000000000000000000000000000000000000000..45e7b764bd4a5635b3606be97df1cbecf225e5df GIT binary patch literal 47851 zcmce-byS;O7bglui)(Rcfuf}pcPrka1&T|HySoIp;_jhnad$5zI20(s2@u?aJ2&+E z-gjorn)&PAxml1r>&eM^_St94Z_9~LQIf^RAjd#JK){xlllp{!fHaJNfOvhkrRto+Je_czq0pK6c9pto~5fCs5pZ*aMGO|eFH_=?=6{XQu5V7(3@t%Et zoeIB2<|3`-B57}HYij3$An9cK#l_U*rMsnz#Ys9YS+-RkU zeGX`{h&US3Z&{RYp06Mub5#%M>}je>NlDSm#<&uvNUtlSuH#WwJ|Zn-t_<)5%TUqr zKQaeOCc>DC2l|#@iu4rFOC{!zO7E8Fb_*Z@K*Qj9HI|t0@NlL#-v;_HhDIG*fQ2d> zD2swO*6(TCOC#4=48_1%bQJbzr+Mc^fTBS7*zljV;dgb>(kfaal$DGv-eXgxq3d2W zE>tlyrnhtzs( zP%Vds1FHKcl@#Hv$~ksCO3w<8qWH*Hw6wGs!?X##6~W#_g%nllujrLaU55Ecx29Nv z;Xj8HEf>Q9`ty>BJ8d%-P-P{T^T%T4?Fn%d4`}gUD%O);1e07#o5l&Vl}cgZ$YK(| zhck>QMVj8cImlY2eUpLs{YgE+j18!nr3?@L$h_(|v;w_*74I!-Jf6Oy)mW=}$oTh( zV-BqZ%sM<0A#uVLQcF^lW4$2KrhjNXxxDt>fZax6yzIF+ z3A4o+l5^*8U^#}?A>F$x7?%mXPy_AL0^m%OatgajQ&BpkR2ZDMH%u7s+L&X9nG!)W zRoNOipT<1XV+jb?i{HeymR^im_TU;?b11;0JZFnW>v&(7sf^&@<1LyJO)cf5$90#J zM=HxAu}V=geQ#>zF7zu9ZNcfP-~0!pjqcp*;BnODv2SAZarNfA?GG>vU00N?N0}=u zKE(qY+=`B|AUBNzwfMuwuqQHXuJWCi48@}^iG6T&xg~K`2dSZ#G;h1U{NFW(kHO7A^7h&CJSlV)4Cs39fKGw z<@51Ud)%b6HUrl?IL@X1whC%P7AXY5J-b_5EuZNGwkD6#`24z=X;Up)<@WPv5(3lw zRO~&3mZtP0UcsQGyb75=8wIABbfDe{yRHj^hgJ8K%fAs&4<}{dTK!~6Xf-ovHSJf{ zmv684J7dvfA40!2fE}Ru5PX6fa{nI~C1*JhT>lPM3?~m?Z6z8e<=ved|HLR0Mu{(? zk<(eqBaz^8;HPvMB=?$~-WUGBRuK}!IHywl%HP@QR=!E~TmcunKXOxl51bdg=EgzZ zckM%9yvCp!&FEVChyfjEQZ(r!o7-$t?+Dq?qCp=P+I-QQs+#bVxY(Scc-4Q&=GKO9 zkdYi=O72_LN0rVBZ3(hmw4l!K90#!^#ww$B2>#jD2v zf(yE|!}ne^PHPhb-Te5BV>$J=^k5Rw!%G>0Ec>GnVo-V{JDuKtWC`vi^hz>fb_lAGg%Y>29P8-3 z@3A?O7bH(Ue?0ygAfDq`bUZgT#uUZMk5^7rDb=3y%sjeoeaAYY($QZ>KgOiP%oo2o z5Zd7Qq~1S**x~#fZM9}PTD;)!tNL!V?w@P;!)?KW0o6%SK#Jj|)@H?uC3E`4d~rwoA*u^q}yr$ydmggoZVnZ8w$!eIafu zEA9a?Js&U$4@_gZbXoHN-9|^Sa!C|l z2f_CcUPL?{BQ7##p4pD|8I=xWJC3iP6*jwvP_?VFuLOwpzP;pM`|%&4$ku)l&#LNj zZZCgTL_*_6Avv*odhDrBd0#_Agm*Ns`@VRW>BlA5`A zq<@{>Oi0o4hYF#sVhPIhdW$0FD#fOklh5Q#vv&;TR6&07`%>OIB8=r4TKF8Tm0Q~0 z{CHv1yj#>TFaG3V{@P)wQR)S`9qUl2JnQI#z2VAAtGQ!q!VlkmgduK)0*OZvqN-E+ zoIfY~Sz^ietUwS|XKa}e4ua9%{`_1KiMEsIN`c8e%A7&fJVT0?`z46XCwvx2Z44=` z@%U7kClw@X$@NfX2r;zcuzVgZC$KT*Rk7jB%IrJZYeKKNvNB&&@Qb(5BnV)h=~q@` zsJ1!(?#GeE$@Y@=rJ|;#Z&s_w?HZN6EdA542FA7ki^s7*NVZv__PI#F#`GlID=MRLc)f z@Ae9%NghvQkztnOAxY)8&niHEzS>}q`BCTUhe)taEH6LYHniXg*1e&1Dv{QZD^w|D z{$+cVeBihJ&GZ^D55*Gv$u{nrpZo-_o{&z0cYP)|W-(VfO0TZrpK+1K*I9|)H!6EE zjJ1NCgin^n_4qYy0xQ2>N{;hU%QjHA{4>G*iv}>plNq{RT224(^2xmZXSV-)7oM3M z{R82+pWqnqqY(7xYE&KAOC1YNf~wYw_^$CI<&CSu_bkEdmbWP+sCyc(o+JehxST>c zGT|of2ON;;?8kgH;{EYIAl{L_^y1i_2KwMsjBN`J&^#OCAH+#l-e3rof2-u9@T2sV z=jYwQ(r)wr0RUk|%Bz`--X(YmjH8DTq^?IUYunm?5MY9Fc>|Zc@Qbm8N4+vQBCS1) zF3l2EnY!U*_(A$#E(y@2`7XEdU+E*I+})DHfpPG;{pT+WTTQxM#mRps0)*6nOEGAj zzF>#4TD(9RJ}m706RUwe*dW@~L|A;u+i0NtkysMGL^vc{U*jep%k{3l_(B`WmhW-E zlhoxWR#>U1V!EDiy>WX-siPT5M^VWLv(UeL7%v|`t;L{&69V^#PL32f##p}z&3}(x z-Jf^UggP=jQ_|QPKM6D9AeAk(f@x}rt^C@V4`;L`emAUB#%}))SEW60p8Z6~x4N_J z@c-#Q7W}}&44&ssmVkfnl=1O3UVPWEP9~zs4+20A2Ll;;9XRI`&(m+6aL+^8{tC%o z;rqWQF8?oP{)-g;{{9Iv{C|4U0)+DhzvU{5LlddNA62}7qln_TuEDLY^l3*DFk@!Q z8%hJi2l{Y_#mquCAoJ!G6}h{A;ip$Cmaf$LqzAU#uB>cCxSkGcz#7KT({ozB!GU48-frkDX;T9@|HIR$b?R1gZ8$+8 z>l9JF9n@jg9UMi;EKj2ozQs&G+35AWuyqy6L&s*x50h8RgG7~aBbu?eujmH9u^Vfd zDbGEPeX>AKA>6GJ628aRG{x%q^7WJ*v|ceMWbkmf)?-0;>r41OF~;Il6*_ z$Dy^K@UsW*lBmZiuIxj>kv=_TJN2F~e663SpDfnjwce5I6yFMD9q#>@@Z`k4Iq1mc zJ4n-wI)ab~G76w}9ldfzVEBgsPwr|^eg7(@?Af&agxzFd7k4}gU52AcuZrGSv5gGK zyYw$(;D|=f0DG{|0X3SD3BW?dsKih%1%l*khq+_Xo|};QEPnydXP5rnhNrR1mg?DK zvJTCMxod2R7AFI-0)nukJ3k3|8G>~ZfrH8$gc;Dc+(X3R!!_d zR&4+DcHYU#UHR^5*6Y&FC#FBmYKJ+v%D)742$6DzRu3jwyPf3u97m+7bo!Z~lMOPQ z&W-ff^FHa?)4Xqek#?QV`vs{B_jwX6U?Zg;ISJtr45Qhc(Q${hZ>MJc=YNMP_F5{~ zMp;u{f3q!Kh-z}`Q}CU?R9eGb4nN1K16NMy5d6bikLaSQ`)6Y-sDE|^BfL5;wo20% z1geI zVn+u&G_94Nh=5yb`eI2Z?I#j27^Zd_B7%udHq+A|fAn`0Wc~0T=Ni#zQ?yq5@7VPt zzBr|=d{RwwmZq!`Y~1@KMv||+^^rFBHt$5ot@ci%CUuDaOYyZec0R`_N2Mdtn3PEsrBgVz`iy^@I~4$z%pD@5f3OtYTj zS0?nWT)-K$+O2~Q^ZhG*$Hw&%iAGZ4P-6;69$|Ln!r_o zz4Ole|K@6*aJay$miL=niOSCXBN6<1RtSJ2C^eG2s46pDT68s@9Qj|J$)XS{cBYTX zZB)18N#6^zQ~AksUuWcR58X2v7X{l1s_4nB`;b`*KP# zQhOaev#Pm4mdO9GG<>~CW+csyw11eWiYp$_aTm?vgwN(z`}}qWr{{}dwZW0@ztig7 z#OdKf$z?rO2^V3jQX1<7H_he%f>{0NCvCA){bxhhKXL0RZ9(~i9;G+HiOqJ$I2!aM zS6{pY8htp43~#*lPVayiPp0t6n3I(Ca2A=u#gACD5Sj@rqiy+3B54o()#zRQ5LVux zBm3XgpWueBzlR$E^dXuLr>coes(h*%gME`qtylY|cos#%6Zg3G{vNdPoCa&D4m9m3Yx8$v7X$5o_Hs>e}X zHvT;Drc?Q|Y5cpc@h}rUoUP&J6MgAkzr+&o!;exYve_oVNDbq#6~&1DEzbd+%-p=E zZGem5KnS;-goFs}Cg;0)ko@9B;F!2UOsD6KAWkLOv(D$>EpN4dW$Tnj3Z&k*LoRFa zUDD-on@3|E<5<3`lb*69c@A+F_unnJYs7a#6GIv+QnwdMmkDw!q1B8VrAam$9(m<4 z*{B8F!Y6(btP>k8UJ&U^In%^%qdJ+DEP7_qu^f*-SIK32J{(QK8rU`BS!eIU>^HVI zzo(Czd_C2&zGn#vzccBmiUsQYnY}G|ADzQ65+UqN>W}xo9T3Nzk@|C zXQ^Lz#iU*3#S$4~egQQ5*%k`V%|J((Efla({-)#RQweZNe{N zAEavxkV;~vcsEl&Qw|CD#gM(so|QTzLV_Y>0QJ^`#80A>9TI3ur*RQ0{QW>#fQedmF87} z5sFpAV@8IEpQ<#y=8cnu?wZ?j7}+`HHce`!uVvWZO-sG3Dh`&qvd6pPEbE; za!*FD&#kXj7qnv}b0D+&P877?0oHV2!Y6~CjMmnd1dLCQPug@%M7VCjRL8$TUt*A@p zN*X-$z>%Y)q$fNpK~18a3MqtCE#NL zsrT`YBfCk{Ugm%@tpQJ+msyp?I-p`}ym|}kshhf|Jp4WQXZNBg@I-9jh(~kX z$vs;%8x#b>OL~NWc5;lO94(BSgR^>inP%3F;d$jw;Eb`#zpl1R}MLy1oTu@o1c~T2Qll)^31~h^RhJU3`3Av!Bft+hqrjG~h2`0vWx`~8b*?Bv1 z+^5#lm2Z!NHgZzc43joc;V`eeD_}3+c8p`lH@)|;32ab0#-B-OV3MvQF*vn*e)EFz zTpb<0L8%;|5J&LmqnU)Q5b1t=K&~5(G7n;!NtE{2ifFZX0AW)0SePTqdG6P5^4w&d z0!Qp|tN}4JRqes0?K+DaX{-*?D7ms}x=vN+^SG zQ={#=1MH9b6TNsq1q7chm}hW-;_0Cg2*1kTbkA#sCZ_x*?GnRsKla1W%$CT6ZHY>X z<=;z9j&UOzS=A}3x0@p17a|3`-Z9}Yb4e5T`f3~{|JpDfrJh_U{s#dW!ms||+T+1n zxk%fHbLlmVW!b@2dxzoe4NpH2o=yN`^byU-R*)bmJfY(Eq*7HUC$!quzMwSGZkZL= zT*b{?K7V>YXV4s}Gy5@u3L^ir_UG+JT;9jrASon5{}oK6%mZ5sxgMp+tWlf&-s}?%qN~4z zxU~`HyIxY~UPxLS6Qu;%O)p()FR-b*raF9J4qi4Ics!&1P3AF5TK7}OdzTU_oO6xV zv;zpEFy2IJn~thvNucfA93p9(XU?>@ezOJo4b+!nXxGg0 zXHS)n^D*PHPdJM+8VLumuPir!{nF<^L@yoAhZn%}kD}Ns6vhe|@4%#7Jv!du-S?yH z+SX#jJ`jv&<`eB!%kYqKOgVN5@0zB(!627i1>IvqIDZM<=YHX(ZG|F|84};-wCp0O zu@zaE_wz4(dz1DP2bv}-W8klXY-lroP$-k^2eusu>38aWbP7C;1ERp88@I`t8#r{ZA6oH)35Ts%Hb5fib;H?1{1Ji@w0 z*&D{~9!!(*2cr6ZHW_`I1;6m~+Avf9n5Q&*o2%;-6f(7yX&{xvW=(n607~0CvABgI z-XLrsh#jxkqZ$Iqa>ckn%@4OoBWPLTQ|0W+D;&lnvY@nOaaHRBI2uxPV(HM%{!cGJ*FJxX zkf5_}$DNDst#6}WO*qXmnPt`!sKeE@<~q^3t(zcqex_wyp?Ec#`#$|Kr;6l;ApOw| zO$NaoZ`-?v+&Bf{zPzF9M+nK^i0ry82St!zTiAT}C^Q>&?7V$yO}w;$cO2Q&Sb;GL zYKox=NW>we>0Fz+iC4Ua(a$h&TS>o6+Qf7jBW|j5_$;drhlbKdws@5*9zQ>#7{oFO z1l2~r$f2^qL=Gh>Oa67h#ekG}y%WT_uQQo7b&FQJnvD-H&Kbq91@&f!JJPG>-*;?L z8q}DMn0DY;yM!0YgsHwEorub(0PspkC@(}s?WFc3^qD^_AkF&5tcG#+UXVR&iWJV7 z>w3?)BL9qvq)~0^0qxEpsMk~j9Y3Bm@on#m7V&iR{2Pb+;a#%O?6YU}U3gIQBCd1JGJgu~CnRPuTl5t7;u(YkBx9m{N>c3#Ci z2qCQYc?!K!i?7PU_(nnNB4`Vhrwn#IbZ}w??Z{B6Yf#&y9-6Mi5 z0M*0U8sN9hEk~MI10~9k-LIQoc}1K-Ua@{aCFrp5-a-GBuW+N^7qa^o?(_x6uAq&F zc~WOrYQww+f3zPq6-&nunrEp-VwgmHAow382k30TrvF0A+7S5#lBv^%DBn>JuYx^S zv?U+A@%(6+XVWyA562Hy=Hj=@q2vJiaNHx(o=Nk{E_&BAZ-8bI@4_$G!8O7xM-%DP zLPz|$x02Frl@3oMuRVk}({gl%t7BAG@B?1_a6CK>ch}P0-a~rIdAxmu8a;*u8jj{L z_KzA7*GJyY*bAzix@M}(eXHK;dScjWcu}j>vMeV`<6*wZjw5WTT9DO@qpYLx^BX|C zuAldr%I!t34NxR=s_Se6Dzrq@YDEVNt7Py40N>I!uMrATp@}2+%rxL&&H=pUUTj zeZUg?${oiA2GS9&#w9)Xm zxDc?1JM6-9&zyn$g9%6D5&mc9QKyI>0}{Fc{%YO4*0!M>W@zu0NeOZGQONPOiEq>O z8pN547k%b0Ur!R+(bIqBK^f`@a`ciDH2^ke$8xmU8@G;9N~okA(Ew9}hQGxVd846J z>3GXq;eT3TlDM8(8KThw>qGQD%6x?aOy&U^BPX{top(enH_|7>f<<)5e={Wh#r_w_ z)P(1dAn+30j0J23F#ErD0B@mMA6&NZ(o;-fLCKYSFfg~dT~~-ZKHqo#%$mI)004UV zmDg~tL)KiWi$||e=0FEG%cPsjfTSrjp*WATx0Hukc^|qY_h4N)`Yq>k({DVz(8GAK zOdj3GjVX7K!|tUTVvuSN5$zuUbXp>g=!^jBfrtZ?cZbGO$==yGRbAf8*Kgc=DI3RI z0usH^2t8vCS0aTD z&CqZbkxU%>_S3LSo_;%Qd5b=_^-!;WaZyHd%!mxSkr*Z?@Q|kSZ65l51FjI7|XXIVq=EP=liFWL? zcUj-pCra5mIZI%CU!qx1-)onPWy3VzVPL~;kfXi!XB)`(eBWnz^L^WN80Iij$=Q`&k* zyg{qW*TD;>kuhm0+@d_hxNzQLRDReLSVin_68oT@o-UP~JvM#NSaa4Ay03jE2ulBu zZXKppf8&v$%=2Yusw%;a!GULK3(1S%@-#n~L|djMle)ko8vwoBfTn7&JHnfeSlkyS zuNfo}!Yc(s1>MC^y5a2x1a0>mKQSuv@1k+>R8P2+`moj#m$x7W?K?P~4l^Yn8e~Mw7D)XVMt6>JkRpZJ(5G1Eo18t|A#+Aemm~@qRtU-ZUqsh=a;0HI_r+T zv7M^dxe*{s~E2s_w41(ZYr~u9V)!Mw~}Z; z7rr16SpB|?8PH27m2wlv73R&+c9gb%+H&L<*o!;mA?}W$ksz9j1-s6z$2TESd>GK?b}a3B`or+AwmVEzMQXY9^D;Imtyu;P1fxAHKI= zaLT`}oCS0SljKM?;XZm_-{^?aq=6!qdS?af88jBM?ynj)@~iq1KZQ+3)2udbA^BpN z(A%#BEqrvgvGz4$ML1l!cX>2&0h8^vTx#C)WG&;3bM-52`zsEl)>+;gP61*U+cu+_&mhceMo>a^qJ{$-tgHBXTQ$>5_TZT7JL_~ z1(kUAODtP)AcXC4FD=uci7&O`9$(nHClKgjUg-%%Kc)2L#*j^mz2Ee#Hk8cyQo4F? zx0KQX3Qp^BXV0f;JH7Amp;)^CkkhyZUX74zG=XeCg!W}I_deYK&dj<8nl>IRY9``Y?x7K$Z!$VG1hGYad+|PadynYLanQtu$8U-<{ zo63V-5QliQ`y!TNtIg$+N*e`kJ!gu)?jne0#OTGJ>!_r~E}tHa@ESO*Z;G9VmnL#V zBZy(&ln?NV!J)pBkFJ{A7;6Uc@}tGPD)FZskuDkpZ%v~0=&9I}iF5ppigAZj>c^f(s^6ZsoR9rBJdzY`5h8e(B`}#ucHj*>_p_JbM#x-d z9Zu1v8giU6GfM5cRvt;^jATGgeu`ca4(A(7yo5(hto+C3^r}#Z7x-BD_M$J=C(8`hQp&kn=e3_3JK3+*=!V(4X7q=sPjF+IMGD09MZ2pMuXfc+Bol2iib_pNG_6xy*mFHTUAqlm(7wt#CDL{yTrrt*R;)D`mUFB1 zeE`fhwfBe6RHS#C?t*F3fX__%zTU4EFoc<80-<7>#+Q?R&5ItWyI>{9B?Q^fWlsfpfUzg_;Y zskdHBRcifYM|B5f>V>~OQfOImG;{HyHuQS#HQsfbHv)zC_SP6LyOh=+4oCM^m5Wib z8kYC>xHdU&?LST(UhzrRax@v~LE)}!%O#6bj`$k0sL7ic?XA~X$5y271*RoymCN}p zNTuuO-6oEuZB`}eT_?QSWccHqKtW%kTKc7mK8~$N4jGjWJi#gA2TUwz-W!y&QIPvX zJFj@Nj$5pn_dt*1bBn^WCH?aQ4(XLm}=7i;L3r@p1-adWtm74uF#>j%Q#l3Bi@ zT>4FHuS1Nmh8t|+nslN0r}O^Zg8BI78N2WGl@eb_<-FY8_p%5G1Q<6!yvV&KYkNhT zkg5M*o}&C9j0a@AvyY{FjQUURSSRF4_f<=-BTC0dxpf3P3X!xJHBmK}j1v(#A z8&cRQJ*?{wVy+F8E12Xy?Tjlre2L)dWdC9(kxAWAc#tup)_w!|tNWsC=MVc9$6p;% zL?Z6FE-1Gx8)8AvS?j|S+m60G?xr3W%Bq!Yyd=k7bnR&+ZI&#L7K-tO@PS?;wvN9A0(mzdw zhEVP5b^x~yZJm6f?=?GQCL=PRP?kAP6JzO_kc*%0y#>4-MQjX}Wevj@D2jP_zo0f8 zZJq*YHGQ=zO=2eEwelV`k-qWG+-z%WK#o}!Sao=}Fr_0_$f+x~W8RUI0>FENsco%n zz$;WeC4ioFsa82?V&}Ie#A6AVO7=0ken0;~V4<|8VXn^No!`-$z0(etxq3DbQ9U?E z@W?^)I4r5nk$IHn(SRag-SVixH{h&*vAkhV0}KDU1JD>$)pF_n+D;Sj0St(s%RK4> zs-lM7@}saS6!-3R8GPWe*J53BI|F5^z6hfWS@~gaDZHI*6X1P#uP;zjEaa!mOnJzk z_hG!Km*U98clge)zlKzneC6f&*=TbwpgU2IVh?v?WHm>@7MzGUJa$@;QquIk6UmtFX zUJ1W;2(v48NY*xwKAl1{ojn=EnW9IhZGSqn1kwG%kZsqH(f&IJK&Wo__RrTVafx$3R~~z zSH-N*Hez`^*JU$=IsKK<7VWYQ6|bIr_%M6WYwrb8HL5gZAG->XAIb3kIL!>e1Ep=Wy5c8CWa5S15JhjK>C?s3EIb9ln)WLBs(0VQKGfz{srq3u6?2~?WwWoDDRHr?4 zRX;BNwMk4ytH(8|3x-Jh!4FiDCgC&bt<^aGLBN-5`OG5nGmT{Ykn<1kOMU(<#z9Sw zx2{L~USron5dP&qWdg)gLEA%9Osad@KFe}$Y+2&)7!=Qgdi92H`88W1hO~7|k$Qgo zmG2ju>lLcTab~||uQwjmZ2f*-p}z-4lR6IZ-{Nw00tC7+W{-6$R!s2YArbKd9 zjvrM3-KQ?u50x1;T`LOZnbXD)db%3kKI?Y5npR^u{zV++PrWu!-$`p^_}<`sw&2;Y z_Xr;NWazNzz;1R)b!x5RcY=CRkrmwQnlU*e{9(c>QC@T+P+Iw6OL;UALO41BME&&r zy6#U)9U2bwmD!vYPC1#xjx|WFO4;3^pvE0W+P)Le=)L2NJy*Bw8pV~&IfGMdaSo#g zTK$|XHXOa!pMIRiF_hC~29yu~(XJ;wfA>8emsIn&y0L-*;Kja%xbzB&Q4oh&2uD#E z2ZI!=F1*i}=leFYs%j0uexi!Z?-QrxD8+lq1==6?@= zKv9%vwm*8T3b@=Jhm4d|Zkz^KX3dI3WuKaTYEWE>$3`Vlr1nk1;L91ixf?yYbwFYK zo%@*MJZ5-rz_CTyuhaYx;QeFrh93b_mf>W09(H#nZ)!&lqx+u^i3Hd$j_(@|mp?eq zao4d=&x^T_jSICJBfP?gO!|Vk(yPihd#PX1Qyt{+jHQgM%%*>|=W3!Cb6h7U=Y5RCWkzfEtf5&pD8 zU)nd2`uDmD?m3OLy3?#2EF99mZhUbp@DcdjrSVhy7}IB`TTU|*~TMcKDsa?=bC#^P!vbi)>8fc_J;^T_TRgO zJ64?!p~>TrNcMc;>G|`KRvqJ+ywP&fQ&TX%*cglaCmRxsBu`fBNB?Ob4yGJ<=CbB4 zM39@RCS8&OZ4GB`6mEi(TnmTW(e5cB6RC8WCyynKwfhamEwBk11pbp=8@TE#MW8;e zZWcdFo$a^H?CEi3uQ6BU)>!y;GMw?9KL}^?d0`SHXK@)Cvf5qt2C`TYuJKVLM5Jrry5<^{aBZ-Y{` zX5*s#Q8wvgFMlG;`x!)uq{Rz~@p5_G{L)v-UatOBc=NT}bJh zLAN5f0o8zKM$x@fxO1&C#f_Yi55`|4J>r-j2bAYxspPJ)-_^dDBt$~%VlF0M#aNOr z1k2WKvi^IvMs$nYot-&KET21`*xbasw%gV9+bWAgk^@uwWwQ=c#*gk0{D5d>;s-KuIE6$>U~CIazsD!GwpcWY^fxj zL71)LoIsTY{Gdxu{9N$?j!;Cy+XSW7v4vMdkS6jgEDOx6Yki{&M8nOA`{{_@9eTS< z*L{Op=9x3hIFi?tl|j9poC~(t$@US(2L&_;j0pcN!@)EfFL}wYh)-#}q6o$KRuuMm zg_(JnRLnj!#)Qo)r1f9t5Z}tOEZyuqtYKja1L{pG422M#LQ&sVC<&$jXDj4AK9v%x zeig(?9i1onpX2>=l!o2}=NQ}PTeFQ64uYC%r|ih>o-Xos*Goq`>BF^e>aY)rpBxRw zu)wQ!Etw0F@;=~oc{c_1@_U(GU&@Dvw*)ws^s6cWH+Esg01UMq?hQ#!0y;$g;{$rL zdNJ?$9rL_8l-8^@2Qx9QJ(qdBeP_S$@;r3=YX$iDxErV;FyoJ!J1 z%Ef!yRnv{QqVeqVE#os%&1!g$8$56~BntS5G~>8y^iE8{c3@&uM4;tX6|AtVpt4zq z@@>X9>gUGTp;3X#`Rqr|aU5CNv1)Af7T2G1aOHj!fT(SkcBkjn2M5j>C<~IGw;g+- z+UtC;>mrq7#$t$upHJi0i|`OZ86!6zoSGrfha&hTk{#ZUK}PlX`6nNiYugApV(6{v z#oTdsiFHBip`%0aCVU?(ADbvI)$u|1)R1~(KH2>(*-vC^<*lD(*aZkVzYBAcOu zFj<88k+G;U{bO`&&-F7~<;Ag|+S#TOD_}h9AP1CwwE`bbBUq6Mghcs{a%eOCykzl0 zcHl0MiEd6_B@GvSk<0b~(iX$hu5Oe=`(Z5CCO_nHeA!o4R^zQ6T4_4oS88eA%O5b5121E4^B4$qjI4)6gkAVx<7&A#3Oy{;U+$A# z@D%3t(**;!k$N7Fv6fF+@5-__$Hk`~D% zt*xS-m_@O*j9G7!9dBXSC=SKy9lMw1D%TaHhA)}rJvm3c|JY9p)aS9|Y;E`;`)cW( zPOuq|$QzH4fYQwEQbJ}tmU@qy=LuWedAJ0{WEbTRq&xoQbL5!?-O`jrvqxIfLhTx?;)nW4@W*IZe%I=7rOu#+w{luln81hh@p{_M$q zk0pBuH-sJ3ZW`rz+Dc*ylm*Je&mh@VJ`Oldkniy~6)%#eu&(#s1bmJVMTx4gMr!p}2{P>7V z#_ho_<0JmbED_ijoMCzt^ZE)rxXy;xztd46Cwhwadav^)^^#TJo~R!T0G%n(;QQ=7 z^1H9`5-7Qhax0!U63z;iFn@%Q$xiG-R*p{{yxjSsn%*U6wxf$L^%vEdNeO}dZeE80 zGW<<1oxIG&_Wk-TuFg0kHI&V6&+@Ybegm(O*lbc#w!EYav znyX>Ra&%VW|MUW+i2iKJ=ZU}sWVH93a^d`Olh>b1_wUz;Z@KqUsW^8kb>}bXJE`^i zO^rrf^QMeS>?}>9W|z=X$SOYJx_JDUf;AmBVE6O0-_JX>eAqZm|BikK?Aq^9sr+={ z`Ne3?=$x_dRb^%(ZE_QV`yKDvPvA@C01a+WOGbpk_nm9ot?X&wFQn3C+i(#e|Vl z#J73FMPH#L?n~;qR_cj9bC>SfS7#+#ir~?Q3|Mn9bDXu&IlzwbE0oS9Gusa}1O-Wu zu;oZYP_ZTPr|DGf2G1Rg$i8Lp0p;~9_k%6Tb_>TF0+C zqt;zCjJ1RSpCUA#(vzleuPd=7{E}a0sj|cI3b=VT#>d}zZTrR>qeN}H{0nz{lhI$fN&1l*O6CsSxq#ui6G=^Yfjb?Yz6uOKwI;7|NYP#RniBmVP zL0c8?M|yk|Y(xUt2w7N@0asXjzTOC)7!?dR-F1|ZyBD6Awv6_xrs+j{!W(pv>JRJ@ z<{9{%ZuBt5dDZHDDM8=U_aJVzWy6mxZNNS#i~O(9FIm?WGy#2Eu;0gLbjuL%1$W_Y z*Ry2=_*znf6Cd-wCh|G(SNV}7yf~^V{FEqhCEOGIc*D`p*A+6FBYuu^-`rt-Whw$r z_QBnhY4c<1OKPOSZ^*|2=?;2KswY(?heu~SyiV1?o9XF!?Y{cq>fWdjQJSFoHv8A% zz>Qd*z^N@`^X|LAGMs#eLiXoOo#>h;Y;bW&=^JnQllh8vCJ{xwC*GaBY-W!q_{%-J!8)||ll+uM;(oNjo|@}V0?>cBVA&2TvphIX}+Et;pZ2m5p6ZHh*6 zUlza7y(aeid|?D&A=bef*T?P`G^3yJ`KW2o#VxL!cjLRV+(#d}CiW@#u{s>-mrl+c zpnVh_9h|P^DEkW}Q;L|Pjj%2zvUt||wfoTE3Tkv8+x9~MYn;uyh9!~$5TBsok4CkP z06(%OTcAp;F$LO+Vp-ruRG!?ld_9eb5cHz?cl+I)8GwLJ_iH18x?Ep6vSekUie}nHFpn zAt680*yq}D{du86N0r5c-3>E*6Lpn)IMqBnPSV7P2OrLKwc(X+A-|~6la&$oge$cJ zj?R}S$cF_Fg!Yar{hPl+#X@1kzu1i^F0nlLrYz}6u(n6id-Y*0!$!_BYSsHT^Rek^ zj$UnN{k;6AVet-mbRb>Qw#Qd25WYYVyRE4kq(1_iD#0KFtvvt#VeT!1;_A9^K_r9_ z9Fm~HA-D%<9D-|bx8M#3bGgVVHw`%%V zSIaqj?Y58K;)qZJv!!G zwvMJ4Is2X=`j0$bO5rFte|HEhQnlfKX1)sF$sKOETYP!Hb!wZc>vtd4+FO}5{I*=V ze*JUjtWPjo8)*f*;KV?TMqiA>4f#v8G==%5j6Rk}L4^ai%m&2*QqS&KGh>)+u5_do zK*T^lw!+#Rw?oLh4y0xxO5C*wzNguWXm>JA9o(SBr=rs^74h!1B}sT~3QT#py-?FW z>x)X=FDAtb%os_}xhIXW~Vle+MX_|u2XwOjoU4`*}o(jlcEB7!n<6=v-; zx$uG#d}O@7$MSiwWC>rF!xgU7@{xO+Irgcvjh`3z5bqs76ej3w;MyiSQs| zI$HJJmOOA$4GAJ%wlt#*CCDhN2ETcM-Js7|$q44aGc#89dq^-{9%_uHoZ~QmpWbUt zDjN-9FNeJQgyG!1Ltqttt>tG@_2)pL!dr$ypCRH#k$Cj8PSLk0x8q4_IO65{5Nei3 z(aqMIb_MljPt3A_uRwjn4XFfZmZQcSo}yL|^$t9~b8Bm)Xj7~D@ZO88V|oHp`FfJU zJow7lt(UV{&?1oUT%Dd95}IFr|47qhowPts$`*8ki^m(q6l>p?uA5j1`26X%Trj3@`PDI5U9>Z4qSWIj_y@i}ui$bnL->O(mTm>H3 z+;S26{$T22&%dU01?&0CD2^scDlVv-T?&MaBskx4E)qXarF^cajm?Bb0dBD{(V}vV z+pg)|X#G-e{4VJin4(yys6bVW`O|&jA33jM*-sb^;j?-l#IK*L=5`(3N+;UmM~#pK z&Bl}ZCjH`rBR%&lr+B{-4Pz-BwrVbWNvx@PmlKtYV}RF|6+s|Qkk#YKP{F9tyLA;? zXI#~HmrYy1;IjD0+A8egWe_p{R$njPvB|(UQ9rD4+_H0X=r(ZMb>B-#5He2? zG~!5;ON%&{9)hoU(@d)Q5ieXw{0Gw*=h17zQuuvheSM(~AB9KbWEqE#MM-BkX>mI- z`l*ly`82+jprW@z+kG9jD0+GU%##u(!~v>en>5+crqN5PDJ^Bu38o{P$0yOm(24Lj zM^S@k8y~5-Z)^7qW5%9soS$*_604JO7q(YINOsR)kC3~|@2}x(?ymMz!dAGqKPr)( zP#8o4o-lnxSN-ktRF3USbJ(l)hoGTHmMkd`cW3Hn>&~yc%@oNLzwP|knKV;u?T?3e z8**rf!ox+D5%o;D;H_l5F*su(?W>%)H0Ro$c&Jv!<}jwOpB@Ut#+8uHAZ{oeVMy+DS?HNHo?1 z3wY%CalKkO`>^pce8*BrHDUxN8wMfwInM=~5}S~T;m`yPww3=#qt^d%zeJT2S~eT_ zrtzW-%dz7?+)B($Yn0mR-AVt{c)Nwm7;Rt2mOO~)fl7y_RqWhF%L%I)J@=2_z=sE% z#q*9g(R;PpO3x@7YB^ar^)H#aNxg6n=RchhD02X#oHfl)*771 z4>b@ZYCs4(>u>AKZ@61`X=wP5IVSnqhRR4~^p5d`+B`^OAKu5qMrQIAXLmQk6cS?( zGL#|*Yz5cO%0Bh((dFiNb=`}>jEwYV^j^k8Lt#iUF>yhB$VVerc;`CK7^T0%y4+#6 z*LX|83~S7hwxgMj%b}Qu?N=wJx)}5guQTgjFbLLDPI`|KTSS=3=13%dc}3gy_Gi_} z7YTy8rkMSGoih@nHvZ?pB6p_i@=h9mPb-B?JE~bWpbnjUBUTZdZ1((bfR{+pvL$Pv zbj3XUxH^#&Zr>UZ_<`hE){JrAZ%!kehimS2S%ze4d+*H*I0_%{H$xElyXTUU`b89rmdmG@;<2Y{*isy|I8_13F+ zsFX|M!^s-70K2+GO!+GNAlFrBTz#k50VHL_I3M?0n{58%)TS!*^3R9P5MDQd4-srS z=WF%YO_dz*QNBkh2MjZ4$SM;2>z78g1^G! z>dl^M5GZsgGpDpPMDC`$U{~zgZVQ|mAcUo_P94^|EmIfWv=6~;(p9Hy{&u_{^$HRVtYusx8oHlP)U=>!9~5y>&&v)n%s49w4l_mRZpDS zaZ-0g<8?1=7zb-a-uvK)SnP1*burSG_!n*CdP`rzP>)Ym-yvRaeevrKxS-f}5V7$o zpwl#Bv=vOfO1x~Uk*5kNxc%wc;RK*=L9RZn(Ag{h!uxxOfsags#lv=N2_YzWu1nEj z+YnCSkyU2KJD!UYui){=$tA4a6H)6NX7~w1peOl@yW=KEcsgOsp)Yn9QfS3)@~Zgj z7WLuWMq1c$G|Sbymuh#(Dts$Ve}+kt`9rVo#~dy!%mH+Qs6z}NI5VF0XyG5)#B%NU z$7NY;^U#(mZQp-v1KDK7zJ7OzrQ#w?r2FoI%KYMWCpaVDFtFU>ar*m^&&c5>)+n)z zkU*Si1Ari5sB<5BBx0T0S+N^d7_(kRHc$S(Z!35mv}uvryV99)bW0f3l-F4w%7Qd> z(sf82NvSAK$j_FtxR5dG$WdV^Y)*06B9ljh$W!YGw^B{7IZ7LJzjVxFI~tsTju>fbwVcd=GccmT%zX@Ham!D zJx`j>721isr2Kx{1pxnmd2dhbkNdQMf+e#>Fbs@t2F>88{_$*-BZ}S-#KpEot+cul zp1>JRhjN1yWN+2H6nXBX2~XS z1P!|i>ynlWBqP(4k84P=RIN~`_u9U8J@Slu8kmp# z!Q;)*cWyvpa)imDb!`U}UtUZil`}ANvIx5R$V?N8?2Y;GLk=X&&S?i5HUu~zvOCMN ziI$XO1}}|g{M@@Ue}{}28#yI04iq_Taln12dDGxF@0HInj;x;#1SSoS@o80%qsHj> zpn4N5!7=^~=h+$Mr#2?^KzBmty!pMG&dQSHfKtMaYTFTuhZzf*DTQHdmR5-%=#cmI zSJ>RXqnqBYWK)alZ@a^{3+S1BpJp-hf>%^B>Vto{O@ta<$_gnKju`bDc(I`rEN;l$ zJZpnvQEIE{Otxnsk0PZ8E5aRa5Vg_tSKkNp< z!9>kS!G?ZpKKHdWNC)$$IqyL@#P2@&a1SlG10OkrEpli9879NzeJ+@T*({U&(g1ec zT>)D6cBP)b&K@IEHbz}N|IF4KU@Z+~ccK~ShMqTV#N~WTgZ?@GRF$rdHA|*#oa0B5 zU@FkxNp4K%v3FU03qC}D>_i-*dE6x=g)H5hxIp#O(2qiZxUjNk4euwOjonq(t`$9} zUjJxOixx)-{JFWpd$kq#LC4W! zmIMFDsW*wV`b?ie9SuV$3j8hYQOQLNQ9>jb(8nzvUAp+!ftzjv<}cSc7PQwF61IEV zKMfsvg-Mr6It{f+I9>W8g1}}z#8Z)Tzs%`A+M(6(jcv?uMZ?M2oxbnAGL>_c%=~!a z-IiI{!ZddbMZnLDyQuW&*B}$mH%gv|NLe;t4)B(?of30}cel9jZX3L1fGQcnV8Eah@YFHE}8m8BbTntExDNK{&`r=?hS5d6q0J>ls+7bOrz9&rG z-i%GG*ZjiaV65n{1XJViF)$D19P5ua5gE`TDXKnRTy3IE^KAeA{7#!;k*tWV zS%IS#I}cR1pHw1r;bQiEEmNDYme-Pz@JiuV*tyj)+< zIRbSicH6mXi9fhQbN2+zt!|Ct3R|(tE3g}y-W|pb#=RtP8Q)=6cM^K%a>G-3hvHQx zU9WuVU?pn~a4B%Xd@1iX42`ttm`kvoGUcF~3s-m2AdTp_xou7Lmo-hzkdCto><304 z7%qaWT~=38GWU{a{r-q2sL=>clQLpfKv>qacA=xe7}4)KR1{od8_QtWtZy7H0X#LD zGjZvD>hT84IV%C6u|{4SU})x(RW@*XPUIUm#|JMceWkM%`m|Fr0a_2NBjF0lQjX1fQ$;jNu zFYlW6#3kDWP+XKZh@uIdhS1Mf0?U}Y<1XwS_GcTf_|YR~->b`hs=Yd^puMJR@G)yQosdQ1%ep1oxe1``5RIv!#Xu8;K)!Q1Y)&^s-RPLRBi+ zlAG@sxH^&4G-oBS#t*7-_P$%odk>g9k+U7KW-5d+8+SZ~0twzpp+K|S^zdj?xS?I{ zv@Eb7Z$xI91yx_tgxNDo>2d;NF4}OS-$Ol>p@vnM@9h1&mTpgI2j5G5qzBKhQ>Ne9 z9~;IPpQZ`>x~0c2FNo^Iik4*_f>Y0E&wiGG zmcLQ26)I`x7Q2A<&Y(S(hWRA8v)%|ISJ%CbFB1L3$>I?@FC)f0?=MmsvT*sV_cD#m ztPG(+BoUVLS_TIXl*l}ZtQU(o8Df&x^Fas4`R7k*S+6GmVwwod;}GcQ073mBc#M9@ z-z3R4fZhYJQET5Y($Jf575^~wCNaIFM)sPYOD{Kes?OKm8($Kz$i#_mt9AxcU-$?C z$+ld_f|eX%aQlg^R^4ji4hMqlQQmwLROM%!Y*9bD>ChGZzRoY?a?d8mg64c-vCYt- zlk3+8O#2V_6~oKV;`P5$8sPYK6m;0VN;P2!8uxd_6;dJdVBULDB%yn~^8

cx~}OZhVr}^x~PEF)6jk+ zZt>C)rp&^?Fn9ks&(JRFY!m z`XTiuQOkVTyaTVD5k-!a)6@xFP}h*~<%@x{zsQE2?EQv!Q>K752H_jWybgV#nJ^9K z)`OqR5f8MdWQ0yJG&c*s`ZS~>V*HPCpL_K~)mRK|iw=6UfdvIy6{5rxGLlN)u z{eBk85S`lY?`Ipl07cy(0!ExAEcO8N{0M-?U|n-Ut=5aiXu%(MkAqqXYSI?nxjBJv+!@ig9R0m8P|lJ&DDcrPPu0%hiS*b=y%$!VlGt#p zQ&oCGO~ms%oRw*|J??17xol?96IczQrUSc=q>Sb-oJk1e`!^)x`_VVsJJ)Rpxv>-n z*_sctdy_Z=DZo8#L;$Nw0Zs?K@(bRi>P^4MG1Vfs$>jC#lD+)p{$q5+ixP+x_;x4= z)1jLl=?G7You&Y+nA9l4aIXzF$>n{w<}N0!i+s8&i(wR*|zolzJuq^>y$STvW7y?Sbkv?Nze zP#e6t-)SRnwNtcdM||K8n`U{@Kx(G(k{A-m~SE7 zS%Lw@8DH^@ebk;BQpFHG=?+-Zh|8=TR=ail^IsRR=8au#gK^|)&Q z#Vh+?F@R+)T^eZCPStm=5_FO#4h1k688h}ifPmbRWx76%jheC7;dbxdjcDd8K-2>V zf5p%Wh=K4Iw6erg^Y;41#i)*a0c_IA6#o?YGucgh7d{lgzL{scPu;hq3jjF`jO4ke z!y1Ti@Lc=>8?OLVqQPu?HmWs3y0mR`Sfm{0Ze94-;!W~_pDS5jcnDQ7?&);;5DXMC zjab5V@t$eOG+3HnEtY+e5>!DeFGytD{w4?y%$fpkqQ5fug<&|zmfuoOIyAkvxqyZP zVz`)UM}yaL47ZWWLI!eafYk#Hz5vs}R?-4m5Kc`r_g^j5VR`m^S~ebXgqAzQuQ>VLYGYfWL0e%*H*(whezYp!?fyCx z>;?}&*|8g9Cic%GD*?$wmXJty*P8Jk1FXud+~5q}+NtL7AGV}TjzE}4BZ0B#`6ytu zz=i>MQYfG;oWGVUOVk;O*&{pE%*NM>-RDm>|DmQ4VNcZb@I=$!W{@>c`qe+3xSa{) z8q(`Oc72~QsC*dGDWCtJh};~2$o(h42ipR93o)uVcW`%n&&GxGZpHuI1fykS(A^nt$&+&s{n|m z)a0p?Vr7tNxYEmc>}t~pcpuJQMrA^Z2D@u}-{orpBpLhs$!_Vy&js#^0-|!i+m77< z^Hrx6kJdf)hOr*M`i4h~MEs1xkGwZYlbVVm#=Ck9=vwyPEPNhq$$0+Y9)OO7ua5}C zC+oQMKd;wxSvy(G3wvdNdiTn5&&0s#C&I?zuzh6MU_)# z|I12HG;ATmaI*5Z&LD3y%Y9+)^t7+BK}XhEBv{X=h>X?gfL@OAKySt+wUlMcBb@|O zIuz{dFQ6S%4hvOa7i=6a$^}%_)o7-JQjF@<)t@K{GY!#<9+2bShbK8wP;h4q2qPH} z>x+~B^{>DO@I#e@@aKLx-!l>DGL;)B9sx%}-Qys>?k7gpiGLclj`eg)pfV_fy5X&h zq${z{)_{r|!)PXS0gF$J5XFA^T64nCNqid-&8a7gq z+B&pQL@OJ4+#hFowbM2U-u9L?0>IHzhfiH1mo}88$8|U)a!@g=;v);ZI3m-~pF&o# zC!Yd{FK+AD)8BVhlU^VTkw$uS^3U?TX076@fWM|0EcK?&)YCJigKYk)o-vL4*o_w#_cTEa zq5$^LXrhUkqSx~mBg8UOUO`D+dJY9@-P=G(Mh`(X>8Wk+XVf5msj~-tH{Gp@`4|{W zedO0MFNJ9{bM|~K)+`Ql4A-6=<}V`z@*R~`mO^F}TtV=L+CfH|wW{qBgY#xQh;?fU zKfb`Ws2{{IdzYbKd>B43yG5uhdW%?jQNr~ux24l#-nG)5U7(!*uUxua6za&(nEk~& zwo2+=9k?I}e%^=PO5KIE3ie{_iuxmFb^c$~XTU$krrlXDSuNd%#55CT?=r5h~XXz=x@lPNa za3;0=-Yh`<-m6A0CsJywD2kiaw&YV24LEfl)hHD{L9(phgg-b*rC{1!(qT=h=b3Gp zj*tJh#SrWQiYN1C0MV-4+$;I2$yAU$%C*ldirnBBLA24i^|y8L|2G98rf(K$Gz=ee z$}1RYo%)JjmGPtly#A+f4i%-9vk^{Rx-B|=Pkd9tX203Jz6a8GKkZD=;rK1N-n4P1 zY!-68D!N18B6=h;&j7a4NR#FMl*IFgG;|_g$SMlq#hy&`k6fwn!~QY*;ofbz?3Ilu zmFAlrDha{iv2wxB^QS&s`vk-f6;lWEu`=?RJ?WaUOweYu_O~r~AG7W>;8g7w)4vH; zRsRf@Qhx$&0JNV&2zwMxjShpqnk|q`zSh(m{d&JMI931(hM)VZ9kfp2i> z7($!w*|m?(9BwL8JOrIo%Aw}$`hGW_L+p;1-#A6j=@#J)X7h9uyK6ck8P_Ltr`zF; z<3W)nj!jFS>tp7n0cX0!V|Q)uW@0#vi8p5a$_bO6f8aft?`KU`?)mwz+u)`=IQ>yZ zZjGGM@`kFh;R5)5;_S7ZDM6K7te2JB%h9eZdifFj5V~+JW}4GEX24J9^*b!SUs7rccJJqFS!WEzzyI)zdehcIsZ!x-7m4cVsPi ztOKx`?{wzZUspW_?r!Uva2Sk*sJ)pK(+RPJNBvhC+2e%mqib8|kVmymyo@4RgHpn` zT;_LeUR`cB7d*{ncW~VSEAUr^P*1h|+1ILO@AWm1fWX0LyiYEqJj~!%Z+H&cul1IA z%>;%Gu+`nc6;kOC?I0XLxJ8%$1}}xwZAe#P6KUfegQ3O6?D;@qbHZAQn^!)`OY3wu z69UN}O4uOwfe&JTT(5q&ey;n_e2dqAH#h2wAMW@KKNp@9yJ7oG{Ha^{d|##V@inuL z47Drx<{aZOPHq;D7W=XQoB$^b{_I02(1xoa15vO!9BsfA;Bmb}!MOKI5RLC0ciflL zML~k&X|#K#vZ!~JW(gDLc->g?O7mijGF|WilGPcj4)+tbQDx2S0ZsZK?$?j{IJL^; z+r{FPT?azrG9NzDa6?_~$8|C)8o`szag1^6BrPu{K%Nk79gjo|uKP}o#(Gc#x|4Mnq7%&OM& zCZ|rrlE4FYN9+i=8eNB$F_l%!t@k8~e*!1JQzL(gm+6q9n@dNzYQA=)o(ERmOzw0K z@BQ(7%aXtCS1p>NAyM5szY>9_xVL@OsEl)?j5#5 zxu4iKAzR0U;tJlC8_NXOKBz&SmwjGgA#B+~Y`SIf??h(AUT;m#?B6;P zuk9tSW(py=g0W+aQ&vyovcyX3I3hkHP)XM9G#yI6`tdXHH{ys?guPg@$F8Ipv$pZu zorE(Jv&1MM<4LX`^+kox^HWuyQp?60fQ>bD8Yt?P3FiGpI^+|X zf=POP%MO$X(cO@23wZm_bhWju)`;9l75%qV`$Tpydv~uGD96SSO@zqk&bcATlCCX{ zr*sDj$*-(l6Cg9(R((5+)x4Z<(|p**mzlW+jxu{VbHDBq9GYHKFx>l|&**JVEM5%x z(lyq#yS&W0(y3~9LIF3jqT6?-&=fp(#&w!;&EnUi;9%vd(|j1C>P;rF$RDU4OS~LO z>Oo3P#*@YoqzxQ(;y#_}$B=#*=9mEmuO>!i=8Kh@0yWK&=Dh;NuT+x3^ zv~~(b6VCe9ANx>cS_T@dyrAbI9R6UySidSLZhs#aS5*UQ^uaId{u5_=g@B21OW=EJ zFfTLDXV9Lmop9`&iB$pf-j5Xf!@m#(MxO|qqKuVP`aUQXGrA->_h&4437YAJG&_Ek zSAar)_^>!j*XNxPH zE_rL{)a&GRdMifi6|?@nwZD1{EEQ!ub+AAb^k}JY*6S-@2LB7;Sn}L{4L20WK9Zfyi&@9bkQ}#>XpMV< z`U&^8q((h%AVC=s5Ua=2&{Fe;6>#DSY!Y-PlD`t(KffBsuadF^3@}o^0QBFC{&kAr z_`iUVo{L24)OCi=eE_UNauZP9%?)H3UVRO|OMZ&l{=S~Lw!g233=H516#&%adk6q0 z22qNM0KC_E7Qnas^ZFYVJ-z)u^QM6y+2UAxPz3zIVzdKl&m;R643}lhdPh#pt-lln zH&=hB7yj=5Z-6%NGDu2(umGP*(usP$qJ-9Xm@bg~-vI2jy5pgyN)H)mfrWG#sr3cY zf4-m&XOm>xHv;Oh~L5;J6MjrDA1MV{T7x_D=-h9D?Tub9FC$UbRQTa~j{neZJxZN=%SNR6@S-<~#r>y3K^(T3PuILA^=S zPZtXMs~%KC_{P168%#r$@EzaN8D3bN?hk38y5Zn|r!5O63TD@L&B^&sv>Yu{g&EBI zsK^{^swEnORiPHqg*_v=R2ERBV-T3F>O8*itz|&{TaYA=O*h#rk|M2d>={HRT z!kgER_Uyf44F3=?0A|z$`rQ%*!^ild$N=8rFLxj|aesMt#A)l#1mpvLPbob~nLC4^ zUBNh9>D7M(j$r7-A7xr>re?qT&7961a~Lk)0lUMo$Eo_i#bc5@~m;;x834h2gf*Mtew zJOaz6JCCJ16va<> z>K{2tB_rk9d6DKW<1p(xu4?PPT}isx2dSe1yF$W`K*qzEGHOq2^>?+vhez;1xtL!y zXeS+BF$rmUt6?U@SQy(uJE;1e8$G3t*JL#R$FC=je6=+ru{T*CrKK5hvQZ7*4B zsdMBpQ^X)ap@dqa`C0FuLf4qZnfrr^dC8AwwT{(qYj|`rIBjf2X3&U&-+@TVJ%ib{ z(^gP`>YCiszl&;OE6p6Xg)g!~LHGG;T?s*^q4HpWVTDMt#}jJ4yXfj@b6=jY{E!Uu zXq#yQoY(aeO$+Qx>aR_k?vaRnoC;^ai& zc77uuvRV=E5Q{wy5(OvRQfC*I`I2dvQJ6W}sUY z#FYISJRvRy5Cvh8BYD26A!t+V@q5IM+dN>^Cz@C&8q!CB^VERVuK+BdEqK}fO`RZ5 zR9`ERqY9p>ubKUw43v5qgMwcAm1?< zu&@Wvi9??b&I8*@*On|k&DOvQSufv3jRLYZZZBB@ko=%}i%Qcv7B2mx+m}Gz_{KRv zBB9FGwB!k*L=#yq+qhzMB^O}SG)7WvRv61{;*5Cb3seM=cKm(DLmKcpgOyJihu|gR zz0Fb0+O=2ZpwJ*egCAmL?Ynw@jGpFLWn$d=vuzP<=0H~QKZ76D#nb2phf^7>Rq?Z% zzQTY2w6P4sinZ|EACXle>*kelAm3+4!wWF+z@_iR=j|X!k{Lkp=C4csi{%~qL9Oq* zM5((?XO8}ZYL&!3M2tgLg&)N>^R-+pOhBprGfy-}|GDNPS06b1yF-urXJS5`5Zw>A z+leNp0U~b780kXXRg&5NWB8hT%c8qGav1%JlNypr`5mCV7drL5#onx8U0Ux3jAAn?gaZQhhv6Mb?; zql6Tde$L>R4q1ZZ^0|fpXGgoKiZ8aWL2abT$nPt%!;$N{Md+C^P6}fQR?f^CHfC6vQ_+ znwDIdrp@=lCbgQ{H0_z#3-W==ZzftV$OGKK&-wo)VgA*;scoI&uw?Zms)r_w5 zhqctX{+amybopv%u_c0gUl&1w_CFP+W7^uR0?=(Q4@9cu}Un_ z7vz=dIX0Y;J)68?C$>AXIcZ4KkVm){ANRMIZJ!1WSBm32^!+IU`s1M76P0%X2uw^v zz@NI??wM^PJ6;8kafDg$dB=-U5%E;83k9{l4W}l5)?^zn!z&K_3z%(;DR}^vDF2+R zgVs~KUJK=_{q(#jGK?lnvco*&8l(c(`FrIE{t`A|wS6{BOW-)BcuR`VeJ zKmDA-+(&~K)Dk)J03T@m40ckWLrvk|kA=t8%#pOoqoO^#zlRgYsDpO_mtqM1;a{65 zUaVQ&QZFXKuk?I_`sa=W!RRM>foC>T+I=#Wi~~>W9j(lsy;-iE~KE&lL(htaq458zuzm#}vl*-~gS`4z7fuS_`SLR!)i zzq@f$D9ln&kK#6&w$*C&0&DTl_2=owNsT#Yx8`R=raU(M#l-INNN-%o>8r^Xcy+B? zR1jiz_u9nS8oVM3pd$L|6`~Xr>^t6DBNyEPsvRj4M`JA-R9XrDs3{>dtUL=1ci?j0 zOIu!#5*r(He~H(?CtdJ`>Z1Ob8ib?dfq3H33Kp#X-1wLYMl713*iKWt40Tldh{dB~$0TsN@1 z8Nj%)`Qxk8N(iWIVcZWgkpZe<1&+eyM?I8)e(;Y=f{^juJ?JCD-!&p9v5zTH)iY%! zZ7+5cxw)H2ef|hyRKkvuD>yP&&KvqXTxLL*d#!@fuhO=%xUm^8CG1Jiplc!!&#Twd z!=OetjnPhpjs2vj#y>clKCvovgItX=h*(o5M(j+B5H(ktNb6Wy&I@v7IxJfKJX_^C zi8+FrO=H-5S~K+ZeDAAz$M>t&Hc=h;yZD;MX_ijP^G{t>D(?r>OI=x~JuuDBSIq`3 zUMi%fy65QzD*BBVap$EDCkO{K7JrVNCe~RX(j@!zNa2y$TCw}F!M%CMYjSggN7K6Go%%2h<|_!P-o>6Q{h)@xpBOYU5! zJB}}ymU5K;ie!p19*n(3X+Q6iZ z>zXUzviBK{rtge`NT{Tz=Kj8dCh>Vmz1vaFHjxVL@|D8S%?xZBWmy1AcA|~0_ zWBhe>GR*dd%~Z`93X)lNy{T$8kOcJWNrJ_?MNw)#x&j+iPt$b?qr7$z-2KY*q4n{^`hrG zg$Ib3xSJ*NkR?_#qCVMcCe4628!ys&%Da$SmBv+d+V_%3?b8AXzDaxTzF2m|ME;;z z^2T!F=+q~)DYkxtBjzmY=adeinUfVurf9Vgb_w`gFVK2yGdGk|+u@UfAZD12ZZqdjN# zB-Wvd5-$6ezy9q4(PeY-@9N*D)r$LDeGda-X{5c$@1aVyrkb_13~e_`XN8XjT;3mp zezn}j4{$2!ltTN}?)nKT7OC2>v@&OC+Nu882)n3*wdtI-=;Cilj?@%9+e~YtzKmaC z&=io;PP?HmCm?Uvi(QW?lr#G>)vyXa>~S>f=R)0wnRldv3l-*2xEVvX9EO_SevytP zwx$5hh)o~ju_oE!y#0fpHMHz1l+gWS*p@Ao^w!z@F%73Wy&^clZ;w#dwumOxMYs#L@cKKuf3XQkf!p zt=}sfIdQzXaiPjGTWw?Pnfc3KQu>#*gCUAO*H2E3L|l)+Xzo z`yPCz^$mYdO7rAqnd0#4J2(XrY**wF;*eT*9QPI6kKOu51O77tN7|z)e^7-N%Xg~G zED)5)ZG-Ds!-G+~Koy%f59fk;Yq!WGCmIpmXph|Z#ADJkJGBXq(~MQiu+vflRs$&4bj9GB`r!5%})Z{ zqm=1i;QxrTI=$7MkfFn6C8|$LU`2(E&6m;-VIE%wOL5yg8OoYBx-ML+l1#(Be9Uf9 zTuNcwOLZA)hP+6+yhhU^v3Zj}VI7~peHwdPusDcGt@L~b&04`ql$t-3vCnYgS#_)5 z_%5#!Ig7cb-Q)0tri#p3$_{IfRkx7~ND};6D}xBkey<4oN}dMg_q9f5Kwz!wv1#4A z5`^o?Xp=u35L(-)duDq|btibrOB9z|TvJ<&Ecn$th2#SrLrAm_!9}0ddk2?Eoh9B_ zZppYUhFG8My&tvpTh>Kr+obWzJsj60QP2JTEFt(MHas5*eizj!NHtw@ev~;-mZ7H0 zqli=Hh*#E!)N>QWDU&kfG1KKKPaG!O&VIyHdM>ibBYd&V&`eQj5q*%>e zw-vUodshXIb05x}-@S1r=}CB;k%riI6lb#4_1vX-6elJ;VaxS3YWNnvx9tV(-)^Y} z724I?G4T`CJ8Y2|KgzgUmwsV)2KIXDIJ$33NQ&c@A_c(id23#?vARSB$5>?deW^?s zZ1Z-wArf{{&llhC|JuLa<5=ZQb+VM7?=)4PJFbrzoJ2wDl$$XDT;LBR?8aLL;7egY z-}iIXem^(Ljiu?Ov*~f+9LDOR7Rm3m9z3Wrs4-%RlcNe{1sn!iguFe9gg6RnaO`jQ z$z%tWmVcOZ4^?+(S3F>f+C`*!zx1!TITnuce4-G+hk!}XRAnrlti zo7(8d8qUMw#_N?AZ8A-J^`^Do(dXSDr21jTDXaKm`VMICrCZJ(hPAV_zsV9rLE(4IeDl@>Fd<)WI03ypSd}=w=D38(;P}H{n++?I{qs4b#U8sXu83xJh7J6 z`HQ)78wO!7O>-}q!}xOdf8q{^iqUdjT*^x{xxL7iJ(4hI_#bdA_t{Ms+Iew&#}&#} zwKKeIDl~%?G70@Z3Za z@0>O)ghV0t2&Pi)J)ZC0L(w|R)fwUB1y_2u9ltc(=s-k$?$J!8I_3{};B9a7`Wi;U zwMvK$DK9)2a>~y{3DyU;sv;V@@|Rpm8C>TT=U^YY^^O9T|2!l1&NANPVF^~V7kA*R zMs(zE^d~3eK3bk~v!*AxW&)L!?4b#Wq-Wcoe0aPVG!#tW;y%rnb9yk49AvI39#TvXhr+4}~i>KE=_*|yiV>2Bvadin}nmZyUjErravBF#UN%K3%D znp^V~zs}y+Sbd%am*z7eCgeRr4JWG8uLX`ym&nEuml7Swj zhXtP^zB@#manu(=`t=)*!P~&jfrA%Y z`si|x<4nAB@#w}-3c(V(h3$}mYn;I1;VjsdCp6P1T{&_?i22#-Nk)0n>BJ^`w143806kW`pW|=z zAryCEVPu$LDg9=UD6_mzY} zsH6PQ2W?w#&|+9M7iwL)G2!z$rt&U3ciYXokVuF@c;?q?ifypsFtd5#-2C_tFUKa#Tk~ORPzBmGLwJGI$oQPC z9r5jhjzTGYQmbIoNNRAEH{I!pl(wRGh_0X~$_jhDK|x&8&V{QYy<&f@C4QRShQW?N z=nRS9{1y(jIn=Z-F|ufM)b?y^_0C;0=AKs9onPE4q9ftY&{`nJ3%<3l%Re;FFR0e- znnR-=5khB)zRusHk$WP}^E7q{)af)HAcfApMf0_vS1elE_`=5~?U7KpI(y6{5GMLs zsMqX#bLs1V7&2e)$GH<}bY`2hNOl^fk_)Mm#8fd+RlVBqR0*(6f?ZntKi(LsrpaC4 z97Oy)?QwFk&hc~fT@{o;IXR~(mz@yW^Lr|CLcZXn^LRt~hv;30>|-6?+)(ALC*2o! zNg$ervcpLFzTXRAOQN0#KxehBiNCz|DUBNp%Z>M7{0TfWD0I-UowhTR{P^==igK(VuYV8&NT1K-XJkVWp912v9w<4^5@FX1@Xjrp8LS)QbZpr z6C0{=b-nGBi#BS6yvCoL&d2-)V;v%iK1cT>sz_!Ad0;1KXf}T#QNZvyi7!r9FtU&P zLXNL*U@L6y1}bs+dxrU+i2h6XvlMuPyWR5xVU|4AE+OZh!_?5y4(6<_T|*CDf&x;~4N8hIAPoXT zcY}1dGITfJMt$!4`QGC_Uj8!2n!VTBbFK3_V{Mo#3cCU08nVLu*?^y9Zw4sdZA9m< z-m}$wrb4tyKsk@g);Lvh3pIbgMv!f7>?HECV4ZJ7S2^9gsK#@LULbFrGAu~vC6_2< zWy|Md+g{>s?e#)_L>La2vv)1!LyNG7&U8rMOsbRa$wU^vRV#kk(a&2(!ddJnYK;IJm-uv2hI8Kxdemr=zEan2f^zH`ZA%tiht1Z9s@UC zplrTF#Co7hY`gw6r(ZOvTPoYAFHRFP7 zjC9=;#Qm`jCr8WgmRcE9cB|sD@bQ|WKZYC6bpe>IJ_XngViaofvjZ~YRGIxf{2z8k zd9ID_$Rd$ChUfV_nnWe+;E+Bvhq<~$zA)iiIOM+AJ6(mM%h$C#3Yj8-PNI~(;Gpde z`_q;bFaT)rW>;9fEEYk595=iJDq#Bsp&c6bxUnBgCg`F^K<<1%`~r}mJ4Xn~8E3s=&L8&SaqLXO@Lx%X=8ID^G< z?r_IP_PD<%KkyI5k}aDw!I-;#ujF>Ak}y~OCE2Ka#64mEQ86vpu^P#1S(1orj-+6f z)pM$p@R?_H^lhM_tzH9v1MOLlZ=6YWd9MBNkD)u#Am&`(UCjoRPM6n>_i-x5Ek>VQ zqI|n25^%ftGoyiNdtuq_MZSVXw+$PF{6z_M z8{YH6#k}yfmmEneuiv}(RKri5PX@Vhd`WEFw*bf9|_g zLt@OJeu4|OeBL>c<ABg`XL@HJ8(7K{Az=v!9Rm}U5u=DX$`I()oOhs#ta3e3H= zm4^VRQkt=)1T9^vY&5#tBY#_Bo3CC;((ZLwj$67)Mgg1VCy;bJh}jM z*#|aC(NDD)RfV4WoWDw+?=)2M7ti-=ye{MWW_00PH{4uIE5*~)emM_=GnQ&N^jzz{ z-|(*X(HD7P@9ceB<4H+<;z>VXKOkR_NM>S?2CzYk+iJ4m7x?y#fo%&v@%<(L2yO#+8yvZ}6OB`7x#@Mf%d= zL}Yzu&%KNq_jk^R+ISVvJmb1Ir?UxD+q8@vu0SMRK$K1*g#S?!tla(+w(O)WE0VhJ zwh$Dp%6uYmwC0;HZ;$25`mir?I;$F@U(x+Mch9Hu8H)W)%uo4p2R85Mq@e@J;QCOT zc@6h?neQ7_4Oe8aCO)Nxo@uxKinHbBbz(O47a>D)2Bn|+Q7}=8n)7gi$oE}ff0L^ci4bU#2o3ZOt8;B8$_&#L}JwSHYhX<(bh$J})>1YpJtET>_(TOsf zOIBH(x|w9zaiY0GhUMSNgoR!^9{R2>ZQ z5T}+<5tNr}M;m5U1@Sbg&3JTDA>CB|0vZff$Vv zgg36h;+$#gt!LI+%iC>7g@qPxzT*A%YdPuViW-kG88#g2QzBwyaKo;L%G0i38Yy&Jsg zjj1$x*0=980;dUloow?UIKFY_eDnTZH#jaj#Ajl?^1TNQcIRKv5~0{=mkM^}iv3cj zPeu(C8FS;FhAW2>RHTY1E8VXZEvulsIC*}s{N@igW|}WKWl0v%z4lm+FI6s`n%>!k zy+x^})a*)(z@A59#@WOPBTuIC7x%?3E0TFb#bdTc)VAP;Ai4tDjP~`#WvEa?;n6_o zb|@w^oUGn@5mF!Kqj>4T6@m*jYn`kP!L#{LfdnzgBcuwB1b0OJ3J5EZU_ns|!SmT-XGL#C9W z>da*;ly7zBhwe|of*5<5+~@V}O|T8juOCgCSAlWtUgwc2NEr6;`klLK4r$e$;y@l_ zn){SF@SI@I&0mlkNyP|Z;XrZ%0Rg(@>;!e_TX`X?$p(}C`rAS5%>5FbPYh1dgxHN-Yx6kO{Or7w{#zql%A$mtl{t;&eV&NW9NrPkt zW%tdL!OC`ZXo|fHRpKB7l1|qD+2aOjD?>fwqunSw|6E7ofEOW5q#&@U#ZI6k;;z%SFcHRu3&yL;!x&j?_)Fo>CXlX z+Sfh`16sANPS`^9>OK2J=E3$GhqIrefD-N3W0{f_*RzSEF^J6L|Emcn_lHETx=Af^ z*p{45LM9o}r%KhYaY1){|1&f8@uv3CzOY@qESU&mj0fNByzN**;~8}j9_frQqvPV%X7Kpg+LsH@2hl`5%d5~JB`m3x)pd7s zL0;2;vF(^X-g=h=>GKWZucxjGfiA~}egG}`>$|u6g=3M&jMCY!c`(S^B4biQLsT(U z2}9y^dn57I_Su%Y>!M{OhzMC{f$G!oWfA4r$HGRv*K+;$m&<<+6UtxCaBc4vi*e<~ zp?20E5Us5rqW|tyWvKw7&Tp6elTahxIqRJ$$Rw40&n#}<*pKirnB?2A;nB&_MB1$F z5qO5D)oCC@nqo6~r)x3AKYg>IDwfPEpJGkL6n%-F)WKZQ7bvKgGp=6oGFcnbqDbJ` zoz}{0-&x!jN+a9W{?R{BOgvS+*dXtea&Lv~89VW4YY#Hy{rdS}VHG@#ZaTR>0Jk^E z&efTC`OvY7m_zG6k`OfPJYyyVhs#8kCCaTdnItlMZI!1f1-m!F#*6BD!MD};Ud55mx1R?I%h?HFy6dZ5~}6kLY>NkuCGVHgen?JCC%+olKmu|Jt_;543iVL7^6MYX_bU zyYblL5;~~KY%S10J-0idD(Y^w)U|?D(qS!FY~Irdn5=Mi<=TrFzeub&MVAlwBQZaS zF0h30-G3Z6%%5VPsyMih>`l_|IB8eAYyJ7!RZd__iWEQshf(7;?46&n_v7rZ*F_fm z@~rldVH=BYm%&p)4=tk7)wlR#dgfS-oT|#}wfrE#>K?26lkDc)vMM-?U{{uV;5iWn)8Awo2kXKCRX7ms(ClP4&molRpAqCa0G zUSw9md}C^H5SDpY&(dSeQ|*MuSBukb3XsF<>Lcb-xF~P;kA$#^r!HjYjwVzeg{SFU zK1{4?I9cSOGjl`Xh0PRIFNjynrRSg!{h>n7rjQ2ge+71586t3mv?*Zyao$$EW0&Bz z)vZaT7FY^WRQ;@~ap7XzC0~l7b`$_qk*a+3$)#JnDXY!oZySUCIM>1Xp?D>kMtY3{ zmQA_o;*!B~e2B{_pi4IAOO`&W#J8*bG4MQ;vxyewY6d%&kd1qlw@=)-kz;n}0qBBY zl#e%yk>;wSuXF1uHp{75J*=UYMqSD+tvfHC<0#&u1n|;rtH=Tmgv|b3zv@TTh}**^ z1V>$`0738Ie2&;VKvpad+!dmrc0Wv%G)Q^pwG`GClt3@Ist7(TZYh);L5A@eoR5Nq ztT&d|;gf0`F)3Ru5etHbimb?DE?=-}y(#qE^vY*sRgE{x%(b1p<$~}XpZn`tEQpcB ze47IAT=5%*KU>ly*MxgStUpRr`O@Pe;ihb4G=p)5RzxGvkr=`i2yk(cAGS*#m1(fn zfWCY5r7Ke60fcJww_D;BbxP86^iRMJRej z`>kv6*lyocWFGb-`~#}g&$-{|^zOR*Yk=Jwt}UCGtaWQ$>(i|S1`GK=^6U!?$tO@V10mH% zlrwIrBRcXQ@0=jEN{kwh%`n@_hd2cLQUOJN`Qa4T@tc8b;RmT^fmLsuj-npO6*Qm4 zF^Jbq9hSA>mOTBDuor7$B?61AV6jkHsJsmNA?fD{LtMyAT)teGm(&+#p8Iw;G?|!< z&jZU(;T<=9kg|}hLG)qMS&Gnb{M(jg)Y&^*d6h{aiHhe;+mGzFqPJx;J(wDB$5d$&L4vC~%^8D+8Oe6DdMz*e-(p`@{!h}+ zTt@wWWBdpUA0|?FH+(Z=7+*!gUU#_4@cK5-2*UArr)%M5R8H8k<@urBEMdN~uLIA< z(az7Ws5|!_GwXcam-7xnIX?L4%F>=UNa>0_DDG^Nflvt|&2VZ>1(4cH6O3#8H!Bhu zRFD2*a1w(H4+98%}u%gk%syMAA?>)QD zez#|K7QWG_9T?0 zS*V_lNkTZM@);>t;jlG9Hm^ zObHm_CgSmISUEtDUqzCxcbZZ z!EJeDM`)uI%vY~VjVa_zx1?<8R@0E3UIiwNcYy8+ub0(O8>F-m}_sq*FyeRcyn+~kv|K(4f4aQGbq>zM`%!H%Euh3| z&^CU{n>7`5oThgui1w26#dBO5dy>v3f5bxAVo%AVTh1qZN~f*uCVYAcH}h+LL}B{Q z)HhOzLcRZr|2NbBL;Sad5LL{*yJ(%yGF9tzB-114voAMya?(JmbpoAPZakkDt;jqD zAu+kYTehUG0mXdO%7_X{!!w9;W38C>y#|V}X|EsR<5R7$xAC1rP9xJ5m0L#Qq{_u) zWSF+{2G!EdxfK}~&yaw&&P=~|ye)VP^$Eey1zPY%r->S)`mWcKW18p4Z-3e9Y>r1* zl`fOB&>b}DH`Ovk4gG+BT3V!~jO%+y!MJ~$|DvF^VmyWcB%7O(rgU39{Nky9%i~?_ zaSIn$7yHP@UzP&f-;W-B_r66nqMx07MA($F#O8eHE{{~isB}8pu}|6ixiZ=NF|UPt zLvM`oPxwK)(2NtVqH^55`pjBvF*z^HMU@s0}ZG&&4Jwu0ZkY)z39OP`KPvQQT34ulJ9}@yD5EFcy z=9Dg@9OtJjb!ls>)Ow01tUkrRA)3B)+d~)_tJ^XE1kFU4w=mn5CeY?S^y}$#21O=t z5frbWhVsW7eJNLNF>5p=6L##c46Eye3r3Z6e%lt)GPq}K4H$A09L)8o5>I*ZjwcM3 z*3DwO9t5mR4ffWdBac@0A5@{NGCHz(y2PWx;+K1q9D>1yP)FLz zs>|8=B1e6s)d9atw$paQz8W^Ea+5Yw7>;DdDGFifgjd-o*TK5#=*?8<%5mGO%cXMY zrw+r&`dz4fuqV=DoY2aK@b#{6FqvEHXlb}~n_i~Yx=cm?K74L7)VVk;D#tc%f2WLt zcqj8nS55dHG6-kRWAOCZ;N@}*Uvo4}&@BPs5Tb}PYC2f=_L_ar*SaCOK{O+}kwv>tCwD6=Ks5>p8N zrDw{OZT{3*$?EWH=Q}g9-ld--Es_~*ZCLh{7neEk5EF8WcSMU?hdbxn=?&z&q>97Z zY5+S2T(HN2>jvX5OBLnF{q8-_E1VLc88&=Gh`8;1-9-AGp8;0UCX8FSw!^{98&w!# zfBt%lX&W7>ZeN+%5&h*sBNJty0Ipd`zBhtz_xy%SF%V^+N#gb&CVml?f)>V5nMyD(Sa;@e+&<&jB(+ogMIGw&#MwwqbgSUi9?QYA zV=0P`{4d#nJ;M}Mf!*aeM-nIUg4*S(QDHQe!E9+g6pduu&Dz6W0vg`hy}j!-3vAZG zQ)^`1!)6|kuI?jHJL!7|-$SHg@}i$IDGet8%_`*6^uqr|<`2mk=Q+1II)t>53tX%( zK958n*qYL>aV&k1vqxRCB=iTq_1z@rmgdE^@I;xkL9}+CFfSTE zL_X$t{K4(Y!J+*1#iiD%r?D*4aY=9I%r4dRj*{wI`S--{GI18K5=4{w@L~t1RfMZ9 zzx?$u?c_|EljO#IZTtK#AZ@|rgA$gxygEfGxqpbvL=sZCjMiekwDx_JqZ8;=8Ffa7-~(F~wCJs@-!{Dnp)b$N8X4 z693^}&w1vx(Ztp!;3gJ^Hc%gd2rPs}b~rDDVmo;F7iZ=C?A=C#>qjKlmRzmPBV+WM z7m~jFp0n*1abU%7j=ta~EU~xF77FLaI&C2e#dx9Y(v@1XuJ=wWly>skzqU*O*T&k> zcWWY@v!CzL(8)!%aQvUm6aQ2xsZ#Xoc0!^|jbq%DVnUgftzKx)Gne0xIZX72#ccf} z$DRiC)B32YTrQ5Dz651B4M*8Scy42^d&3gH7sb;0eksc?54&_+=Q8U{{$n-iqV74M zAeE+ldXp5J8eyS}jckIQ2t{);2VT(KeeQ0gZGqh(lf|Y5r483RSy_dK)F9Gpd}{=d z$Tv`z)QmA5mm+E_ObGUkA{bxaJkwFWUJ9sQSY6SJ`vM}a<6)z2^z9f!rZi;lcsNu= z37|^gZNRxz>F;i9QuvE9M_vj^j@j`wp}K) zr}0RyPFY6rD1Sn*^9qIsIL2#ipI+Vv=1}EJhm4MQDdY7qYKgCulZ(%H){;a~R3&Kn zPI?{~#7TT-8utuMOS;_@X z)2|57vS1xZK(E_x)d7Qs&;j%3Cp~t4z1A5&3_A;!o{vAC_&`vMI)$QBv>ygiCxbmE zMwbi4gb#F+W|oDhk~3^BO|?&FpB%CaE+FZ$#+Z=5I9{lCPqKJ=+M4}k1wG`f>pqJm zS8`m94nw?Tu{UVcwuP`BGk1Or#|uzYW(6k_TgKq47twsB`A=F6aXa(dgr^k@65w-( zsfP!M3OAWh7>*cZA+tG2Le+)J-#vQF{KgHM<>}q_Nq=e-DSoa-WDQ3QJ zJs1DL(z&lT0W)ywyRtgsnsFdQh+WViM{WXF-O`QIr#3__+rg3gSG*hYKHv8; zGu!G*q7VJS2x&BxqH$X5WBcI334KU9Nq>fw**$3@M7n_zJx?*yc_vPd;aHT+hhl}T zYoW>GOye97zzB-8ln5^LKRj73PhXIEE7;J(%0oF42X@ zyXYKwOl$ITRlj+>++u^|ymN^49^;k>a4;tMAf1WuMbkA*J6s#;En@46T8F<_Be}2R znmxcStxECT9+Wz7;I+UHo=geWGf;R57zlt}2 zegyOZTK>3l1>-C`z%h$!>q7^Hm2WOS=_u;rvH*$OzWp^{$+QW9dtb-t~eM^Z&ik7X>LREG{lvZ|M^RIi`K6YKBiOGyR$^z2c z9cND}c`Qm)zS=CA=4#fOq(b|OSK5XPZ4?JA9Qi5kJ*a=p%Bg2ErkK#u$0GUuW37kv zc7k4S@5@BGwnARW6eRjx%=kD!6?@L!mgNs3dx3UPRd2yelcS<0)t)Bob8rL~+J;Px zbXom*Bb%WtOK15DgTW`E2R(d(0HZ@t=UOxFSq?6Z(zstmsEiTVbzs|F8zA`~pE*Dw znpLQN74A$>pm9f_3bI}a_L8>&+Ul<_^wcG zjmJ-$7tm_`eDqLCRRMB$C8`8Y$V;3}iFffE3cZ%1V+=b*JB6$M>pts>G@NXN1q@Tw z7Qp1UQso$k(T!(wCmyb3QN;zp@~Y|E?oTd4+q&M)jC zHunGl$BjN$U`a~#$oUiu|79U>C3M}+;zf}6ocJ6*I+Lb5@x;c7-mcu6No)O)Goj50 z7Xe!I+M8Ip`<;J$v~AhSDL@osxC#?|4P!af_35g0g}*WG?1#|HMie%u81+v94a{c1 zc5Q{LaL>me;9$QY1oN0NPgR_;WgWVPSIJ-!bLz^syeAs~mB1CAa{Yzp#{H3bqI250 z2Mq|vs{P{hY1s|v_T`KS(xqOn{mmy-#Qb#{b6tHIa4?FwHrIOfO+e5d&$P9Nh7CE5 z*2<&$ol1B>mGs`sR?J-@;hMLOme(d|{NnxJ-w*il2CbbuxtQE63RLkT?y-+S?~#z6 z*B()g=hpiAzDk;oK-i3ye%4X%?&4N$U|doUUISc?yaYg#LFE&?AI3s@_cCs=3SZ~x zO6rqI?hSm1+D=j!fNsJ?h%HVZ1*Ma<1H1F$vMV;xV7j5qcboIJ89JFrn7l-VbArGW z?%=5jq?fJMwMTab<_o+c#0gcDju$~Ta6O`WpSrBbxv~Cj)d1RS9UF|0-%BoJ#*N!* zxGBC*ls~ix3U+Q2r_|F)x*qk*k_@bN{}pJE*&|ApruBC3(csY8ieggQZUyb2hX=_( zt@4QLR1FLHirL&HzFWC4FTw$KY*ahK*<1;6(vg7iZK&;x*#L8tOJ)F$3tWJX6)>j% zO;p9gB$+kvvqw$APP$ft)FHw*-BSl*rwTp^h3K0PDaTO)%SKl62Z$Av^G7P_8T?~G zENyeA(g&!v9p*d^2p29u>VN&&PWg^Lm+x>Nog{iNCxrh4nD}%?Ev>xo13v6YZbKW1 zkh`x37{mv4xe4Qfnt$_Ou%07k;_!g8gmme`0-LhAdyva|P9opr56#|z2jtQ!k9Ks_qvZToH@b=xVqF1kYM@O3=bbBj{uZxC}wd0Pi^M7U~4w=UpuFj))!=U zK}8y^40)Fu-}jP|vu2kY@ek%X@#}nQtKPsr`kR*8%vw@}br)a`P^hdjS7(AL_T4X} zvnpeLhR|QV%MSgXgf8z5fnfW@zKt7VK}%1LYpv*WAYllIVt^R-z_GFCgX%e%GnW^!<%J6V-{>FC?!?OG zjX1+`ZB^btg8zfRCjKDzy_{Ns9>Ng&U+oncRlwonIB5%Mi4AIKMv9p7sa$V-AN(`$ zeiRd%`G%vRcc{~geAPo(IYBhbW-weY1k*043U^dz_v63Ao>f04&h0Ve1}qDwXz7ia zOb@#y068aFUKh=znr(!)7v;ZhOBHYqH!BTDctNh>_!fKM z;>6*UHa45!|GLAzMDE7$-|0jN)w2>JPQ z@_u#+qspLkm!dfcf&H9`NE-5-ECOh+I=bJv&EGdyCYLK+ph~P5P_v4$QrXVQcbNTc z<{xoarfM^zhjeVzk#+?+UoD3^OHHm7lng z0zP<-3IIS{RQyTp-YuM@QUM`jJbJbOe*SE&CBHf5yRU6)XP=7vN~pC?@mdV8UhArD zbietXHN9ItnvLiEim&rz&l14m2olh07gZWy_ChX4GgicHHYfR9sT9uzcxnCw5`)A@ zB6dw&AhN&K)!cnw5B&11&vJ7!E*6gJ7nHDRkRCw!=k91sUda~3FpSd99!d>)49D5} zeA5*zXwKb64iK155PT(Pa5w0moe|$Jk=spz_~B*?yB9+Y1N$0>^RS z8M2oR1+40SKZ~dD$eBWK3@s3AFBVtd@uusg90E#VjceYsX;I)Jl;pJk`I(+s#M9?~ z{S1U|AB)Oe);gE1if<)rCOF%m8a(p9)7FgrIWkp&yTD6DS4q~pX?{0y4Q)$AvJy7gZ{g4kAr^C?O zKv(UF+%KU0{Cmk!LROF_k+M&)=FuUqb|_0imBd?;loTKd+6zipB}kLt#1sOe| literal 0 HcmV?d00001 diff --git a/source/tutorial/crud.md b/source/tutorial/crud.md new file mode 100644 index 00000000..9eee9f38 --- /dev/null +++ b/source/tutorial/crud.md @@ -0,0 +1,139 @@ +# CRUD Operations + +CRUD is an acronym for Create, Read, Update, and Delete. These operations may be +performed via the [MongoDB\Collection][collection] class, which implements +MongoDB's cross-driver [CRUD specification][crud-spec]. This page will +demonstrate how to insert, query, update, and delete documents using the +library. A general introduction to CRUD operations in MongoDB may be found in +the [MongoDB Manual][crud]. + +[collection]: ../classes/collection.md +[crud-spec]: https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst +[crud]: https://docs.mongodb.org/manual/crud/ + +## Querying + +### Finding One Document + +The [findOne()][findone] method returns the first matched document, or null if +no document was matched. By default, the library returns BSON documents and +arrays as MongoDB\Model\BSONDocument and MongoDB\Model\BSONArray objects, +respectively. Both of those classes extend PHP's [ArrayObject][arrayobject] +class and implement the driver's [MongoDB\BSON\Serializable][serializable] and +[MongoDB\BSON\Unserializable][unserializable] interfaces. + +[findone]: ../classes/collection.md#findone +[arrayobject]: http://php.net/arrayobject +[serializable]: http://php.net/mongodb-bson-serializable +[unserializable]: http://php.net/mongodb-bson-unserializable + +``` +demo->zips; + +$document = $collection->findOne(['_id' => '94301']); + +var_dump($document); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#13 (1) { + ["storage":"ArrayObject":private]=> + array(5) { + ["_id"]=> + string(5) "94301" + ["city"]=> + string(9) "PALO ALTO" + ["loc"]=> + object(MongoDB\Model\BSONArray)#12 (1) { + ["storage":"ArrayObject":private]=> + array(2) { + [0]=> + float(-122.149685) + [1]=> + float(37.444324) + } + } + ["pop"]=> + int(15965) + ["state"]=> + string(2) "CA" + } +} +``` + +Most methods that read data from MongoDB support a "typeMap" option, which +allows control over how BSON is converted to PHP. If desired, this option can be +used to return everything as a PHP array, as was done in the legacy +[mongo extension][ext-mongo]: + +[ext-mongo]: http://php.net/mongo + +``` +demo->zips; + +$document = $collection->findOne( + ['_id' => '94301'], + ['typeMap' => ['root' => 'array', 'document' => 'array', 'array' => 'array']] +); + +var_dump($document); +``` + +The above example would output something similar to: + +``` +array(5) { + ["_id"]=> + string(5) "94301" + ["city"]=> + string(9) "PALO ALTO" + ["loc"]=> + array(2) { + [0]=> + float(-122.149685) + [1]=> + float(37.444324) + } + ["pop"]=> + int(15965) + ["state"]=> + string(2) "CA" +} +``` + +### Finding Many Documents + +The [find()][find] method returns a [MongoDB\Driver\Cursor][cursor] object, +which may be iterated upon to access all matched documents. + +[find]: ../classes/collection.md#find +[cursor]: http://php.net/mongodb-driver-cursor + +``` +demo->zips; + +$cursor = $collection->find(['city' => 'JERSEY CITY', 'state' => 'NJ']); + +foreach ($cursor as $document) { + echo $document['_id'], "\n"; +} +``` + +The above example would output something similar to: + +``` +07302 +07304 +07305 +07306 +07307 +07310 +``` diff --git a/source/example-data.md b/source/tutorial/example-data.md similarity index 62% rename from source/example-data.md rename to source/tutorial/example-data.md index 0d873bd5..9b2be0f4 100644 --- a/source/example-data.md +++ b/source/tutorial/example-data.md @@ -1,13 +1,18 @@ # Example Data Some examples in this documentation use example data fixtures from -[zips.json](http://media.mongodb.org/zips.json). This is a dataset comprised of -United States postal codes, populations, and geographic locations. +[zips.json][zips]. This is a dataset comprised of United States postal codes, +populations, and geographic locations. Importing the dataset into MongoDB can be done in several ways. The following -example uses [PHP driver](http://php.net/mongodb) (i.e. `mongodb` extension). +example uses [mongodb extension][ext-mongodb]: + +[zips]: http://media.mongodb.org/zips.json +[ext-mongodb]: http://php.net/mongodb ``` +demo->zips; + +$result = $collection->createIndex(['state' => 1]); + +var_dump($result); +``` + +Creating an index will return its name, which is automatically generated from +its specification (i.e. fields and orderings). The above example would output +something similar to: + +``` +string(7) "state_1" +``` + +### Enumerating Indexes + +Information about indexes in a collection may be obtained via the +[listIndexes()][listindexes] method, which returns an iterator of +MongoDB\Model\IndexInfo objects. The following example lists all indexes in the +"demo.zips" collection: + +[listindexes]: ../classes/collection.md#listindexes + +``` +demo->zips; + +foreach ($collection->listIndexes() as $indexInfo) { + var_dump($indexInfo); +} +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\IndexInfo)#10 (4) { + ["v"]=> + int(1) + ["key"]=> + array(1) { + ["_id"]=> + int(1) + } + ["name"]=> + string(4) "_id_" + ["ns"]=> + string(9) "demo.zips" +} +object(MongoDB\Model\IndexInfo)#13 (4) { + ["v"]=> + int(1) + ["key"]=> + array(1) { + ["state"]=> + int(1) + } + ["name"]=> + string(7) "state_1" + ["ns"]=> + string(9) "demo.zips" +} +``` + +### Dropping Indexes + +Indexes may be dropped via the [dropIndex()][dropindex] and +[dropIndexes()][dropindexes] methods. The following example drops a single index +by its name: + +[dropindex]: ../classes/collection.md#dropindex +[dropindexes]: ../classes/collection.md#dropindexes + +``` +demo->zips; + +$result = $collection->dropIndex('state_1'); + +var_dump($result); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#11 (1) { + ["storage":"ArrayObject":private]=> + array(2) { + ["nIndexesWas"]=> + int(2) + ["ok"]=> + float(1) + } +} +``` diff --git a/source/upgrade-guide.md b/source/upgrade-guide.md new file mode 100644 index 00000000..cd78ac64 --- /dev/null +++ b/source/upgrade-guide.md @@ -0,0 +1,162 @@ +# Upgrade Guide + +The MongoDB PHP Library and underlying [mongodb extension][ext-mongodb] have +notable API differences from the legacy [mongo extension][ext-mongo]. This page +will attempt to summarize those differences for the benefit of those upgrading +rom the legacy driver. + +Additionally, a community-developed [mongo-php-adapter][adapter] library exists, +which implements the [mongo extension][ext-mongo] API using this library and the +new driver. While this adapter library is not officially supported by MongoDB, +it does bear mentioning. + +[ext-mongo]: http://php.net/mongo +[ext-mongodb]: http://php.net/mongodb +[adapter]: https://github.com/alcaeus/mongo-php-adapter + +## Collection API + +This library's [MongoDB\Collection][collection] class implements MongoDB's +cross-driver [CRUD][crud-spec] and [Index Management][index-spec] +specifications. Although some method names have changed in accordance with the +new specifications, the new class provides the same functionality as the legacy +driver's [MongoCollection][mongocollection] class with some notable exceptions. + +[collection]: classes/collection.md +[crud-spec]: https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst +[index-spec]: https://github.com/mongodb/specifications/blob/master/source/index-management.rst +[mongocollection]: http://php.net/mongocollection + +### Old and New Methods + +| [MongoCollection][mongocollection] | [MongoDB\Collection][collection] | +| --- | --- | +| [aggregate()](http://php.net/manual/en/mongocollection.aggregate.php) | [aggregate()](classes/collection.md#aggregate) | +| [aggregateCursor()](http://php.net/manual/en/mongocollection.aggregatecursor.php) | [aggregate()](classes/collection.md#aggregate) | +| [batchInsert()](http://php.net/manual/en/mongocollection.batchinsert.php) | [insertMany()](classes/collection.md#insertmany) | +| [count()](http://php.net/manual/en/mongocollection.count.php) | [count()](classes/collection.md#count) | +| [createDBRef()](http://php.net/manual/en/mongocollection.createdbref.php) | Not yet implemented ([PHPLIB-24][jira-dbref]) | +| [createIndex()](http://php.net/manual/en/mongocollection.createindex.php) | [createIndex()](classes/collection.md#createindex) | +| [deleteIndex()](http://php.net/manual/en/mongocollection.deleteindex.php) | [dropIndex()](classes/collection.md#dropindex) | +| [deleteIndexes()](http://php.net/manual/en/mongocollection.deleteindexes.php) | [dropIndexes()](classes/collection.md#dropindexes) | +| [drop()](http://php.net/manual/en/mongocollection.drop.php) | [drop()](classes/collection.md#drop) | +| [distinct()](http://php.net/manual/en/mongocollection.distinct.php) | [distinct()](classes/collection.md#distinct) | +| [ensureIndex()](http://php.net/manual/en/mongocollection.ensureindex.php) | [createIndex()](classes/collection.md#createindex) | +| [find()](http://php.net/manual/en/mongocollection.find.php) | [find()](classes/collection.md#find) | +| [findAndModify()](http://php.net/manual/en/mongocollection.findandmodify.php) | [findOneAndDelete()](classes/collection.md#findoneanddelete), [findOneAndReplace()](classes/collection.md#findoneandreplace), and [findOneAndUpdate()](classes/collection.md#findoneandupdate) | +| [findOne()](http://php.net/manual/en/mongocollection.findone.php) | [findOne()](classes/collection.md#findone) | +| [getDBRef()](http://php.net/manual/en/mongocollection.getdbref.php) | Not yet implemented ([PHPLIB-24][jira-dbref]) | +| [getIndexInfo()](http://php.net/manual/en/mongocollection.getindexinfo.php) | [listIndexes()](classes/collection.md#listindexes) | +| [getName()](http://php.net/manual/en/mongocollection.getname.php) | [getCollectionName()](classes/collection.md#getcollectionname) | +| [getReadPreference()](http://php.net/manual/en/mongocollection.getreadpreference.php) | Not implemented | +| [getSlaveOkay()](http://php.net/manual/en/mongocollection.getslaveokay.php) | Not implemented | +| [getWriteConcern()](http://php.net/manual/en/mongocollection.getwriteconcern.php) | Not implemented | +| [group()](http://php.net/manual/en/mongocollection.group.php) | Not yet implemented ([PHPLIB-177][jira-group]). Use [Database::command()](classes/database.md#command) for now. | +| [insert()](http://php.net/manual/en/mongocollection.insert.php) | [insertOne()](classes/collection.md#insertone) | +| [parallelCollectionScan()](http://php.net/manual/en/mongocollection.parallelcollectionscan.php) | Not implemented | +| [remove()](http://php.net/manual/en/mongocollection.remove.php) | [deleteMany()](classes/collection.md#deleteMany) and [deleteOne()](classes/collection.md#deleteone) | +| [save()](http://php.net/manual/en/mongocollection.save.php) | [insertOne()](classes/collection.md#insertone) or [replaceOne()](classes/collection.md#replaceone) with "upsert" option | +| [setReadPreference()](http://php.net/manual/en/mongocollection.setreadpreference.php) | Not implemented. Use [withOptions()](classes/collection.md#withoptions). | +| [setSlaveOkay()](http://php.net/manual/en/mongocollection.getslaveokay.php) | Not implemented | +| [setWriteConcern()](http://php.net/manual/en/mongocollection.setwriteconcern.php) | Not implemented. Use [withOptions()](classes/collection.md#withoptions). | +| [update()](http://php.net/manual/en/mongocollection.update.php) | [replaceOne()](classes/collection.md#replaceone), [updateMany()](classes/collection.md#updatemany), and [updateOne()](classes/collection.md#updateone) | +| [validate()](http://php.net/manual/en/mongocollection.validate.php) | Not implemented | + +[jira-group]: https://jira.mongodb.org/browse/PHPLIB-177 +[jira-dbref]: https://jira.mongodb.org/browse/PHPLIB-24 + +A guiding principle in designing the new APIs was that explicit method names +are preferable to overloaded terms found in the old API. For instance, +[MongoCollection::save()][save] and +[MongoCollection::findAndModify()][findandmodify] have very different modes of +operation, depending on their arguments. Methods were also split to distinguish +between [updating specific fields][update] and +[full-document replacement][replace]. + +[save]: http://php.net/manual/en/mongocollection.save.php +[findandmodify]: http://php.net/manual/en/mongocollection.findandmodify.php +[update]: https://docs.mongodb.org/manual/tutorial/modify-documents/#update-specific-fields-in-a-document +[replace]: https://docs.mongodb.org/manual/tutorial/modify-documents/#replace-the-document + +### Group Command Helper + +[MongoDB\Collection][collection] does not yet have a helper method for the +[group][group] command; however, that is planned in [PHPLIB-177][jira-group]. +The following example demonstrates how to execute a group command using +[Database::command()](classes/database.md#command): + +```php +selectDatabase('db_name'); +$cursor = $database->command([ + 'group' => [ + 'ns' => 'collection_name', + 'key' => ['field_name' => 1], + 'initial' => ['total' => 0], + '$reduce' => new MongoDB\BSON\Javascript('...'), + ], +]); + +$resultDocument = $cursor->toArray()[0]; +``` + +[group]: https://docs.mongodb.org/manual/reference/command/group/ + +### MapReduce Command Helper + +[MongoDB\Collection][collection] does not yet have a helper method for the +[mapReduce][mapReduce] command; however, that is planned in +[PHPLIB-53][jira-mapreduce]. The following example demonstrates how to execute a +mapReduce command using [Database::command()](classes/database.md#command): + +```php +selectDatabase('db_name'); +$cursor = $database->command([ + 'mapReduce' => 'collection_name', + 'map' => new MongoDB\BSON\Javascript('...'), + 'reduce' => new MongoDB\BSON\Javascript('...'), + 'out' => 'output_collection_name', +]); + +$resultDocument = $cursor->toArray()[0]; +``` + +[mapReduce]: https://docs.mongodb.org/manual/reference/command/mapReduce/ +[jira-mapreduce]: https://jira.mongodb.org/browse/PHPLIB-53 + +### DBRef Helpers + +[MongoDB\Collection][collection] does not yet have helper methods for working +with [DBRef][dbref] objects; however, that is planned in +[PHPLIB-24][jira-dbref]. + +[dbref]: https://docs.mongodb.org/manual/reference/database-references/#dbrefs + +### MongoCollection::save() Removed + +[MongoCollection::save()][save], which was syntactic sugar for an insert or +upsert operation, has been removed in favor of explicitly using +[insertOne()](classes/collection.md#insertone) or +[replaceOne()](classes/collection.md#replaceone) (with the "upsert" option). + +![save() flowchart](img/save-flowchart.png) + +While the [save()][save] method does have its uses for interactive environments, +such as the mongo shell, it was intentionally excluded from the +[CRUD][crud-spec] specification for language drivers. Generally, application +code should know if the document has an identifier and be able to explicitly +insert or replace the document and handle the returned InsertResult or +UpdateResult, respectively. This also helps avoid inadvertent and potentially +dangerous [full-document replacements][replace]. + +### MongoWriteBatch + +The legacy driver's [MongoWriteBatch][batch] classes have been replaced with a +general-purpose [bulkWrite()](classes/collection.md#bulkwrite) method. Whereas +the legacy driver only allowed bulk operations of the same time, the new method +allows operations to be mixed (e.g. inserts, updates, and deletes). + +[batch]: http://php.net/manual/en/class.mongowritebatch.php From c6f5deb9420a967e5433e97fd1368ca5d981c6e7 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 24 Mar 2016 16:26:31 -0400 Subject: [PATCH 015/321] Split Database docs into API and tutorial --- source/classes/collection.md | 2 + source/classes/database.md | 431 ++++++++++++++++++++++++++++------- source/tutorial/commands.md | 125 ++++++++++ 3 files changed, 474 insertions(+), 84 deletions(-) create mode 100644 source/tutorial/commands.md diff --git a/source/classes/collection.md b/source/classes/collection.md index 256d7254..b5c303e6 100644 --- a/source/classes/collection.md +++ b/source/classes/collection.md @@ -57,6 +57,7 @@ writeConcern (MongoDB\Driver\WriteConcern) ### See Also * [MongoDB\Collection::withOptions()](#withoptions) + * [MongoDB\Database::selectCollection()](database.md#selectcollection) --- @@ -411,6 +412,7 @@ object(MongoDB\Model\BSONDocument)#11 (1) { ### See Also + * [MongoDB\Database::dropCollection()](database.md#dropcollection) * [MongoDB Manual: drop command](https://docs.mongodb.org/manual/reference/command/drop/) --- diff --git a/source/classes/database.md b/source/classes/database.md index 1fd04621..7fe017f8 100644 --- a/source/classes/database.md +++ b/source/classes/database.md @@ -1,10 +1,11 @@ # MongoDB\Database -`MongoDB\Database` provides methods for common operations on a database, such -as creating, enumerating, and dropping collections. +The MongoDB\Database class provides methods for common operations on a database, +such as executing commands and managing collections. A Database may be constructed directly (using the extension's Manager class) or -selected from the library's Client class. It supports the following options: +selected from the library's [Client](client.md) class. It supports the following +options: * [readConcern](http://php.net/mongodb-driver-readconcern) * [readPreference](http://php.net/mongodb-driver-readpreference) @@ -14,97 +15,192 @@ selected from the library's Client class. It supports the following options: If any options are omitted, they will be inherited from the Manager constructor argument or object from which the Database was selected. -Operations within the Database class (e.g. `command()`) will generally inherit -the Database's options. +Operations within the Database class (e.g. [command()](#command)) will generally +inherit the Database's options. -### Selecting Collections +--- -The Database class provides methods for creating Collection instances (using its -internal Manager instance). When selecting a Collection, the child will inherit -options (e.g. read preference, type map) from the Database. New options may also -be provided to the `selectCollection()` method. +## __construct() +```php +function __construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = []) ``` -$db = (new MongoDB\Client)->demo; -/* Select the "users" collection */ -$collection = $db->selectCollection('users'); +If the Database is constructed explicitly, any omitted options will be inherited +from the Manager object. If the Database is selected from a [Client](client.md) +object, options will be inherited from that object. -/* selectCollection() also takes an options array, which can override any - * options inherited from the Database. */ -$collection = $client->selectCollection('users', [ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), -]); +### Supported Options + +readConcern (MongoDB\Driver\ReadConcern) +: The default read concern to use for database operations and selected + collections. Defaults to the Manager's read concern. + +readPreference (MongoDB\Driver\ReadPreference) +: The default read preference to use for database operations and selected + collections. Defaults to the Manager's read preference. + +typeMap (array) +: Default type map for cursors and BSON documents. + +writeConcern (MongoDB\Driver\WriteConcern) +: The default write concern to use for database operations and selected + collections. Defaults to the Manager's write concern. + +### See Also + + * [MongoDB\Database::withOptions()](#withoptions) + +--- -/* The property accessor may also be used to select a collection without - * specifying additional options. PHP's complex syntax may be used for selecting - * collection whose names contain special characters (e.g. "."). */ -$collection = $db->users; -$collection = $db->{'system.profile'}; +## __get() + +```php +function __get($collectionName): MongoDB\Collection ``` -## Database-level Operations +Select a collection within this database. + +The Collection will inherit options (e.g. read preference, type map) from the +Database object. Use [selectCollection()](#selectcollection) to override any +options. + +**Note:** collections whose names contain special characters (e.g. ".") may be +selected with complex syntax (e.g. `$database->{"system.profile"}`) or +[selectCollection()](#selectcollection). -The Database class has methods for database-level operations, such as dropping -the database, executing a command, or managing the database's collections. +### Example -### Dropping the Database +The following example selects the "demo.users" and "demo.system.profile" +collections: ``` +demo; -$result = $db->drop(); -var_dump($result); +$users = $db->users; +$systemProfile = $db->{'system.profile'}; ``` -The above example would output something similar to: +### See Also + + * [MongoDB\Database::selectCollection()](#selectcollection) + * [PHP Manual: Property Overloading](http://php.net/oop5.overloading#object.get) + +--- + +## command() +```php +function function command($command, array $options = []): MongoDB\Driver\Cursor ``` -object(MongoDB\Model\BSONDocument)#11 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["dropped"]=> - string(4) "demo" - ["ok"]=> - float(1) - } -} + +Execute a command on this database. + +### Supported Options + +readPreference (MongoDB\Driver\ReadPreference) +: The read preference to use when executing the command. This may be used when + issuing the command to a replica set or mongos node to ensure that the + driver sets the wire protocol accordingly or adds the read preference to the + command document, respectively. + +typeMap (array) +: Type map for BSON deserialization. This will be applied to the returned + Cursor (it is not sent to the server). + +### See Also + + * [Tutorial: Database Commands](../tutorial/commands.md) + * [MongoDB Manual: Database Commands](https://docs.mongodb.org/manual/reference/command/) + +## createCollection + +```php +function createCollection($collectionName, array $options = []): array|object ``` -### Executing a Command +Create a new collection explicitly. Returns the command result document. -While the library provides helpers for some common database commands, it is far -from an [exhaustive list](https://docs.mongodb.org/manual/reference/command/). -The following example demonstrates how the -[createUser](https://docs.mongodb.org/manual/reference/command/createUser/) -command might be invoked: +MongoDB already creates collections implicitly when they are first referenced in +commands (e.g. inserting a document into a new collection); however, collections +may also be explicitly created with specific options. This is useful for +creating [capped collections][capped], enabling +[document validation][validation], or supplying storage engine options. + +[capped]: https://docs.mongodb.org/manual/core/capped-collections/ +[validation]: https://docs.mongodb.org/manual/core/document-validation/ + +### Supported Options + +autoIndexId (boolean) +: Specify false to disable the automatic creation of an index on the _id + field. For replica sets, this option cannot be false. The default is true. + +capped (boolean) +: Specify true to create a capped collection. If set, the size option must + also be specified. The default is false. + +flags (integer) +: Options for the MMAPv1 storage engine only. Must be a bitwise combination + `MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES` and + `MongoDB\Operation\CreateCollection::NO_PADDING`. The default is + `MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES`. + +indexOptionDefaults (document) +: Default configuration for indexes when creating the collection. + +max (integer) +: The maximum number of documents allowed in the capped collection. The size + option takes precedence over this limit. + +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. + +size (integer) +: The maximum number of bytes for a capped collection. + +storageEngine (document) +: Storage engine options. + +typeMap (array) +: Type map for BSON deserialization. This will only be used for the returned + command result document. + +validationAction (string) +: Validation action. + +validationLevel (string) +: Validation level. + +validator (document) +: Validation rules or expressions. + +### Example + +The following example creates the "demo.users" collection with a custom +[document validator][validation] (available in MongoDB 3.2+): ``` +demo; -/* Define a command document for creating a new database user */ -$createUserCmd = [ - 'createUser' => 'username', - 'pwd' => 'password', - 'roles' => [ 'readWrite' ], -]; - -/* It doesn't hurt to specify an explicit read preference for the command, in - * case the Database was created with a different read preference. This isn't - * required for other command helpers, as the library knows which commands might - * require a primary; however, the Database::command() method is generic. */ -$cursor = $db->command($createUserCmd, [ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY), +$result = $db->createCollection('users', [ + 'validator' => [ + 'username' => ['$type' => 'string'], + 'email' => ['$regex' => '@mongodb\.com$'], + ], ]); -/* The command result will be the first and only document in the cursor */ -var_dump($cursor->toArray()[0]); +var_dump($result); ``` The above example would output something similar to: ``` -object(MongoDB\Model\BSONDocument)#8 (1) { +object(MongoDB\Model\BSONDocument)#11 (1) { ["storage":"ArrayObject":private]=> array(1) { ["ok"]=> @@ -113,30 +209,35 @@ object(MongoDB\Model\BSONDocument)#8 (1) { } ``` -## Collection Management +### See Also -The Database class has several methods for managing collections. + * [MongoDB Manual: create command](http://docs.mongodb.org/manual/reference/command/create/) -### Creating Collections +--- -MongoDB already creates collections implicitly when they are first referenced in -commands (e.g. inserting a document into a new collection); however, collections -may also be explicitly created with specific options. This is useful for -creating -[capped collections](https://docs.mongodb.org/manual/core/capped-collections/), -enabling -[document validation](https://docs.mongodb.org/manual/core/document-validation/), -or supplying storage engine options. +## drop + +```php +function drop(array $options = []): array|object +``` + +Drop this database. Returns the command result document. + +### Supported Options + +typeMap (array) +: Type map for BSON deserialization. This will only be used for the returned + command result document. + +### Example + +The following example drops the "demo" database: ``` $db = (new MongoDB\Client)->demo; -$result = $db->createCollection('users', [ - 'validator' => [ - 'username' => ['$type' => 'string'], - 'email' => ['$regex' => '@mongodb\.com$'], - ], -]); +$result = $db->drop(); + var_dump($result); ``` @@ -145,19 +246,47 @@ The above example would output something similar to: ``` object(MongoDB\Model\BSONDocument)#11 (1) { ["storage":"ArrayObject":private]=> - array(1) { + array(2) { + ["dropped"]=> + string(4) "demo" ["ok"]=> float(1) } } ``` -### Dropping Collections +### See Also + + * [MongoDB\Client::dropDatabase()](client.md#dropdatabase) + * [MongoDB Manual: dropDatabase command](http://docs.mongodb.org/manual/reference/command/dropDatabase/) + +--- + +## dropCollection + +```php +function dropCollection($collectionName, array $options = []): array|object +``` + +Drop a collection within this database. Returns the command result document. + +### Supported Options + +typeMap (array) +: Type map for BSON deserialization. This will only be used for the returned + command result document. + +### Example + +The following example drops the "demo.users" collection: ``` +demo; $result = $db->dropCollection('users'); + var_dump($result); ``` @@ -177,15 +306,49 @@ object(MongoDB\Model\BSONDocument)#11 (1) { } ``` -### Enumerating Collections +### See Also + + * [MongoDB\Collection::drop()](collection.md#drop) + * [MongoDB Manual: drop command](http://docs.mongodb.org/manual/reference/command/drop/) -The Database class implements MongoDB's -[Enumerating Collections specification](https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst). +--- +## getDatabaseName() + +```php +function getDatabaseName(): string +``` + +Return the database name. + +--- + +## listCollections() + +```php +function listCollections(array $options = []): MongoDB\Model\CollectionInfoIterator ``` + +Returns information for all collections in this database. Elements in the +returned iterator will be MongoDB\Model\CollectionInfo objects. + +### Supported Options + +filter (document) +: Query by which to filter collections. + +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. + +### Example + +The following example lists all collections in the "demo" database: + +``` +demo; -/* listCollections() returns an iterator of MongoDB\Model\CollectionInfo objects */ foreach ($db->listCollections() as $collectionInfo) { var_dump($collectionInfo); } @@ -213,3 +376,103 @@ object(MongoDB\Model\CollectionInfo)#13 (2) { } } ``` + +### See Also + + * [MongoDB Manual: listCollections command](http://docs.mongodb.org/manual/reference/command/listCollections/) + * [MongoDB Specification: Enumerating Collections](https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst) + +--- + +## selectCollection() + +```php +function selectCollection($collectionName, array $options = []): MongoDB\Collection +``` + +Select a collection within this database. + +The Collection will inherit options (e.g. read preference, type map) from the +Database object unless otherwise specified. + +### Supported Options + +readConcern (MongoDB\Driver\ReadConcern) +: The default read concern to use for collection operations. Defaults to the + Database's read concern. + +readPreference (MongoDB\Driver\ReadPreference) +: The default read preference to use for collection operations. Defaults to + the Database's read preference. + +typeMap (array) +: Default type map for cursors and BSON documents. Defaults to the Database's + type map. + +writeConcern (MongoDB\Driver\WriteConcern) +: The default write concern to use for collection operations. Defaults to the + Database's write concern. + +### Example + +The following example selects the "demo.users" collection: + +``` +demo; + +$collection = $db->selectCollection('users'); +``` + +The following examples selects the "demo.users" collection with a custom read +preference: + +``` +demo; + +$collection = $db->selectCollection( + 'users', + [ + 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), + ] +); +``` + +### See Also + + * [MongoDB\Collection::__construct()](collection.md#__construct) + * [MongoDB\Database::__get()](#__get) + +--- + +## withOptions() + +```php +function withOptions(array $options = []): MongoDB\Database +``` + +Returns a clone of this database with different options. + +### Supported Options + +readConcern (MongoDB\Driver\ReadConcern) +: The default read concern to use for database operations and selected + collections. Defaults to the Manager's read concern. + +readPreference (MongoDB\Driver\ReadPreference) +: The default read preference to use for database operations and selected + collections. Defaults to the Manager's read preference. + +typeMap (array) +: Default type map for cursors and BSON documents. + +writeConcern (MongoDB\Driver\WriteConcern) +: The default write concern to use for database operations and selected + collections. Defaults to the Manager's write concern. + +### See Also + + * [MongoDB\Database::__construct()](#__construct) diff --git a/source/tutorial/commands.md b/source/tutorial/commands.md new file mode 100644 index 00000000..128d4700 --- /dev/null +++ b/source/tutorial/commands.md @@ -0,0 +1,125 @@ +# Database Commands + +While the library provides helpers for some common database commands, it is far +from an [exhaustive list][command-list]. This page will demonstrate how to +execute arbitrary commands on the MongoDB server via the +[Database::command()][command] method and access their results. + +[command-list]: https://docs.mongodb.org/manual/reference/command/ +[command]: ../classes/database.md#command + +## Single Result Documents + +The [command()][command] method always returns a +[MongoDB\Driver\Cursor][cursor]. Unless otherwise stated in the MongoDB +documentation, command responses are returned as a single document. Reading such +a result will require iterating on the cursor and accessing the first (and only) +document, like so: + +[cursor]: http://php.net/mongodb-driver-cursor + +``` +demo; + +$cursor = $database->command(['ping' => 1]); + +var_dump($cursor->toArray()[0]); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#2 (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["ok"]=> + float(1) + } +} +``` + +## Iterable Results as a Command Cursor + +Some commands, such as [aggregate][aggregate] with the "cursor" option, may +return their results via an iterable command cursor. In this case, the returned +[MongoDB\Driver\Cursor][cursor] may be iterated in the same manner as one might +do with a [Collection::find()][find] query, like so: + +[aggregate]: http://docs.mongodb.org/manual/reference/command/aggregate/ +[find]: ../classes/collection.md#find + +``` +demo; + +$cursor = $database->command([ + 'aggregate' => 'zips', + 'pipeline' => [ + ['$group' => ['_id' => '$state', 'count' => ['$sum' => 1]]], + ['$sort' => ['count' => -1]], + ['$limit' => 5], + ], + 'cursor' => new \stdClass, +]); + +foreach ($cursor as $state) { + printf("%s has %d zip codes\n", $state['_id'], $state['count']); +} +``` + +The above example would output something similar to: + +``` +TX has 1671 zip codes +NY has 1595 zip codes +CA has 1516 zip codes +PA has 1458 zip codes +IL has 1237 zip codes +``` + +## Specifying a Read Preference + +Some commands, such as [createUser][createUser], can only be executed on a +primary server. Command helpers in the library, such as +[Database::drop()][drop], know to apply their own read preference if necessary; +however, [command()][command] is a generic method and has no special knowledge. +It defaults to the read preference of the Database object on which it is +invoked. In such cases, it can be helpful to explicitly specify the correct read +preference, like so: + +[createUser]: https://docs.mongodb.org/manual/reference/command/createUser/ +[drop]: ../classes/database.md#drop + +``` +demo; + +$cursor = $db->command( + [ + 'createUser' => 'username', + 'pwd' => 'password', + 'roles' => ['readWrite'], + ], + [ + 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY), + ] +); + +var_dump($cursor->toArray()[0]); +``` + +The above example would output something similar to: + +``` +object(MongoDB\Model\BSONDocument)#8 (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["ok"]=> + float(1) + } +} +``` From f5af2f530751f146159f1070537a6d9a369a842d Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 24 Mar 2016 17:02:13 -0400 Subject: [PATCH 016/321] Add Client API documentation --- source/classes/client.md | 327 ++++++++++++++++++++++++++++++++------- 1 file changed, 275 insertions(+), 52 deletions(-) diff --git a/source/classes/client.md b/source/classes/client.md index 5fa72647..98249aa2 100644 --- a/source/classes/client.md +++ b/source/classes/client.md @@ -1,86 +1,149 @@ # MongoDB\Client -`MongoDB\Client` serves as an entry point for the library and driver. It is -constructed with the same arguments as the driver's `MongoDB\Driver\Manager` -class, which it composes. Additional reference may be found in the -[`MongoDB\Driver\Manager::__construct`](http://php.net/manual/en/mongodb-driver-manager.construct.php]) -and -[Connection String](https://docs.mongodb.org/manual/reference/connection-string/) -documentation. +The MongoDB\Client class serves as an entry point for the library. It is the +preferred class for connecting to a MongoDB server or cluster of servers and +serves as a gateway for accessing individual databases and collections. It is +analogous to the driver's [MongoDB\Driver\Manager][manager] class, which it +composes. +[manager]: http://php.net/mongodb-driver-manager + +--- + +## __construct() + +```php +function __construct($uri = 'mongodb://localhost:27017', array $uriOptions = [], array $driverOptions = []) ``` -/* By default, the driver connects to mongodb://localhost:27017 */ -$client = new MongoDB\Client; -/* Any URI options will be merged into the URI string */ +Constructs a new Client instance. + +Additional URI options may be provided as the second argument and will take +precedence over any like options present in the URI string (e.g. authentication +credentials, query string parameters). + +Driver options may be provided as the third argument. In addition to any options +supported by the extension, this library allows you to specify a default +type map to apply to the cursors it creates. A more thorough description of type +maps may be found in the driver's [Persistence documentation][typemap]. + +[typemap]: http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps + +### Supported URI Options + +See [MongoDB\Driver\Manager::__construct()][manager-construct] and the +[MongoDB manual][connection-string]. + +[manager-construct]: http://php.net/manual/en/mongodb-driver-manager.construct.php +[connection-string]: https://docs.mongodb.org/manual/reference/connection-string/ + +### Supported Driver Options + +typeMap (array) +: Default type map for cursors and BSON documents. + +### Example + +By default, the driver connects to a standalone server on localhost via port +27017. The following example demonstrates how to connect to a replica set. +Additionally, it demonstrates a replica set with a custom read preference: + +``` + 'secondaryPreferred'] + [ + 'readPreference' => 'secondaryPreferred' + ] ); ``` -Driver options may be provided as the third argument. In addition to options -supported by the extension, the PHP library allows you to specify a default -type map to apply to the cursors it creates. A more thorough description of type -maps may be found in the driver's -[Persistence documentation](http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps). +By default, the library will unserialize BSON documents and arrays as +MongoDB\Model\BSONDocument and MongoDB\Model\BSONArray objects, respectively. +The following example demonstrates how to have the library unserialize +everything as a PHP array, as was done in the legacy +[mongo extension][ext-mongo]: + +[ext-mongo]: http://php.net/mongo ``` -/* This example instructs the library to unserialize root and embedded BSON - * documents as PHP arrays, like the legacy driver (i.e. ext-mongo). */ -$client = new MongoDB\Client(null, [], [ - 'typeMap' => ['root' => 'array', 'document' => 'array'], + ['root' => 'array', 'document' => 'array', 'array' => 'array']] ); ``` -By default, the library will unserialize BSON documents and arrays as -`MongoDB\Model\BSONDocument` and `MongoDB\Model\BSONArray` objects, -respectively. Each of these model classes extends PHP's -[`ArrayObject`](http://php.net/arrayobject) class and implements the driver's -[`MongoDB\BSON\Serializable`](http://php.net/mongodb-bson-serializable) and -[`MongoDB\BSON\Unserializable`](http://php.net/mongodb-bson-unserializable) -interfaces. +### See Also + + * [MongoDB\Driver\Manager::__construct()][manager-construct] + * [MongoDB Manual: Connection String][connection-string] -## Selecting Databases and Collections +--- -The Client class provides methods for creating Database or Collection instances -(using its internal Manager instance). When selecting a Database or Collection, -the child will inherit options (e.g. read preference, type map) from the Client. -New options may also be provided to the `selectDatabase()` and -`selectCollection()` methods. +## __get() +```php +function __get($databaseName): MongoDB\Database ``` + +Select a database. + +The Database will inherit options (e.g. read preference, type map) from the +Client object. Use [selectDatabase()](#selectdatabase) to override any options. + +**Note:** databases whose names contain special characters (e.g. "-") may be +selected with complex syntax (e.g. `$client->{"that-database"}`) or +[selectDatabase()](#selectdatabase). + +### Example + +The following example selects the "demo" and "another-app" databases: + +``` +selectDatabase('demo'); +$demo = $client->demo; +$anotherApp = $client->{'another-app'}; +``` -/* Select the "demo.users" collection */ -$collection = $client->selectCollection('demo', 'users'); +### See Also + + * [MongoDB\Client::selectDatabase()](#selectdatabase) + * [PHP Manual: Property Overloading](http://php.net/oop5.overloading#object.get) + +--- -/* selectDatabase() and selectCollection() also take an options array, which can - * override any options inherited from the Client. */ -$db = $client->selectDatabase('demo', [ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), -]); +## dropDatabase -/* The property accessor may also be used to select a database without - * specifying additional options. PHP's complex syntax may be used for selecting - * databases whose names contain special characters (e.g. "-"). */ -$db = $client->demo; -$db = $client->{'another-app'}; +```php +function dropDatabase($databaseName, array $options = []): array|object ``` -## Database Management +Drop a database. Returns the command result document. -The Client class has several methods for managing databases. +### Supported Options -### Dropping Databases +typeMap (array) +: Type map for BSON deserialization. This will only be used for the returned + command result document. + +### Example + +The following example drops the "demo" database: ``` +dropDatabase('demo'); + var_dump($result); ``` @@ -98,12 +161,36 @@ object(MongoDB\Model\BSONDocument)#8 (1) { } ``` -### Enumerating Databases +### See Also + + * [MongoDB\Database::drop()](database.md#drop) + * [MongoDB Manual: dropDatabase command](http://docs.mongodb.org/manual/reference/command/dropDatabase/) + +--- + +## listDatabases() +```php +function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator ``` + +Returns information for all database on the server. Elements in the returned +iterator will be MongoDB\Model\DatabaseInfo objects. + +### Supported Options + +maxTimeMS (integer) +: The maximum amount of time to allow the query to run. + +### Example + +The following example lists all databases on the server: + +``` +listDatabases() as $databaseInfo) { var_dump($databaseInfo); } @@ -129,3 +216,139 @@ object(MongoDB\Model\DatabaseInfo)#7 (3) { bool(false) } ``` + +### See Also + + * [MongoDB Manual: listDatabases command](http://docs.mongodb.org/manual/reference/command/listDatabases/) + +--- + +## selectCollection() + +```php +function selectCollection($databaseName, $collectionName, array $options = []): MongoDB\Collection +``` + +Select a collection on the server. + +The Collection will inherit options (e.g. read preference, type map) from the +Client object unless otherwise specified. + +### Supported Options + +readConcern (MongoDB\Driver\ReadConcern) +: The default read concern to use for collection operations. Defaults to the + Client's read concern. + +readPreference (MongoDB\Driver\ReadPreference) +: The default read preference to use for collection operations. Defaults to + the Client's read preference. + +typeMap (array) +: Default type map for cursors and BSON documents. Defaults to the Client's + type map. + +writeConcern (MongoDB\Driver\WriteConcern) +: The default write concern to use for collection operations. Defaults to the + Client's write concern. + +### Example + +The following example selects the "demo.users" collection: + +``` +selectCollection('demo', 'users'); +``` + +The following examples selects the "demo.users" collection with a custom read +preference: + +``` +selectCollection( + 'demo', + 'users', + [ + 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), + ] +); +``` + +### See Also + + * [MongoDB\Collection::__construct()](collection.md#__construct) + * [MongoDB\Client::__get()](#__get) + + +--- + +## selectDatabase() + +```php +function selectDatabase($databaseName array $options = []): MongoDB\Collection +``` + +Select a database on the server. + +The Database will inherit options (e.g. read preference, type map) from the +Client object unless otherwise specified. + +### Supported Options + +readConcern (MongoDB\Driver\ReadConcern) +: The default read concern to use for database operations. Defaults to the + Client's read concern. + +readPreference (MongoDB\Driver\ReadPreference) +: The default read preference to use for database operations. Defaults to the + Client's read preference. + +typeMap (array) +: Default type map for cursors and BSON documents. Defaults to the Client's + type map. + +writeConcern (MongoDB\Driver\WriteConcern) +: The default write concern to use for database operations. Defaults to the + Client's write concern. + +### Example + +The following example selects the "demo" database: + +``` +selectDatabase('demo'); +``` + +The following examples selects the "demo" database with a custom read +preference: + +``` +selectDatabase( + 'demo', + [ + 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), + ] +); +``` + +### See Also + + * [MongoDB\Database::__construct()](database.md#__construct) + * [MongoDB\Client::__get()](#__get) + +--- From e2f56c2d1b08e5e1659a2eba12c0049a647880e8 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 28 Mar 2016 14:51:37 -0400 Subject: [PATCH 017/321] Clarify that Persistable is supported in methods without "typeMap" option --- source/classes/collection.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/source/classes/collection.md b/source/classes/collection.md index b5c303e6..f4b6493e 100644 --- a/source/classes/collection.md +++ b/source/classes/collection.md @@ -75,8 +75,12 @@ returned; otherwise, an ArrayIterator is returned, which wraps the "result" array from the command response document. **Note:** BSON deserialization of inline aggregation results (i.e. not using a -command cursor) does not yet support a custom type map. Support is pending new -functionality in the driver. +command cursor) does not yet support a "typeMap" options; however, classes +implementing [MongoDB\BSON\Persistable][persistable] will still be deserialized +according to the [Persistence][persistence] specification. + +[persistable]: http://php.net/mongodb-bson-persistable +[persistence]: http://php.net/manual/en/mongodb.persistence.deserialization.php ### Supported Options @@ -595,7 +599,9 @@ Finds a single document and deletes it, returning the original. The document to return may be null if no document matched the filter. **Note:** BSON deserialization of the returned document does not yet support a -custom type map. Support is pending new functionality in the driver. +"typeMap" option; however, classes implementing +[MongoDB\BSON\Persistable][persistable] will still be deserialized according to +the [Persistence][persistence] specification. ### Supported Options @@ -635,7 +641,9 @@ default, the original document is returned. Specify "returnDocument" option to return the updated document. **Note:** BSON deserialization of the returned document does not yet support a -custom type map. Support is pending new functionality in the driver. +"typeMap" option; however, classes implementing +[MongoDB\BSON\Persistable][persistable] will still be deserialized according to +the [Persistence][persistence] specification. ### Supported Options @@ -688,7 +696,9 @@ default, the original document is returned. Specify "returnDocument" option to return the updated document. **Note:** BSON deserialization of the returned document does not yet support a -custom type map. Support is pending new functionality in the driver. +"typeMap" option; however, classes implementing +[MongoDB\BSON\Persistable][persistable] will still be deserialized according to +the [Persistence][persistence] specification. ### Supported Options From 0bef6ff11d8f97c57f0bbd2c3e91dad31ca6d327 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 28 Mar 2016 16:34:45 -0400 Subject: [PATCH 018/321] Add query examples and create BSON tutorial page --- source/tutorial/bson.md | 198 ++++++++++++++++++++++++++++++++++++++++ source/tutorial/crud.md | 110 +++++++++++++--------- 2 files changed, 264 insertions(+), 44 deletions(-) create mode 100644 source/tutorial/bson.md diff --git a/source/tutorial/bson.md b/source/tutorial/bson.md new file mode 100644 index 00000000..6627dd63 --- /dev/null +++ b/source/tutorial/bson.md @@ -0,0 +1,198 @@ +# BSON Conversion + +## Deserialization + +By default, the library returns BSON documents and arrays as +MongoDB\Model\BSONDocument and MongoDB\Model\BSONArray objects, respectively. +Both of those classes extend PHP's [ArrayObject][arrayobject] class and +implement the driver's [MongoDB\BSON\Serializable][serializable] and +[MongoDB\BSON\Unserializable][unserializable] interfaces. + +[arrayobject]: http://php.net/arrayobject +[serializable]: http://php.net/mongodb-bson-serializable +[unserializable]: http://php.net/mongodb-bson-unserializable + +## Type Maps + +Most methods that read data from MongoDB support a "typeMap" option, which +allows control over how BSON is converted to PHP. Additionally, the +[MongoDB\Client][client], [MongoDB\Database][database], and +[MongoDB\Collection][collection] classes accept a "typeMap" option, which will +apply to any supporting methods and selected classes by default. + +[client]: ../classes/client.md +[database]: ../classes/database.md +[collection]: ../classes/collection.md + +The [MongoDB\Client][client], [MongoDB\Database][database], and +[MongoDB\Collection][collection] classes use the following type map by default: + +```php +[ + 'array' => 'MongoDB\Model\BSONArray', + 'document' => 'MongoDB\Model\BSONDocument', + 'root' => 'MongoDB\Model\BSONDocument', +] +``` + +## Persistable Classes + +Classes implementing [MongoDB\BSON\Persistable][persistable] will be serialized +and deserialized according to the [Persistence][persistence] specification. This +behavior occurs by default in the [driver][ext-mongodb] and does not require use +of the "typeMap" option. + +[persistable]: http://php.net/mongodb-bson-persistable +[persistence]: http://php.net/manual/en/mongodb.persistence.php +[ext-mongodb]: https://php.net/mongodb + +Given the following class definition: + +``` +id = new MongoDB\BSON\ObjectID; + $this->name = (string) $name; + + // Get current time in milliseconds since the epoch + $msec = floor(microtime(true) * 1000); + $this->createdAt = new MongoDB\BSON\UTCDateTime($msec); + } + + function bsonSerialize() + { + return [ + '_id' => $this->id, + 'name' => $this->name, + 'createdAt' => $this->createdAt, + ]; + } + + function bsonUnserialize(array $data) + { + $this->id = $data['_id']; + $this->name = $data['name']; + $this->createdAt = $data['createdAt']; + } +} +``` + +The following example constructs a Person object, inserts it into the database, +and reads it back as an object of the same type (without the use of the +"typeMap" option): + +``` +demo->persons; + +$result = $collection->insertOne(new Person('Bob')); + +$person = $collection->findOne(['_id' => $result->getInsertedId()]); + +var_dump($person); +``` + +The above example would output something similar to: + +``` +object(Person)#18 (3) { + ["id":"Person":private]=> + object(MongoDB\BSON\ObjectID)#15 (1) { + ["oid"]=> + string(24) "56fad2c36118fd2e9820cfc1" + } + ["name":"Person":private]=> + string(3) "Bob" + ["createdAt":"Person":private]=> + object(MongoDB\BSON\UTCDateTime)#17 (1) { + ["milliseconds"]=> + int(1459278531218) + } +} +``` + +The same document in the MongoDB shell might display as: + +``` +> db.persons.findOne() +{ + "_id" : ObjectId("56fad2c36118fd2e9820cfc1"), + "__pclass" : BinData(128,"UGVyc29u"), + "name" : "Bob", + "createdAt" : ISODate("2016-03-29T19:08:51.218Z") +} +``` + +**Note:** [MongoDB\BSON\Persistable][persistable] may only be used for root and +embedded BSON documents; BSON arrays are not supported. + +## Emulating the Legacy Driver + +The legacy [mongo extension][ext-mongo] returned both BSON documents and +arrays as PHP arrays. While PHP arrays are convenient to work with, this +behavior was problematic for several reasons: + +[ext-mongo]: http://php.net/mongo + + * Different BSON types could deserialize to the same PHP value (e.g. + `{"0": "foo"}` and `["foo"]`), which made it impossible to infer the + original BSON type. + + * Numerically indexed PHP arrays would be serialized as BSON documents if there + was a gap in their key sequence. Such gaps were easily (and inadvertently) + caused by unsetting a key to remove an element and forgetting to reindex the + array. + +The libary's MongoDB\Model\BSONDocument and MongoDB\Model\BSONArray classes +address these concerns by preserving the BSON type information during +serialization and deserialization; however, some users may still prefer the +legacy behavior. If desired, the following "typeMap" option can be used to have +the library return everything as a PHP array: + +``` + ['root' => 'array', 'document' => 'array', 'array' => 'array']] +); + +$document = $client->demo->zips->findOne( + ['_id' => '94301'], + ['typeMap' => ['root' => 'array', 'document' => 'array', 'array' => 'array']] +); + +var_dump($document); +``` + +The above example would output something similar to: + +``` +array(5) { + ["_id"]=> + string(5) "94301" + ["city"]=> + string(9) "PALO ALTO" + ["loc"]=> + array(2) { + [0]=> + float(-122.149685) + [1]=> + float(37.444324) + } + ["pop"]=> + int(15965) + ["state"]=> + string(2) "CA" +} +``` diff --git a/source/tutorial/crud.md b/source/tutorial/crud.md index 9eee9f38..3cd673f3 100644 --- a/source/tutorial/crud.md +++ b/source/tutorial/crud.md @@ -11,21 +11,12 @@ the [MongoDB Manual][crud]. [crud-spec]: https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst [crud]: https://docs.mongodb.org/manual/crud/ -## Querying - -### Finding One Document +## Finding One Document The [findOne()][findone] method returns the first matched document, or null if -no document was matched. By default, the library returns BSON documents and -arrays as MongoDB\Model\BSONDocument and MongoDB\Model\BSONArray objects, -respectively. Both of those classes extend PHP's [ArrayObject][arrayobject] -class and implement the driver's [MongoDB\BSON\Serializable][serializable] and -[MongoDB\BSON\Unserializable][unserializable] interfaces. +no document was matched. [findone]: ../classes/collection.md#findone -[arrayobject]: http://php.net/arrayobject -[serializable]: http://php.net/mongodb-bson-serializable -[unserializable]: http://php.net/mongodb-bson-unserializable ``` demo->zips; + +$cursor = $collection->find(['city' => 'JERSEY CITY', 'state' => 'NJ']); + +foreach ($cursor as $document) { + echo $document['_id'], "\n"; +} +``` + +The above example would output something similar to: + +``` +07302 +07304 +07305 +07306 +07307 +07310 +``` + +## Query Projection + +Queries may include a [projection][projection] to include or exclude specific +fields in the returned documents. The following example selects only the +population field for the zip code: + +[projection]: https://docs.mongodb.org/manual/tutorial/project-fields-from-query-results/ -[ext-mongo]: http://php.net/mongo ``` demo->zips; $document = $collection->findOne( - ['_id' => '94301'], - ['typeMap' => ['root' => 'array', 'document' => 'array', 'array' => 'array']] + ['_id' => '10011'], + ['projection' => ['pop => 1']] ); var_dump($document); @@ -88,39 +113,37 @@ var_dump($document); The above example would output something similar to: ``` -array(5) { - ["_id"]=> - string(5) "94301" - ["city"]=> - string(9) "PALO ALTO" - ["loc"]=> +object(MongoDB\Model\BSONDocument)#12 (1) { + ["storage":"ArrayObject":private]=> array(2) { - [0]=> - float(-122.149685) - [1]=> - float(37.444324) + ["_id"]=> + string(5) "10011" + ["pop"]=> + int(46560) } - ["pop"]=> - int(15965) - ["state"]=> - string(2) "CA" } ``` -### Finding Many Documents +**Note:** the "_id" field is included by default unless explicitly excluded. -The [find()][find] method returns a [MongoDB\Driver\Cursor][cursor] object, -which may be iterated upon to access all matched documents. +## Limit, Sort, and Skip Options -[find]: ../classes/collection.md#find -[cursor]: http://php.net/mongodb-driver-cursor +In addition to criteria, queries may take options to limit, sort, and skip +returned documents. The following example queries for the five most populous +zip codes in the United States: ``` demo->zips; -$cursor = $collection->find(['city' => 'JERSEY CITY', 'state' => 'NJ']); +$cursor = $collection->find( + [], + [ + 'limit' => 5, + 'sort' => ['pop' => -1], + ] +); foreach ($cursor as $document) { echo $document['_id'], "\n"; @@ -130,10 +153,9 @@ foreach ($cursor as $document) { The above example would output something similar to: ``` -07302 -07304 -07305 -07306 -07307 -07310 +60623: CHICAGO, IL +11226: BROOKLYN, NY +10021: NEW YORK, NY +10025: NEW YORK, NY +90201: BELL GARDENS, CA ``` From cceb47f020dae1880867ec707022291b64caeead Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 29 Mar 2016 14:54:01 -0400 Subject: [PATCH 019/321] Use listCollections for command cursor example, move aggregate to CRUD --- source/classes/collection.md | 1 + source/tutorial/commands.md | 36 ++++++++++++++--------------- source/tutorial/crud.md | 45 ++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 19 deletions(-) diff --git a/source/classes/collection.md b/source/classes/collection.md index f4b6493e..a79956c2 100644 --- a/source/classes/collection.md +++ b/source/classes/collection.md @@ -131,6 +131,7 @@ useCursor (boolean) ### See Also * [MongoDB Manual: aggregate command](http://docs.mongodb.org/manual/reference/command/aggregate/) + * [MongoDB Manual: Aggregation Pipeline](https://docs.mongodb.org/manual/core/aggregation-pipeline/) --- diff --git a/source/tutorial/commands.md b/source/tutorial/commands.md index 128d4700..7e860af3 100644 --- a/source/tutorial/commands.md +++ b/source/tutorial/commands.md @@ -42,12 +42,12 @@ object(MongoDB\Model\BSONDocument)#2 (1) { ## Iterable Results as a Command Cursor -Some commands, such as [aggregate][aggregate] with the "cursor" option, may -return their results via an iterable command cursor. In this case, the returned +Some commands, such as [listCollections][listcollections], return their results +via an iterable command cursor. In this case, the returned [MongoDB\Driver\Cursor][cursor] may be iterated in the same manner as one might do with a [Collection::find()][find] query, like so: -[aggregate]: http://docs.mongodb.org/manual/reference/command/aggregate/ +[listcollections]: http://docs.mongodb.org/manual/reference/command/listCollections/ [find]: ../classes/collection.md#find ``` @@ -55,31 +55,29 @@ do with a [Collection::find()][find] query, like so: $database = (new MongoDB\Client)->demo; -$cursor = $database->command([ - 'aggregate' => 'zips', - 'pipeline' => [ - ['$group' => ['_id' => '$state', 'count' => ['$sum' => 1]]], - ['$sort' => ['count' => -1]], - ['$limit' => 5], - ], - 'cursor' => new \stdClass, -]); +$cursor = $database->command(['listCollections' => 1]); -foreach ($cursor as $state) { - printf("%s has %d zip codes\n", $state['_id'], $state['count']); +foreach ($cursor as $collection) { + echo $collection['name'], "\n"; } ``` The above example would output something similar to: ``` -TX has 1671 zip codes -NY has 1595 zip codes -CA has 1516 zip codes -PA has 1458 zip codes -IL has 1237 zip codes +persons +posts +zips ``` +**Note:** at the protocol level, commands that support a cursor actually return +a single result document with the essential ingredients for constructing the +command cursor (i.e. the cursor's ID, namespace, and first batch of results); +however, the driver's [executeCommand()][executecommand] method already detects +such a result and constructs the iterable command cursor for us. + +[executecommand]: http://php.net/manual/en/mongodb-driver-manager.executecommand.php + ## Specifying a Read Preference Some commands, such as [createUser][createUser], can only be executed on a diff --git a/source/tutorial/crud.md b/source/tutorial/crud.md index 3cd673f3..af09d5c8 100644 --- a/source/tutorial/crud.md +++ b/source/tutorial/crud.md @@ -159,3 +159,48 @@ The above example would output something similar to: 10025: NEW YORK, NY 90201: BELL GARDENS, CA ``` + +## Aggregation + +The [Aggregation Framework][aggregation] may be used to issue complex queries +that filter, transform, and group collection data. The [aggregate()][aggregate] +method returns a [Traversable][traversable] object, which may be iterated +upon to access the results of an aggregation pipeline. + +[aggregation]: https://docs.mongodb.org/manual/core/aggregation-pipeline/ +[aggregate]: ../classes/collection.md#aggregate +[traversable]: http://php.net/traversable + +``` +demo->zips; + +$cursor = $collection->aggregate([ + ['$group' => ['_id' => '$state', 'count' => ['$sum' => 1]]], + ['$sort' => ['count' => -1]], + ['$limit' => 5], +]); + +foreach ($cursor as $state) { + printf("%s has %d zip codes\n", $state['_id'], $state['count']); +} +``` + +The above example would output something similar to: + +``` +TX has 1671 zip codes +NY has 1595 zip codes +CA has 1516 zip codes +PA has 1458 zip codes +IL has 1237 zip codes +``` + +**Note:** [aggregate()][aggregate] is documented as returning a +[Traversable][traversable] object because the [aggregate][aggregate-cmd] command +may return its results inline (i.e. a single result document's array field, +which the library will package as a PHP iterator) or via a command cursor (i.e. +[MongoDB\Driver\Cursor][cursor]). + +[aggregate-cmd]: (http://docs.mongodb.org/manual/reference/command/aggregate/) From 58cbccf00a7ad338e12f02e1a5a602a68edb85ed Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 30 Mar 2016 14:52:50 -0400 Subject: [PATCH 020/321] Use reference-style links in Upgrade Guide --- source/upgrade-guide.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/source/upgrade-guide.md b/source/upgrade-guide.md index cd78ac64..1dbe6ee1 100644 --- a/source/upgrade-guide.md +++ b/source/upgrade-guide.md @@ -83,7 +83,9 @@ between [updating specific fields][update] and [MongoDB\Collection][collection] does not yet have a helper method for the [group][group] command; however, that is planned in [PHPLIB-177][jira-group]. The following example demonstrates how to execute a group command using -[Database::command()](classes/database.md#command): +[Database::command()][command]: + +[command]: classes/database.md#command ```php toArray()[0]; [MongoDB\Collection][collection] does not yet have a helper method for the [mapReduce][mapReduce] command; however, that is planned in [PHPLIB-53][jira-mapreduce]. The following example demonstrates how to execute a -mapReduce command using [Database::command()](classes/database.md#command): +mapReduce command using [Database::command()][command]: ```php Date: Wed, 30 Mar 2016 14:57:32 -0400 Subject: [PATCH 021/321] Discuss how inserted IDs may be accessed in Upgrade Guide --- source/upgrade-guide.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/source/upgrade-guide.md b/source/upgrade-guide.md index 1dbe6ee1..2f638d09 100644 --- a/source/upgrade-guide.md +++ b/source/upgrade-guide.md @@ -157,6 +157,32 @@ insert or replace the document and handle the returned InsertResult or UpdateResult, respectively. This also helps avoid inadvertent and potentially dangerous [full-document replacements][replace]. +### Accessing IDs of Inserted Documents + +In the legacy driver, [MongoCollection::insert()][insert], +[MongoCollection::batchInsert()][batchinsert], and +[MongoCollection::save()][save] (when inserting) would modify their input +argument by injecting an "_id" key containing the generated ObjectId (i.e. +[MongoId][mongoid] object). This behavior was a bit of a hack, as it did not +rely on the argument being [passed by reference][byref]; it directly modified +memory through the extension API and could not be implemented in PHP userland. +As such, it is no longer done in the new driver and library. + +[insert]: http://php.net/manual/en/mongocollection.insert.php +[batchinsert]: http://php.net/manual/en/mongocollection.batchinsert.php +[mongoid]: http://php.net/manual/en/class.mongoid.php +[byref]: http://php.net/manual/en/language.references.pass.php + +IDs of inserted documents (whether generated or not) may be accessed through the +result objects returned by the write methods: + + * MongoDB\InsertOneResult::getInsertedId() for [insertOne()][insertone] + * MongoDB\InsertManyResult::getInsertedIds() for [insertMany()][insertmany] + * MongoDB\BulkWriteResult::getInsertedIds() for [bulkWrite()][bulkwrite] + +[insertmany]: classes/collection.md#insertmany +[bulkwrite]: classes/collection.md#bulkwrite + ### MongoWriteBatch The legacy driver's [MongoWriteBatch][batch] classes have been replaced with a @@ -165,4 +191,3 @@ allowed bulk operations of the same time, the new method allows operations to be mixed (e.g. inserts, updates, and deletes). [batch]: http://php.net/manual/en/class.mongowritebatch.php -[bulkwrite]: classes/collection.md#bulkwrite From 777f12f5ad06e0789fcff164bf5ee8590333318c Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 2 Jun 2016 16:56:00 -0400 Subject: [PATCH 022/321] Add write method examples to CRUD tutorial --- source/tutorial/crud.md | 410 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 409 insertions(+), 1 deletion(-) diff --git a/source/tutorial/crud.md b/source/tutorial/crud.md index af09d5c8..f52be365 100644 --- a/source/tutorial/crud.md +++ b/source/tutorial/crud.md @@ -11,6 +11,23 @@ the [MongoDB Manual][crud]. [crud-spec]: https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst [crud]: https://docs.mongodb.org/manual/crud/ +This page covers the following common use cases: + + * Querying for [one](#finding-one-document) or [many](#finding-many-documents) + documents at a time + * [Projecting](#query-projection) fields in a query + * Applying [limit, sort, and skip options](#limit-sort-and-skip-options) to a + query + * Inserting [one](#inserting-one-document) or [many](#inserting-many-documents) + documents at a time + * Updating [one](#updating-one-document) or [many](#updating-many-documents) + documents at a time + * [Replacing](#replacing-a-document) a document + * [Upserting](#upserting-a-document) a document + * Deleting [one](#deleting-one-document) or [many](#deleting-many-documents) + documents at a time + * [Aggregating](#aggregating-documents) documents + ## Finding One Document The [findOne()][findone] method returns the first matched document, or null if @@ -160,7 +177,398 @@ The above example would output something similar to: 90201: BELL GARDENS, CA ``` -## Aggregation +## Inserting One Document + +The [insertOne()][insertone] method may be used to insert a single document. +This method returns an instance of `MongoDB\InsertOneResult`, which may be used +to access the ID of the inserted document. Note that if a document does not +contain an `_id` field at the time of insertion, the driver will generate a +`MongoDB\BSON\ObjectID` to use as its ID. + +[insertone]: ../classes/collection.md#insertone + +``` +demo->users; +$collection->drop(); + +$insertOneResult = $collection->insertOne(['name' => 'Bob']); + +printf("Inserted %d document(s)\n", $insertOneResult->getInsertedCount()); +var_dump($insertOneResult->getInsertedId()); +``` + +The above example would output something similar to: + +``` +Inserted 1 document(s) +object(MongoDB\BSON\ObjectID)#10 (1) { + ["oid"]=> + string(24) "5750905b6118fd170565aa81" +} +``` + +The following example inserts a document with an ID. Note that if an ID is not +unique for the collection, the insert will fail due to a duplicate key error. + +``` +demo->users; +$collection->drop(); + +$insertOneResult = $collection->insertOne(['_id' => 1, 'name' => 'Alice']); + +printf("Inserted %d document(s)\n", $insertOneResult->getInsertedCount()); +var_dump($insertOneResult->getInsertedId()); +``` + +The above example would output: + +``` +Inserted 1 document(s) +int(1) +``` + +## Inserting Many Documents + +The [insertMany()][insertmany] method may be used to insert multiple documents +at a time. This method returns an instance of `MongoDB\InsertManyResult`, which +may be used to access the IDs of the inserted documents. + +[insertmany]: ../classes/collection.md#insertmany + +``` +demo->users; +$collection->drop(); + +$insertManyResult = $collection->insertMany([ + ['name' => 'Bob'], + ['_id' => 1, 'name' => 'Alice'], +]); + +printf("Inserted %d document(s)\n", $insertManyResult->getInsertedCount()); +var_dump($insertManyResult->getInsertedIds()); +``` + +The above example would output something similar to: + +``` +Inserted 2 document(s) +array(2) { + [0]=> + object(MongoDB\BSON\ObjectID)#10 (1) { + ["oid"]=> + string(24) "5750927b6118fd1ed64eb141" + } + [1]=> + int(1) +} +``` + +## Updating One Document + +The [updateOne()][updateone] method may be used to update a single document +matching a filter. This method returns an instance of `MongoDB\UpdateResult`, +which may be used to access statistics about the update operation. + +[updateone]: ../classes/collection.md#updateone + +This method has two required parameters: a query filter and an update document. +The query filter is similar to what might be provided to [find()][find]. The +update document consists of one or more [update operators][updateops]. + +[updateops]: https://docs.mongodb.com/manual/reference/operator/update/ + +``` +demo->users; +$collection->drop(); + +$collection->insertOne(['name' => 'Bob', 'state' => 'ny']); +$collection->insertOne(['name' => 'Alice', 'state' => 'ny']); +$updateResult = $collection->updateOne( + ['state' => 'ny'], + ['$set' => ['country' => 'us']] +); + +printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); +printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); +``` + +The above example would output something similar to: + +``` +Matched 1 document(s) +Modified 1 document(s) +``` + +Note that it is possible for a document to match the filter but not be modified +by an update: + +``` +demo->users; +$collection->drop(); + +$collection->insertOne(['name' => 'Bob', 'state' => 'ny']); +$updateResult = $collection->updateOne( + ['name' => 'Bob'], + ['$set' => ['state' => 'ny']] +); + +printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); +printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); +``` + +The above example would output something similar to: + +``` +Matched 1 document(s) +Modified 0 document(s) +``` + +## Updating Many Documents + +The [updateMany()][updatemany] method may be used to update multiple documents +at a time. This method returns an instance of `MongoDB\UpdateResult`, which may +be used to access statistics about the update operation. + +[updatemany]: ../classes/collection.md#updatemany + +This method has two required parameters: a query filter and an update document. +The query filter is similar to what might be provided to [find()][find]. The +update document consists of one or more [update operators][updateops]. + +``` +demo->users; +$collection->drop(); + +$collection->insertOne(['name' => 'Bob', 'state' => 'ny', 'country' => 'us']); +$collection->insertOne(['name' => 'Alice', 'state' => 'ny']); +$collection->insertOne(['name' => 'Sam', 'state' => 'ny']); +$updateResult = $collection->updateMany( + ['state' => 'ny'], + ['$set' => ['country' => 'us']] +); + +printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); +printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); +``` + +The above example would output something similar to: + +``` +Matched 3 document(s) +Modified 2 document(s) +``` + +## Replacing a Document + +The [replaceOne()][replaceone] method may be used to replace a single document +matching a filter. This method returns an instance of `MongoDB\UpdateResult`, +which may be used to access statistics about the replacement operation. + +[replaceone]: ../classes/collection.md#replaceone + +This method has two required parameters: a query filter and a replacement +document. The query filter is similar to what might be provided to +[find()][find]. The replacement document will be used to overwrite the matched +document (excluding its ID, which is immutable) and must not contain +[update operators][updateops]. + +Note that the very nature of a replacement operation makes it easy to +inadvertently overwrite or delete fields in a document. When possible, users +should consider updating individual fields with [updateOne()][updateone] or +[updateMany()][updatemany]. + +``` +demo->users; +$collection->drop(); + +$collection->insertOne(['name' => 'Bob', 'state' => 'ny']); +$updateResult = $collection->replaceOne( + ['name' => 'Bob'], + ['name' => 'Robert', 'state' => 'ca'] +); + +printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); +printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); +``` + +The above example would output something similar to: + +``` +Matched 1 document(s) +Modified 1 document(s) +``` + +Note that it is possible for a document to match the filter but not be modified +by a replacement (i.e. the matched document and replacement may be the same). + +## Upserting a Document + +An upsert is a variation of an update or replace operation, whereby a new +document is inserted if the query filter does not match an existing document. +An upsert may be specified via the `upsert` option for [updateOne()][updateone], +[updateMany()][updatemany], or [replaceOne()][replaceone]. The logic by which +the inserted document is created is discussed in the [MongoDB manual][upsert]. + +[upsert]: https://docs.mongodb.com/manual/reference/method/db.collection.update/#upsert-parameter + +If a document has been upserted, its ID will be accessible via +`MongoDB\UpdateResult::getUpsertedId()`. + +The following example demonstrates an upsert via [updateOne()][updateone]: + +``` +demo->users; +$collection->drop(); + +$updateResult = $collection->updateOne( + ['name' => 'Bob'], + ['$set' => ['state' => 'ny']], + ['upsert' => true] +); + +printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); +printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); +var_dump($collection->findOne(['_id' => $updateResult->getUpsertedId()])); +``` + +The above example would output something similar to: + +``` +Matched 0 document(s) +Modified 0 document(s) +object(MongoDB\Model\BSONDocument)#16 (1) { + ["storage":"ArrayObject":private]=> + array(3) { + ["_id"]=> + object(MongoDB\BSON\ObjectID)#15 (1) { + ["oid"]=> + string(24) "57509c4406d7241dad86e7c3" + } + ["name"]=> + string(3) "Bob" + ["state"]=> + string(2) "ny" + } +} +``` + +The following example demonstrates an upsert via [replaceOne()][replaceone]: + +``` +demo->users; +$collection->drop(); + +$updateResult = $collection->replaceOne( + ['name' => 'Bob'], + ['name' => 'Alice', 'state' => 'ny'], + ['upsert' => true] +); + +printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); +printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); +var_dump($collection->findOne(['_id' => $updateResult->getUpsertedId()])); +``` + +The above example would output something similar to: + +``` +Matched 0 document(s) +Modified 0 document(s) +object(MongoDB\Model\BSONDocument)#16 (1) { + ["storage":"ArrayObject":private]=> + array(3) { + ["_id"]=> + object(MongoDB\BSON\ObjectID)#15 (1) { + ["oid"]=> + string(24) "57509c6606d7241dad86e7c4" + } + ["name"]=> + string(5) "Alice" + ["state"]=> + string(2) "ny" + } +} +``` + +## Deleting One Document + +The [deleteOne()][deleteone] method may be used to delete a single document +matching a filter. This method returns an instance of `MongoDB\DeleteResult`, +which may be used to access statistics about the delete operation. + +[deleteone]: ../classes/collection.md#deleteone + +This method has two required parameters: a query filter. The query filter is +similar to what might be provided to [find()][find]. + +``` +demo->users; +$collection->drop(); + +$collection->insertOne(['name' => 'Bob', 'state' => 'ny']); +$collection->insertOne(['name' => 'Alice', 'state' => 'ny']); +$deleteResult = $collection->deleteOne(['state' => 'ny']); + +printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); +``` + +The above example would output something similar to: + +``` +Deleted 1 document(s) +``` + +## Deleting Many Documents + +The [deleteMany()][deletemany] method may be used to delete multiple documents +at a time. This method returns an instance of `MongoDB\DeleteResult`, which may +be used to access statistics about the delete operation. + +[deletemany]: ../classes/collection.md#deletemany + +This method has two required parameters: a query filter. The query filter is +similar to what might be provided to [find()][find]. + +``` +demo->users; +$collection->drop(); + +$collection->insertOne(['name' => 'Bob', 'state' => 'ny']); +$collection->insertOne(['name' => 'Alice', 'state' => 'ny']); +$deleteResult = $collection->deleteMany(['state' => 'ny']); + +printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); +``` + +The above example would output something similar to: + +``` +Deleted 2 document(s) +``` + +## Aggregating Documents The [Aggregation Framework][aggregation] may be used to issue complex queries that filter, transform, and group collection data. The [aggregate()][aggregate] From 17b95e8c47dc20a2075a04399862e7ee643bdbf7 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Fri, 3 Jun 2016 13:49:01 -0400 Subject: [PATCH 023/321] Note that non-arrays may also be used as documents --- source/tutorial/crud.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/tutorial/crud.md b/source/tutorial/crud.md index f52be365..813d99cd 100644 --- a/source/tutorial/crud.md +++ b/source/tutorial/crud.md @@ -28,6 +28,21 @@ This page covers the following common use cases: documents at a time * [Aggregating](#aggregating-documents) documents +Note that the use of arrays to express documents in the following examples was +done for simplicity. The driver will also accept instances of stdClass or +[MongoDB\BSON\Serializable][serializable]) for these arguments (e.g. query +filters, inserted documents, update documents). + +[serializable]: http://php.net/mongodb-bson-serializable + +Documents destined for database storage (e.g. insert documents, replacement +documents, embedded documents included in an update operation) may also be +instances of [MongoDB\BSON\Persistable][persistable]. See +[Persistable Classes][persistable-classes] for more information. + +[persistable]: http://php.net/mongodb-bson-persistable +[persistable-classes]: bson.md#persistable-classes + ## Finding One Document The [findOne()][findone] method returns the first matched document, or null if From 25715457fff31d4567446f363f5ee98367cd55c1 Mon Sep 17 00:00:00 2001 From: Jesper Wallin Date: Mon, 23 May 2016 13:36:56 +0200 Subject: [PATCH 024/321] Fix typo in query projection example --- source/tutorial/crud.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tutorial/crud.md b/source/tutorial/crud.md index 813d99cd..eef92fc8 100644 --- a/source/tutorial/crud.md +++ b/source/tutorial/crud.md @@ -136,7 +136,7 @@ $collection = (new MongoDB\Client)->demo->zips; $document = $collection->findOne( ['_id' => '10011'], - ['projection' => ['pop => 1']] + ['projection' => ['pop' => 1]] ); var_dump($document); From de910665c717c177e912457b33eb7c6a4c34ed67 Mon Sep 17 00:00:00 2001 From: Metod Date: Thu, 14 Jul 2016 14:10:42 +0200 Subject: [PATCH 025/321] Fixed a typo --- source/upgrade-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/upgrade-guide.md b/source/upgrade-guide.md index 2f638d09..14f21865 100644 --- a/source/upgrade-guide.md +++ b/source/upgrade-guide.md @@ -3,7 +3,7 @@ The MongoDB PHP Library and underlying [mongodb extension][ext-mongodb] have notable API differences from the legacy [mongo extension][ext-mongo]. This page will attempt to summarize those differences for the benefit of those upgrading -rom the legacy driver. +from the legacy driver. Additionally, a community-developed [mongo-php-adapter][adapter] library exists, which implements the [mongo extension][ext-mongo] API using this library and the From 14c843961de3d1c491bdb054e6c5a77573833f03 Mon Sep 17 00:00:00 2001 From: Allison Moore Date: Tue, 9 Aug 2016 14:12:23 -0400 Subject: [PATCH 026/321] Remove Markdown documentation (i.e gh-pages) --- source/classes/client.md | 354 ------------ source/classes/collection.md | 969 -------------------------------- source/classes/database.md | 478 ---------------- source/getting-started.md | 50 -- source/index.md | 41 -- source/tutorial/bson.md | 198 ------- source/tutorial/commands.md | 123 ---- source/tutorial/crud.md | 629 --------------------- source/tutorial/example-data.md | 45 -- source/tutorial/indexes.md | 122 ---- source/upgrade-guide.md | 193 ------- 11 files changed, 3202 deletions(-) delete mode 100644 source/classes/client.md delete mode 100644 source/classes/collection.md delete mode 100644 source/classes/database.md delete mode 100644 source/getting-started.md delete mode 100644 source/index.md delete mode 100644 source/tutorial/bson.md delete mode 100644 source/tutorial/commands.md delete mode 100644 source/tutorial/crud.md delete mode 100644 source/tutorial/example-data.md delete mode 100644 source/tutorial/indexes.md delete mode 100644 source/upgrade-guide.md diff --git a/source/classes/client.md b/source/classes/client.md deleted file mode 100644 index 98249aa2..00000000 --- a/source/classes/client.md +++ /dev/null @@ -1,354 +0,0 @@ -# MongoDB\Client - -The MongoDB\Client class serves as an entry point for the library. It is the -preferred class for connecting to a MongoDB server or cluster of servers and -serves as a gateway for accessing individual databases and collections. It is -analogous to the driver's [MongoDB\Driver\Manager][manager] class, which it -composes. - -[manager]: http://php.net/mongodb-driver-manager - ---- - -## __construct() - -```php -function __construct($uri = 'mongodb://localhost:27017', array $uriOptions = [], array $driverOptions = []) -``` - -Constructs a new Client instance. - -Additional URI options may be provided as the second argument and will take -precedence over any like options present in the URI string (e.g. authentication -credentials, query string parameters). - -Driver options may be provided as the third argument. In addition to any options -supported by the extension, this library allows you to specify a default -type map to apply to the cursors it creates. A more thorough description of type -maps may be found in the driver's [Persistence documentation][typemap]. - -[typemap]: http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps - -### Supported URI Options - -See [MongoDB\Driver\Manager::__construct()][manager-construct] and the -[MongoDB manual][connection-string]. - -[manager-construct]: http://php.net/manual/en/mongodb-driver-manager.construct.php -[connection-string]: https://docs.mongodb.org/manual/reference/connection-string/ - -### Supported Driver Options - -typeMap (array) -: Default type map for cursors and BSON documents. - -### Example - -By default, the driver connects to a standalone server on localhost via port -27017. The following example demonstrates how to connect to a replica set. -Additionally, it demonstrates a replica set with a custom read preference: - -``` - 'secondaryPreferred' - ] -); -``` - -By default, the library will unserialize BSON documents and arrays as -MongoDB\Model\BSONDocument and MongoDB\Model\BSONArray objects, respectively. -The following example demonstrates how to have the library unserialize -everything as a PHP array, as was done in the legacy -[mongo extension][ext-mongo]: - -[ext-mongo]: http://php.net/mongo - -``` - ['root' => 'array', 'document' => 'array', 'array' => 'array']] -); -``` - -### See Also - - * [MongoDB\Driver\Manager::__construct()][manager-construct] - * [MongoDB Manual: Connection String][connection-string] - ---- - -## __get() - -```php -function __get($databaseName): MongoDB\Database -``` - -Select a database. - -The Database will inherit options (e.g. read preference, type map) from the -Client object. Use [selectDatabase()](#selectdatabase) to override any options. - -**Note:** databases whose names contain special characters (e.g. "-") may be -selected with complex syntax (e.g. `$client->{"that-database"}`) or -[selectDatabase()](#selectdatabase). - -### Example - -The following example selects the "demo" and "another-app" databases: - -``` -demo; -$anotherApp = $client->{'another-app'}; -``` - -### See Also - - * [MongoDB\Client::selectDatabase()](#selectdatabase) - * [PHP Manual: Property Overloading](http://php.net/oop5.overloading#object.get) - ---- - -## dropDatabase - -```php -function dropDatabase($databaseName, array $options = []): array|object -``` - -Drop a database. Returns the command result document. - -### Supported Options - -typeMap (array) -: Type map for BSON deserialization. This will only be used for the returned - command result document. - -### Example - -The following example drops the "demo" database: - -``` -dropDatabase('demo'); - -var_dump($result); -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\BSONDocument)#8 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["dropped"]=> - string(4) "demo" - ["ok"]=> - float(1) - } -} -``` - -### See Also - - * [MongoDB\Database::drop()](database.md#drop) - * [MongoDB Manual: dropDatabase command](http://docs.mongodb.org/manual/reference/command/dropDatabase/) - ---- - -## listDatabases() - -```php -function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator -``` - -Returns information for all database on the server. Elements in the returned -iterator will be MongoDB\Model\DatabaseInfo objects. - -### Supported Options - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. - -### Example - -The following example lists all databases on the server: - -``` -listDatabases() as $databaseInfo) { - var_dump($databaseInfo); -} -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\DatabaseInfo)#4 (3) { - ["name"]=> - string(5) "local" - ["sizeOnDisk"]=> - float(65536) - ["empty"]=> - bool(false) -} -object(MongoDB\Model\DatabaseInfo)#7 (3) { - ["name"]=> - string(4) "test" - ["sizeOnDisk"]=> - float(32768) - ["empty"]=> - bool(false) -} -``` - -### See Also - - * [MongoDB Manual: listDatabases command](http://docs.mongodb.org/manual/reference/command/listDatabases/) - ---- - -## selectCollection() - -```php -function selectCollection($databaseName, $collectionName, array $options = []): MongoDB\Collection -``` - -Select a collection on the server. - -The Collection will inherit options (e.g. read preference, type map) from the -Client object unless otherwise specified. - -### Supported Options - -readConcern (MongoDB\Driver\ReadConcern) -: The default read concern to use for collection operations. Defaults to the - Client's read concern. - -readPreference (MongoDB\Driver\ReadPreference) -: The default read preference to use for collection operations. Defaults to - the Client's read preference. - -typeMap (array) -: Default type map for cursors and BSON documents. Defaults to the Client's - type map. - -writeConcern (MongoDB\Driver\WriteConcern) -: The default write concern to use for collection operations. Defaults to the - Client's write concern. - -### Example - -The following example selects the "demo.users" collection: - -``` -selectCollection('demo', 'users'); -``` - -The following examples selects the "demo.users" collection with a custom read -preference: - -``` -selectCollection( - 'demo', - 'users', - [ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), - ] -); -``` - -### See Also - - * [MongoDB\Collection::__construct()](collection.md#__construct) - * [MongoDB\Client::__get()](#__get) - - ---- - -## selectDatabase() - -```php -function selectDatabase($databaseName array $options = []): MongoDB\Collection -``` - -Select a database on the server. - -The Database will inherit options (e.g. read preference, type map) from the -Client object unless otherwise specified. - -### Supported Options - -readConcern (MongoDB\Driver\ReadConcern) -: The default read concern to use for database operations. Defaults to the - Client's read concern. - -readPreference (MongoDB\Driver\ReadPreference) -: The default read preference to use for database operations. Defaults to the - Client's read preference. - -typeMap (array) -: Default type map for cursors and BSON documents. Defaults to the Client's - type map. - -writeConcern (MongoDB\Driver\WriteConcern) -: The default write concern to use for database operations. Defaults to the - Client's write concern. - -### Example - -The following example selects the "demo" database: - -``` -selectDatabase('demo'); -``` - -The following examples selects the "demo" database with a custom read -preference: - -``` -selectDatabase( - 'demo', - [ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), - ] -); -``` - -### See Also - - * [MongoDB\Database::__construct()](database.md#__construct) - * [MongoDB\Client::__get()](#__get) - ---- diff --git a/source/classes/collection.md b/source/classes/collection.md deleted file mode 100644 index a79956c2..00000000 --- a/source/classes/collection.md +++ /dev/null @@ -1,969 +0,0 @@ -# MongoDB\Collection - -The MongoDB\Collection class provides methods for common operations on a -collection and its documents. This includes, but is not limited to, CRUD -operations (e.g. inserting, querying, counting) and managing indexes. - -A Collection may be constructed directly (using the extension's Manager class), -selected from the library's [Client](client.md) or [Database](database.md) -classes, or cloned from an existing Collection via -[withOptions()](#withoptions). It supports the following options: - - * [readConcern](http://php.net/mongodb-driver-readconcern) - * [readPreference](http://php.net/mongodb-driver-readpreference) - * [typeMap](http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps) - * [writeConcern](http://php.net/mongodb-driver-writeconcern) - -Operations within the Collection class (e.g. [find()](#find), -[insertOne()](#insertone)) will generally inherit the Collection's options. One -notable exception to this rule is that [aggregate()](#aggregate) (when not using -a cursor), [distinct()](#distinct), and the [findAndModify][findandmodify] -helpers do not yet support a "typeMap" option due to a driver limitation. This -means that they will always return BSON documents and arrays as stdClass objects -and arrays, respectively. - -[findandmodify]: http://docs.mongodb.org/manual/reference/command/findAndModify/ - ---- - -## __construct() - -```php -function __construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = []) -``` - -If the Collection is constructed explicitly, any omitted options will be -inherited from the Manager object. If the Collection is selected from a -[Client](client.md) or [Database](database.md) object, options will be -inherited from that object. - -### Supported Options - -readConcern (MongoDB\Driver\ReadConcern) -: The default read concern to use for collection operations. Defaults to the - Manager's read concern. - -readPreference (MongoDB\Driver\ReadPreference) -: The default read preference to use for collection operations. Defaults to - the Manager's read preference. - -typeMap (array) -: Default type map for cursors and BSON documents. - -writeConcern (MongoDB\Driver\WriteConcern) -: The default write concern to use for collection operations. Defaults to the - Manager's write concern. - -### See Also - - * [MongoDB\Collection::withOptions()](#withoptions) - * [MongoDB\Database::selectCollection()](database.md#selectcollection) - ---- - -## aggregate() - -```php -function aggregate(array $pipeline, array $options = []): Traversable -``` - -Executes an aggregation framework pipeline on the collection. - -This method's return value depends on the MongoDB server version and the -"useCursor" option. If "useCursor" is true, a MongoDB\Driver\Cursor will be -returned; otherwise, an ArrayIterator is returned, which wraps the "result" -array from the command response document. - -**Note:** BSON deserialization of inline aggregation results (i.e. not using a -command cursor) does not yet support a "typeMap" options; however, classes -implementing [MongoDB\BSON\Persistable][persistable] will still be deserialized -according to the [Persistence][persistence] specification. - -[persistable]: http://php.net/mongodb-bson-persistable -[persistence]: http://php.net/manual/en/mongodb.persistence.deserialization.php - -### Supported Options - -allowDiskUse (boolean) -: Enables writing to temporary files. When set to true, aggregation stages can - write data to the _tmp sub-directory in the dbPath directory. The default is - false. - -batchSize (integer) -: The number of documents to return per batch. - -bypassDocumentValidation (boolean) -: If true, allows the write to opt out of document level validation. This only - applies when the $out stage is specified. -

- For servers < 3.2, this option is ignored as document level validation is - not available. - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. - -readConcern (MongoDB\Driver\ReadConcern) -: Read concern. Note that a "majority" read concern is not compatible with the - $out stage. -

- For servers < 3.2, this option is ignored as read concern is not available. - -readPreference (MongoDB\Driver\ReadPreference) -: Read preference. - -typeMap (array) -: Type map for BSON deserialization. This will be applied to the returned - Cursor (it is not sent to the server). -

- This is currently not supported for inline aggregation results (i.e. - useCursor option is false or the server versions < 2.6). - -useCursor (boolean) -: Indicates whether the command will request that the server provide results - using a cursor. The default is true. -

- For servers < 2.6, this option is ignored as aggregation cursors are not - available. -

- For servers >= 2.6, this option allows users to turn off cursors if - necessary to aid in mongod/mongos upgrades. - -### See Also - - * [MongoDB Manual: aggregate command](http://docs.mongodb.org/manual/reference/command/aggregate/) - * [MongoDB Manual: Aggregation Pipeline](https://docs.mongodb.org/manual/core/aggregation-pipeline/) - ---- - -## bulkWrite() - -```php -function bulkWrite(array $operations, array $options = []): MongoDB\BulkWriteResult -``` - -Executes multiple write operations. - -### Operations Example - -Example array structure for all supported operation types: - -```php -[ - [ 'deleteMany' => [ $filter ] ], - [ 'deleteOne' => [ $filter ] ], - [ 'insertOne' => [ $document ] ], - [ 'replaceOne' => [ $filter, $replacement, $options ] ], - [ 'updateMany' => [ $filter, $update, $options ] ], - [ 'updateOne' => [ $filter, $update, $options ] ], -] -``` -Arguments correspond to the respective operation methods; however, the -"writeConcern" option is specified for the top-level bulk write operation -instead of each individual operation. - -### Supported Options - -bypassDocumentValidation (boolean) -: If true, allows the write to opt out of document level validation. - -ordered (boolean) -: If true, when an insert fails, return without performing the remaining - writes. If false, when a write fails, continue with the remaining writes, if - any. The default is true. - -writeConcern (MongoDB\Driver\WriteConcern) -: Write concern. - -### See Also - - * [MongoDB\Collection::deleteMany()](#deletemany) - * [MongoDB\Collection::deleteOne()](#deleteone) - * [MongoDB\Collection::insertOne()](#insertone) - * [MongoDB\Collection::replaceOne()](#replaceone) - * [MongoDB\Collection::updateMany()](#updatemany) - * [MongoDB\Collection::updateOne()](#updateone) - * [Tutorial: CRUD Operations](../tutorial/crud.md) - ---- - -## count() - -```php -function count($filter = [], array $options = []): integer -``` - -Gets the number of documents matching the filter. Returns the number of matched -documents as an integer. - -### Supported Options - -hint (string|document) -: The index to use. If a document, it will be interpretted as an index - specification and a name will be generated. - -limit (integer) -: The maximum number of documents to count. - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. - -readConcern (MongoDB\Driver\ReadConcern) -: Read concern. -

- For servers < 3.2, this option is ignored as read concern is not available. - -readPreference (MongoDB\Driver\ReadPreference) -: Read preference. - -skip (integer) -: The number of documents to skip before returning the documents. - -### See Also - - * [MongoDB Manual: count command](http://docs.mongodb.org/manual/reference/command/count/) - ---- - -## createIndex() - -```php -function createIndex($key, array $options = []): string -``` - -Create a single index for the collection. Returns the name of the created index -as a string. - -### Key Example - -The `$key` argument must be a document containing one or more fields mapped to -an order or type. For example: - -``` -// Ascending index on the "username" field -$key = [ 'username' => 1 ]; - -// 2dsphere index on the "loc" field with a secondary index on "created_at" -$key = [ 'loc' => '2dsphere', 'created_at' => 1 ]; -``` - -### Supported Options - -Index options are documented in the [MongoDB manual][createIndexes]. - -[createIndexes]: https://docs.mongodb.org/manual/reference/command/createIndexes/ - -### See Also - - * [MongoDB\Collection::createIndexes()](#createindexes) - * [Tutorial: Indexes](../tutorial/indexes.md) - * [MongoDB Manual: createIndexes command][createIndexes] - * [MongoDB Manual: Indexes][indexes] - -[indexes]: https://docs.mongodb.org/manual/indexes/ - ---- - -## createIndexes() - -``` -function createIndexes(array $indexes): string[] -``` - -Create one or more indexes for the collection. Returns the names of the created -indexes as an array of strings. - -### Indexes Array - -Each element in the `$indexes` array must have a "key" document, which contains -fields mapped to an order or type. Other options may follow. For example: - -```php -[ - // Create a unique index on the "username" field - [ 'key' => [ 'username' => 1 ], 'unique' => true ], - // Create a 2dsphere index on the "loc" field with a custom name - [ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo' ], -] -``` -If the "name" option is unspecified, a name will be generated from the "key" -document. - -Index options are documented in the [MongoDB manual][createIndexes]. - -### See Also - - * [MongoDB\Collection::createIndex()](#createindex) - * [Tutorial: Indexes](../tutorial/indexes.md) - * [MongoDB Manual: createIndexes command][createIndexes] - * [MongoDB Manual: Indexes][indexes] - ---- - -## deleteMany() - -```php -function deleteMany($filter, array $options = []): MongoDB\DeleteResult -``` - -Deletes all documents matching the filter. - -### Supported Options - -writeConcern (MongoDB\Driver\WriteConcern) -: Write concern. - -### See Also - - * [MongoDB\Collection::bulkWrite()](#bulkwrite) - * [MongoDB\Collection::deleteOne()](#deleteone) - * [Tutorial: CRUD Operations](../tutorial/crud.md) - * [MongoDB Manual: delete command](https://docs.mongodb.org/manual/reference/command/delete/) - ---- - -## deleteOne() - -```php -function deleteOne($filter, array $options = []): MongoDB\DeleteResult -``` - -Deletes at most one document matching the filter. - -### Supported Options - -writeConcern (MongoDB\Driver\WriteConcern) -: Write concern. - -### See Also - - * [MongoDB\Collection::bulkWrite()](#bulkwrite) - * [MongoDB\Collection::deleteMany()](#deletemany) - * [Tutorial: CRUD Operations](../tutorial/crud.md) - * [MongoDB Manual: delete command](https://docs.mongodb.org/manual/reference/command/delete/) - ---- - -## distinct() - -```php -function distinct($fieldName, $filter = [], array $options = []): mixed[] -``` - -Finds the distinct values for a specified field across the collection. Returns -an array of the distinct values. - -### Supported Options - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. - -readConcern (MongoDB\Driver\ReadConcern) -: Read concern. -

- For servers < 3.2, this option is ignored as read concern is not available. - -readPreference (MongoDB\Driver\ReadPreference) -: Read preference. - -### See Also - - * [MongoDB Manual: distinct command](https://docs.mongodb.org/manual/reference/command/distinct/) - ---- - -## drop() - -```php -function drop(array $options = []): array|object -``` - -Drop this collection. Returns the command result document. - -### Supported Options - -typeMap (array) -: Type map for BSON deserialization. This will be used for the returned - command result document. - -### Example - -The following example drops the "demo.zips" collection: - -``` -demo->zips; - -$result = $collection->drop(); - -var_dump($result); -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\BSONDocument)#11 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["ns"]=> - string(9) "demo.zips" - ["nIndexesWas"]=> - int(1) - ["ok"]=> - float(1) - } -} -``` - -### See Also - - * [MongoDB\Database::dropCollection()](database.md#dropcollection) - * [MongoDB Manual: drop command](https://docs.mongodb.org/manual/reference/command/drop/) - ---- - -## dropIndex() - -```php -function dropIndex($indexName, array $options = []): array|object -``` - -Drop a single index in the collection. Returns the command result document. - -### Supported Options - -typeMap (array) -: Type map for BSON deserialization. This will be used for the returned - command result document. - -### See Also - - * [MongoDB\Collection::dropIndexes()](#dropindexes) - * [Tutorial: Indexes](../tutorial/indexes.md) - * [MongoDB Manual: dropIndexes command](http://docs.mongodb.org/manual/reference/command/dropIndexes/) - * [MongoDB Manual: Indexes][indexes] - ---- - -## dropIndexes() - -```php -function dropIndexes(array $options = []): array|object -``` - -Drop all indexes in the collection. Returns the command result document. - -### Supported Options - -typeMap (array) -: Type map for BSON deserialization. This will be used for the returned - command result document. - -### See Also - - * [MongoDB\Collection::dropIndex()](#dropindex) - * [Tutorial: Indexes](../tutorial/indexes.md) - * [MongoDB Manual: dropIndexes command](http://docs.mongodb.org/manual/reference/command/dropIndexes/) - * [MongoDB Manual: Indexes][indexes] - ---- - -## find() - -```php -function find($filter = [], array $options = []): MongoDB\Driver\Cursor -``` - -Finds documents matching the query. Returns a MongoDB\Driver\Cursor. - -### Supported Options - -allowPartialResults (boolean) -: Get partial results from a mongos if some shards are inaccessible (instead - of throwing an error). - -batchSize (integer) -: The number of documents to return per batch. - -comment (string) -: Attaches a comment to the query. If "$comment" also exists in the modifiers - document, this option will take precedence. - -cursorType (enum) -: Indicates the type of cursor to use. Must be either NON_TAILABLE, TAILABLE, - or TAILABLE_AWAIT. The default is NON_TAILABLE. - -limit (integer) -: The maximum number of documents to return. - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. If "$maxTimeMS" also - exists in the modifiers document, this option will take precedence. - -modifiers (document) -: Meta-operators modifying the output or behavior of a query. - -noCursorTimeout (boolean) -: The server normally times out idle cursors after an inactivity period (10 - minutes) to prevent excess memory use. Set this option to prevent that. - -oplogReplay (boolean) -: Internal replication use only. The driver should not set this. - -projection (document) -: Limits the fields to return for the matching document. - -readConcern (MongoDB\Driver\ReadConcern) -: Read concern. -

- For servers < 3.2, this option is ignored as read concern is not - available. - -readPreference (MongoDB\Driver\ReadPreference) -: Read preference. - -skip (integer) -: The number of documents to skip before returning. - -sort (document) -: The order in which to return matching documents. If "$orderby" also exists - in the modifiers document, this option will take precedence. - -typeMap (array) -: Type map for BSON deserialization. This will be applied to the returned - Cursor (it is not sent to the server). - -### See Also - - * [MongoDB\Collection::findOne()](#findOne) - * [MongoDB Manual: find command](http://docs.mongodb.org/manual/reference/command/find/) - ---- - -## findOne() - -```php -function findOne($filter = [], array $options = []): array|object -``` - -Finds a single document matching the query. Returns the matching document or -null. - -### Supported Options - -comment (string) -: Attaches a comment to the query. If "$comment" also exists in the modifiers - document, this option will take precedence. - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. If "$maxTimeMS" also - exists in the modifiers document, this option will take precedence. - -modifiers (document) -: Meta-operators modifying the output or behavior of a query. - -projection (document) -: Limits the fields to return for the matching document. - -readConcern (MongoDB\Driver\ReadConcern) -: Read concern. -

- For servers < 3.2, this option is ignored as read concern is not available. - -readPreference (MongoDB\Driver\ReadPreference) -: Read preference. - -skip (integer) -: The number of documents to skip before returning. - -sort (document) -: The order in which to return matching documents. If "$orderby" also exists - in the modifiers document, this option will take precedence. - -typeMap (array) -: Type map for BSON deserialization. - -### See Also - - * [MongoDB\Collection::find()](#find) - * [MongoDB Manual: find command](http://docs.mongodb.org/manual/reference/command/find/) - ---- - -## findOneAndDelete() - -```php -function findOneAndDelete($filter, array $options = []): object|null -``` - -Finds a single document and deletes it, returning the original. The document to -return may be null if no document matched the filter. - -**Note:** BSON deserialization of the returned document does not yet support a -"typeMap" option; however, classes implementing -[MongoDB\BSON\Persistable][persistable] will still be deserialized according to -the [Persistence][persistence] specification. - -### Supported Options - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. - -projection (document) -: Limits the fields to return for the matching document. - -sort (document) -: Determines which document the operation modifies if the query selects - multiple documents. - -writeConcern (MongoDB\Driver\WriteConcern) -: Write concern. This option is only supported for server versions >= 3.2. - -### See Also - - * [MongoDB\Collection::findOneAndReplace()](#findoneandreplace) - * [MongoDB\Collection::findOneAndUpdate()](#findoneandupdate) - * [MongoDB Manual: findAndModify command][findandmodify] - ---- - -## findOneAndReplace() - -```php -function findOneAndReplace($filter, $replacement, array $options = []): object|null -``` - -Finds a single document and replaces it, returning either the original or the -replaced document. - -The document to return may be null if no document matched the filter. By -default, the original document is returned. Specify -`MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER` for the -"returnDocument" option to return the updated document. - -**Note:** BSON deserialization of the returned document does not yet support a -"typeMap" option; however, classes implementing -[MongoDB\BSON\Persistable][persistable] will still be deserialized according to -the [Persistence][persistence] specification. - -### Supported Options - -bypassDocumentValidation (boolean) -: If true, allows the write to opt out of document level validation. - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. - -projection (document) -: Limits the fields to return for the matching document. - -returnDocument (enum) -: Whether to return the document before or after the update is applied. Must - be either `MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE` or - `MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER`. The default is - `MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`. - -sort (document) -: Determines which document the operation modifies if the query selects - multiple documents. - -upsert (boolean) -: When true, a new document is created if no document matches the query. The - default is false. - -writeConcern (MongoDB\Driver\WriteConcern) -: Write concern. This option is only supported for server versions >= 3.2. - -### See Also - - * [MongoDB\Collection::findOneAndDelete()](#findoneanddelete) - * [MongoDB\Collection::findOneAndUpdate()](#findoneandupdate) - * [MongoDB Manual: findAndModify command][findandmodify] - ---- - -## findOneAndUpdate() - -```php -function findOneAndUpdate($filter, $update, array $options = []): object|null -``` - -Finds a single document and updates it, returning either the original or the -updated document. - -The document to return may be null if no document matched the filter. By -default, the original document is returned. Specify -`MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER` for the -"returnDocument" option to return the updated document. - -**Note:** BSON deserialization of the returned document does not yet support a -"typeMap" option; however, classes implementing -[MongoDB\BSON\Persistable][persistable] will still be deserialized according to -the [Persistence][persistence] specification. - -### Supported Options - -bypassDocumentValidation (boolean) -: If true, allows the write to opt out of document level validation. - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. - -projection (document) -: Limits the fields to return for the matching document. - -returnDocument (enum) -: Whether to return the document before or after the update is applied. Must - be either `MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE` or - `MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER`. The default is - `MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`. - -sort (document) -: Determines which document the operation modifies if the query selects - multiple documents. - -upsert (boolean) -: When true, a new document is created if no document matches the query. The - default is false. - -writeConcern (MongoDB\Driver\WriteConcern) -: Write concern. This option is only supported for server versions >= 3.2. - -### See Also - - * [MongoDB\Collection::findOneAndDelete()](#findoneanddelete) - * [MongoDB\Collection::findOneAndReplace()](#findoneandreplace) - * [MongoDB Manual: findAndModify command][findandmodify] - ---- - -## getCollectionName() - -```php -function getCollectionName(): string -``` - -Return the collection name. - ---- - -## getDatabaseName() - -```php -function getDatabaseName(): string -``` - -Return the database name. - ---- - -## getNamespace() - -```php -function getNamespace(): string -``` - -Return the collection namespace. - -### See Also - - * [MongoDB Manual: namespace](https://docs.mongodb.org/manual/reference/glossary/#term-namespace) - ---- - -## insertMany() - -```php -function insertMany(array $documents, array $options = []): MongoDB\InsertManyResult -``` - -Inserts multiple documents. - -### Supported Options - -bypassDocumentValidation (boolean) -: If true, allows the write to opt out of document level validation. - -ordered (boolean) -: If true, when an insert fails, return without performing the remaining - writes. If false, when a write fails, continue with the remaining writes, if - any. The default is true. - -writeConcern (MongoDB\Driver\WriteConcern) -: Write concern. - -### See Also - - * [MongoDB\Collection::bulkWrite()](#bulkwrite) - * [MongoDB\Collection::insertOne()](#insertone) - * [Tutorial: CRUD Operations](../tutorial/crud.md) - * [MongoDB Manual: insert command](http://docs.mongodb.org/manual/reference/command/insert/) - ---- - -## insertOne() - -```php -function insertOne($document, array $options = []): MongoDB\InsertOneResult -``` - -Inserts one document. - -### Supported Options - -bypassDocumentValidation (boolean) -: If true, allows the write to opt out of document level validation. - -writeConcern (MongoDB\Driver\WriteConcern) -: Write concern. - -### See Also - - * [MongoDB\Collection::bulkWrite()](#bulkwrite) - * [MongoDB\Collection::insertMany()](#insertmany) - * [Tutorial: CRUD Operations](../tutorial/crud.md) - * [MongoDB Manual: insert command](http://docs.mongodb.org/manual/reference/command/insert/) - ---- - -## listIndexes() - -```php -function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator -``` - -Returns information for all indexes for the collection. Elements in the returned -iterator will be MongoDB\Model\IndexInfo objects. - -### Supported Options - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. - -### See Also - - * [Tutorial: Indexes](../tutorial/indexes.md) - * [MongoDB Manual: listIndexes command](http://docs.mongodb.org/manual/reference/command/listIndexes/) - * [MongoDB Manual: Indexes][indexes] - * [MongoDB Specification: Enumerating Collections](https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst) - ---- - -## replaceOne() - -```php -function replaceOne($filter, $replacement, array $options = []): MongoDB\UpdateResult -``` - -Replaces at most one document matching the filter. - -### Supported Options - -bypassDocumentValidation (boolean) -: If true, allows the write to opt out of document level validation. - -upsert (boolean) -: When true, a new document is created if no document matches the query. The - default is false. - -writeConcern (MongoDB\Driver\WriteConcern) -: Write concern. - -### See Also - - * [MongoDB\Collection::bulkWrite()](#bulkwrite) - * [MongoDB\Collection::updateMany()](#updatemany) - * [MongoDB\Collection::updateOne()](#updateone) - * [Tutorial: CRUD Operations](../tutorial/crud.md) - * [MongoDB Manual: update command](http://docs.mongodb.org/manual/reference/command/update/) - ---- - -## updateMany() - -```php -function updateMany($filter, $update, array $options = []): MongoDB\UpdateResult -``` - -Updates all documents matching the filter. - -### Supported Options - -bypassDocumentValidation (boolean) -: If true, allows the write to opt out of document level validation. - -upsert (boolean) -: When true, a new document is created if no document matches the query. The - default is false. - -writeConcern (MongoDB\Driver\WriteConcern) -: Write concern. - -### See Also - - * [MongoDB\Collection::bulkWrite()](#bulkwrite) - * [MongoDB\Collection::replaceOne()](#replaceone) - * [MongoDB\Collection::updateOne()](#updateone) - * [Tutorial: CRUD Operations](../tutorial/crud.md) - * [MongoDB Manual: update command](http://docs.mongodb.org/manual/reference/command/update/) - ---- - -## updateOne() - -```php -function updateOne($filter, $update, array $options = []): MongoDB\UpdateResult -``` - -Updates at most one document matching the filter. - -### Supported Options - -bypassDocumentValidation (boolean) -: If true, allows the write to opt out of document level validation. - -upsert (boolean) -: When true, a new document is created if no document matches the query. The - default is false. - -writeConcern (MongoDB\Driver\WriteConcern) -: Write concern. - -### See Also - - * [MongoDB\Collection::bulkWrite()](#bulkwrite) - * [MongoDB\Collection::replaceOne()](#replaceone) - * [MongoDB\Collection::updateMany()](#updatemany) - * [Tutorial: CRUD Operations](../tutorial/crud.md) - * [MongoDB Manual: update command](http://docs.mongodb.org/manual/reference/command/update/) - ---- - -## withOptions() - -```php -function withOptions(array $options = []): MongoDB\Collection -``` - -Returns a clone of this Collection with different options. - -### Supported Options - -readConcern (MongoDB\Driver\ReadConcern) -: The default read concern to use for collection operations. Defaults to the - Manager's read concern. - -readPreference (MongoDB\Driver\ReadPreference) -: The default read preference to use for collection operations. Defaults to - the Manager's read preference. - -typeMap (array) -: Default type map for cursors and BSON documents. - -writeConcern (MongoDB\Driver\WriteConcern) -: The default write concern to use for collection operations. Defaults to the - Manager's write concern. - -### See Also - - * [MongoDB\Collection::__construct()](#__construct) diff --git a/source/classes/database.md b/source/classes/database.md deleted file mode 100644 index 7fe017f8..00000000 --- a/source/classes/database.md +++ /dev/null @@ -1,478 +0,0 @@ -# MongoDB\Database - -The MongoDB\Database class provides methods for common operations on a database, -such as executing commands and managing collections. - -A Database may be constructed directly (using the extension's Manager class) or -selected from the library's [Client](client.md) class. It supports the following -options: - - * [readConcern](http://php.net/mongodb-driver-readconcern) - * [readPreference](http://php.net/mongodb-driver-readpreference) - * [typeMap](http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps) - * [writeConcern](http://php.net/mongodb-driver-writeconcern) - -If any options are omitted, they will be inherited from the Manager constructor -argument or object from which the Database was selected. - -Operations within the Database class (e.g. [command()](#command)) will generally -inherit the Database's options. - ---- - -## __construct() - -```php -function __construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = []) -``` - -If the Database is constructed explicitly, any omitted options will be inherited -from the Manager object. If the Database is selected from a [Client](client.md) -object, options will be inherited from that object. - -### Supported Options - -readConcern (MongoDB\Driver\ReadConcern) -: The default read concern to use for database operations and selected - collections. Defaults to the Manager's read concern. - -readPreference (MongoDB\Driver\ReadPreference) -: The default read preference to use for database operations and selected - collections. Defaults to the Manager's read preference. - -typeMap (array) -: Default type map for cursors and BSON documents. - -writeConcern (MongoDB\Driver\WriteConcern) -: The default write concern to use for database operations and selected - collections. Defaults to the Manager's write concern. - -### See Also - - * [MongoDB\Database::withOptions()](#withoptions) - ---- - -## __get() - -```php -function __get($collectionName): MongoDB\Collection -``` - -Select a collection within this database. - -The Collection will inherit options (e.g. read preference, type map) from the -Database object. Use [selectCollection()](#selectcollection) to override any -options. - -**Note:** collections whose names contain special characters (e.g. ".") may be -selected with complex syntax (e.g. `$database->{"system.profile"}`) or -[selectCollection()](#selectcollection). - -### Example - -The following example selects the "demo.users" and "demo.system.profile" -collections: - -``` -demo; - -$users = $db->users; -$systemProfile = $db->{'system.profile'}; -``` - -### See Also - - * [MongoDB\Database::selectCollection()](#selectcollection) - * [PHP Manual: Property Overloading](http://php.net/oop5.overloading#object.get) - ---- - -## command() - -```php -function function command($command, array $options = []): MongoDB\Driver\Cursor -``` - -Execute a command on this database. - -### Supported Options - -readPreference (MongoDB\Driver\ReadPreference) -: The read preference to use when executing the command. This may be used when - issuing the command to a replica set or mongos node to ensure that the - driver sets the wire protocol accordingly or adds the read preference to the - command document, respectively. - -typeMap (array) -: Type map for BSON deserialization. This will be applied to the returned - Cursor (it is not sent to the server). - -### See Also - - * [Tutorial: Database Commands](../tutorial/commands.md) - * [MongoDB Manual: Database Commands](https://docs.mongodb.org/manual/reference/command/) - -## createCollection - -```php -function createCollection($collectionName, array $options = []): array|object -``` - -Create a new collection explicitly. Returns the command result document. - -MongoDB already creates collections implicitly when they are first referenced in -commands (e.g. inserting a document into a new collection); however, collections -may also be explicitly created with specific options. This is useful for -creating [capped collections][capped], enabling -[document validation][validation], or supplying storage engine options. - -[capped]: https://docs.mongodb.org/manual/core/capped-collections/ -[validation]: https://docs.mongodb.org/manual/core/document-validation/ - -### Supported Options - -autoIndexId (boolean) -: Specify false to disable the automatic creation of an index on the _id - field. For replica sets, this option cannot be false. The default is true. - -capped (boolean) -: Specify true to create a capped collection. If set, the size option must - also be specified. The default is false. - -flags (integer) -: Options for the MMAPv1 storage engine only. Must be a bitwise combination - `MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES` and - `MongoDB\Operation\CreateCollection::NO_PADDING`. The default is - `MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES`. - -indexOptionDefaults (document) -: Default configuration for indexes when creating the collection. - -max (integer) -: The maximum number of documents allowed in the capped collection. The size - option takes precedence over this limit. - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. - -size (integer) -: The maximum number of bytes for a capped collection. - -storageEngine (document) -: Storage engine options. - -typeMap (array) -: Type map for BSON deserialization. This will only be used for the returned - command result document. - -validationAction (string) -: Validation action. - -validationLevel (string) -: Validation level. - -validator (document) -: Validation rules or expressions. - -### Example - -The following example creates the "demo.users" collection with a custom -[document validator][validation] (available in MongoDB 3.2+): - -``` -demo; - -$result = $db->createCollection('users', [ - 'validator' => [ - 'username' => ['$type' => 'string'], - 'email' => ['$regex' => '@mongodb\.com$'], - ], -]); - -var_dump($result); -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\BSONDocument)#11 (1) { - ["storage":"ArrayObject":private]=> - array(1) { - ["ok"]=> - float(1) - } -} -``` - -### See Also - - * [MongoDB Manual: create command](http://docs.mongodb.org/manual/reference/command/create/) - ---- - -## drop - -```php -function drop(array $options = []): array|object -``` - -Drop this database. Returns the command result document. - -### Supported Options - -typeMap (array) -: Type map for BSON deserialization. This will only be used for the returned - command result document. - -### Example - -The following example drops the "demo" database: - -``` -$db = (new MongoDB\Client)->demo; - -$result = $db->drop(); - -var_dump($result); -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\BSONDocument)#11 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["dropped"]=> - string(4) "demo" - ["ok"]=> - float(1) - } -} -``` - -### See Also - - * [MongoDB\Client::dropDatabase()](client.md#dropdatabase) - * [MongoDB Manual: dropDatabase command](http://docs.mongodb.org/manual/reference/command/dropDatabase/) - ---- - -## dropCollection - -```php -function dropCollection($collectionName, array $options = []): array|object -``` - -Drop a collection within this database. Returns the command result document. - -### Supported Options - -typeMap (array) -: Type map for BSON deserialization. This will only be used for the returned - command result document. - -### Example - -The following example drops the "demo.users" collection: - -``` -demo; - -$result = $db->dropCollection('users'); - -var_dump($result); -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\BSONDocument)#11 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["ns"]=> - string(10) "demo.users" - ["nIndexesWas"]=> - int(1) - ["ok"]=> - float(1) - } -} -``` - -### See Also - - * [MongoDB\Collection::drop()](collection.md#drop) - * [MongoDB Manual: drop command](http://docs.mongodb.org/manual/reference/command/drop/) - ---- - -## getDatabaseName() - -```php -function getDatabaseName(): string -``` - -Return the database name. - ---- - -## listCollections() - -```php -function listCollections(array $options = []): MongoDB\Model\CollectionInfoIterator -``` - -Returns information for all collections in this database. Elements in the -returned iterator will be MongoDB\Model\CollectionInfo objects. - -### Supported Options - -filter (document) -: Query by which to filter collections. - -maxTimeMS (integer) -: The maximum amount of time to allow the query to run. - -### Example - -The following example lists all collections in the "demo" database: - -``` -demo; - -foreach ($db->listCollections() as $collectionInfo) { - var_dump($collectionInfo); -} -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\CollectionInfo)#8 (2) { - ["name"]=> - string(5) "users" - ["options"]=> - array(0) { - } -} -object(MongoDB\Model\CollectionInfo)#13 (2) { - ["name"]=> - string(14) "system.profile" - ["options"]=> - array(2) { - ["capped"]=> - bool(true) - ["size"]=> - int(1048576) - } -} -``` - -### See Also - - * [MongoDB Manual: listCollections command](http://docs.mongodb.org/manual/reference/command/listCollections/) - * [MongoDB Specification: Enumerating Collections](https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst) - ---- - -## selectCollection() - -```php -function selectCollection($collectionName, array $options = []): MongoDB\Collection -``` - -Select a collection within this database. - -The Collection will inherit options (e.g. read preference, type map) from the -Database object unless otherwise specified. - -### Supported Options - -readConcern (MongoDB\Driver\ReadConcern) -: The default read concern to use for collection operations. Defaults to the - Database's read concern. - -readPreference (MongoDB\Driver\ReadPreference) -: The default read preference to use for collection operations. Defaults to - the Database's read preference. - -typeMap (array) -: Default type map for cursors and BSON documents. Defaults to the Database's - type map. - -writeConcern (MongoDB\Driver\WriteConcern) -: The default write concern to use for collection operations. Defaults to the - Database's write concern. - -### Example - -The following example selects the "demo.users" collection: - -``` -demo; - -$collection = $db->selectCollection('users'); -``` - -The following examples selects the "demo.users" collection with a custom read -preference: - -``` -demo; - -$collection = $db->selectCollection( - 'users', - [ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY), - ] -); -``` - -### See Also - - * [MongoDB\Collection::__construct()](collection.md#__construct) - * [MongoDB\Database::__get()](#__get) - ---- - -## withOptions() - -```php -function withOptions(array $options = []): MongoDB\Database -``` - -Returns a clone of this database with different options. - -### Supported Options - -readConcern (MongoDB\Driver\ReadConcern) -: The default read concern to use for database operations and selected - collections. Defaults to the Manager's read concern. - -readPreference (MongoDB\Driver\ReadPreference) -: The default read preference to use for database operations and selected - collections. Defaults to the Manager's read preference. - -typeMap (array) -: Default type map for cursors and BSON documents. - -writeConcern (MongoDB\Driver\WriteConcern) -: The default write concern to use for database operations and selected - collections. Defaults to the Manager's write concern. - -### See Also - - * [MongoDB\Database::__construct()](#__construct) diff --git a/source/getting-started.md b/source/getting-started.md deleted file mode 100644 index 028757c0..00000000 --- a/source/getting-started.md +++ /dev/null @@ -1,50 +0,0 @@ -# Getting Started - -### Requirements - -Since this library is only a high-level abstraction for the driver, it requires -that the `mongodb` extension be installed: - -``` -$ pecl install mongodb -$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` -``` - -Instructions for installing the `mongodb` extension on HHVM may be found in the -[Installation with HHVM](http://php.net/manual/en/mongodb.tutorial.install.hhvm.php) -article in the driver documentation. - -### Installation - -The preferred method of installing this library is with -[Composer](https://getcomposer.org/) by running the following from your project -root: - -``` -$ composer require "mongodb/mongodb=^1.0.0" -``` - -While not recommended, the package may also be installed manually via source -tarballs attached to -[GitHub releases](https://github.com/mongodb/mongo-php-library/releases). - -### Configure Autoloading - -Once the library is installed, ensure that your application includes Composer's -autoloader. - -``` -// This path should point to Composer's autoloader -require_once __DIR__ . "/vendor/autoload.php"; -``` - -More information on this setup may be found in Composer's -[autoloading documentation](https://getcomposer.org/doc/01-basic-usage.md#autoloading). - -If you have installed the package manually (e.g. from a source tarball), you -will likely need configure autoloading manually: - - * Map the top-level `MongoDB\` namespace to the `src/` directory using your - preferred autoloader implementation - * Manually require the `src/functions.php` file, since PHP does not yet support - function autoloading diff --git a/source/index.md b/source/index.md deleted file mode 100644 index 27030b10..00000000 --- a/source/index.md +++ /dev/null @@ -1,41 +0,0 @@ -# MongoDB PHP Library - -This library provides a high-level abstraction around the lower-level -[PHP driver](https://php.net/mongodb) (i.e. the `mongodb` extension). - -While the extension provides a limited API for executing commands, queries, and -write operations, this library implements an API similar to that of the -[legacy PHP driver](http://php.net/manual/en/book.mongo.php). It contains -abstractions for client, database, and collection objects, and provides methods -for CRUD operations and common commands (e.g. index and collection management). -Support for GridFS is forthcoming. - -If you are developing an application with MongoDB, you should consider using -this library, or another high-level abstraction, instead of the extension alone. - -For additional information about this library and the ``mongodb`` extension, -see the [Architecture Overview](http://php.net/manual/en/mongodb.overview.php) -article in the driver documentation. [Derick Rethans](http://derickrethans.nl/) -has also written a series of blog posts entitled *New MongoDB Drivers for PHP -and HHVM*: - - * [Part One: History](http://derickrethans.nl/new-drivers.html) - * [Part Two: Architecture](http://derickrethans.nl/new-drivers-part2.html) - * [Part Three: Cursor Behaviour](https://derickrethans.nl/new-drivers-part3-cursor.html) - -## API Documentation - -Generated API documentation for the library is available at: - - * [http://mongodb.github.io/mongo-php-library/api](http://mongodb.github.io/mongo-php-library/api) - -## MongoDB Tutorial - -If you are a new MongoDB user, these links should help you become more familiar -with MongoDB and introduce some of the concepts and terms you will encounter in -this documentation: - - * [Introduction to CRUD operations in MongoDB](http://docs.mongodb.org/manual/core/crud-introduction/) - * [What is a MongoDB document?](http://docs.mongodb.org/manual/core/document/) - * [MongoDB's *dot notation* for accessing document properties](http://docs.mongodb.org/manual/core/document/#dot-notation) - * [ObjectId: MongoDB's document identifier](http://docs.mongodb.org/manual/reference/object-id/) diff --git a/source/tutorial/bson.md b/source/tutorial/bson.md deleted file mode 100644 index 6627dd63..00000000 --- a/source/tutorial/bson.md +++ /dev/null @@ -1,198 +0,0 @@ -# BSON Conversion - -## Deserialization - -By default, the library returns BSON documents and arrays as -MongoDB\Model\BSONDocument and MongoDB\Model\BSONArray objects, respectively. -Both of those classes extend PHP's [ArrayObject][arrayobject] class and -implement the driver's [MongoDB\BSON\Serializable][serializable] and -[MongoDB\BSON\Unserializable][unserializable] interfaces. - -[arrayobject]: http://php.net/arrayobject -[serializable]: http://php.net/mongodb-bson-serializable -[unserializable]: http://php.net/mongodb-bson-unserializable - -## Type Maps - -Most methods that read data from MongoDB support a "typeMap" option, which -allows control over how BSON is converted to PHP. Additionally, the -[MongoDB\Client][client], [MongoDB\Database][database], and -[MongoDB\Collection][collection] classes accept a "typeMap" option, which will -apply to any supporting methods and selected classes by default. - -[client]: ../classes/client.md -[database]: ../classes/database.md -[collection]: ../classes/collection.md - -The [MongoDB\Client][client], [MongoDB\Database][database], and -[MongoDB\Collection][collection] classes use the following type map by default: - -```php -[ - 'array' => 'MongoDB\Model\BSONArray', - 'document' => 'MongoDB\Model\BSONDocument', - 'root' => 'MongoDB\Model\BSONDocument', -] -``` - -## Persistable Classes - -Classes implementing [MongoDB\BSON\Persistable][persistable] will be serialized -and deserialized according to the [Persistence][persistence] specification. This -behavior occurs by default in the [driver][ext-mongodb] and does not require use -of the "typeMap" option. - -[persistable]: http://php.net/mongodb-bson-persistable -[persistence]: http://php.net/manual/en/mongodb.persistence.php -[ext-mongodb]: https://php.net/mongodb - -Given the following class definition: - -``` -id = new MongoDB\BSON\ObjectID; - $this->name = (string) $name; - - // Get current time in milliseconds since the epoch - $msec = floor(microtime(true) * 1000); - $this->createdAt = new MongoDB\BSON\UTCDateTime($msec); - } - - function bsonSerialize() - { - return [ - '_id' => $this->id, - 'name' => $this->name, - 'createdAt' => $this->createdAt, - ]; - } - - function bsonUnserialize(array $data) - { - $this->id = $data['_id']; - $this->name = $data['name']; - $this->createdAt = $data['createdAt']; - } -} -``` - -The following example constructs a Person object, inserts it into the database, -and reads it back as an object of the same type (without the use of the -"typeMap" option): - -``` -demo->persons; - -$result = $collection->insertOne(new Person('Bob')); - -$person = $collection->findOne(['_id' => $result->getInsertedId()]); - -var_dump($person); -``` - -The above example would output something similar to: - -``` -object(Person)#18 (3) { - ["id":"Person":private]=> - object(MongoDB\BSON\ObjectID)#15 (1) { - ["oid"]=> - string(24) "56fad2c36118fd2e9820cfc1" - } - ["name":"Person":private]=> - string(3) "Bob" - ["createdAt":"Person":private]=> - object(MongoDB\BSON\UTCDateTime)#17 (1) { - ["milliseconds"]=> - int(1459278531218) - } -} -``` - -The same document in the MongoDB shell might display as: - -``` -> db.persons.findOne() -{ - "_id" : ObjectId("56fad2c36118fd2e9820cfc1"), - "__pclass" : BinData(128,"UGVyc29u"), - "name" : "Bob", - "createdAt" : ISODate("2016-03-29T19:08:51.218Z") -} -``` - -**Note:** [MongoDB\BSON\Persistable][persistable] may only be used for root and -embedded BSON documents; BSON arrays are not supported. - -## Emulating the Legacy Driver - -The legacy [mongo extension][ext-mongo] returned both BSON documents and -arrays as PHP arrays. While PHP arrays are convenient to work with, this -behavior was problematic for several reasons: - -[ext-mongo]: http://php.net/mongo - - * Different BSON types could deserialize to the same PHP value (e.g. - `{"0": "foo"}` and `["foo"]`), which made it impossible to infer the - original BSON type. - - * Numerically indexed PHP arrays would be serialized as BSON documents if there - was a gap in their key sequence. Such gaps were easily (and inadvertently) - caused by unsetting a key to remove an element and forgetting to reindex the - array. - -The libary's MongoDB\Model\BSONDocument and MongoDB\Model\BSONArray classes -address these concerns by preserving the BSON type information during -serialization and deserialization; however, some users may still prefer the -legacy behavior. If desired, the following "typeMap" option can be used to have -the library return everything as a PHP array: - -``` - ['root' => 'array', 'document' => 'array', 'array' => 'array']] -); - -$document = $client->demo->zips->findOne( - ['_id' => '94301'], - ['typeMap' => ['root' => 'array', 'document' => 'array', 'array' => 'array']] -); - -var_dump($document); -``` - -The above example would output something similar to: - -``` -array(5) { - ["_id"]=> - string(5) "94301" - ["city"]=> - string(9) "PALO ALTO" - ["loc"]=> - array(2) { - [0]=> - float(-122.149685) - [1]=> - float(37.444324) - } - ["pop"]=> - int(15965) - ["state"]=> - string(2) "CA" -} -``` diff --git a/source/tutorial/commands.md b/source/tutorial/commands.md deleted file mode 100644 index 7e860af3..00000000 --- a/source/tutorial/commands.md +++ /dev/null @@ -1,123 +0,0 @@ -# Database Commands - -While the library provides helpers for some common database commands, it is far -from an [exhaustive list][command-list]. This page will demonstrate how to -execute arbitrary commands on the MongoDB server via the -[Database::command()][command] method and access their results. - -[command-list]: https://docs.mongodb.org/manual/reference/command/ -[command]: ../classes/database.md#command - -## Single Result Documents - -The [command()][command] method always returns a -[MongoDB\Driver\Cursor][cursor]. Unless otherwise stated in the MongoDB -documentation, command responses are returned as a single document. Reading such -a result will require iterating on the cursor and accessing the first (and only) -document, like so: - -[cursor]: http://php.net/mongodb-driver-cursor - -``` -demo; - -$cursor = $database->command(['ping' => 1]); - -var_dump($cursor->toArray()[0]); -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\BSONDocument)#2 (1) { - ["storage":"ArrayObject":private]=> - array(1) { - ["ok"]=> - float(1) - } -} -``` - -## Iterable Results as a Command Cursor - -Some commands, such as [listCollections][listcollections], return their results -via an iterable command cursor. In this case, the returned -[MongoDB\Driver\Cursor][cursor] may be iterated in the same manner as one might -do with a [Collection::find()][find] query, like so: - -[listcollections]: http://docs.mongodb.org/manual/reference/command/listCollections/ -[find]: ../classes/collection.md#find - -``` -demo; - -$cursor = $database->command(['listCollections' => 1]); - -foreach ($cursor as $collection) { - echo $collection['name'], "\n"; -} -``` - -The above example would output something similar to: - -``` -persons -posts -zips -``` - -**Note:** at the protocol level, commands that support a cursor actually return -a single result document with the essential ingredients for constructing the -command cursor (i.e. the cursor's ID, namespace, and first batch of results); -however, the driver's [executeCommand()][executecommand] method already detects -such a result and constructs the iterable command cursor for us. - -[executecommand]: http://php.net/manual/en/mongodb-driver-manager.executecommand.php - -## Specifying a Read Preference - -Some commands, such as [createUser][createUser], can only be executed on a -primary server. Command helpers in the library, such as -[Database::drop()][drop], know to apply their own read preference if necessary; -however, [command()][command] is a generic method and has no special knowledge. -It defaults to the read preference of the Database object on which it is -invoked. In such cases, it can be helpful to explicitly specify the correct read -preference, like so: - -[createUser]: https://docs.mongodb.org/manual/reference/command/createUser/ -[drop]: ../classes/database.md#drop - -``` -demo; - -$cursor = $db->command( - [ - 'createUser' => 'username', - 'pwd' => 'password', - 'roles' => ['readWrite'], - ], - [ - 'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY), - ] -); - -var_dump($cursor->toArray()[0]); -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\BSONDocument)#8 (1) { - ["storage":"ArrayObject":private]=> - array(1) { - ["ok"]=> - float(1) - } -} -``` diff --git a/source/tutorial/crud.md b/source/tutorial/crud.md deleted file mode 100644 index eef92fc8..00000000 --- a/source/tutorial/crud.md +++ /dev/null @@ -1,629 +0,0 @@ -# CRUD Operations - -CRUD is an acronym for Create, Read, Update, and Delete. These operations may be -performed via the [MongoDB\Collection][collection] class, which implements -MongoDB's cross-driver [CRUD specification][crud-spec]. This page will -demonstrate how to insert, query, update, and delete documents using the -library. A general introduction to CRUD operations in MongoDB may be found in -the [MongoDB Manual][crud]. - -[collection]: ../classes/collection.md -[crud-spec]: https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst -[crud]: https://docs.mongodb.org/manual/crud/ - -This page covers the following common use cases: - - * Querying for [one](#finding-one-document) or [many](#finding-many-documents) - documents at a time - * [Projecting](#query-projection) fields in a query - * Applying [limit, sort, and skip options](#limit-sort-and-skip-options) to a - query - * Inserting [one](#inserting-one-document) or [many](#inserting-many-documents) - documents at a time - * Updating [one](#updating-one-document) or [many](#updating-many-documents) - documents at a time - * [Replacing](#replacing-a-document) a document - * [Upserting](#upserting-a-document) a document - * Deleting [one](#deleting-one-document) or [many](#deleting-many-documents) - documents at a time - * [Aggregating](#aggregating-documents) documents - -Note that the use of arrays to express documents in the following examples was -done for simplicity. The driver will also accept instances of stdClass or -[MongoDB\BSON\Serializable][serializable]) for these arguments (e.g. query -filters, inserted documents, update documents). - -[serializable]: http://php.net/mongodb-bson-serializable - -Documents destined for database storage (e.g. insert documents, replacement -documents, embedded documents included in an update operation) may also be -instances of [MongoDB\BSON\Persistable][persistable]. See -[Persistable Classes][persistable-classes] for more information. - -[persistable]: http://php.net/mongodb-bson-persistable -[persistable-classes]: bson.md#persistable-classes - -## Finding One Document - -The [findOne()][findone] method returns the first matched document, or null if -no document was matched. - -[findone]: ../classes/collection.md#findone - -``` -demo->zips; - -$document = $collection->findOne(['_id' => '94301']); - -var_dump($document); -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\BSONDocument)#13 (1) { - ["storage":"ArrayObject":private]=> - array(5) { - ["_id"]=> - string(5) "94301" - ["city"]=> - string(9) "PALO ALTO" - ["loc"]=> - object(MongoDB\Model\BSONArray)#12 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - [0]=> - float(-122.149685) - [1]=> - float(37.444324) - } - } - ["pop"]=> - int(15965) - ["state"]=> - string(2) "CA" - } -} -``` - -## Finding Many Documents - -The [find()][find] method returns a [MongoDB\Driver\Cursor][cursor] object, -which may be iterated upon to access all matched documents. The following -example queries for all zip codes in a given city: - -[find]: ../classes/collection.md#find -[cursor]: http://php.net/mongodb-driver-cursor - -``` -demo->zips; - -$cursor = $collection->find(['city' => 'JERSEY CITY', 'state' => 'NJ']); - -foreach ($cursor as $document) { - echo $document['_id'], "\n"; -} -``` - -The above example would output something similar to: - -``` -07302 -07304 -07305 -07306 -07307 -07310 -``` - -## Query Projection - -Queries may include a [projection][projection] to include or exclude specific -fields in the returned documents. The following example selects only the -population field for the zip code: - -[projection]: https://docs.mongodb.org/manual/tutorial/project-fields-from-query-results/ - - -``` -demo->zips; - -$document = $collection->findOne( - ['_id' => '10011'], - ['projection' => ['pop' => 1]] -); - -var_dump($document); -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\BSONDocument)#12 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["_id"]=> - string(5) "10011" - ["pop"]=> - int(46560) - } -} -``` - -**Note:** the "_id" field is included by default unless explicitly excluded. - -## Limit, Sort, and Skip Options - -In addition to criteria, queries may take options to limit, sort, and skip -returned documents. The following example queries for the five most populous -zip codes in the United States: - -``` -demo->zips; - -$cursor = $collection->find( - [], - [ - 'limit' => 5, - 'sort' => ['pop' => -1], - ] -); - -foreach ($cursor as $document) { - echo $document['_id'], "\n"; -} -``` - -The above example would output something similar to: - -``` -60623: CHICAGO, IL -11226: BROOKLYN, NY -10021: NEW YORK, NY -10025: NEW YORK, NY -90201: BELL GARDENS, CA -``` - -## Inserting One Document - -The [insertOne()][insertone] method may be used to insert a single document. -This method returns an instance of `MongoDB\InsertOneResult`, which may be used -to access the ID of the inserted document. Note that if a document does not -contain an `_id` field at the time of insertion, the driver will generate a -`MongoDB\BSON\ObjectID` to use as its ID. - -[insertone]: ../classes/collection.md#insertone - -``` -demo->users; -$collection->drop(); - -$insertOneResult = $collection->insertOne(['name' => 'Bob']); - -printf("Inserted %d document(s)\n", $insertOneResult->getInsertedCount()); -var_dump($insertOneResult->getInsertedId()); -``` - -The above example would output something similar to: - -``` -Inserted 1 document(s) -object(MongoDB\BSON\ObjectID)#10 (1) { - ["oid"]=> - string(24) "5750905b6118fd170565aa81" -} -``` - -The following example inserts a document with an ID. Note that if an ID is not -unique for the collection, the insert will fail due to a duplicate key error. - -``` -demo->users; -$collection->drop(); - -$insertOneResult = $collection->insertOne(['_id' => 1, 'name' => 'Alice']); - -printf("Inserted %d document(s)\n", $insertOneResult->getInsertedCount()); -var_dump($insertOneResult->getInsertedId()); -``` - -The above example would output: - -``` -Inserted 1 document(s) -int(1) -``` - -## Inserting Many Documents - -The [insertMany()][insertmany] method may be used to insert multiple documents -at a time. This method returns an instance of `MongoDB\InsertManyResult`, which -may be used to access the IDs of the inserted documents. - -[insertmany]: ../classes/collection.md#insertmany - -``` -demo->users; -$collection->drop(); - -$insertManyResult = $collection->insertMany([ - ['name' => 'Bob'], - ['_id' => 1, 'name' => 'Alice'], -]); - -printf("Inserted %d document(s)\n", $insertManyResult->getInsertedCount()); -var_dump($insertManyResult->getInsertedIds()); -``` - -The above example would output something similar to: - -``` -Inserted 2 document(s) -array(2) { - [0]=> - object(MongoDB\BSON\ObjectID)#10 (1) { - ["oid"]=> - string(24) "5750927b6118fd1ed64eb141" - } - [1]=> - int(1) -} -``` - -## Updating One Document - -The [updateOne()][updateone] method may be used to update a single document -matching a filter. This method returns an instance of `MongoDB\UpdateResult`, -which may be used to access statistics about the update operation. - -[updateone]: ../classes/collection.md#updateone - -This method has two required parameters: a query filter and an update document. -The query filter is similar to what might be provided to [find()][find]. The -update document consists of one or more [update operators][updateops]. - -[updateops]: https://docs.mongodb.com/manual/reference/operator/update/ - -``` -demo->users; -$collection->drop(); - -$collection->insertOne(['name' => 'Bob', 'state' => 'ny']); -$collection->insertOne(['name' => 'Alice', 'state' => 'ny']); -$updateResult = $collection->updateOne( - ['state' => 'ny'], - ['$set' => ['country' => 'us']] -); - -printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); -printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); -``` - -The above example would output something similar to: - -``` -Matched 1 document(s) -Modified 1 document(s) -``` - -Note that it is possible for a document to match the filter but not be modified -by an update: - -``` -demo->users; -$collection->drop(); - -$collection->insertOne(['name' => 'Bob', 'state' => 'ny']); -$updateResult = $collection->updateOne( - ['name' => 'Bob'], - ['$set' => ['state' => 'ny']] -); - -printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); -printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); -``` - -The above example would output something similar to: - -``` -Matched 1 document(s) -Modified 0 document(s) -``` - -## Updating Many Documents - -The [updateMany()][updatemany] method may be used to update multiple documents -at a time. This method returns an instance of `MongoDB\UpdateResult`, which may -be used to access statistics about the update operation. - -[updatemany]: ../classes/collection.md#updatemany - -This method has two required parameters: a query filter and an update document. -The query filter is similar to what might be provided to [find()][find]. The -update document consists of one or more [update operators][updateops]. - -``` -demo->users; -$collection->drop(); - -$collection->insertOne(['name' => 'Bob', 'state' => 'ny', 'country' => 'us']); -$collection->insertOne(['name' => 'Alice', 'state' => 'ny']); -$collection->insertOne(['name' => 'Sam', 'state' => 'ny']); -$updateResult = $collection->updateMany( - ['state' => 'ny'], - ['$set' => ['country' => 'us']] -); - -printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); -printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); -``` - -The above example would output something similar to: - -``` -Matched 3 document(s) -Modified 2 document(s) -``` - -## Replacing a Document - -The [replaceOne()][replaceone] method may be used to replace a single document -matching a filter. This method returns an instance of `MongoDB\UpdateResult`, -which may be used to access statistics about the replacement operation. - -[replaceone]: ../classes/collection.md#replaceone - -This method has two required parameters: a query filter and a replacement -document. The query filter is similar to what might be provided to -[find()][find]. The replacement document will be used to overwrite the matched -document (excluding its ID, which is immutable) and must not contain -[update operators][updateops]. - -Note that the very nature of a replacement operation makes it easy to -inadvertently overwrite or delete fields in a document. When possible, users -should consider updating individual fields with [updateOne()][updateone] or -[updateMany()][updatemany]. - -``` -demo->users; -$collection->drop(); - -$collection->insertOne(['name' => 'Bob', 'state' => 'ny']); -$updateResult = $collection->replaceOne( - ['name' => 'Bob'], - ['name' => 'Robert', 'state' => 'ca'] -); - -printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); -printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); -``` - -The above example would output something similar to: - -``` -Matched 1 document(s) -Modified 1 document(s) -``` - -Note that it is possible for a document to match the filter but not be modified -by a replacement (i.e. the matched document and replacement may be the same). - -## Upserting a Document - -An upsert is a variation of an update or replace operation, whereby a new -document is inserted if the query filter does not match an existing document. -An upsert may be specified via the `upsert` option for [updateOne()][updateone], -[updateMany()][updatemany], or [replaceOne()][replaceone]. The logic by which -the inserted document is created is discussed in the [MongoDB manual][upsert]. - -[upsert]: https://docs.mongodb.com/manual/reference/method/db.collection.update/#upsert-parameter - -If a document has been upserted, its ID will be accessible via -`MongoDB\UpdateResult::getUpsertedId()`. - -The following example demonstrates an upsert via [updateOne()][updateone]: - -``` -demo->users; -$collection->drop(); - -$updateResult = $collection->updateOne( - ['name' => 'Bob'], - ['$set' => ['state' => 'ny']], - ['upsert' => true] -); - -printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); -printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); -var_dump($collection->findOne(['_id' => $updateResult->getUpsertedId()])); -``` - -The above example would output something similar to: - -``` -Matched 0 document(s) -Modified 0 document(s) -object(MongoDB\Model\BSONDocument)#16 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#15 (1) { - ["oid"]=> - string(24) "57509c4406d7241dad86e7c3" - } - ["name"]=> - string(3) "Bob" - ["state"]=> - string(2) "ny" - } -} -``` - -The following example demonstrates an upsert via [replaceOne()][replaceone]: - -``` -demo->users; -$collection->drop(); - -$updateResult = $collection->replaceOne( - ['name' => 'Bob'], - ['name' => 'Alice', 'state' => 'ny'], - ['upsert' => true] -); - -printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); -printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); -var_dump($collection->findOne(['_id' => $updateResult->getUpsertedId()])); -``` - -The above example would output something similar to: - -``` -Matched 0 document(s) -Modified 0 document(s) -object(MongoDB\Model\BSONDocument)#16 (1) { - ["storage":"ArrayObject":private]=> - array(3) { - ["_id"]=> - object(MongoDB\BSON\ObjectID)#15 (1) { - ["oid"]=> - string(24) "57509c6606d7241dad86e7c4" - } - ["name"]=> - string(5) "Alice" - ["state"]=> - string(2) "ny" - } -} -``` - -## Deleting One Document - -The [deleteOne()][deleteone] method may be used to delete a single document -matching a filter. This method returns an instance of `MongoDB\DeleteResult`, -which may be used to access statistics about the delete operation. - -[deleteone]: ../classes/collection.md#deleteone - -This method has two required parameters: a query filter. The query filter is -similar to what might be provided to [find()][find]. - -``` -demo->users; -$collection->drop(); - -$collection->insertOne(['name' => 'Bob', 'state' => 'ny']); -$collection->insertOne(['name' => 'Alice', 'state' => 'ny']); -$deleteResult = $collection->deleteOne(['state' => 'ny']); - -printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); -``` - -The above example would output something similar to: - -``` -Deleted 1 document(s) -``` - -## Deleting Many Documents - -The [deleteMany()][deletemany] method may be used to delete multiple documents -at a time. This method returns an instance of `MongoDB\DeleteResult`, which may -be used to access statistics about the delete operation. - -[deletemany]: ../classes/collection.md#deletemany - -This method has two required parameters: a query filter. The query filter is -similar to what might be provided to [find()][find]. - -``` -demo->users; -$collection->drop(); - -$collection->insertOne(['name' => 'Bob', 'state' => 'ny']); -$collection->insertOne(['name' => 'Alice', 'state' => 'ny']); -$deleteResult = $collection->deleteMany(['state' => 'ny']); - -printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); -``` - -The above example would output something similar to: - -``` -Deleted 2 document(s) -``` - -## Aggregating Documents - -The [Aggregation Framework][aggregation] may be used to issue complex queries -that filter, transform, and group collection data. The [aggregate()][aggregate] -method returns a [Traversable][traversable] object, which may be iterated -upon to access the results of an aggregation pipeline. - -[aggregation]: https://docs.mongodb.org/manual/core/aggregation-pipeline/ -[aggregate]: ../classes/collection.md#aggregate -[traversable]: http://php.net/traversable - -``` -demo->zips; - -$cursor = $collection->aggregate([ - ['$group' => ['_id' => '$state', 'count' => ['$sum' => 1]]], - ['$sort' => ['count' => -1]], - ['$limit' => 5], -]); - -foreach ($cursor as $state) { - printf("%s has %d zip codes\n", $state['_id'], $state['count']); -} -``` - -The above example would output something similar to: - -``` -TX has 1671 zip codes -NY has 1595 zip codes -CA has 1516 zip codes -PA has 1458 zip codes -IL has 1237 zip codes -``` - -**Note:** [aggregate()][aggregate] is documented as returning a -[Traversable][traversable] object because the [aggregate][aggregate-cmd] command -may return its results inline (i.e. a single result document's array field, -which the library will package as a PHP iterator) or via a command cursor (i.e. -[MongoDB\Driver\Cursor][cursor]). - -[aggregate-cmd]: (http://docs.mongodb.org/manual/reference/command/aggregate/) diff --git a/source/tutorial/example-data.md b/source/tutorial/example-data.md deleted file mode 100644 index 9b2be0f4..00000000 --- a/source/tutorial/example-data.md +++ /dev/null @@ -1,45 +0,0 @@ -# Example Data - -Some examples in this documentation use example data fixtures from -[zips.json][zips]. This is a dataset comprised of United States postal codes, -populations, and geographic locations. - -Importing the dataset into MongoDB can be done in several ways. The following -example uses [mongodb extension][ext-mongodb]: - -[zips]: http://media.mongodb.org/zips.json -[ext-mongodb]: http://php.net/mongodb - -``` -insert($document); -} - -$manager = new MongoDB\Driver\Manager('mongodb://localhost'); - -$result = $manager->executeBulkWrite('demo.zips', $bulk); -printf("Inserted %d documents\n", $result->getInsertedCount()); -``` - -Executing this script should yield the following output: - -``` -Inserted 29353 documents -``` - -You may also import the dataset using the [mongoimport][mongoimport] command, -which is included with MongoDB: - -[mongoimport]: http://docs.mongodb.org/manual/reference/program/mongoimport/ - -```bash -$ mongoimport --db demo --collection zips --file zips.json --drop -``` diff --git a/source/tutorial/indexes.md b/source/tutorial/indexes.md deleted file mode 100644 index cd2b7902..00000000 --- a/source/tutorial/indexes.md +++ /dev/null @@ -1,122 +0,0 @@ -# Indexes - -Indexes may be managed via the [MongoDB\Collection][collection] class, which -implements MongoDB's cross-driver [Index Management][index-spec] and -[Enumerating Indexes][enum-spec] specifications. This page will demonstrate how -to create, list, and drop indexes using the library. General information on how -indexes work in MongoDB may be found in the [MongoDB manual][indexes]. - -[collection]: ../classes/collection.md -[index-spec]: https://github.com/mongodb/specifications/blob/master/source/index-management.rst -[enum-spec]: https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst -[indexes]: https://docs.mongodb.org/manual/indexes/ - -## Creating Indexes - -Indexes may be created via the [createIndex()][createindex] and -[createIndexes()][createindexes] methods. The following example creates an -ascending index on the "state" field: - -[createindex]: ../classes/collection.md#createindex -[createindexes]: ../classes/collection.md#createindexes - -``` -demo->zips; - -$result = $collection->createIndex(['state' => 1]); - -var_dump($result); -``` - -Creating an index will return its name, which is automatically generated from -its specification (i.e. fields and orderings). The above example would output -something similar to: - -``` -string(7) "state_1" -``` - -### Enumerating Indexes - -Information about indexes in a collection may be obtained via the -[listIndexes()][listindexes] method, which returns an iterator of -MongoDB\Model\IndexInfo objects. The following example lists all indexes in the -"demo.zips" collection: - -[listindexes]: ../classes/collection.md#listindexes - -``` -demo->zips; - -foreach ($collection->listIndexes() as $indexInfo) { - var_dump($indexInfo); -} -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\IndexInfo)#10 (4) { - ["v"]=> - int(1) - ["key"]=> - array(1) { - ["_id"]=> - int(1) - } - ["name"]=> - string(4) "_id_" - ["ns"]=> - string(9) "demo.zips" -} -object(MongoDB\Model\IndexInfo)#13 (4) { - ["v"]=> - int(1) - ["key"]=> - array(1) { - ["state"]=> - int(1) - } - ["name"]=> - string(7) "state_1" - ["ns"]=> - string(9) "demo.zips" -} -``` - -### Dropping Indexes - -Indexes may be dropped via the [dropIndex()][dropindex] and -[dropIndexes()][dropindexes] methods. The following example drops a single index -by its name: - -[dropindex]: ../classes/collection.md#dropindex -[dropindexes]: ../classes/collection.md#dropindexes - -``` -demo->zips; - -$result = $collection->dropIndex('state_1'); - -var_dump($result); -``` - -The above example would output something similar to: - -``` -object(MongoDB\Model\BSONDocument)#11 (1) { - ["storage":"ArrayObject":private]=> - array(2) { - ["nIndexesWas"]=> - int(2) - ["ok"]=> - float(1) - } -} -``` diff --git a/source/upgrade-guide.md b/source/upgrade-guide.md deleted file mode 100644 index 14f21865..00000000 --- a/source/upgrade-guide.md +++ /dev/null @@ -1,193 +0,0 @@ -# Upgrade Guide - -The MongoDB PHP Library and underlying [mongodb extension][ext-mongodb] have -notable API differences from the legacy [mongo extension][ext-mongo]. This page -will attempt to summarize those differences for the benefit of those upgrading -from the legacy driver. - -Additionally, a community-developed [mongo-php-adapter][adapter] library exists, -which implements the [mongo extension][ext-mongo] API using this library and the -new driver. While this adapter library is not officially supported by MongoDB, -it does bear mentioning. - -[ext-mongo]: http://php.net/mongo -[ext-mongodb]: http://php.net/mongodb -[adapter]: https://github.com/alcaeus/mongo-php-adapter - -## Collection API - -This library's [MongoDB\Collection][collection] class implements MongoDB's -cross-driver [CRUD][crud-spec] and [Index Management][index-spec] -specifications. Although some method names have changed in accordance with the -new specifications, the new class provides the same functionality as the legacy -driver's [MongoCollection][mongocollection] class with some notable exceptions. - -[collection]: classes/collection.md -[crud-spec]: https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst -[index-spec]: https://github.com/mongodb/specifications/blob/master/source/index-management.rst -[mongocollection]: http://php.net/mongocollection - -### Old and New Methods - -| [MongoCollection][mongocollection] | [MongoDB\Collection][collection] | -| --- | --- | -| [aggregate()](http://php.net/manual/en/mongocollection.aggregate.php) | [aggregate()](classes/collection.md#aggregate) | -| [aggregateCursor()](http://php.net/manual/en/mongocollection.aggregatecursor.php) | [aggregate()](classes/collection.md#aggregate) | -| [batchInsert()](http://php.net/manual/en/mongocollection.batchinsert.php) | [insertMany()](classes/collection.md#insertmany) | -| [count()](http://php.net/manual/en/mongocollection.count.php) | [count()](classes/collection.md#count) | -| [createDBRef()](http://php.net/manual/en/mongocollection.createdbref.php) | Not yet implemented ([PHPLIB-24][jira-dbref]) | -| [createIndex()](http://php.net/manual/en/mongocollection.createindex.php) | [createIndex()](classes/collection.md#createindex) | -| [deleteIndex()](http://php.net/manual/en/mongocollection.deleteindex.php) | [dropIndex()](classes/collection.md#dropindex) | -| [deleteIndexes()](http://php.net/manual/en/mongocollection.deleteindexes.php) | [dropIndexes()](classes/collection.md#dropindexes) | -| [drop()](http://php.net/manual/en/mongocollection.drop.php) | [drop()](classes/collection.md#drop) | -| [distinct()](http://php.net/manual/en/mongocollection.distinct.php) | [distinct()](classes/collection.md#distinct) | -| [ensureIndex()](http://php.net/manual/en/mongocollection.ensureindex.php) | [createIndex()](classes/collection.md#createindex) | -| [find()](http://php.net/manual/en/mongocollection.find.php) | [find()](classes/collection.md#find) | -| [findAndModify()](http://php.net/manual/en/mongocollection.findandmodify.php) | [findOneAndDelete()](classes/collection.md#findoneanddelete), [findOneAndReplace()](classes/collection.md#findoneandreplace), and [findOneAndUpdate()](classes/collection.md#findoneandupdate) | -| [findOne()](http://php.net/manual/en/mongocollection.findone.php) | [findOne()](classes/collection.md#findone) | -| [getDBRef()](http://php.net/manual/en/mongocollection.getdbref.php) | Not yet implemented ([PHPLIB-24][jira-dbref]) | -| [getIndexInfo()](http://php.net/manual/en/mongocollection.getindexinfo.php) | [listIndexes()](classes/collection.md#listindexes) | -| [getName()](http://php.net/manual/en/mongocollection.getname.php) | [getCollectionName()](classes/collection.md#getcollectionname) | -| [getReadPreference()](http://php.net/manual/en/mongocollection.getreadpreference.php) | Not implemented | -| [getSlaveOkay()](http://php.net/manual/en/mongocollection.getslaveokay.php) | Not implemented | -| [getWriteConcern()](http://php.net/manual/en/mongocollection.getwriteconcern.php) | Not implemented | -| [group()](http://php.net/manual/en/mongocollection.group.php) | Not yet implemented ([PHPLIB-177][jira-group]). Use [Database::command()](classes/database.md#command) for now. | -| [insert()](http://php.net/manual/en/mongocollection.insert.php) | [insertOne()](classes/collection.md#insertone) | -| [parallelCollectionScan()](http://php.net/manual/en/mongocollection.parallelcollectionscan.php) | Not implemented | -| [remove()](http://php.net/manual/en/mongocollection.remove.php) | [deleteMany()](classes/collection.md#deleteMany) and [deleteOne()](classes/collection.md#deleteone) | -| [save()](http://php.net/manual/en/mongocollection.save.php) | [insertOne()](classes/collection.md#insertone) or [replaceOne()](classes/collection.md#replaceone) with "upsert" option | -| [setReadPreference()](http://php.net/manual/en/mongocollection.setreadpreference.php) | Not implemented. Use [withOptions()](classes/collection.md#withoptions). | -| [setSlaveOkay()](http://php.net/manual/en/mongocollection.getslaveokay.php) | Not implemented | -| [setWriteConcern()](http://php.net/manual/en/mongocollection.setwriteconcern.php) | Not implemented. Use [withOptions()](classes/collection.md#withoptions). | -| [update()](http://php.net/manual/en/mongocollection.update.php) | [replaceOne()](classes/collection.md#replaceone), [updateMany()](classes/collection.md#updatemany), and [updateOne()](classes/collection.md#updateone) | -| [validate()](http://php.net/manual/en/mongocollection.validate.php) | Not implemented | - -[jira-group]: https://jira.mongodb.org/browse/PHPLIB-177 -[jira-dbref]: https://jira.mongodb.org/browse/PHPLIB-24 - -A guiding principle in designing the new APIs was that explicit method names -are preferable to overloaded terms found in the old API. For instance, -[MongoCollection::save()][save] and -[MongoCollection::findAndModify()][findandmodify] have very different modes of -operation, depending on their arguments. Methods were also split to distinguish -between [updating specific fields][update] and -[full-document replacement][replace]. - -[save]: http://php.net/manual/en/mongocollection.save.php -[findandmodify]: http://php.net/manual/en/mongocollection.findandmodify.php -[update]: https://docs.mongodb.org/manual/tutorial/modify-documents/#update-specific-fields-in-a-document -[replace]: https://docs.mongodb.org/manual/tutorial/modify-documents/#replace-the-document - -### Group Command Helper - -[MongoDB\Collection][collection] does not yet have a helper method for the -[group][group] command; however, that is planned in [PHPLIB-177][jira-group]. -The following example demonstrates how to execute a group command using -[Database::command()][command]: - -[command]: classes/database.md#command - -```php -selectDatabase('db_name'); -$cursor = $database->command([ - 'group' => [ - 'ns' => 'collection_name', - 'key' => ['field_name' => 1], - 'initial' => ['total' => 0], - '$reduce' => new MongoDB\BSON\Javascript('...'), - ], -]); - -$resultDocument = $cursor->toArray()[0]; -``` - -[group]: https://docs.mongodb.org/manual/reference/command/group/ - -### MapReduce Command Helper - -[MongoDB\Collection][collection] does not yet have a helper method for the -[mapReduce][mapReduce] command; however, that is planned in -[PHPLIB-53][jira-mapreduce]. The following example demonstrates how to execute a -mapReduce command using [Database::command()][command]: - -```php -selectDatabase('db_name'); -$cursor = $database->command([ - 'mapReduce' => 'collection_name', - 'map' => new MongoDB\BSON\Javascript('...'), - 'reduce' => new MongoDB\BSON\Javascript('...'), - 'out' => 'output_collection_name', -]); - -$resultDocument = $cursor->toArray()[0]; -``` - -[mapReduce]: https://docs.mongodb.org/manual/reference/command/mapReduce/ -[jira-mapreduce]: https://jira.mongodb.org/browse/PHPLIB-53 - -### DBRef Helpers - -[MongoDB\Collection][collection] does not yet have helper methods for working -with [DBRef][dbref] objects; however, that is planned in -[PHPLIB-24][jira-dbref]. - -[dbref]: https://docs.mongodb.org/manual/reference/database-references/#dbrefs - -### MongoCollection::save() Removed - -[MongoCollection::save()][save], which was syntactic sugar for an insert or -upsert operation, has been removed in favor of explicitly using -[insertOne()][insertone] or [replaceOne()][replaceone] (with the "upsert" -option). - -[insertone]: classes/collection.md#insertone -[replaceone]: classes/collection.md#replaceone - -![save() flowchart](img/save-flowchart.png) - -While the [save()][save] method does have its uses for interactive environments, -such as the mongo shell, it was intentionally excluded from the -[CRUD][crud-spec] specification for language drivers. Generally, application -code should know if the document has an identifier and be able to explicitly -insert or replace the document and handle the returned InsertResult or -UpdateResult, respectively. This also helps avoid inadvertent and potentially -dangerous [full-document replacements][replace]. - -### Accessing IDs of Inserted Documents - -In the legacy driver, [MongoCollection::insert()][insert], -[MongoCollection::batchInsert()][batchinsert], and -[MongoCollection::save()][save] (when inserting) would modify their input -argument by injecting an "_id" key containing the generated ObjectId (i.e. -[MongoId][mongoid] object). This behavior was a bit of a hack, as it did not -rely on the argument being [passed by reference][byref]; it directly modified -memory through the extension API and could not be implemented in PHP userland. -As such, it is no longer done in the new driver and library. - -[insert]: http://php.net/manual/en/mongocollection.insert.php -[batchinsert]: http://php.net/manual/en/mongocollection.batchinsert.php -[mongoid]: http://php.net/manual/en/class.mongoid.php -[byref]: http://php.net/manual/en/language.references.pass.php - -IDs of inserted documents (whether generated or not) may be accessed through the -result objects returned by the write methods: - - * MongoDB\InsertOneResult::getInsertedId() for [insertOne()][insertone] - * MongoDB\InsertManyResult::getInsertedIds() for [insertMany()][insertmany] - * MongoDB\BulkWriteResult::getInsertedIds() for [bulkWrite()][bulkwrite] - -[insertmany]: classes/collection.md#insertmany -[bulkwrite]: classes/collection.md#bulkwrite - -### MongoWriteBatch - -The legacy driver's [MongoWriteBatch][batch] classes have been replaced with a -general-purpose [bulkWrite()][bulkwrite] method. Whereas the legacy driver only -allowed bulk operations of the same time, the new method allows operations to be -mixed (e.g. inserts, updates, and deletes). - -[batch]: http://php.net/manual/en/class.mongowritebatch.php From 1c759511f4abb48b1d1592c373316aa86b2b5bb5 Mon Sep 17 00:00:00 2001 From: Allison Moore Date: Tue, 9 Aug 2016 14:52:07 -0400 Subject: [PATCH 027/321] Port docs to RST and split the API reference --- source/.static/.mongodb | 0 source/{img => images}/save-flowchart.png | Bin ...-MongoDBClient-method-construct-param.yaml | 47 ++ ...goDBClient-method-dropDatabase-option.yaml | 8 + ...ngoDBClient-method-dropDatabase-param.yaml | 15 + ...piargs-MongoDBClient-method-get-param.yaml | 7 + ...oDBClient-method-listDatabases-option.yaml | 5 + ...goDBClient-method-listDatabases-param.yaml | 8 + ...DBClient-method-selectDatabase-option.yaml | 26 + ...oDBClient-method-selectDatabase-param.yaml | 12 + ...oDBCollection-method-aggregate-option.yaml | 73 ++ ...goDBCollection-method-aggregate-param.yaml | 16 + ...oDBCollection-method-bulkWrite-option.yaml | 30 + ...goDBCollection-method-bulkWrite-param.yaml | 39 + ...goDBCollection-method-construct-param.yaml | 34 + ...MongoDBCollection-method-count-option.yaml | 52 ++ ...-MongoDBCollection-method-count-param.yaml | 12 + ...BCollection-method-createIndex-option.yaml | 99 +++ ...DBCollection-method-createIndex-param.yaml | 24 + ...DBCollection-method-deleteMany-option.yaml | 8 + ...oDBCollection-method-deleteMany-param.yaml | 14 + ...oDBCollection-method-deleteOne-option.yaml | 8 + ...goDBCollection-method-deleteOne-param.yaml | 14 + ...goDBCollection-method-distinct-option.yaml | 21 + ...ngoDBCollection-method-distinct-param.yaml | 22 + ...-MongoDBCollection-method-drop-option.yaml | 6 + ...s-MongoDBCollection-method-drop-param.yaml | 7 + ...oDBCollection-method-dropIndex-option.yaml | 6 + ...goDBCollection-method-dropIndex-param.yaml | 19 + ...BCollection-method-dropIndexes-option.yaml | 6 + ...DBCollection-method-dropIndexes-param.yaml | 6 + ...-MongoDBCollection-method-find-option.yaml | 167 +++++ ...s-MongoDBCollection-method-find-param.yaml | 14 + ...ngoDBCollection-method-findOne-option.yaml | 56 ++ ...ongoDBCollection-method-findOne-param.yaml | 14 + ...ection-method-findOneAndDelete-option.yaml | 24 + ...lection-method-findOneAndDelete-param.yaml | 14 + ...ction-method-findOneAndReplace-option.yaml | 42 ++ ...ection-method-findOneAndReplace-param.yaml | 25 + ...ection-method-findOneAndUpdate-option.yaml | 52 ++ ...lection-method-findOneAndUpdate-param.yaml | 27 + ...DBCollection-method-insertMany-option.yaml | 18 + ...oDBCollection-method-insertMany-param.yaml | 16 + ...oDBCollection-method-insertOne-option.yaml | 12 + ...goDBCollection-method-insertOne-param.yaml | 16 + ...BCollection-method-listIndexes-option.yaml | 6 + ...DBCollection-method-listIndexes-param.yaml | 6 + ...DBCollection-method-replaceOne-option.yaml | 18 + ...oDBCollection-method-replaceOne-param.yaml | 25 + ...DBCollection-method-updateMany-option.yaml | 18 + ...oDBCollection-method-updateMany-param.yaml | 22 + ...oDBCollection-method-updateOne-option.yaml | 18 + ...goDBCollection-method-updateOne-param.yaml | 22 + ...BCollection-method-withOptions-option.yaml | 32 + ...DBCollection-method-withOptions-param.yaml | 6 + ...MongoDBDatabase-method-command-option.yaml | 12 + ...-MongoDBDatabase-method-command-param.yaml | 17 + ...ngoDBDatabase-method-construct-option.yaml | 24 + ...ongoDBDatabase-method-construct-param.yaml | 18 + ...tabase-method-createCollection-option.yaml | 238 +++++++ ...atabase-method-createCollection-param.yaml | 14 + ...gs-MongoDBDatabase-method-drop-option.yaml | 6 + ...rgs-MongoDBDatabase-method-drop-param.yaml | 14 + ...Database-method-dropCollection-option.yaml | 6 + ...BDatabase-method-dropCollection-param.yaml | 14 + ...args-MongoDBDatabase-method-get-param.yaml | 6 + ...atabase-method-listCollections-option.yaml | 24 + ...Database-method-listCollections-param.yaml | 7 + ...tabase-method-selectCollection-option.yaml | 24 + ...atabase-method-selectCollection-param.yaml | 13 + ...oDBDatabase-method-withOptions-option.yaml | 32 + ...goDBDatabase-method-withOptions-param.yaml | 6 + source/includes/apiargs-common-option.yaml | 95 +++ source/includes/apiargs-common-param.yaml | 46 ++ source/includes/example-insertOne.rst | 64 ++ .../extracts-bson-deserialization-base.yaml | 13 + .../extracts-bson-deserialization.yaml | 21 + source/index.txt | 74 ++ source/reference.txt | 13 + source/reference/bson.txt | 220 ++++++ source/reference/class/MongoDBClient.txt | 36 + source/reference/class/MongoDBCollection.txt | 83 +++ source/reference/class/MongoDBDatabase.txt | 59 ++ .../method/MongoDBClient-dropDatabase.txt | 70 ++ .../method/MongoDBClient-listDatabases.txt | 78 ++ .../method/MongoDBClient-selectCollection.txt | 72 ++ .../method/MongoDBClient-selectDatabase.txt | 71 ++ .../method/MongoDBClient__construct.txt | 66 ++ .../reference/method/MongoDBClient__get.txt | 63 ++ .../method/MongoDBCollection-aggregate.txt | 66 ++ .../method/MongoDBCollection-bulkWrite.txt | 44 ++ .../method/MongoDBCollection-count.txt | 39 + .../method/MongoDBCollection-createIndex.txt | 107 +++ .../MongoDBCollection-createIndexes.txt | 98 +++ .../method/MongoDBCollection-deleteMany.txt | 69 ++ .../method/MongoDBCollection-deleteOne.txt | 71 ++ .../method/MongoDBCollection-distinct.txt | 256 +++++++ .../method/MongoDBCollection-drop.txt | 76 ++ .../method/MongoDBCollection-dropIndex.txt | 76 ++ .../method/MongoDBCollection-dropIndexes.txt | 77 ++ .../method/MongoDBCollection-find.txt | 156 ++++ .../method/MongoDBCollection-findOne.txt | 85 +++ .../MongoDBCollection-findOneAndDelete.txt | 89 +++ .../MongoDBCollection-findOneAndReplace.txt | 134 ++++ .../MongoDBCollection-findOneAndUpdate.txt | 73 ++ .../MongoDBCollection-getCollectionName.txt | 38 + .../MongoDBCollection-getDatabaseName.txt | 38 + .../method/MongoDBCollection-getNamespace.txt | 39 + .../method/MongoDBCollection-insertMany.txt | 97 +++ .../method/MongoDBCollection-insertOne.txt | 52 ++ .../method/MongoDBCollection-listIndexes.txt | 112 +++ .../method/MongoDBCollection-replaceOne.txt | 114 +++ .../method/MongoDBCollection-updateMany.txt | 109 +++ .../method/MongoDBCollection-updateOne.txt | 110 +++ .../method/MongoDBCollection-withOptions.txt | 49 ++ .../method/MongoDBCollection__construct.txt | 44 ++ .../method/MongoDBDatabase-command.txt | 125 ++++ .../MongoDBDatabase-createCollection.txt | 89 +++ .../reference/method/MongoDBDatabase-drop.txt | 68 ++ .../method/MongoDBDatabase-dropCollection.txt | 71 ++ .../MongoDBDatabase-getDatabaseName.txt | 43 ++ .../MongoDBDatabase-listCollections.txt | 85 +++ .../MongoDBDatabase-selectCollection.txt | 140 ++++ .../method/MongoDBDatabase-withOptions.txt | 48 ++ .../method/MongoDBDatabase__construct.txt | 40 ++ .../reference/method/MongoDBDatabase__get.txt | 63 ++ source/tutorial.txt | 10 + source/tutorial/commands.txt | 388 ++++++++++ source/tutorial/crud.txt | 672 ++++++++++++++++++ source/tutorial/example-data.md | 45 ++ source/tutorial/indexes.txt | 134 ++++ source/tutorial/install-php-library.txt | 64 ++ source/upgrade.txt | 273 +++++++ 133 files changed, 7609 insertions(+) create mode 100644 source/.static/.mongodb rename source/{img => images}/save-flowchart.png (100%) create mode 100644 source/includes/apiargs-MongoDBClient-method-construct-param.yaml create mode 100644 source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml create mode 100644 source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml create mode 100644 source/includes/apiargs-MongoDBClient-method-get-param.yaml create mode 100644 source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml create mode 100644 source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml create mode 100644 source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml create mode 100644 source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-construct-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-count-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-count-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-drop-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-drop-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-find-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-find-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-command-option.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-command-param.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-get-param.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml create mode 100644 source/includes/apiargs-common-option.yaml create mode 100644 source/includes/apiargs-common-param.yaml create mode 100644 source/includes/example-insertOne.rst create mode 100644 source/includes/extracts-bson-deserialization-base.yaml create mode 100644 source/includes/extracts-bson-deserialization.yaml create mode 100644 source/index.txt create mode 100644 source/reference.txt create mode 100644 source/reference/bson.txt create mode 100644 source/reference/class/MongoDBClient.txt create mode 100644 source/reference/class/MongoDBCollection.txt create mode 100644 source/reference/class/MongoDBDatabase.txt create mode 100644 source/reference/method/MongoDBClient-dropDatabase.txt create mode 100644 source/reference/method/MongoDBClient-listDatabases.txt create mode 100644 source/reference/method/MongoDBClient-selectCollection.txt create mode 100644 source/reference/method/MongoDBClient-selectDatabase.txt create mode 100644 source/reference/method/MongoDBClient__construct.txt create mode 100644 source/reference/method/MongoDBClient__get.txt create mode 100644 source/reference/method/MongoDBCollection-aggregate.txt create mode 100644 source/reference/method/MongoDBCollection-bulkWrite.txt create mode 100644 source/reference/method/MongoDBCollection-count.txt create mode 100644 source/reference/method/MongoDBCollection-createIndex.txt create mode 100644 source/reference/method/MongoDBCollection-createIndexes.txt create mode 100644 source/reference/method/MongoDBCollection-deleteMany.txt create mode 100644 source/reference/method/MongoDBCollection-deleteOne.txt create mode 100644 source/reference/method/MongoDBCollection-distinct.txt create mode 100644 source/reference/method/MongoDBCollection-drop.txt create mode 100644 source/reference/method/MongoDBCollection-dropIndex.txt create mode 100644 source/reference/method/MongoDBCollection-dropIndexes.txt create mode 100644 source/reference/method/MongoDBCollection-find.txt create mode 100644 source/reference/method/MongoDBCollection-findOne.txt create mode 100644 source/reference/method/MongoDBCollection-findOneAndDelete.txt create mode 100644 source/reference/method/MongoDBCollection-findOneAndReplace.txt create mode 100644 source/reference/method/MongoDBCollection-findOneAndUpdate.txt create mode 100644 source/reference/method/MongoDBCollection-getCollectionName.txt create mode 100644 source/reference/method/MongoDBCollection-getDatabaseName.txt create mode 100644 source/reference/method/MongoDBCollection-getNamespace.txt create mode 100644 source/reference/method/MongoDBCollection-insertMany.txt create mode 100644 source/reference/method/MongoDBCollection-insertOne.txt create mode 100644 source/reference/method/MongoDBCollection-listIndexes.txt create mode 100644 source/reference/method/MongoDBCollection-replaceOne.txt create mode 100644 source/reference/method/MongoDBCollection-updateMany.txt create mode 100644 source/reference/method/MongoDBCollection-updateOne.txt create mode 100644 source/reference/method/MongoDBCollection-withOptions.txt create mode 100644 source/reference/method/MongoDBCollection__construct.txt create mode 100644 source/reference/method/MongoDBDatabase-command.txt create mode 100644 source/reference/method/MongoDBDatabase-createCollection.txt create mode 100644 source/reference/method/MongoDBDatabase-drop.txt create mode 100644 source/reference/method/MongoDBDatabase-dropCollection.txt create mode 100644 source/reference/method/MongoDBDatabase-getDatabaseName.txt create mode 100644 source/reference/method/MongoDBDatabase-listCollections.txt create mode 100644 source/reference/method/MongoDBDatabase-selectCollection.txt create mode 100644 source/reference/method/MongoDBDatabase-withOptions.txt create mode 100644 source/reference/method/MongoDBDatabase__construct.txt create mode 100644 source/reference/method/MongoDBDatabase__get.txt create mode 100644 source/tutorial.txt create mode 100644 source/tutorial/commands.txt create mode 100644 source/tutorial/crud.txt create mode 100644 source/tutorial/example-data.md create mode 100644 source/tutorial/indexes.txt create mode 100644 source/tutorial/install-php-library.txt create mode 100644 source/upgrade.txt diff --git a/source/.static/.mongodb b/source/.static/.mongodb new file mode 100644 index 00000000..e69de29b diff --git a/source/img/save-flowchart.png b/source/images/save-flowchart.png similarity index 100% rename from source/img/save-flowchart.png rename to source/images/save-flowchart.png diff --git a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml new file mode 100644 index 00000000..39d52142 --- /dev/null +++ b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml @@ -0,0 +1,47 @@ +arg_name: param +name: $uri +type: string +description: | + The URI of the standalone, replica set, or sharded cluster to which to connect. Refer + to the :manual:`MongoDB connection string reference ` + for formatting. + + Defaults to ``mongodb://localhost:27017`` if unspecified. +interface: phpmethod +operation: MongoDB\\Client::__construct +optional: true +position: 1 +--- +arg_name: param +name: $uriOptions +type: array +description: | + Specifies additional URI options, such as authentication credentials + or query string parameters. The options specified in ``$uriOptions`` + take precedence over any analogous options present in the + ``$uri`` string. +post: | + Refer to the :php:`MongoDB\\Driver\\Manager::__construct() + ` extension reference and + :manual:`MongoDB connection string ` + documentation for valid options. +interface: phpmethod +operation: MongoDB\\Client::__construct +optional: true +position: 2 +--- +arg_name: param +name: $driverOptions +type: array +description: | + Specify driver-specific options. In addition to any + options supported by the :php:`extension `, + the |php-library| allows you to specify a default ``typeMap`` to + apply to the cursors it creates. Refer to the driver's + :php:`Persistence documentation ` for more + about type maps. +interface: phpmethod +operation: MongoDB\\Client::__construct +optional: true +position: 3 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml new file mode 100644 index 00000000..52da8b42 --- /dev/null +++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml @@ -0,0 +1,8 @@ +arg_name: option +interface: phpmethod +operation: MongoDB\\Client::dropDatabase +source: + file: apiargs-common-option.yaml + ref: typeMap +position: 1 +... diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml new file mode 100644 index 00000000..d588d522 --- /dev/null +++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml @@ -0,0 +1,15 @@ +source: + ref: $databaseName + file: apiargs-common-param.yaml +arg_name: param +interface: phpmethod +operation: MongoDB\\Client::dropDatabase +--- +source: + ref: $options + file: apiargs-common-param.yaml +arg_name: param +interface: phpmethod +operation: MongoDB\\Client::dropDatabase +position: 2 +... diff --git a/source/includes/apiargs-MongoDBClient-method-get-param.yaml b/source/includes/apiargs-MongoDBClient-method-get-param.yaml new file mode 100644 index 00000000..8a71be55 --- /dev/null +++ b/source/includes/apiargs-MongoDBClient-method-get-param.yaml @@ -0,0 +1,7 @@ +source: + ref: $databaseName + file: apiargs-common-param.yaml +arg_name: param +interface: phpmethod +operation: MongoDB\\Client::__get +... diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml new file mode 100644 index 00000000..dff0a84f --- /dev/null +++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml @@ -0,0 +1,5 @@ +source: + file: apiargs-common-option.yaml + ref: maxTimeMS +position: 1 +... diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml new file mode 100644 index 00000000..f0dfad50 --- /dev/null +++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml @@ -0,0 +1,8 @@ +source: + ref: $options + file: apiargs-common-param.yaml +arg_name: param +interface: phpmethod +operation: MongoDB\\Client::listDatabases +position: 1 +... diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml new file mode 100644 index 00000000..28ce2f4b --- /dev/null +++ b/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml @@ -0,0 +1,26 @@ +source: + ref: readConcern + file: apiargs-common-option.yaml +operation: MongoDB\\Client::selectDatabase +replacement: + resource: "database" +--- +source: + ref: readPreference + file: apiargs-common-option.yaml +operation: MongoDB\\Client::selectDatabase +replacement: + resource: "database" +--- +source: + ref: typeMap + file: apiargs-common-option.yaml +operation: MongoDB\\Client::selectDatabase +--- +source: + ref: writeConcern + file: apiargs-common-option.yaml +operation: MongoDB\\Client::selectDatabase +replacement: + resource: "database" +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml new file mode 100644 index 00000000..e79c1972 --- /dev/null +++ b/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml @@ -0,0 +1,12 @@ +source: + ref: $databaseName + file: apiargs-common-param.yaml +operation: MongoDB\\Client::selectDatabase +position: 1 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Client::selectDatabase +position: 2 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml new file mode 100644 index 00000000..8804e887 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml @@ -0,0 +1,73 @@ +arg_name: option +name: allowDiskUse +type: boolean +description: | + Enables writing to temporary files. When set to true, aggregation + stages can write data to the ``_tmp`` sub-directory in the dbPath + directory. The default is ``false``. +interface: phpmethod +operation: MongoDB\\Collection::aggregate +optional: true +position: 1 +--- +arg_name: option +name: batchSize +type: integer +description: | + The number of documents to return per batch +interface: phpmethod +operation: MongoDB\\Collection::aggregate +optional: true +position: 2 +--- +source: + ref: bypassDocumentValidation + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::aggregate +position: 5 +--- +source: + ref: maxTimeMS + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::aggregate +position: 4 +--- +source: + ref: readConcern + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::selectDatabase +replacement: + resource: "aggregation" +position: 5 +--- +source: + ref: readPreference + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::selectDatabase +replacement: + resource: "aggregation" +position: 6 +--- +source: + ref: typeMap + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::selectDatabase +position: 7 +--- +arg_name: param +name: useCursor +type: boolean +description: | + Indicates whether the command will request that the server provide + results using a cursor. The default is ``true``. + + For MongoDB version 2.6 or later, ``useCursor`` allows users to turn + off cursors if necessary to aid in mongod/mongos upgrades. + + ``useCursor`` is ignored for MongoDB versions prior to 2.6 as + aggregation cursors are not available pre-2.6. +interface: phpmethod +operation: MongoDB\\Collection::aggregate +optional: true +position: 8 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml new file mode 100644 index 00000000..b7fdfb88 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml @@ -0,0 +1,16 @@ +arg_name: param +name: $pipeline +type: array +description: | + Specifies an :manual:`aggregation pipeline ` operation. +interface: phpmethod +operation: MongoDB\\Collection::aggregate +optional: true +position: 1 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::aggregate +position: 2 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml new file mode 100644 index 00000000..93cec712 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml @@ -0,0 +1,30 @@ +source: + ref: bypassDocumentValidation + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::bulkWrite +position: 1 +--- +arg_name: option +name: ordered +type: boolean +description: | + If ``true``: when an insert fails, the operation returns without performing the + remaining writes. + + If ``false``: when a write fails, the operation will continue with the + remaining writes, if any. + + The default is ``true``. +optional: true +interface: phpmethod +operation: MongoDB\\Collection::bulkWrite +position: 2 +--- +source: + ref: writeConcern + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::bulkWrite +replacement: + resource: "write" +position: 3 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml new file mode 100644 index 00000000..f9996c2d --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml @@ -0,0 +1,39 @@ +arg_name: param +name: $operations +type: array +description: | + An array containing the write operations to perform. {{role}} + supports :phpmethod:`deleteMany `, + :phpmethod:`deleteOne `, :phpmethod:`insertOne + `, :phpmethod:`replaceOne + `, :phpmethod:`updateMany + `, and :phpmethod:`updateOne + ` operations in the following array + structure: + + .. code-block:: php + + [ + [ 'deleteMany' => [ $filter ] ], + [ 'deleteOne' => [ $filter ] ], + [ 'insertOne' => [ $document ] ], + [ 'replaceOne' => [ $filter, $replacement, $options ] ], + [ 'updateMany' => [ $filter, $update, $options ] ], + [ 'updateOne' => [ $filter, $update, $options ] ], + ] +post: | + Arguments correspond to the respective operation methods. However, + the ``writeConcern`` option is specified for the top-level bulk write + operation instead of each individual operation. +interface: phpmethod +operation: MongoDB\\Collection::bulkWrite +optional: true +position: 1 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::bulkWrite +interface: phpmethod +position: 2 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml b/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml new file mode 100644 index 00000000..7c2ecfd6 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml @@ -0,0 +1,34 @@ +arg_name: param +name: $manager +type: :php:`MongoDB\\Driver\\Manager ` +description: | + The :php:`Manager ` instance from the driver. + The manager maintains connections between the driver and your MongoDB + instances. +interface: phpmethod +operation: MongoDB\\Collection::__construct +optional: false +position: 1 +--- +source: + ref: $databaseName + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::__construct +replacement: + select: "" +position: 2 +--- +source: + ref: $collectionName + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::__construct +replacement: + select: "" +position: 3 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::__construct +position: 4 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml new file mode 100644 index 00000000..36cc82cb --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml @@ -0,0 +1,52 @@ +arg_name: option +name: hint +type: string or array|object +description: | + The index to use. If you specify a document, it is interpreted as + an index specification and a name will be generated. +optional: true +interface: phpmethod +operation: MongoDB\\Collection::count +position: 1 +--- +arg_name: option +name: limit +type: integer +description: | + The maximum number of documents to return. +optional: true +interface: phpmethod +operation: MongoDB\\Collection::count +position: 2 +--- +source: + ref: maxTimeMS + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::count +position: 3 +--- +source: + ref: readConcern + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::count +replacement: + resource: "count" +position: 4 +--- +source: + ref: readPreference + file: apiargs-common-option.yaml +replacement: + resource: "count" +position: 5 +--- +arg_name: option +name: skip +type: integer +description: | + The number of documents to skip before returning the documents. +optional: true +interface: phpmethod +operation: MongoDB\\Collection::count +position: 6 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-count-param.yaml b/source/includes/apiargs-MongoDBCollection-method-count-param.yaml new file mode 100644 index 00000000..bc666678 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-count-param.yaml @@ -0,0 +1,12 @@ +source: + ref: $filter + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::count +position: 1 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::count +position: 2 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml new file mode 100644 index 00000000..1c22e6e8 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml @@ -0,0 +1,99 @@ +arg_name: option +name: unique +type: boolean +description: | + Creates a :manual:`unique ` index. +interface: phpmethod +operation: MongoDB\\Collection::createIndex +optional: true +position: 1 +--- +arg_name: option +name: partialFilterExpression +type: array|object +description: | + Creates a :manual:`partial ` index. +interface: phpmethod +operation: MongoDB\\Collection::createIndex +optional: true +position: 2 +--- +arg_name: option +name: sparse +type: boolean +description: | + Creates a :manual:`sparse ` index. +interface: phpmethod +operation: MongoDB\\Collection::createIndex +optional: true +position: 3 +--- +arg_name: option +name: expireAfterSeconds +type: integer +description: | + Creates a :manual:`TTL ` index. +interface: phpmethod +operation: MongoDB\\Collection::createIndex +optional: true +position: 4 +--- +arg_name: option +name: name +type: string +description: | + Specifies the name for the index. By default, MongoDB creates index + names based on the key. +interface: phpmethod +operation: MongoDB\\Collection::createIndex +optional: true +position: 5 +--- +arg_name: option +name: background +type: string +description: | + Instructs MongoDB to build the index :manual:`as a background + ` process. +interface: phpmethod +operation: MongoDB\\Collection::createIndex +optional: true +position: 6 +--- +arg_name: option +name: 2dsphereIndexVersion +type: integer +description: | + Specifies the :manual:`version of a 2dsphere ` index + to create. + + MongoDB 2.6 introduced version 2 of 2dsphere indexes. Version 2 is + the default version of 2dsphere indexes created in MongoDB 2.6 and + later series. ``2dsphereIndexVersion`` enables you to overrride the + default version 2. +interface: phpmethod +operation: MongoDB\\Collection::createIndex +optional: true +position: 7 +--- +arg_name: option +name: socketTimeoutMS +type: integer +description: | + Specifies the time limit, in milliseconds, for socket + communication. If the :program:`mongod` does not respond within the + timeout period, a ``MongoCursorTimeoutException`` is thrown and + there will be no way to determine if the server actually handled the + write or not. Specify ``-1`` to block indefinitely. The default value + is 30000 (30 seconds). +interface: phpmethod +operation: MongoDB\\Collection::createIndex +optional: true +position: 8 +--- +source: + ref: maxTimeMS + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::createIndex +position: 9 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml new file mode 100644 index 00000000..23a75281 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml @@ -0,0 +1,24 @@ +arg_name: param +name: $key +type: array|object +description: | + Specifies the field or fields to index and the index order. + + For example, the following specifies a descending index + on the ``username`` field: + + .. code-block:: php + + $key = [ 'username' => -1 ]; + +operation: MongoDB\\Collection::createIndex +interface: phpmethod +optional: false +position: 1 +--- +source: + file: apiargs-common-param.yaml + ref: $options +operation: MongoDB\\Collection::createIndex +position: 2 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml new file mode 100644 index 00000000..1593a191 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml @@ -0,0 +1,8 @@ +source: + ref: writeConcern + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::deleteMany +replacement: + resource: "delete" +position: 1 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml new file mode 100644 index 00000000..c304607c --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml @@ -0,0 +1,14 @@ +source: + ref: $filter + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::deleteMany +replacement: + verb: "delete" +position: 1 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::deleteMany +position: 2 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml new file mode 100644 index 00000000..55bd14ad --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml @@ -0,0 +1,8 @@ +source: + ref: writeConcern + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::deleteOne +replacement: + resource: "delete" +position: 1 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml new file mode 100644 index 00000000..1ab60699 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml @@ -0,0 +1,14 @@ +source: + ref: $filter + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::deleteOne +replacement: + verb: "delete" +position: 1 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::deleteOne +position: 2 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml new file mode 100644 index 00000000..6c1ad568 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml @@ -0,0 +1,21 @@ +source: + ref: maxTimeMS + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::distinct +position: 1 +--- +source: + ref: readConcern + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::distinct +replacement: + resource: "distinct" +position: 2 +--- +source: + ref: readPreference + file: apiargs-common-option.yaml +replacement: + resource: "distinct" +position: 3 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml new file mode 100644 index 00000000..c5396306 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml @@ -0,0 +1,22 @@ +arg_name: param +name: $fieldName +type: string +description: | + The field for which to return distinct values. +interface: phpmethod +operation: MongoDB\\Collection::distinct +optional: false +position: 1 +--- +source: + file: apiargs-common-param.yaml + ref: $filter +position: 2 +optional: true +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::count +position: 3 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml new file mode 100644 index 00000000..a73e6b98 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml @@ -0,0 +1,6 @@ +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Collection::drop +position: 1 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml new file mode 100644 index 00000000..8f0f8afd --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml @@ -0,0 +1,7 @@ +source: + file: apiargs-common-param.yaml + ref: $options +interface: phpmethod +operation: MongoDB\\Collection::drop +position: 1 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml new file mode 100644 index 00000000..a88f9759 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml @@ -0,0 +1,6 @@ +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Collection::dropIndex +position: 1 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml new file mode 100644 index 00000000..85a6b386 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml @@ -0,0 +1,19 @@ +arg_name: param +name: $indexName +type: string +description: | + The name of the index to drop. View the existing indexes on the + collection using the :phpmethod:`listIndexes + ` method. +interface: phpmethod +operation: MongoDB\\Collection::dropIndex +optional: false +position: 1 +--- +source: + file: apiargs-common-param.yaml + ref: $options +interface: phpmethod +operation: MongoDB\\Collection::dropIndex +position: 2 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml new file mode 100644 index 00000000..1b228492 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml @@ -0,0 +1,6 @@ +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Collection::dropIndexes +position: 1 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml new file mode 100644 index 00000000..db7a73d8 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml @@ -0,0 +1,6 @@ +source: + file: apiargs-common-param.yaml + ref: $options +operation: MongoDB\\Collection::dropIndexes +position: 1 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml new file mode 100644 index 00000000..4ccc8aea --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml @@ -0,0 +1,167 @@ +name: sort +type: array|object +optional: true +description: | + The sort specification for the ordering of the results. +arg_name: field +operation: MongoDB\\Collection::find +interface: phpmethod +position: 2 +--- +name: projection +type: array|object +optional: true +description: | + The :ref:`projection specification ` to determine + which fields to include in the returned documents. See + :manual:`Project Fields to Return from Query + ` in the MongoDB + manual. +arg_name: field +operation: MongoDB\\Collection::find +interface: phpmethod +position: 1 +--- +name: skip +type: integer +optional: true +description: | + Number of documents to skip. Defaults to 0. +arg_name: field +operation: MongoDB\\Collection::find +interface: phpmethod +position: 3 +--- +name: limit +type: integer +optional: true +description: | + The maximum number of documents to return. If unspecified, + then defaults to no limit. A limit of 0 is equivalent to setting no + limit. +arg_name: field +operation: MongoDB\\Collection::find +interface: phpmethod +position: 4 +--- +name: batchSize +type: integer +optional: true +description: | + The number of documents to return in the first batch. + Defaults to 101. A batchSize of 0 means that the cursor will be + established, but no documents will be returned in the first batch. + + Unlike the previous wire protocol version, a batchSize of 1 for + the :dbcommand:`find` command does not close the cursor. +arg_name: field +operation: MongoDB\\Collection::find +interface: phpmethod +position: 5 +--- +name: comment +type: string +optional: true +description: | + A comment to attach to the query to help interpret and trace query + :dbcommand:`profile` data. +arg_name: field +operation: MongoDB\\Collection::find +interface: phpmethod +position: 6 +--- +arg_name: option +name: cursorType +type: integer +description: | + Indicates the type of cursor to use. The cursor types are + ``MongoDB\Operation\Find`` class constants. + + Must be either + ``NON_TAILABLE``, ``TAILABLE``, or ``TAILABLE_AWAIT``. The default is + ``NON_TAILABLE``. +interface: phpmethod +operation: MongoDB\\Collection::find +optional: true +position: 7 +--- +source: + file: apiargs-common-option.yaml + ref: maxTimeMS +operation: MongoDB\\Collection::find +position: 8 +--- +source: + file: apiargs-common-option.yaml + ref: readConcern +operation: MongoDB\\Collection::find +position: 9 +--- +source: + file: apiargs-common-option.yaml + ref: readPreference +pre: | + For use with MongoDB 3.0 and earlier. +operation: MongoDB\\Collection::find +position: 10 +--- +name: oplogReplay +type: boolean +optional: true +description: | + Internal use for replica sets. To use oplogReplay, you must include + the following condition in the filter: + + .. code-block:: javascript + + { ts: { $gte: } } + + The :php:`MongoDB\\BSON\\Timestamp ` + class reference describes how to represent MongoDB's BSON + timestamp type with PHP. +arg_name: field +operation: MongoDB\\Collection::find +interface: phpmethod +position: 11 +--- +name: noCursorTimeout +type: boolean +optional: true +description: | + Prevents the server from timing out idle cursors after an inactivity + period (10 minutes). +arg_name: field +operation: MongoDB\\Collection::find +interface: phpmethod +position: 12 +--- +name: allowPartialResults +type: boolean +optional: true +description: | + For queries against a sharded collection, returns partial results from + the :program:`mongos` if some shards are unavailable instead of + throwing an error. +arg_name: field +operation: MongoDB\\Collection::find +interface: phpmethod +position: 13 +--- +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Collection::find +position: 14 +--- +arg_name: option +name: modifiers +type: array +description: | + Meta-operators that modify the output or behavior of a query. + :manual:`Cursor Methods describes the + query modification methods available in MongoDB. +interface: phpmethod +operation: MongoDB\\Collection::find +optional: true +position: 15 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-find-param.yaml b/source/includes/apiargs-MongoDBCollection-method-find-param.yaml new file mode 100644 index 00000000..4c2e6c51 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-find-param.yaml @@ -0,0 +1,14 @@ +source: + ref: $filter + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::find +replacement: + verb: "query" +position: 1 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::find +position: 2 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml new file mode 100644 index 00000000..751cb510 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml @@ -0,0 +1,56 @@ +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: projection +operation: MongoDB\\Collection::findOne +position: 1 +--- +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: sort +operation: MongoDB\\Collection::findOne +position: 2 +--- +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: skip +operation: MongoDB\\Collection::findOne +position: 3 +--- +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: comment +operation: MongoDB\\Collection::findOne +position: 4 +--- +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: modifiers +operation: MongoDB\\Collection::findOne +position: 5 +--- +source: + file: apiargs-common-option.yaml + ref: maxTimeMS +operation: MongoDB\\Collection::findOne +position: 6 +--- +source: + file: apiargs-common-option.yaml + ref: readConcern +operation: MongoDB\\Collection::findOne +position: 7 +--- +source: + file: apiargs-common-option.yaml + ref: readPreference +pre: | + For use with MongoDB 3.0 and earlier. +operation: MongoDB\\Collection::findOne +position: 8 +--- +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Collection::findOne +position: 9 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml new file mode 100644 index 00000000..fc934334 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml @@ -0,0 +1,14 @@ +source: + ref: $filter + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::findOne +replacement: + verb: "query" +position: 1 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::findOne +position: 2 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml new file mode 100644 index 00000000..ba3e662e --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml @@ -0,0 +1,24 @@ +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: projection +operation: MongoDB\\Collection::findOneAndDelete +position: 1 +--- +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: sort +operation: MongoDB\\Collection::findOneAndDelete +position: 2 +--- +source: + file: apiargs-common-option.yaml + ref: maxTimeMS +operation: MongoDB\\Collection::findOneAndDelete +position: 3 +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Collection::findOneAndDelete +position: 4 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml new file mode 100644 index 00000000..296ecf51 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml @@ -0,0 +1,14 @@ +source: + ref: $filter + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::findOneAndDelete +replacement: + verb: "query" +position: 1 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::findOneAndDelete +position: 2 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml new file mode 100644 index 00000000..670465bc --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml @@ -0,0 +1,42 @@ +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: projection +operation: MongoDB\\Collection::findOneAndReplace +position: 1 +--- +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: sort +operation: MongoDB\\Collection::findOneAndReplace +position: 2 +--- +source: + file: apiargs-common-option.yaml + ref: maxTimeMS +operation: MongoDB\\Collection::findOneAndReplace +position: 3 +--- +source: + file: apiargs-common-option.yaml + ref: bypassDocumentValidation +operation: MongoDB\\Collection::findOneAndReplace +position: 4 +--- +source: + file: apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml + ref: returnDocument +operation: MongoDB\\Collection::findOneAndReplace +position: 5 +--- +source: + file: apiargs-common-option.yaml + ref: upsert +operation: MongoDB\\Collection::findOneAndReplace +position: 6 +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Collection::findOneAndReplace +position: 7 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml new file mode 100644 index 00000000..9d6d9366 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml @@ -0,0 +1,25 @@ +source: + ref: $filter + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::findOneAndReplace +replacement: + verb: "query" +optional: false +position: 1 +--- +arg_name: param +name: $replacement +type: array|object +description: | + The document to replace. +interface: phpmethod +operation: MongoDB\\Collection::findOneAndReplace +optional: false +position: 2 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::findOneAndReplace +position: 3 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml new file mode 100644 index 00000000..b4b550e0 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml @@ -0,0 +1,52 @@ +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: projection +operation: MongoDB\Collection::findOneAndUpdate +position: 1 +--- +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: sort +operation: MongoDB\Collection::findOneAndUpdate +position: 2 +--- +source: + file: apiargs-common-option.yaml + ref: maxTimeMS +operation: MongoDB\Collection::findOneAndUpdate +position: 3 +--- +source: + file: apiargs-common-option.yaml + ref: bypassDocumentValidation +operation: MongoDB\Collection::findOneAndUpdate +position: 4 +--- +arg_name: option +name: returnDocument +type: integer +description: | + Specifies whether to return the document before the {{event}}, or + after. ``returnDocument`` supports the following values: + + - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*) + - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER`` +optional: true +replacement: + event: "update is applied" +interface: phpmethod +operation: MongoDB\Collection::findOneAndUpdate +position: 5 +--- +source: + file: apiargs-common-option.yaml + ref: upsert +operation: MongoDB\\Collection::findOneAndUpdate +position: 6 +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\Collection::findOneAndUpdate +position: 7 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml new file mode 100644 index 00000000..399cef06 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml @@ -0,0 +1,27 @@ +source: + ref: $filter + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::findOneAndUpdate +replacement: + verb: "query" +optional: false +position: 1 +--- +arg_name: param +name: $update +type: array|object +description: | + Specifies the field and value combinations to update and any + relevant update operators. ``$update`` uses MongoDB's + :method:`update operators `. +interface: phpmethod +operation: MongoDB\\Collection::findOneAndUpdate +optional: false +position: 2 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::findOneAndUpdate +position: 3 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml new file mode 100644 index 00000000..a037bead --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml @@ -0,0 +1,18 @@ +source: + file: apiargs-common-option.yaml + ref: bypassDocumentValidation +operation: MongoDB\\Collection::insertMany +position: 1 +--- +source: + file: apiargs-MongoDBCollection-method-bulkWrite-option.yaml + ref: ordered +operation: MongoDB\\Collection::insertMany +position: 2 +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Collection::insertMany +position: 3 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml new file mode 100644 index 00000000..dc307700 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml @@ -0,0 +1,16 @@ +arg_name: param +name: $documents +type: array +description: | + The documents to insert into the collection. +interface: phpmethod +operation: MongoDB\\Collection::insertMany +optional: false +position: 1 +--- +source: + file: apiargs-common-param.yaml + ref: $options +operation: MongoDB\\Collection::insertMany +position: 2 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml new file mode 100644 index 00000000..2195625f --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml @@ -0,0 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: bypassDocumentValidation +operation: MongoDB\\Collection::insertOne +position: 1 +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Collection::insertOne +position: 2 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml new file mode 100644 index 00000000..2b0b77e9 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml @@ -0,0 +1,16 @@ +arg_name: param +name: $document +type: array|object +description: | + The document to insert into the collection. +interface: phpmethod +operation: MongoDB\\Collection::insertOne +optional: false +position: 1 +--- +source: + file: apiargs-common-param.yaml + ref: $options +operation: MongoDB\\Collection::insertOne +position: 2 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml new file mode 100644 index 00000000..97a3be6e --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml @@ -0,0 +1,6 @@ +source: + ref: maxTimeMS + file: apiargs-common-option.yaml +operation: MongoDB\\Collection::listIndexes +position: 1 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml new file mode 100644 index 00000000..b708486e --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml @@ -0,0 +1,6 @@ +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::listIndexes +position: 1 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml new file mode 100644 index 00000000..8b81b920 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml @@ -0,0 +1,18 @@ +source: + file: apiargs-common-option.yaml + ref: bypassDocumentValidation +operation: MongoDB\\Collection::replaceOne +position: 1 +--- +source: + file: apiargs-common-option.yaml + ref: upsert +operation: MongoDB\\Collection::replaceOne +position: 2 +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Collection::replaceOne +position: 3 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml new file mode 100644 index 00000000..7a730cfc --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml @@ -0,0 +1,25 @@ +source: + ref: $filter + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::replaceOne +replacement: + verb: "query" +optional: false +position: 1 +--- +arg_name: param +name: $replacement +type: array +description: | + The document to replace. +interface: phpmethod +operation: MongoDB\\Collection::replaceOne +optional: false +position: 2 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::replaceOne +position: 3 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml new file mode 100644 index 00000000..e432a263 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml @@ -0,0 +1,18 @@ +source: + file: apiargs-common-option.yaml + ref: bypassDocumentValidation +operation: MongoDB\\Collection::updateMany +position: 1 +--- +source: + file: apiargs-common-option.yaml + ref: upsert +operation: MongoDB\\Collection::updateMany +position: 2 +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Collection::updateMany +position: 3 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml new file mode 100644 index 00000000..12137ffc --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml @@ -0,0 +1,22 @@ +source: + ref: $filter + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::updateMany +replacement: + verb: "query" +optional: false +position: 1 +--- +source: + file: apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml + ref: $update +operation: MongoDB\\Collection::updateMany +optional: false +position: 2 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::updateMany +position: 3 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml new file mode 100644 index 00000000..75670747 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml @@ -0,0 +1,18 @@ +source: + file: apiargs-common-option.yaml + ref: bypassDocumentValidation +operation: MongoDB\\Collection::updateOne +position: 1 +--- +source: + file: apiargs-common-option.yaml + ref: upsert +operation: MongoDB\\Collection::updateOne +position: 2 +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Collection::updateOne +position: 3 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml new file mode 100644 index 00000000..d61c8b2a --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml @@ -0,0 +1,22 @@ +source: + ref: $filter + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::updateOne +replacement: + verb: "query" +optional: false +position: 1 +--- +source: + file: apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml + ref: $update +operation: MongoDB\\Collection::updateOne +optional: false +position: 2 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::updateOne +position: 3 +... diff --git a/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml new file mode 100644 index 00000000..ec3bb573 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml @@ -0,0 +1,32 @@ +source: + file: apiargs-common-option.yaml + ref: readConcern +operation: MongoDB\\Collection::withOptions +description: | + The default read concern to use for collection operations. Defaults + to the original Collection's specified read concern. +--- +source: + file: apiargs-common-option.yaml + ref: readPreference +operation: MongoDB\\Collection::withOptions +description: | + The default read preference to use for collection operations. + Defaults to the original Collection's read preference. +--- +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Collection::withOptions +description: | + Default type map for cursors and BSON documents. Defaults to the + original Collection's type map value. +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Collection::withOptions +description: | + The default write concern to use for collection operations. Defaults + to the original Collection's specified write concern. +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml b/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml new file mode 100644 index 00000000..72c3a453 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml @@ -0,0 +1,6 @@ +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Collection::withOptions +position: 1 +... diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml new file mode 100644 index 00000000..e867e0cb --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml @@ -0,0 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: readPreference +operation: MongoDB\\Database::command +position: 1 +--- +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Database::command +position: 2 +... diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml new file mode 100644 index 00000000..7d7b6356 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml @@ -0,0 +1,17 @@ +arg_name: param +name: $command +type: string +description: | + The name of the :manual:`database command ` + to execute. +interface: phpmethod +operation: MongoDB\\Database::command +optional: false +position: 1 +--- +source: + file: apiargs-common-param.yaml + ref: $options +operation: MongoDB\\Database::command +position: 2 +... diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml new file mode 100644 index 00000000..7c286862 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml @@ -0,0 +1,24 @@ +source: + file: apiargs-common-option.yaml + ref: readConcern +operation: MongoDB\\Database::__construct +position: 1 +--- +source: + file: apiargs-common-option.yaml + ref: readPreference +operation: MongoDB\\Database::__construct +position: 2 +--- +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Database::__construct +position: 3 +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Database::__construct +position: 4 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml new file mode 100644 index 00000000..638e6650 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml @@ -0,0 +1,18 @@ +source: + file: apiargs-MongoDBCollection-method-construct-param.yaml + ref: $manager +operation: MongoDB\\Database::__construct +position: 1 +--- +source: + ref: $databaseName + file: apiargs-common-param.yaml +operation: MongoDB\\Database::__construct +position: 2 +--- +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Database::__construct +position: 2 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml new file mode 100644 index 00000000..077a25b0 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -0,0 +1,238 @@ +arg_name: option +name: autoIndexId +type: boolean +description: | + + *Default: true*. Specify false to disable the automatic creation of + an index on the _id field. + + .. important:: + + For replica sets, do not set ``autoIndexId`` to ``false``. + + .. deprecated:: 3.2. The ``autoIndexId`` option will be removed in MongoDB v3.4. + +optional: true +interface: phpmethod +operation: MongoDB\\Database::createCollection +position: 1 +--- +arg_name: option +name: indexOptionDefaults +type: array +description: | + Allows users to specify a default configuration for indexes when + creating a collection. + + The ``indexOptionDefaults`` option accepts a ``storageEngine`` document, + which should take the following form:: + + { : } + + Storage engine configurations specified when creating indexes are + validated and logged to the :term:`oplog` during replication to support + replica sets with members that use different storage engines. +optional: true +interface: phpmethod +operation: MongoDB\\Database::createCollection +position: 2 +--- +arg_name: option +name: capped +type: boolean +description: | + To create a capped collection, specify ``true``. If you specify + ``true``, you must also set a maximum size in the ``size`` option. +optional: true +interface: phpmethod +operation: MongoDB\\Database::createCollection +position: 3 +--- +arg_name: option +name: size +type: integer +description: | + Specify a maximum size in bytes for a capped collection. Once a + capped collection reaches its maximum size, MongoDB removes the older + documents to make space for the new documents. The ``size`` option is + required for capped collections and ignored for other collections. +optional: true +interface: phpmethod +operation: MongoDB\\Database::createCollection +position: 4 +--- +arg_name: option +name: max +type: integer +description: | + The maximum number of documents allowed in the capped collection. The + ``size`` option takes precedence over this limit. If a capped + collection reaches the ``size`` limit before it reaches the maximum + number of documents, MongoDB removes old documents. If you prefer to + use the ``max`` limit, ensure that the ``size`` limit, which is + required for a capped collection, is sufficient to contain the + maximum number of documents. +interface: phpmethod +operation: MongoDB\\Database::createCollection +optional: true +position: 5 +--- +arg_name: option +name: storageEngine +type: array +description: | + Available for the WiredTiger storage engine only. + + Allows users to specify configuration to the storage engine on a + per-collection basis when creating a collection. The value of the + ``storageEngine`` option should take the following form:: + + { : } + + Storage engine configurations specified when creating collections are + validated and logged to the :term:`oplog` during replication to support + replica sets with members that use different storage engines. +interface: phpmethod +operation: MongoDB\\Database::createCollection +optional: true +position: 6 +--- +arg_name: option +name: flags +type: integer +description: | + + Available for the MMAPv1 storage engine only to set the + ``usePowerOf2Sizes`` and ``noPadding`` flags. + + The |php-library| provides constants that you can combine with a + :php:`bitwise OR operator ` to set the + flag values: + + - ``MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES``: ``1`` + - ``MongoDB\Operation\CreateCollection::NO_PADDING``: ``2`` + + Defaults to ``1``. + + .. note:: + + MongoDB 3.0 and later ignores the ``usePowerOf2Sizes`` flag. See + :manual:`collMod ` and + :manual:`db.createCollection() + ` for more information. + +interface: phpmethod +operation: MongoDB\\Database::createCollection +optional: true +position: 7 +--- +arg_name: option +name: validator +type: array +description: | + Allows users to specify :manual:`validation rules or expressions + ` for the collection. For more information, + see :manual:`Document Validation ` + in the MongoDB manual. + + The ``validator`` option takes an array that specifies the + validation rules or expressions. You can specify the expressions using + the same operators as MongoDB's :manual:`query operators ` + with the exception of :query:`$geoNear`, :query:`$near`, + :query:`$nearSphere`, :query:`$text`, and :query:`$where`. + + .. note:: + + - Validation occurs during updates and inserts. Existing + documents do not undergo validation checks until modification. + + - You cannot specify a validator for collections in the ``admin``, + ``local``, and ``config`` databases. + + - You cannot specify a validator for ``system.*`` collections. + +operation: MongoDB\\Database::createCollection +interface: phpmethod +optional: true +position: 8 +--- +arg_name: option +name: validationLevel +type: string +description: | + Determines how strictly MongoDB applies the + validation rules to existing documents during an update. + + .. list-table:: + :header-rows: 1 + + * - ``validationLevel`` + + - Description + + * - ``"off"`` + + - No validation for inserts or updates. + + * - ``"strict"`` + + - **Default** Apply validation rules to all inserts and all + updates. + + * - ``"moderate"`` + + - Apply validation rules to inserts and to updates on existing *valid* + documents. Do not apply rules to updates on existing *invalid* + documents. + +interface: phpmethod +operation: MongoDB\\Database::createCollection +optional: true +position: 9 +--- +arg_name: option +name: validationAction +type: string +description: | + Determines whether to ``error`` on invalid documents or just ``warn`` + about the violations but allow invalid documents to be inserted. + + .. important:: + + Validation of documents only applies to those documents as + determined by the ``validationLevel``. + + .. list-table:: + :header-rows: 1 + + * - ``validationAction`` + + - Description + + * - ``"error"`` + + - **Default** Documents must pass validation before the write occurs. + Otherwise, the write operation fails. + + * - ``"warn"`` + + - Documents do not have to pass validation. If the document fails + validation, the write operation logs the validation failure. + +interface: phpmethod +operation: MongoDB\\Database::createCollection +optional: true +position: 10 +--- +source: + file: apiargs-common-option.yaml + ref: maxTimeMS +operation: MongoDB\\Database::createCollection +position: 11 +--- +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Database::createCollection +position: 12 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml new file mode 100644 index 00000000..928092c7 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml @@ -0,0 +1,14 @@ +source: + file: apiargs-common-param.yaml + ref: $collectionName +operation: MongoDB\\Database::createCollection +position: 1 +optional: false +--- +source: + file: apiargs-common-param.yaml + ref: $options +operation: MongoDB\\Database::createCollection +position: 2 +optional: true +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml new file mode 100644 index 00000000..4e08c693 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml @@ -0,0 +1,6 @@ +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Database::dropCollection +position: 1 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml new file mode 100644 index 00000000..16e22d02 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml @@ -0,0 +1,14 @@ +source: + file: apiargs-common-param.yaml + ref: $collectionName +operation: MongoDB\\Database::dropCollection +position: 1 +optional: false +--- +source: + file: apiargs-common-param.yaml + ref: $options +operation: MongoDB\\Database::dropCollection +position: 2 +optional: true +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml new file mode 100644 index 00000000..4e08c693 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml @@ -0,0 +1,6 @@ +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Database::dropCollection +position: 1 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml new file mode 100644 index 00000000..16e22d02 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml @@ -0,0 +1,14 @@ +source: + file: apiargs-common-param.yaml + ref: $collectionName +operation: MongoDB\\Database::dropCollection +position: 1 +optional: false +--- +source: + file: apiargs-common-param.yaml + ref: $options +operation: MongoDB\\Database::dropCollection +position: 2 +optional: true +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml new file mode 100644 index 00000000..3c6458b6 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml @@ -0,0 +1,6 @@ +source: + file: apiargs-common-param.yaml + ref: $collectionName +operation: MongoDB\\Database::__get +position: 1 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml new file mode 100644 index 00000000..11097786 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml @@ -0,0 +1,24 @@ +source: + file: apiargs-common-option.yaml + ref: readConcern +operation: MongoDB\\Database::listCollections +position: 1 +--- +source: + file: apiargs-common-option.yaml + ref: readPreference +operation: MongoDB\\Database::listCollections +position: 2 +--- +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Database::listCollections +position: 3 +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Database::listCollections +position: 4 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml new file mode 100644 index 00000000..06178173 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml @@ -0,0 +1,7 @@ +source: + file: apiargs-common-param.yaml + ref: $options +operation: MongoDB\\Database::listCollections +position: 1 +optional: true +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml new file mode 100644 index 00000000..095708cf --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml @@ -0,0 +1,24 @@ +source: + file: apiargs-common-option.yaml + ref: readConcern +operation: MongoDB\\Database::selectCollection +position: 1 +--- +source: + file: apiargs-common-option.yaml + ref: readPreference +operation: MongoDB\\Database::selectCollection +position: 2 +--- +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Database::selectCollection +position: 3 +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Database::selectCollection +position: 4 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml new file mode 100644 index 00000000..955b25fb --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml @@ -0,0 +1,13 @@ +source: + file: apiargs-common-param.yaml + ref: $collectionName +operation: MongoDB\\Database::selectCollection +position: 1 +optional: false +--- +source: + file: apiargs-common-param.yaml + ref: $options +operation: MongoDB\\Database::selectCollection +position: 2 +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml new file mode 100644 index 00000000..bf6207f0 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml @@ -0,0 +1,32 @@ +source: + file: apiargs-common-option.yaml + ref: readConcern +operation: MongoDB\\Database::withOptions +description: | + The default read concern to use for database operations. Defaults + to the original Databases's specified read concern. +--- +source: + file: apiargs-common-option.yaml + ref: readPreference +operation: MongoDB\\Database::withOptions +description: | + The default read preference to use for database operations. + Defaults to the original Database's read preference. +--- +source: + file: apiargs-common-option.yaml + ref: typeMap +operation: MongoDB\\Database::withOptions +description: | + Default type map for cursors and BSON documents. Defaults to the + original Database's type map value. +--- +source: + file: apiargs-common-option.yaml + ref: writeConcern +operation: MongoDB\\Database::withOptions +description: | + The default write concern to use for database operations. Defaults + to the original Database's specified write concern. +... \ No newline at end of file diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml new file mode 100644 index 00000000..d36c1097 --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml @@ -0,0 +1,6 @@ +source: + ref: $options + file: apiargs-common-param.yaml +operation: MongoDB\\Database::withOptions +position: 1 +... diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml new file mode 100644 index 00000000..d1fb0e65 --- /dev/null +++ b/source/includes/apiargs-common-option.yaml @@ -0,0 +1,95 @@ +arg_name: option +name: readConcern +type: :php:`MongoDB\\Driver\\ReadConcern ` +description: | + The default read concern to use for {{resource}} operations. Defaults + to the Client's specified read concern. +interface: phpmethod +operation: selectCollection +optional: true +position: 1 +replacement: + resource: "collection" +--- +arg_name: option +description: | + The default read preference to use for {{resource}} operations. + Defaults to the {{parent}}'s read preference. +interface: phpmethod +name: readPreference +operation: selectCollection +optional: true +position: 2 +type: :php:`MongoDB\\Driver\\ReadPreference ` +replacement: + resource: "collection" + parent: "Client" +--- +arg_name: option +description: | + Default type map for cursors and BSON documents. Defaults to the + {{parent}}'s type map. +interface: phpmethod +name: typeMap +operation: selectCollection +optional: true +position: 3 +type: array +replacement: + parent: "Client" +--- +arg_name: option +name: writeConcern +type: :php:`MongoDB\\Driver\\WriteConcern ` +description: | + The default write concern to use for {{resource}} operations. Defaults + to the {{parent}}'s specified write concern. +interface: phpmethod +operation: selectCollection +optional: true +position: 4 +replacement: + resource: "collection" + parent: "Client" +--- +arg_name: option +name: maxTimeMS +description: | + The cumulative time limit in milliseconds for processing operations on + the cursor. MongoDB aborts the operation at the earliest following + :term:`interrupt point`. +interface: phpmethod +operation: listDatabases +type: integer +optional: true +position: 5 +--- +arg_name: option +name: bypassDocumentValidation +type: boolean +description: | + If ``true``, allows the write operation to circumvent document level + validation. This only applies when using the :pipeline:`$out` stage. + + Document validation requires MongoDB v3.2 or later: if you are using + an earlier version of MongoDB, this option will be ignored. +interface: phpmethod +operation: aggregate +optional: true +position: 6 +--- +arg_name: option +name: upsert +type: boolean +description: | + When true, {{role}} creates a new document if no document + matches the query. If a document matches the query, {{role}} + performs an update. To avoid multiple upserts, ensure that the query + fields are uniquely indexed. + + The default is ``false``. +optional: true +interface: phpmethod +operation: MongoDB\\Collection::findOneAndUpdate +position: 7 +... \ No newline at end of file diff --git a/source/includes/apiargs-common-param.yaml b/source/includes/apiargs-common-param.yaml new file mode 100644 index 00000000..a826747f --- /dev/null +++ b/source/includes/apiargs-common-param.yaml @@ -0,0 +1,46 @@ +arg_name: param +name: $databaseName +type: string +description: | + The name of the database{{select}}. +interface: phpmethod +operation: selectCollection +optional: false +replacement: + select: " to select" +position: 1 +--- +arg_name: param +name: $collectionName +type: string +description: | + The name of the collection{{select}}. +interface: phpmethod +operation: selectCollection +optional: false +replacement: + select: " to select" +position: 2 +--- +arg_name: param +name: $options +type: array +description: | + An array specifying the desired options. +interface: phpmethod +operation: selectCollection +optional: true +position: 3 +--- +arg_name: param +name: $filter +type: array|object +description: | + The filter criteria that specifies the documents to {{verb}}. +interface: phpmethod +operation: count +optional: false +position: 4 +replacement: + verb: "count" +... diff --git a/source/includes/example-insertOne.rst b/source/includes/example-insertOne.rst new file mode 100644 index 00000000..85c68aa2 --- /dev/null +++ b/source/includes/example-insertOne.rst @@ -0,0 +1,64 @@ +.. code-block:: php + + selectCollection('users','restaurants'); + + $newUser = $collection->insertOne( + [ + 'username' => 'admin', + 'email' => 'admin@example.com', + 'name' => 'Anna Bennett' + ], + ); + + echo "

";
+   var_dump($newUser);
+
+The output would resemble:
+
+.. code-block:: none
+                
+   object(MongoDB\InsertOneResult)#13 (3) {
+     ["writeResult":"MongoDB\InsertOneResult":private]=>
+     object(MongoDB\Driver\WriteResult)#12 (9) {
+       ["nInserted"]=>
+       int(1)
+       ["nMatched"]=>
+       int(0)
+       ["nModified"]=>
+       int(0)
+       ["nRemoved"]=>
+       int(0)
+       ["nUpserted"]=>
+       int(0)
+       ["upsertedIds"]=>
+       array(0) {
+       }
+       ["writeErrors"]=>
+       array(0) {
+       }
+       ["writeConcernError"]=>
+       NULL
+       ["writeConcern"]=>
+       array(4) {
+         ["w"]=>
+         NULL
+         ["wmajority"]=>
+         bool(false)
+         ["wtimeout"]=>
+         int(0)
+         ["journal"]=>
+         NULL
+       }
+     }
+     ["insertedId":"MongoDB\InsertOneResult":private]=>
+     object(MongoDB\BSON\ObjectID)#11 (1) {
+       ["oid"]=>
+       string(24) "577282631f417d1823121691"
+     }
+     ["isAcknowledged":"MongoDB\InsertOneResult":private]=>
+     bool(true)
+   }
\ No newline at end of file
diff --git a/source/includes/extracts-bson-deserialization-base.yaml b/source/includes/extracts-bson-deserialization-base.yaml
new file mode 100644
index 00000000..d66954d4
--- /dev/null
+++ b/source/includes/extracts-bson-deserialization-base.yaml
@@ -0,0 +1,13 @@
+ref: _bson-deserialization
+content: |
+  .. note::
+      
+      {{method}} does not
+      yet support a ``typeMap`` option for BSON deserialization of the
+      returned document. 
+      
+      Classes implementing
+      :php:`MongoDB\\BSON\\Persistable `
+      are deserialized according to the :php:`persistance
+      ` specification.
+...
\ No newline at end of file
diff --git a/source/includes/extracts-bson-deserialization.yaml b/source/includes/extracts-bson-deserialization.yaml
new file mode 100644
index 00000000..3d5bfacc
--- /dev/null
+++ b/source/includes/extracts-bson-deserialization.yaml
@@ -0,0 +1,21 @@
+ref: bson-deserialization-findOneAndDelete
+source:
+  file: extracts-bson-deserialization-base.yaml
+  ref: _bson-deserialization
+replacement:
+  method: ":phpmethod:`MongoDB\\Collection::findOneAndDelete`"
+---
+ref: bson-deserialization-findOneAndReplace
+source:
+  file: extracts-bson-deserialization-base.yaml
+  ref: _bson-deserialization
+replacement:
+  method: ":phpmethod:`MongoDB\\Collection::findOneAndReplace`"
+---
+ref: bson-deserialization-findOneAndUpdate
+source:
+  file: extracts-bson-deserialization-base.yaml
+  ref: _bson-deserialization
+replacement:
+  method: ":phpmethod:`MongoDB\\Collection::findOneAndUpdate`"
+...
diff --git a/source/index.txt b/source/index.txt
new file mode 100644
index 00000000..2beec9a1
--- /dev/null
+++ b/source/index.txt
@@ -0,0 +1,74 @@
+===================
+MongoDB PHP Library
+===================
+
+.. default-domain:: mongodb
+
+The |php-library| provides a high-level abstraction
+around the lower-level `PHP Driver `_, also
+known as the ``mongodb`` extension.
+
+While the ``mongodb`` extension provides a limited API for executing
+commands, queries, and write operations, the |php-library|
+implements an API similar to that of the `legacy PHP driver
+`_. The library contains
+abstractions for client, database, and collection objects, and provides
+methods for CRUD operations and common commands such as index and
+collection management.
+
+If you are developing a PHP application with MongoDB, you should consider
+using this library, or another high-level abstraction, instead of the
+extension alone.
+
+For additional information about the MongoDB PHP Library and the
+``mongodb`` extension, see the `Architecture Overview
+`_ article in the
+extension documentation. `Derick Rethans `_
+has also written a series of blog posts entitled *New MongoDB Drivers
+for PHP and HHVM*:
+
+- `Part One: History `_
+
+- `Part Two: Architecture
+  `_
+
+- `Part Three: Cursor Behaviour
+  `_
+
+API Reference
+-------------
+
+Generated API reference documentation for the library is available at:
+`http://mongodb.github.io/mongo-php-library/api
+`_
+
+New to MongoDB?
+---------------
+
+If you are a new MongoDB user, these links should help you become more familiar
+with MongoDB and introduce some of the concepts and terms you will encounter in
+this documentation:
+
+- `Introduction to CRUD operations in MongoDB
+  `_
+
+- `What is a MongoDB document?
+  `_
+
+- `MongoDB's *dot notation* for accessing document properties
+  `_
+
+- `ObjectId: MongoDB's document identifier
+  `_
+
+.. class:: hidden
+
+   .. toctree::
+      :titlesonly:
+      
+      Installation 
+      /tutorial
+      /upgrade
+      /reference
+
+.. /getting-started
\ No newline at end of file
diff --git a/source/reference.txt b/source/reference.txt
new file mode 100644
index 00000000..445ad373
--- /dev/null
+++ b/source/reference.txt
@@ -0,0 +1,13 @@
+=========
+Reference
+=========
+
+.. default-domain:: mongodb
+
+.. toctree::
+   :titlesonly:
+   
+   /reference/bson
+   /reference/class/MongoDBClient
+   /reference/class/MongoDBDatabase
+   /reference/class/MongoDBCollection
diff --git a/source/reference/bson.txt b/source/reference/bson.txt
new file mode 100644
index 00000000..30bf3f20
--- /dev/null
+++ b/source/reference/bson.txt
@@ -0,0 +1,220 @@
+====
+BSON
+====
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Overview
+--------
+
+MongoDB stores data records as BSON documents. BSON is a binary
+representation of :term:`JSON` documents, though it contains more data
+types than JSON. For the BSON spec, see `bsonspec.org `_.
+
+By default, the |php-library| returns BSON documents as
+``MongoDB\Model\BSONDocument`` objects and BSON arrays as
+``MongoDB\Model\BSONArray`` objects. ``MongoDB\Model\BSONDocument`` and 
+``MongoDB\Model\BSONArray`` extend PHP's
+:php:`ArrayObject ` class and implement the MongoDB PHP
+driver's :php:`MongoDB\\BSON\\Serializable `
+and :php:`MongoDB\\BSON\\Unserializable `
+interfaces.
+
+Type Maps
+---------
+
+Most methods that read data from MongoDB support a ``typeMap`` option,
+which allows control over how BSON is converted to PHP. Additionally,
+the :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
+:phpclass:`MongoDB\\Collection` classes accept a ``typeMap`` option,
+which applies to any supporting methods and selected classes by default.
+
+The :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
+:phpclass:`MongoDB\\Collection` classes use the following type map by
+default:
+
+.. code-block:: php
+
+   [
+       'array' => 'MongoDB\Model\BSONArray',
+       'document' => 'MongoDB\Model\BSONDocument',
+       'root' => 'MongoDB\Model\BSONDocument',
+   ]
+
+Serialization and deserialization of PHP variables into MongoDB
+---------------------------------------------------------------
+
+``Persistable`` Classes
+~~~~~~~~~~~~~~~~~~~~~~~
+
+The PHP driver's :php:`persistence ` specification
+specifies how classes implementing :php:`MongoDB\\BSON\\Persistable
+` are serialized and deserialized, and is
+analogous to PHP's :php:`Serializable interface `.
+
+The PHP :php:`driver ` automatically handles serialization and
+deserialization for classes implementing ``MongoDB\BSON\Persistable``
+without requiring the use of the ``typeMap`` option.
+
+Consider the following class definition:
+
+.. code-block:: php
+
+   id = new MongoDB\BSON\ObjectID;
+           $this->name = (string) $name;
+       
+           // Get current time in milliseconds since the epoch
+           $msec = floor(microtime(true) * 1000);
+           $this->createdAt = new MongoDB\BSON\UTCDateTime($msec);
+       }
+       
+       function bsonSerialize()
+       {
+           return [
+               '_id' => $this->id,
+               'name' => $this->name,
+               'createdAt' => $this->createdAt,
+           ];
+       }
+       
+       function bsonUnserialize(array $data)
+       {
+           $this->id = $data['_id'];
+           $this->name = $data['name'];
+           $this->createdAt = $data['createdAt'];
+       }
+   }
+
+The following constructs a ``Person`` object, inserts it into the
+database, and reads it back as an object of the same type:
+
+.. code-block:: php
+
+   demo->persons;
+
+   $result = $collection->insertOne(new Person('Bob'));
+
+   $person = $collection->findOne(['_id' => $result->getInsertedId()]);
+
+   var_dump($person);
+
+The output would then resemble:
+
+.. code-block:: none
+
+   object(Person)#18 (3) {
+     ["id":"Person":private]=>
+     object(MongoDB\BSON\ObjectID)#15 (1) {
+       ["oid"]=>
+       string(24) "56fad2c36118fd2e9820cfc1"
+     }
+     ["name":"Person":private]=>
+     string(3) "Bob"
+     ["createdAt":"Person":private]=>
+     object(MongoDB\BSON\UTCDateTime)#17 (1) {
+       ["milliseconds"]=>
+       int(1459278531218)
+     }
+   }
+
+The same document in the MongoDB shell might display as:
+
+.. code-block:: js
+
+   {
+     "_id" : ObjectId("56fad2c36118fd2e9820cfc1"),
+     "__pclass" : BinData(128,"UGVyc29u"),
+     "name" : "Bob",
+     "createdAt" : ISODate("2016-03-29T19:08:51.218Z")
+   }
+
+.. note::
+
+   :php:`MongoDB\\BSON\\Persistable ` may only be used
+   for root and embedded BSON documents. BSON arrays are not supported.
+
+Emulating the Legacy Driver
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The legacy :php:`mongo extension ` returned both BSON
+documents and arrays as PHP arrays. While PHP arrays are convenient to
+work with, this behavior was problematic:
+
+-  Different BSON types could deserialize to the same PHP value (e.g.
+   ``{"0": "foo"}`` and ``["foo"]``), which made it impossible to infer
+   the original BSON type.
+
+-  Numerically-indexed PHP arrays would be serialized as BSON documents
+   if there was a gap in their key sequence. Such gaps were easily 
+   caused by unsetting a key to remove an element and
+   forgetting to reindex the array.
+
+The |php-library|'s ``MongoDB\Model\BSONDocument`` and ``MongoDB\Model\BSONArray``
+classes address these
+concerns by preserving the BSON type information during serialization
+and deserialization; however, some users may still prefer the legacy
+behavior. If desired, you can use the ``typeMap`` option to have
+the library return everything as a PHP array:
+
+.. code-block:: php
+
+    [
+           'root' => 'array', 'document' => 'array', 'array' => 'array'
+           ],
+       ]
+   );
+
+   $document = $client->demo->zips->findOne(
+       ['_id' => '94301'],
+       ['typeMap' => [
+            'root' => 'array', 'document' => 'array', 'array' => 'array'
+            ],
+       ]
+   );
+
+   var_dump($document);
+
+The above example would output something similar to:
+
+.. code-block:: php
+
+   array(5) {
+     ["_id"]=>
+     string(5) "94301"
+     ["city"]=>
+     string(9) "PALO ALTO"
+     ["loc"]=>
+     array(2) {
+       [0]=>
+       float(-122.149685)
+       [1]=>
+       float(37.444324)
+     }
+     ["pop"]=>
+     int(15965)
+     ["state"]=>
+     string(2) "CA"
+   }
diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
new file mode 100644
index 00000000..2c921d6d
--- /dev/null
+++ b/source/reference/class/MongoDBClient.txt
@@ -0,0 +1,36 @@
+=====================
+MongoDB\\Client Class
+=====================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Client
+
+   Serves as an entry point for the |php-library|. ``MongoDB\Client``
+   is the preferred class for connecting to a MongoDB server or cluster
+   of servers and serves as a gateway for accessing individual
+   databases and collections. ``MongoDB\Client`` is analogous to the
+   driver's :php:`MongoDB\\Driver\\Manager `
+   class, which it composes.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBClient__construct
+   /reference/method/MongoDBClient__get
+   /reference/method/MongoDBClient-dropDatabase
+   /reference/method/MongoDBClient-listDatabases
+   /reference/method/MongoDBClient-selectCollection
+   /reference/method/MongoDBClient-selectDatabase
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
new file mode 100644
index 00000000..032ca878
--- /dev/null
+++ b/source/reference/class/MongoDBCollection.txt
@@ -0,0 +1,83 @@
+=========================
+MongoDB\\Collection Class
+=========================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Collection
+
+   Provides methods for common operations on collections and documents,
+   including CRUD operations and index management.
+   
+   You can construct collections directly using the PHP extension's
+   ``Manager`` class, select a collection from the |php-library|'s
+   :phpclass:`MongoDB\\Client` or :phpclass:`MongoDB\\Database`
+   classes, or create a collection from an existing collection using the
+   :phpmethod:`withOptions ` clone method.
+    
+   :phpclass:`MongoDB\\Collection` supports the :php:`readConcern
+   `, :php:`readPreference
+   `, :php:`typeMap
+   `, and
+   :php:`writeConcern ` options.
+   If you omit an option, the collection inherits the value from the
+   Manager constructor argument or the Database object used to select
+   the collection.
+
+   Operations within the ``Collection`` class
+   inherit the Collection's options.
+   
+   The :phpmethod:`MongoDB\\Collection::aggregate` method (when not
+   using a cursor), :phpmethod:`MongoDB\\Collection::distinct`, and
+   :manual:`findAndModify ` helpers do not
+   support a ``typeMap`` option due to a driver limitation.
+   :phpmethod:`MongoDB\\Collection::aggregate`,
+   :phpmethod:`MongoDB\\Collection::distinct`,
+   :phpmethod:`MongoDB\\Collection::findOneAndReplace`,
+   :phpmethod:`MongoDB\\Collection::findOneAndUpdate`, and
+   :phpmethod:`MongoDB\\Collection::findOneAndDelete`
+   return BSON documents as `stdClass` objects and arrays as arrays.
+
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBCollection__construct
+   /reference/method/MongoDBCollection-aggregate
+   /reference/method/MongoDBCollection-bulkWrite
+   /reference/method/MongoDBCollection-count
+   /reference/method/MongoDBCollection-createIndex
+   /reference/method/MongoDBCollection-createIndexes
+   /reference/method/MongoDBCollection-deleteMany
+   /reference/method/MongoDBCollection-deleteOne
+   /reference/method/MongoDBCollection-distinct
+   /reference/method/MongoDBCollection-drop
+   /reference/method/MongoDBCollection-dropIndex
+   /reference/method/MongoDBCollection-dropIndexes
+   /reference/method/MongoDBCollection-find
+   /reference/method/MongoDBCollection-findOne
+   /reference/method/MongoDBCollection-findOneAndDelete
+   /reference/method/MongoDBCollection-findOneAndReplace
+   /reference/method/MongoDBCollection-findOneAndUpdate
+   /reference/method/MongoDBCollection-getCollectionName
+   /reference/method/MongoDBCollection-getDatabaseName
+   /reference/method/MongoDBCollection-getNamespace
+   /reference/method/MongoDBCollection-insertMany
+   /reference/method/MongoDBCollection-insertOne
+   /reference/method/MongoDBCollection-listIndexes
+   /reference/method/MongoDBCollection-replaceOne
+   /reference/method/MongoDBCollection-updateMany
+   /reference/method/MongoDBCollection-updateOne
+   /reference/method/MongoDBCollection-withOptions
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
new file mode 100644
index 00000000..18480f42
--- /dev/null
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -0,0 +1,59 @@
+=======================
+MongoDB\\Database Class
+=======================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Database
+
+   Provides methods for common operations on a database,
+   such as executing database commands and managing collections.
+   
+   You can construct a database directly using the PHP extension's
+   ``Manager`` class or select a database from the |php-library|'s
+   :phpclass:`MongoDB\\Client`
+   class.
+   
+   :phpclass:`MongoDB\\Database` supports the :php:`readConcern
+   `, :php:`readPreference
+   `, :php:`typeMap
+   `, and
+   :php:`writeConcern ` options.
+   If you omit an option, the database inherits the value from the
+   Manager constructor argument or the Client object used to select
+   the database.
+   
+   Operations within the ``Database`` class
+   :phpmethod:`MongoDB\\Database::command` method
+   inherit the Database's options.
+
+.. _database-methods:
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBDatabase__get
+   /reference/method/MongoDBDatabase__construct
+   /reference/method/MongoDBDatabase-command
+   /reference/method/MongoDBDatabase-createCollection
+   /reference/method/MongoDBDatabase-drop
+   /reference/method/MongoDBDatabase-dropCollection
+   /reference/method/MongoDBDatabase-getDatabaseName      
+   /reference/method/MongoDBDatabase-listCollections
+   /reference/method/MongoDBDatabase-selectCollection
+   /reference/method/MongoDBDatabase-withOptions
+
diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
new file mode 100644
index 00000000..127aebfc
--- /dev/null
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -0,0 +1,70 @@
+===============================
+MongoDB\\Client::dropDatabase()
+===============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::dropDatabase($databaseName, $options)
+
+   Drop a MongoDB database.
+
+   .. code-block:: php
+
+      function dropDatabase($databaseName, array $options [])
+
+   :phpmethod:`MongoDB\\Client::dropDatabase` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-param.rst
+
+   ``dropDatabase`` supports the following values for the ``$options`` array:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-option.rst
+
+Output
+------
+
+Returns an array or object containing the result document.
+
+Example
+-------
+
+The following example drops the ``demo`` database:
+
+.. code-block:: php
+
+   dropDatabase('demo');
+
+   var_dump($result);
+
+The ``dropDatabase`` operation would return an object similar to:
+
+.. code-block:: php
+
+   object(MongoDB\Model\BSONDocument)#8 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(2) {
+       ["dropped"]=>
+       string(4) "demo"
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Client::drop`
+   - :manual:`dropDatabase() command reference
+     ` in the MongoDB manual.
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
new file mode 100644
index 00000000..e786127a
--- /dev/null
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -0,0 +1,78 @@
+================================
+MongoDB\\Client::listDatabases()
+================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::listDatabases($options)
+
+   Lists the available databases.
+
+   .. code-block:: php
+
+      function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator
+
+   :phpmethod:`MongoDB\\Client::listDatabases` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-param.rst
+
+   ``listDatabases`` supports the following values for the ``$options`` array:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-option.rst
+
+Output
+------
+
+Information for all databases on the :program:`mongod`, replica set,
+or sharded cluster to which you are connected. The returned elements are
+``MongoDB\Model\DatabaseInfo`` objects.
+
+Example
+-------
+
+The following example lists all databases on the server:
+
+.. code-block:: php
+
+   listDatabases() as $databaseInfo) {
+       var_dump($databaseInfo);
+   }
+
+The above example would output something similar to:
+
+.. code-block:: php
+
+   object(MongoDB\Model\DatabaseInfo)#4 (3) {
+     ["name"]=>
+     string(5) "local"
+     ["sizeOnDisk"]=>
+     float(65536)
+     ["empty"]=>
+     bool(false)
+   }
+   object(MongoDB\Model\DatabaseInfo)#7 (3) {
+     ["name"]=>
+     string(4) "test"
+     ["sizeOnDisk"]=>
+     float(32768)
+     ["empty"]=>
+     bool(false)
+   }
+
+.. seealso::
+
+   :manual:`listDatabases() command reference in the MongoDB
+   manual `
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
new file mode 100644
index 00000000..51d243f5
--- /dev/null
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -0,0 +1,72 @@
+===================================
+MongoDB\\Client::selectCollection()
+===================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::selectCollection($databaseName, $collectionName, $options)
+
+   Selects a collection on the :program:`mongod` to which your application
+   is connected.
+   
+   .. code-block:: php
+
+      function selectCollection($databaseName, $collectionName, array $options = [])
+
+   :phpmethod:`MongoDB\\Client::selectCollection` has the following parameters:
+
+   .. include:: /includes/apiargs/common-param.rst
+
+   The following table describes the options that
+   :phpmethod:`MongoDB\\Client::selectCollection` can accept.
+
+   .. include:: /includes/apiargs/common-option.rst
+
+Output
+------
+
+Returns a :phpclass:`MongoDB\\Collection` object.
+
+Example
+-------
+
+
+The following example selects the ``users`` collection in the ``demo``
+database:
+
+.. code-block:: php
+
+   selectCollection('demo', 'users');
+
+The following examples selects the ``users`` collection in the ``demo``
+database with a custom read preference:
+
+.. code-block:: php
+
+   $client = new MongoDB\Client;
+
+   $collection = $client->selectCollection(
+       'demo',
+       'users',
+       [
+           'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+       ]
+   );
+         
+.. seealso::
+
+   - :phpmethod:`Collection::__construct`
+   - :phpmethod:`MongoDB\\Client::__get`
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
new file mode 100644
index 00000000..b83b60d3
--- /dev/null
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -0,0 +1,71 @@
+=================================
+MongoDB\\Client::selectDatabase()
+=================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::selectDatabase($databaseName, $options)
+
+   Selects a database on the :program:`mongod` instance to which your
+   application is connected.
+   
+   .. code-block:: php
+
+      function selectDatabase($databaseName array $options = []): MongoDB\Database
+
+   :phpmethod:`MongoDB\\Client::selectDatabase` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-param.rst
+
+   The following table describes the options that
+   :phpmethod:`MongoDB\\Client::selectDatabase` can accept.
+
+   .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-option.rst
+
+Output
+------
+
+Returns a :phpclass:`MongoDB\\Database` object.
+
+Example
+-------
+
+The following example selects the ``demo`` database:
+
+.. code-block:: php
+
+   selectDatabase('demo');
+
+The following examples selects the ``demo`` database with a custom read
+preference:
+
+.. code-block:: php
+
+   selectDatabase(
+       'demo',
+       [
+           'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+       ]
+   );
+
+.. seealso::
+
+   - :phpmethod:`Collection::__construct`
+   - :phpmethod:`MongoDB\\Client::__get`
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
new file mode 100644
index 00000000..4130ac9b
--- /dev/null
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -0,0 +1,66 @@
+==============================
+MongoDB\\Client::__construct()
+==============================
+
+.. default-domain:: mongodb
+
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::__construct($uri, $uriOptions, $driverOptions)
+
+   Constructs a new :phpclass:`Client ` instance.
+
+   .. code-block:: php
+
+      function __construct($uri = 'mongodb://localhost:27017', array $uriOptions = [], array $driverOptions = [])
+
+   :phpmethod:`MongoDB\\Client::__construct` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-construct-param.rst
+
+Examples
+--------
+
+If you do not specify a ``$uri`` value, the driver connects to a
+standalone :program:`mongod` on ``localhost`` via port ``27017``. The
+following example demonstrates how to connect to a replica set
+with a custom
+read preference:
+
+.. code-block:: php
+
+    'secondaryPreferred'
+       ]
+   );
+
+By default, the |php-library| deserializes BSON documents and arrays
+as ``MongoDB\Model\BSONDocument`` and ``MongoDB\Model\BSONArray``
+objects, respectively. The following example demonstrates how to
+have the library unserialize everything as a PHP array, as was done
+in the legacy :php:`mongo extension `.
+
+.. code-block:: php
+
+    [
+           'root' => 'array', 'document' => 'array', 'array' => 'array'
+         ],
+       ]
+   );
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
new file mode 100644
index 00000000..c631f34f
--- /dev/null
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -0,0 +1,63 @@
+========================
+MongoDB\\Client::__get()
+========================
+
+.. default-domain:: mongodb
+
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::__get($databaseName)
+
+   Select a MongoDB database.
+
+   .. code-block:: php
+
+      function __get($databaseName): MongoDB\Database
+
+   :phpmethod:`MongoDB\\Client::__get` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-get-param.rst
+
+Behavior
+--------
+
+The selected database inherits options such as read preference and
+type mapping from the :phpclass:`Client ` object.
+If you wish to override any options, use the 
+:phpmethod:`MongoDB\\Client::selectDatabase` method.
+
+.. note::
+   
+   To select databases whose names contain special characters, such as
+   ``-``, use complex syntax, as in ``$client->{'that-database'}``.
+   
+   Alternatively, :phpmethod:`MongoDB\\Client::selectDatabase` supports
+   selecting databases whose names contain special characters.
+
+Examples
+--------
+
+The following example selects the ``demo`` and ``another-app``
+databases:
+
+.. code-block:: php
+
+   demo;
+   $anotherApp = $client->{'another-app'};
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Client::selectDatabase`
+   - :php:`Property Overloading ` in the PHP Manual.
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
new file mode 100644
index 00000000..480481c8
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -0,0 +1,66 @@
+================================
+MongoDB\\Collection::aggregate()
+================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::aggregate($pipeline, $options)
+
+   Executes an :manual:`aggregation framework pipeline
+   ` operation on the collection.
+
+   .. code-block:: php
+
+      function aggregate(array $pipeline, array $options = []): Traversable
+      
+   :phpmethod:`MongoDB\\Collection::aggregate` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-param.rst
+   
+   :phpmethod:`MongoDB\\Collection::aggregate` supports the following
+   options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-option.rst
+
+.. _php-agg-method-output:
+
+Output
+------
+
+:phpmethod:`MongoDB\\Collection::aggregate`'s return value depends on
+the MongoDB server version and whether the ``useCursor`` option is
+specified. If ``useCursor`` is true,
+:phpmethod:`MongoDB\\Collection::aggregate` returns a
+``MongoDB\Driver\Cursor`` object. If ``useCursor`` is false,
+:phpmethod:`MongoDB\\Collection::aggregate` returns an
+``ArrayIterator`` that wraps the ``result`` array from the command
+response document.
+
+.. note::
+
+   BSON deserialization of inline aggregation results (i.e. not using a
+   command cursor) does not yet support a ``typeMap`` option. Classes
+   implementing :php:`MongoDB\\BSON\\Persistable
+   ` will still be deserialized according to
+   the :php:`Persistence `
+   specification.
+
+.. todo: add examples
+
+.. seealso::
+
+   - :manual:`aggregate command reference
+     ` in the MongoDB manual and
+
+   - :manual:`Aggregation Pipeline `
+     documentation in the MongoDB Manual.
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
new file mode 100644
index 00000000..db8c714f
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -0,0 +1,44 @@
+================================
+MongoDB\\Collection::bulkWrite()
+================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::bulkWrite($operations, $options)
+
+   Executes multiple write operations.
+
+   .. code-block:: php
+
+      function bulkWrite(array $operations, array $options = []): MongoDB\BulkWriteResult
+
+   :phpmethod:`MongoDB\\Collection::bulkWrite` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-param.rst
+   
+   :phpmethod:`MongoDB\\Collection::bulkWrite` supports the following
+   options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-option.rst
+
+.. todo: add output and examples
+
+.. seealso::
+   
+   - :phpmethod:`deleteMany `
+   - :phpmethod:`deleteOne ` 
+   - :phpmethod:`insertOne `
+   - :phpmethod:`replaceOne `
+   - :phpmethod:`updateMany `
+   - :phpmethod:`updateOne `
+   - :doc:`/tutorial/crud`
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
new file mode 100644
index 00000000..49c5767f
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -0,0 +1,39 @@
+============================
+MongoDB\\Collection::count()
+============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::count($filter, $options)
+
+   Counts the number of documents that match filter criteria.
+
+   .. code-block:: php
+
+      function count($filter = [], array $options = []): integer
+
+   :phpmethod:`MongoDB\\Collection::count` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-count-param.rst
+   
+   :phpmethod:`MongoDB\\Collection::count` supports the following
+   options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-count-option.rst
+
+.. todo: add output and examples
+
+.. seealso::
+   
+   - :manual:`count command reference `
+     in the MongoDB manual.
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
new file mode 100644
index 00000000..85c0b244
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -0,0 +1,107 @@
+================================
+MongoDBCollection::createIndex()
+================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+                    
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::createIndex($key, $options)
+               
+   Create an index for the collection.
+   
+   .. code-block:: php
+                   
+      function createIndex($key, array $options = []): string
+
+   ``createIndex()`` accepts the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-param.rst
+
+   The ``$options`` parameter accepts all index options that your
+   MongoDB version supports. MongoDB 3.2 includes the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst
+
+   For a full list of the supported index creation options, refer to
+   the :manual:`createIndexes `
+   command reference in the MongoDB manual.
+
+Output
+------
+
+Returns the name of the created index as a string.
+                
+Examples
+--------
+
+Create a Compound Index
+~~~~~~~~~~~~~~~~~~~~~~~
+
+The following operation creates a :manual:`compound index
+` on the ``borough`` and ``cuisine`` fields
+in the ``restaurants`` collection.
+
+.. code-block:: php
+                
+   selectCollection('example','restaurants');
+
+   $keys = ['borough' => 1, 'cuisine' => 1];
+
+   $indexString = $collection->createIndex($keys, ['name' => 'compound']);
+
+   var_dump($indexString);
+
+The output would resemble the following:
+
+.. code-block:: none
+                
+   string(8) "compound"
+
+Create a Partial Index
+~~~~~~~~~~~~~~~~~~~~~~
+
+The following operation adds a :manual:`partial index
+` on the ``borough`` field in the ``restaurants``
+collection in the ``example`` database. The partial index indexes only
+fields where the ``borough`` field exists.
+
+.. code-block:: php
+                
+   selectCollection('example','restaurants');
+
+   $indexString = $collection->createIndex(
+      ['borough' => 1], 
+      ['partialFilterExpression'=>
+         ['borough'=>
+            ['$exists'=>true]
+   ]]);
+   
+   var_dump($indexString);
+
+The output would resemble::
+                
+   string(9) "borough_1"
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::createIndexes`
+   - :doc:`/tutorial/indexes`
+   - :manual:`createIndexes ` 
+     command reference in the MongoDB manual
+   - :manual:`Index documentation `
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
new file mode 100644
index 00000000..6fc65ac1
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -0,0 +1,98 @@
+==================================
+MongoDBCollection::createIndexes()
+==================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+                    
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::createIndexes($indexes)
+               
+   Create one or more indexes for the collection.
+   
+   .. code-block:: php
+
+      function createIndexes(array $indexes): string[]
+
+   ``createIndex()`` has one parameter: ``$indexes``, which is an array
+   or object.
+   Each element in the ``$indexes`` array|object must have a
+   "``key`` document" that specifies the fields to index and the
+   array direction or type. You can then specify index options as
+   additional key-value pairs in that element.
+
+   For example, the following ``$indexes`` parameter creates an ascending
+   unique index on the ``username`` field:
+   
+   .. code-block:: none
+                   
+      [ 'key' => ['username => 1 '], 'unique' => true ],
+   
+   The following ``$indexes`` parameter creates a 2dsphere index on the ``loc`` field and
+   specifies a custom index name:
+   
+   .. code-block:: none
+                   
+      [ 'key' => [ 'loc' => '2dsphere'], 'name' => 'geo_index' ],
+   
+   You can specify any index options that your MongoDB version
+   supports. MongoDB 3.2 includes the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst
+
+   For a full list of the supported index creation options, refer to
+   the :manual:`createIndexes `
+   command reference in the MongoDB manual.
+
+Output
+------
+
+Returns the name of the created indexes as an array of strings.
+                
+Example
+-------
+
+The following creates two indexes on the ``restaurants`` collection in
+the ``example`` database. One index is a compound index on the
+``borough`` and ``cuisine`` fields and the other is 2dsphere index
+on the ``location`` field with a custom name.
+
+.. code-block:: php
+                
+   selectCollection('example','restaurants');
+
+   $index = $collection->createIndexes(
+       [ 
+           [ 'key' => [ 'borough' => 1, 'cuisine' => 1] ],
+           [ 'key' => [ 'location' => '2dsphere'], 'name' => 'geo_index'],
+       ]);
+
+   var_dump($index);
+
+The output would resemble the following::
+
+   array(2) {
+     [0]=>
+     string(19) "borough_1_cuisine_1"
+     [1]=>
+     string(9) "geo_index"
+   }
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::createIndex`
+   - :doc:`/tutorial/indexes`
+   - :manual:`createIndexes ` 
+     command reference in the MongoDB manual
+   - :manual:`Index documentation `
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
new file mode 100644
index 00000000..29a2c882
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -0,0 +1,69 @@
+=================================
+MongoDB\\Collection::deleteMany()
+=================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::deleteMany($filter, $options)
+
+   Deletes all documents that match the filter criteria.
+
+   .. code-block:: php
+
+      function deleteMany($filter, array $options = []): MongoDB\DeleteResult
+
+   :phpmethod:`MongoDB\\Collection::deleteMany` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-param.rst
+   
+   :phpmethod:`MongoDB\\Collection::deleteMany` supports the following
+   options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-option.rst
+
+Output
+------
+
+Returns a ``MongoDB\DeleteResult`` object.
+
+Example
+-------
+
+The following operation deletes all of the documents in the ``users``
+collection that have ``ny`` as the value for the ``state`` field:
+
+.. code-block:: php
+
+   demo->users;
+   $collection->drop();
+
+   $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
+   $collection->insertOne(['name' => 'Alice', 'state' => 'ny']);
+   $deleteResult = $collection->deleteMany(['state' => 'ny']);
+
+   printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount());
+
+The output would then resemble::
+
+   Deleted 2 document(s)
+
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::bulkWrite`
+   - :phpmethod:`MongoDB\\Collection::deleteOne`
+   - :doc:`/tutorial/crud`
+   - :manual:`delete command reference ` matching document.
+
+   .. code-block:: php
+
+      function deleteOne($filter, array $options = []): MongoDB\DeleteResult
+
+   :phpmethod:`MongoDB\\Collection::deleteMany` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-param.rst
+   
+   :phpmethod:`MongoDB\\Collection::deleteMany` supports the following
+   options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-option.rst
+
+Output
+------
+
+Returns a ``MongoDB\DeleteResult`` object.
+
+Example
+-------
+
+The following operation deletes the first documents in the ``users``
+collection that has ``ny`` as the value for the ``state`` field:
+
+.. code-block:: php
+
+   demo->users;
+   $collection->drop();
+
+   $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
+   $collection->insertOne(['name' => 'Alice', 'state' => 'ny']);
+   $deleteResult = $collection->deleteOne(['state' => 'ny']);
+
+   printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount());
+
+The output would then resemble::
+
+   Deleted 1 document(s)
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::bulkWrite`
+   - :phpmethod:`MongoDB\\Collection::deleteMany`
+   - :doc:`/tutorial/crud`
+   - :manual:`delete command reference selectCollection('example','restaurants');
+
+   $distinct = $collection->distinct('borough');
+
+   var_dump($distinct);
+
+The output would resemble::
+            
+   array(6) {
+     [0]=>
+     string(5) "Bronx"
+     [1]=>
+     string(8) "Brooklyn"
+     [2]=>
+     string(9) "Manhattan"
+     [3]=>
+     string(7) "Missing"
+     [4]=>
+     string(6) "Queens"
+     [5]=>
+     string(13) "Staten Island"
+   }
+  
+   
+Return Distinct Values Using a Filter
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following example identifies the distinct values for the
+``cuisine`` field in the ``restaurants`` collection in the ``example``
+database for documents where the ``borough`` is ``Queens``:
+
+.. code-block:: php
+                
+   selectCollection('example','restaurants');
+
+   $distinct = $collection->distinct('cuisine', ['borough'=>'Queens']);
+
+   
+   var_dump($distinct);   
+                
+The output would then resemble::
+                
+   array(75) {
+     [0]=>
+     string(6) "Afghan"
+     [1]=>
+     string(7) "African"
+     [2]=>
+     string(9) "American "
+     [3]=>
+     string(8) "Armenian"
+     [4]=>
+     string(5) "Asian"
+     [5]=>
+     string(10) "Australian"
+     [6]=>
+     string(15) "Bagels/Pretzels"
+     [7]=>
+     string(6) "Bakery"
+     [8]=>
+     string(11) "Bangladeshi"
+     [9]=>
+     string(8) "Barbecue"
+     [10]=>
+     string(55) "Bottled beverages, including water, sodas, juices, etc."
+     [11]=>
+     string(9) "Brazilian"
+     [12]=>
+     string(4) "Cafe"
+     [13]=>
+     string(16) "Café/Coffee/Tea"
+     [14]=>
+     string(5) "Cajun"
+     [15]=>
+     string(9) "Caribbean"
+     [16]=>
+     string(7) "Chicken"
+     [17]=>
+     string(7) "Chinese"
+     [18]=>
+     string(13) "Chinese/Cuban"
+     [19]=>
+     string(16) "Chinese/Japanese"
+     [20]=>
+     string(11) "Continental"
+     [21]=>
+     string(6) "Creole"
+     [22]=>
+     string(5) "Czech"
+     [23]=>
+     string(12) "Delicatessen"
+     [24]=>
+     string(6) "Donuts"
+     [25]=>
+     string(16) "Eastern European"
+     [26]=>
+     string(8) "Egyptian"
+     [27]=>
+     string(7) "English"
+     [28]=>
+     string(8) "Filipino"
+     [29]=>
+     string(6) "French"
+     [30]=>
+     string(17) "Fruits/Vegetables"
+     [31]=>
+     string(6) "German"
+     [32]=>
+     string(5) "Greek"
+     [33]=>
+     string(10) "Hamburgers"
+     [34]=>
+     string(16) "Hotdogs/Pretzels"
+     [35]=>
+     string(31) "Ice Cream, Gelato, Yogurt, Ices"
+     [36]=>
+     string(6) "Indian"
+     [37]=>
+     string(10) "Indonesian"
+     [38]=>
+     string(5) "Irish"
+     [39]=>
+     string(7) "Italian"
+     [40]=>
+     string(8) "Japanese"
+     [41]=>
+     string(13) "Jewish/Kosher"
+     [42]=>
+     string(30) "Juice, Smoothies, Fruit Salads"
+     [43]=>
+     string(6) "Korean"
+     [44]=>
+     string(64) "Latin (Cuban, Dominican, Puerto Rican, South & Central American)"
+     [45]=>
+     string(13) "Mediterranean"
+     [46]=>
+     string(7) "Mexican"
+     [47]=>
+     string(14) "Middle Eastern"
+     [48]=>
+     string(8) "Moroccan"
+     [49]=>
+     string(25) "Not Listed/Not Applicable"
+     [50]=>
+     string(18) "Nuts/Confectionary"
+     [51]=>
+     string(5) "Other"
+     [52]=>
+     string(9) "Pakistani"
+     [53]=>
+     string(16) "Pancakes/Waffles"
+     [54]=>
+     string(8) "Peruvian"
+     [55]=>
+     string(5) "Pizza"
+     [56]=>
+     string(13) "Pizza/Italian"
+     [57]=>
+     string(6) "Polish"
+     [58]=>
+     string(10) "Portuguese"
+     [59]=>
+     string(7) "Russian"
+     [60]=>
+     string(6) "Salads"
+     [61]=>
+     string(10) "Sandwiches"
+     [62]=>
+     string(30) "Sandwiches/Salads/Mixed Buffet"
+     [63]=>
+     string(7) "Seafood"
+     [64]=>
+     string(9) "Soul Food"
+     [65]=>
+     string(18) "Soups & Sandwiches"
+     [66]=>
+     string(12) "Southwestern"
+     [67]=>
+     string(7) "Spanish"
+     [68]=>
+     string(5) "Steak"
+     [69]=>
+     string(5) "Tapas"
+     [70]=>
+     string(7) "Tex-Mex"
+     [71]=>
+     string(4) "Thai"
+     [72]=>
+     string(7) "Turkish"
+     [73]=>
+     string(10) "Vegetarian"
+     [74]=>
+     string(29) "Vietnamese/Cambodian/Malaysia"
+   }
+   
+
+.. seealso::
+   
+   - :manual:`distinct ` command
+     reference in the MongoDB manual.
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
new file mode 100644
index 00000000..6a65b303
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -0,0 +1,76 @@
+===========================
+MongoDB\\Collection::drop()
+===========================
+
+.. default-domain:: mongodb
+                   
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::drop
+               
+   Drops the collection.
+   
+   .. code-block:: php
+                   
+      function drop(array $options = []): array|object
+      
+   ``drop()`` supports the following parameter:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-drop-param.rst
+      
+   The ``$options`` parameter supports the following option:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-drop-option.rst
+      
+Output
+------
+
+Returns the command result document as an array or object, depending
+on the ``typeMap`` specification.
+
+Example
+-------
+
+The following operation drops the ``restaurants`` collection in the
+``example`` database:
+
+.. code-block:: php
+
+   selectCollection('example','restaurants');
+
+   $output = $collection->drop();
+
+   
+   var_dump($output);
+
+The output would resemble::
+                
+   object(MongoDB\Model\BSONDocument)#9 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(3) {
+       ["ns"]=>
+       string(19) "example.restaurants"
+       ["nIndexesWas"]=>
+       int(3)
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Database::dropCollection`
+   - :manual:`drop ` command reference in
+     the MongoDB manual.
+
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
new file mode 100644
index 00000000..ef320fdb
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -0,0 +1,76 @@
+================================
+MongoDB\\Collection::dropIndex()
+================================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::dropIndex($indexName, $options)
+   
+   Drops an index from the collection.
+   
+   .. code-block:: php
+      
+      function dropIndex($indexName, array $options = []): array|object
+
+   ``dropIndex()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
+   
+   The ``$options`` parameter supports the following option:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
+
+Output
+------
+
+Returns the command result document as an array or object, depending
+on the ``typeMap`` specification.
+
+Example
+-------
+
+The following drops an indexes with name ``borough_1`` from the
+``restaurants`` collection in the ``example`` database:
+
+.. code-block:: php
+
+   selectCollection('example','restaurants');
+
+   $index = $collection->dropIndex( "borough_1" );
+
+   
+   var_dump($index);
+
+                
+The output would resemble the following::
+  
+   object(MongoDB\Model\BSONDocument)#9 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(2) {
+       ["nIndexesWas"]=>
+       int(2)
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::dropIndexes`
+   - :doc:`/tutorial/indexes`
+   - :manual:`dropIndexes ` command
+     references in the MongoDB manual.
+   - :manual:`Index documentation `
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
new file mode 100644
index 00000000..3d25b328
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -0,0 +1,77 @@
+==================================
+MongoDB\\Collection::dropIndexes()
+==================================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::dropIndexes($options)
+   
+   Drops **all indexes** in the collection.
+   
+   .. code-block:: php
+      
+      function dropIndexes(array $options = []): array|object
+
+   ``dropIndexes()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
+   
+   The ``$options`` parameter supports the following option:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
+
+Output
+------
+
+Returns the command result document as an array or object, depending
+on the ``typeMap`` specification.
+
+Example
+-------
+
+The following drops all indexes from the ``restaurants`` collection in
+the ``example`` database:
+
+.. code-block:: php
+
+   selectCollection('example','restaurants');
+
+   $response = $collection->dropIndexes();
+
+   var_dump($response);
+
+                
+The output would resemble the following::
+  
+   object(MongoDB\Model\BSONDocument)#9 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(3) {
+       ["nIndexesWas"]=>
+       int(3)
+       ["msg"]=>
+       string(38) "non-_id indexes dropped for collection"
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::dropIndex`
+   - :doc:`/tutorial/indexes`
+   - :manual:`dropIndexes ` command
+     references in the MongoDB manual.
+   - :manual:`Index documentation `
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
new file mode 100644
index 00000000..2a090489
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -0,0 +1,156 @@
+===========================
+MongoDB\\Collection::find()
+===========================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+              
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::find
+               
+   Finds documents matching the query.
+   
+   .. code-block:: php
+                   
+      function find($filter = [], array $options = []): MongoDB\Driver\Cursor
+
+   ``find()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
+
+   The ``$options`` parameter supports the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-find-option.rst
+
+                
+Output
+------
+
+Returns a ``MongoDB\Driver\Cursor`` object.
+
+Examples
+--------
+
+The following example finds restaurants based on the ``cuisine`` and
+``borough`` fields and uses a :manual:`projection
+` to limit the fields
+that are returned. It also limits the results to 5 documents.
+
+.. code-block:: php
+                
+   $database = new MongoDB\Client;
+
+   $collection = $database->selectCollection('example','restaurants');
+
+   $restaurants = $collection->find(
+       [ 'cuisine' => 'Italian', 'borough' => 'Manhattan' ],
+       [ 'limit' => 5, 
+         'projection' => [
+           'name' => 1, 'borough' => 1, 'cuisine' => 1,
+         ],
+       ]
+   );
+
+   
+   foreach ($restaurants as $restaurant) {
+      var_dump($restaurant);
+   };
+
+The output would resemble:
+
+.. code-block:: none
+                
+   object(MongoDB\Model\BSONDocument)#10 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#8 (1) {
+         ["oid"]=>
+         string(24) "576023c6b02fa9281da3f983"
+       }
+       ["borough"]=>
+       string(9) "Manhattan"
+       ["cuisine"]=>
+       string(7) "Italian"
+       ["name"]=>
+       string(23) "Isle Of Capri Resturant"
+     }
+   }
+   object(MongoDB\Model\BSONDocument)#13 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#12 (1) {
+         ["oid"]=>
+         string(24) "576023c6b02fa9281da3f98d"
+       }
+       ["borough"]=>
+       string(9) "Manhattan"
+       ["cuisine"]=>
+       string(7) "Italian"
+       ["name"]=>
+       string(18) "Marchis Restaurant"
+     }
+   }
+   object(MongoDB\Model\BSONDocument)#8 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#10 (1) {
+         ["oid"]=>
+         string(24) "576023c6b02fa9281da3f99b"
+       }
+       ["borough"]=>
+       string(9) "Manhattan"
+       ["cuisine"]=>
+       string(7) "Italian"
+       ["name"]=>
+       string(19) "Forlinis Restaurant"
+     }
+   }
+   object(MongoDB\Model\BSONDocument)#12 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#13 (1) {
+         ["oid"]=>
+         string(24) "576023c6b02fa9281da3f9a8"
+       }
+       ["borough"]=>
+       string(9) "Manhattan"
+       ["cuisine"]=>
+       string(7) "Italian"
+       ["name"]=>
+       string(22) "Angelo Of Mulberry St."
+     }
+   }
+   object(MongoDB\Model\BSONDocument)#10 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#8 (1) {
+         ["oid"]=>
+         string(24) "576023c6b02fa9281da3f9b4"
+       }
+       ["borough"]=>
+       string(9) "Manhattan"
+       ["cuisine"]=>
+       string(7) "Italian"
+       ["name"]=>
+       string(16) "V & T Restaurant"
+     }
+   }
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::findOne`
+   - :manual:`find ` command reference
+     in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
new file mode 100644
index 00000000..e77d04b9
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -0,0 +1,85 @@
+==============================
+MongoDB\\Collection::findOne()
+==============================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+              
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::findOne
+   
+   Finds a single document matching the query.
+   
+   .. code-block:: php
+                   
+      function findOne($filter = [], array $options = []): array|object
+
+   ``findOne()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst
+
+   The ``$options`` parameter supports the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-option.rst
+
+                
+Output
+------
+
+Returns the :term:`first document ` that matches the
+query or ``null`` if no document matches the query.
+
+Examples
+--------
+
+The following example finds a restaurant based on the ``cuisine`` and
+``borough`` fields and uses a :manual:`projection
+` to limit the fields
+that are returned.
+
+.. code-block:: php
+                
+   $database = new MongoDB\Client;
+
+   $collection = $database->selectCollection('example','restaurants');
+
+   $restaurants = $collection->findOne(
+       [ 'cuisine' => 'Italian', 'borough' => 'Manhattan'],
+       [ 'limit' => 5, 
+         'projection' => [
+           'name' => 1, 'borough' => 1, 'cuisine' => 1,
+         ],
+       ]
+   );
+
+   
+   foreach ($restaurants as $restaurant) {
+      var_dump($restaurant);
+   };
+
+The output would resemble:
+
+.. code-block:: none
+                
+   object(MongoDB\BSON\ObjectID)#11 (1) {
+     ["oid"]=>
+     string(24) "576023c6b02fa9281da3f983"
+   }
+   string(9) "Manhattan"
+   string(7) "Italian"
+   string(23) "Isle Of Capri Resturant"
+
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::findOne`
+   - :manual:`find ` command reference
+     in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
new file mode 100644
index 00000000..05e7c355
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -0,0 +1,89 @@
+=======================================
+MongoDB\\Collection::findOneAndDelete()
+=======================================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+              
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::findOneAndDelete
+   
+   Finds a single document and deletes it.
+   
+   .. code-block:: php
+                   
+      function findOneAndDelete($filter = [], array $options = []): object|null
+
+   ``findOne()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-param.rst
+
+   The ``$options`` parameter supports the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-option.rst
+
+   .. include:: /includes/extracts/bson-deserialization-findOneAndDelete.rst
+                 
+Output
+------
+
+Returns the document that was deleted. If no document matched the
+filter, the returned document is ``null``.
+
+Examples
+--------
+
+The following example deletes the document with ``restaurant_id`` of
+``40375376`` from the ``restaurants`` collection in the ``example``
+database:
+
+.. code-block:: php
+   
+   selectCollection('example','restaurants');
+
+   $deletedRestaurant = $collection->findOneAndDelete(
+       [ 'restaurant_id' => '40375376' ],
+       [ 'projection' => [ 'name' => 1, 
+                           'borough' => 1, 
+                           'restaurant_id' => 1
+                         ] 
+       ]
+   );
+
+The output would resemble:
+
+.. code-block:: none
+                
+   object(stdClass)#14 (4) {
+     ["_id"]=>
+     object(MongoDB\BSON\ObjectID)#11 (1) {
+       ["oid"]=>
+       string(24) "576023c6b02fa9281da3fad9"
+     }
+     ["borough"]=>
+     string(9) "Manhattan"
+     ["name"]=>
+     string(15) "Agra Restaurant"
+     ["restaurant_id"]=>
+     string(8) "40375376"
+   }   
+  
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate`
+   - :phpmethod:`MongoDB\\Collection::findOneAndReplace`
+   - :manual:`findAndModify `
+     command reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
new file mode 100644
index 00000000..c6411d0d
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -0,0 +1,134 @@
+========================================
+MongoDB\\Collection::findOneAndReplace()
+========================================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+              
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::findOneAndReplace
+   
+   Finds a single document matching the query and replaces it.
+   
+   .. code-block:: php
+                   
+      function findOneAndReplace($filter, $replacement, array $options = []): object|null
+
+   ``findOneAndReplace()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-param.rst
+
+   The ``$options`` parameter supports the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-option.rst
+
+   .. include:: /includes/extracts/bson-deserialization-findOneAndReplace.rst
+
+Output
+------
+
+By default, returns the original document. To return the *new*
+document, use the ``returnDocument`` option. If no document matched
+the query, returns ``null``.
+
+Examples
+--------
+
+Consider the following document in the ``restaurants`` collection in
+the ``example`` database:
+
+.. code-block:: javascript
+                
+   {
+     "_id" : ObjectId("576023c7b02fa9281da4139e"),
+     "address" : {
+       "building" : "977",
+       "coord" : [
+         -74.06940569999999,
+         40.6188443
+       ],
+       "street" : "Bay Street",
+       "zipcode" : "10305"
+     },
+     "borough" : "Staten Island",
+     "cuisine" : "French",
+     "grades" : [
+       {
+         "date" : ISODate("2014-08-15T00:00:00Z"),
+         "grade" : "A",
+         "score" : 7
+       },
+       {
+         "date" : ISODate("2014-02-13T00:00:00Z"),
+         "grade" : "A",
+         "score" : 5
+       },
+       {
+         "date" : ISODate("2013-06-07T00:00:00Z"),
+         "grade" : "A",
+         "score" : 11
+       }
+     ],
+     "name" : "Zest",
+     "restaurant_id" : "41220906"
+   }
+
+The following operation replaces the document with ``restaurant_id :
+41220906`` with the new specified document:
+
+.. code-block:: php
+                
+   selectCollection('example','restaurants');
+
+   $updateRestaurant = $collection->findOneAndReplace(
+       [ 'restaurant_id' => '41220906' ],
+       [ 'Borough' => 'Staten Island', 
+         'cuisine' => 'Italian',
+         'grades' => [],
+         'name' => 'Staten Island Pastaria',
+         'restaurant_id' => '999999999',
+       ],
+       [ 'returnDocument' => MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER ]
+   );  
+
+   
+
+   var_dump($updateRestaurant)
+      
+The ``var_dump()`` output contains the new document, as in the following::
+   
+   object(stdClass)#14 (6) {
+     ["_id"]=>
+     object(MongoDB\BSON\ObjectID)#11 (1) {
+       ["oid"]=>
+       string(24) "576023c7b02fa9281da4139e"
+     }
+     ["borough"]=>
+     string(13) "Staten Island"
+     ["cuisine"]=>
+     string(7) "Italian"
+     ["grades"]=>
+     array(0) {
+     }
+     ["name"]=>
+     string(22) "Staten Island Pastaria"
+     ["restaurant_id"]=>
+     string(9) "999999999"
+   }
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::findOneAndDelete`
+   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate`
+   - :manual:`findAndModify `
+     command reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
new file mode 100644
index 00000000..56d8a423
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -0,0 +1,73 @@
+=======================================
+MongoDB\\Collection::findOneAndUpdate()
+=======================================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+              
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::findOneAndUpdate
+   
+   Finds a single document matching the query and updates it.
+   
+   .. code-block:: php
+                   
+      function findOneAndUpdate($filter, $update, array $options = []): object|null
+
+   ``findOneAndUpdate()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-param.rst
+
+   The ``$options`` parameter supports the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-option.rst
+
+   .. include:: /includes/extracts/bson-deserialization-findOneAndUpdate.rst
+                
+Output
+------
+
+Returns either the original or the updated document, depending on the
+specified value for the ``returnDocument`` option. By default, the
+original document is returned.
+
+Examples
+--------
+
+The following operation updates the building number of the restaurant
+with ``restaurant_id : 40361708`` in the ``restaurants`` collection in
+the ``example`` database to ``761``:
+
+.. code-block:: php
+                
+   selectCollection('example','restaurants');
+
+   $updateRestaurant = $collection->findOneAndUpdate(
+       [ 'restaurant_id' => '40361708' ],
+       [ '$set' => ['address.building' => '761']],
+       [ 'returnDocument' => MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER ]
+   );
+
+   
+   var_dump($updateRestaurant)
+                
+
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::findOneAndDelete`
+   - :phpmethod:`MongoDB\\Collection::findOneAndReplace`
+   - :manual:`findAndModify ` command reference
+     in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-getCollectionName.txt b/source/reference/method/MongoDBCollection-getCollectionName.txt
new file mode 100644
index 00000000..8e58b1ad
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-getCollectionName.txt
@@ -0,0 +1,38 @@
+========================================
+MongoDB\\Collection::getCollectionName()
+========================================
+
+.. default-domain:: mongodb
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::getCollectionName()
+
+   Returns the name of the current collection.
+   
+   .. code-block:: php
+
+      function getCollectionName(): string
+
+Example
+-------
+
+The following returns the name of the collection assigned to the
+``$collection`` variable
+
+.. code-block:: php
+
+   demo->zips;   
+   echo $collection->getCollectionName();
+
+The ``$collection`` variable uses the :phpmethod:`constructor
+` method to select the ``zips``
+collection in the ``demo`` database, as such, the printed output would
+resemble:
+
+.. code-block:: none
+
+   zips
diff --git a/source/reference/method/MongoDBCollection-getDatabaseName.txt b/source/reference/method/MongoDBCollection-getDatabaseName.txt
new file mode 100644
index 00000000..024cde9f
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-getDatabaseName.txt
@@ -0,0 +1,38 @@
+======================================
+MongoDB\\Collection::getDatabaseName()
+======================================
+
+.. default-domain:: mongodb
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::getDatabaseName()
+
+   Returns the name of the current database.
+   
+   .. code-block:: php
+
+      function getDatabaseName(): string
+
+Example
+-------
+
+The following returns the name of the database of the collection
+assigned to the ``$collection`` variable
+
+.. code-block:: php
+
+   demo->zips;   
+   echo $collection->getDatabaseName();
+
+The ``$collection`` variable uses the :phpmethod:`constructor
+` method to select the ``zips``
+collection in the ``demo`` database, as such, the printed output would
+resemble:
+
+.. code-block:: none
+
+   demo
diff --git a/source/reference/method/MongoDBCollection-getNamespace.txt b/source/reference/method/MongoDBCollection-getNamespace.txt
new file mode 100644
index 00000000..f3d5cce2
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-getNamespace.txt
@@ -0,0 +1,39 @@
+===================================
+MongoDB\\Collection::getNamespace()
+===================================
+
+.. default-domain:: mongodb
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::getNamespace()
+
+   Returns the :term:`namespace` of the collection. A namespace
+   is the canonical name of an index or collection in MongoDB.
+   
+   .. code-block:: php
+
+      function getNamespace(): string
+
+Example
+-------
+
+The following returns the namespace of the collection
+assigned to the ``$collection`` variable
+
+.. code-block:: php
+
+   demo->zips;   
+   echo $collection->getNamespace();
+
+The ``$collection`` variable uses the :phpmethod:`constructor
+` method to select the ``zips``
+collection in the ``demo`` database, as such, the printed output would
+resemble:
+
+.. code-block:: none
+
+   demo.zips
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
new file mode 100644
index 00000000..1644a2d3
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -0,0 +1,97 @@
+=================================
+MongoDB\\Collection::insertMany()
+=================================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+              
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::insertMany
+   
+   Inserts one document.
+   
+   .. code-block:: php
+                   
+      function insertMany(array $documents, array $options = []): MongoDB\InsertManyResult
+
+   ``insertMany()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-param.rst
+
+   The ``$options`` parameter supports the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-option.rst
+
+Output
+------
+
+Returns a ``MongoDB\InsertManyResult`` object.
+
+Example
+-------
+
+.. start-crud-include
+
+The following operation inserts two documents into the ``users``
+collection in the ``example`` database:
+
+.. code-block:: php
+                
+   selectCollection('users','restaurants');
+
+   $newUsers = $collection->insertMany(
+       [
+         [
+           'username' => 'admin',
+           'email' => 'admin@example.com',
+           'name' => 'Admin User'
+         ],
+         [
+           'username' => 'test',
+           'email' => 'test@example.com',
+           'name' => 'Test User'
+   
+         ],
+       ]
+   );
+
+   printf("Inserted %d document(s)\n", $newUsers->getInsertedCount());
+   var_dump($newUsers->getInsertedIds());
+
+The output would resemble::
+
+   Inserted 2 document(s)
+   array(2) {
+     [0]=>
+     object(MongoDB\BSON\ObjectID)#11 (1) {
+       ["oid"]=>
+       string(24) "579a25921f417dd1e5518141"
+     }
+     [1]=>
+     object(MongoDB\BSON\ObjectID)#12 (1) {
+       ["oid"]=>
+       string(24) "579a25921f417dd1e5518142"
+     }
+   }
+
+.. end-crud-include  
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::bulkWrite`
+   - :phpmethod:`MongoDB\\Collection::insertOne`
+   - :doc:`/tutorial/crud`
+   - :manual:`insert ` command reference
+     in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
new file mode 100644
index 00000000..59c58406
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -0,0 +1,52 @@
+================================
+MongoDB\\Collection::insertOne()
+================================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+              
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::insertOne
+   
+   Inserts one document.
+   
+   .. code-block:: php
+                   
+      function insertOne($document, array $options = []): MongoDB\InsertOneResult
+
+   ``insertOne()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-param.rst
+
+   The ``$options`` parameter supports the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-option.rst
+
+Output
+------
+
+Returns a ``MongoDB\InsertOneResult`` object.
+
+Example
+-------
+
+The following operation inserts a document into the ``users``
+collection in the ``example`` database:
+
+.. include:: /includes/example-insertOne.rst
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::bulkWrite`
+   - :phpmethod:`MongoDB\\Collection::insertMany`
+   - :doc:`/tutorial/crud`
+   - :manual:`insert ` command reference
+     in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
new file mode 100644
index 00000000..c2a3a2f8
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -0,0 +1,112 @@
+==================================
+MongoDB\\Collection::listIndexes()
+==================================
+
+.. default-domain:: mongodb
+
+.. contents::
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::listIndexes($options)
+
+   Returns information for all indexes for the collection.
+   
+   .. code-block:: php
+
+      function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator
+
+   :phpmethod:`MongoDB\\Collection::listIndexes` supports the
+   following parameter:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-param.rst
+   
+   The ``$options`` parameter supports the following options:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-option.rst
+
+Output
+------
+
+Elements in the returned iterator are ``MongoDB\Model\IndexInfo``
+objects.
+
+                
+Example
+-------
+
+The following lists information about the indexes on the collection
+assigned to the ``$collection`` variable
+
+.. code-block:: php
+
+   selectCollection('example','restaurants');
+
+   $indexes = $collection->listIndexes();
+
+   foreach ($indexes as $index) {
+      var_dump($index);
+   }
+
+The output would then resemble::
+
+   object(MongoDB\Model\IndexInfo)#8 (4) {
+     ["v"]=>
+     int(1)
+     ["key"]=>
+     array(1) {
+       ["_id"]=>
+       int(1)
+     }
+     ["name"]=>
+     string(4) "_id_"
+     ["ns"]=>
+     string(19) "example.restaurants"
+   }
+   object(MongoDB\Model\IndexInfo)#12 (4) {
+     ["v"]=>
+     int(1)
+     ["key"]=>
+     array(1) {
+       ["cuisine"]=>
+       float(-1)
+     }
+     ["name"]=>
+     string(10) "cuisine_-1"
+     ["ns"]=>
+     string(19) "example.restaurants"
+   }
+   object(MongoDB\Model\IndexInfo)#8 (4) {
+     ["v"]=>
+     int(1)
+     ["key"]=>
+     array(1) {
+       ["borough"]=>
+       float(1)
+     }
+     ["name"]=>
+     string(9) "borough_1"
+     ["ns"]=>
+     string(19) "example.restaurants"
+   }
+
+
+.. seealso::
+
+   - :doc:`/tutorial/indexes`
+
+   - :manual:`listIndexes command ` in the MongoDB manual.
+   
+   - :manual:`Index documentation ` in the MongoDB manual.
+   
+   - `MongoDB Specification: Enumerating Collections
+     `_
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
new file mode 100644
index 00000000..e84ff3aa
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -0,0 +1,114 @@
+=================================
+MongoDB\\Collection::replaceOne()
+=================================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+              
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::replaceOne
+   
+   Replaces at most one document that matches the filter.
+   
+   .. code-block:: php
+                   
+      function replaceOne($filter, $replacement, array $options = []): MongoDB\UpdateResult
+
+   ``replaceOne()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-param.rst
+
+   The ``$options`` parameter supports the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-option.rst
+
+Output
+------
+
+Returns a ``MongoDB\UpdateResult`` object.
+
+Example
+-------
+
+The following operation replaces the document with ``restaurant_id``
+``40356068`` in the ``restaurants`` collection in the ``example`` database:
+
+.. code-block:: php
+                
+   selectCollection('users','restaurants');
+
+   $replacement = $collection->replaceOne(
+       [   'restaurant_id' => '40356068'],
+       [
+           'name' => 'New Restaurant',
+           'restaurant_id' => '99988877',
+           'borough' => 'Queens',
+           'cuisine' => 'Cafe',
+           'grades' => [],
+       ]
+   );
+
+   
+   var_dump($replacement);
+
+The output would resemble:
+
+.. code-block:: none
+                
+   object(MongoDB\UpdateResult)#13 (2) {
+     ["writeResult":"MongoDB\UpdateResult":private]=>
+     object(MongoDB\Driver\WriteResult)#12 (9) {
+       ["nInserted"]=>
+       int(0)
+       ["nMatched"]=>
+       int(1)
+       ["nModified"]=>
+       int(1)
+       ["nRemoved"]=>
+       int(0)
+       ["nUpserted"]=>
+       int(0)
+       ["upsertedIds"]=>
+       array(0) {
+       }
+       ["writeErrors"]=>
+       array(0) {
+       }
+       ["writeConcernError"]=>
+       NULL
+       ["writeConcern"]=>
+       array(4) {
+         ["w"]=>
+         NULL
+         ["wmajority"]=>
+         bool(false)
+         ["wtimeout"]=>
+         int(0)
+         ["journal"]=>
+         NULL
+       }
+     }
+     ["isAcknowledged":"MongoDB\UpdateResult":private]=>
+     bool(true)
+   }
+
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::bulkWrite`
+   - :phpmethod:`MongoDB\\Collection::updateMany`
+   - :phpmethod:`MongoDB\\Collection::updateOne`
+   - :doc:`/tutorial/crud`
+   - :manual:`update ` command reference
+     in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
new file mode 100644
index 00000000..7460afbb
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -0,0 +1,109 @@
+=================================
+MongoDB\\Collection::updateMany()
+=================================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+              
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::updateMany
+   
+   Updates all documents that match the filter criteria.
+   
+   .. code-block:: php
+                   
+      function updateMany($filter, $update, array $options = []): MongoDB\UpdateResult
+
+   ``updateMany()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-param.rst
+
+   The ``$options`` parameter supports the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-option.rst
+                
+Output
+------
+
+Returns a ``MongoDB\UpdateResult`` object.
+
+Examples
+--------
+
+The following operation adds a an ``active`` field to all of the documents
+with ``borough: Queens`` with value ``true``:
+
+.. code-block:: php
+                
+   $database = new MongoDB\Client;
+
+   $collection = $database->selectCollection('example','restaurants');
+
+   $update = $collection->updateMany(
+          [   'borough' => 'Queens'],
+          [
+              '$set' => [
+                   'active' => 'True'
+              ]
+          ]
+      );
+
+   
+
+   var_dump($update);
+
+The output would then resemble::
+  
+   object(MongoDB\UpdateResult)#13 (2) {
+     ["writeResult":"MongoDB\UpdateResult":private]=>
+     object(MongoDB\Driver\WriteResult)#12 (9) {
+       ["nInserted"]=>
+       int(0)
+       ["nMatched"]=>
+       int(5656)
+       ["nModified"]=>
+       int(5656)
+       ["nRemoved"]=>
+       int(0)
+       ["nUpserted"]=>
+       int(0)
+       ["upsertedIds"]=>
+       array(0) {
+       }
+       ["writeErrors"]=>
+       array(0) {
+       }
+       ["writeConcernError"]=>
+       NULL
+       ["writeConcern"]=>
+       array(4) {
+         ["w"]=>
+         NULL
+         ["wmajority"]=>
+         bool(false)
+         ["wtimeout"]=>
+         int(0)
+         ["journal"]=>
+         NULL
+       }
+     }
+     ["isAcknowledged":"MongoDB\UpdateResult":private]=>
+     bool(true)
+   }
+   
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::bulkWrite`
+   - :phpmethod:`MongoDB\\Collection::replaceOne`
+   - :phpmethod:`MongoDB\\Collection::updateOne`
+   - :doc:`/tutorial/crud`
+   - :manual:`update ` command reference
+     in the MongoDB manual.
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
new file mode 100644
index 00000000..cef82ad5
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -0,0 +1,110 @@
+================================
+MongoDB\\Collection::updateOne()
+================================
+
+.. default-domain:: mongodb
+                    
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+              
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::updateOne
+   
+   Finds a single document matching the query and updates it.
+   
+   .. code-block:: php
+                   
+      function updateOne($filter, $update, array $options = []): MongoDB\UpdateResult
+
+   ``updateOne()`` supports the following parameters:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-param.rst
+
+   The ``$options`` parameter supports the following options:
+                
+   .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-option.rst
+                
+Output
+------
+
+Returns a ``MongoDB\UpdateResult`` object.
+
+Examples
+--------
+
+The following operation updates the ``name`` of the restaurant with
+``restaurant_id: 40356151`` to "Brunos on Astoria":
+
+.. code-block:: php
+                
+   $database = new MongoDB\Client;
+
+   $collection = $database->selectCollection('example','restaurants');
+
+   $update = $collection->updateOne(
+          [   'restaurant_id' => '40356151'],
+          [
+              '$set' => [
+                   'name' => 'Brunos on Astoria'
+              ]
+          ]
+      );
+
+   
+
+   var_dump($update);
+
+The output would then resemble::
+  
+  object(MongoDB\UpdateResult)#13 (2) {
+     ["writeResult":"MongoDB\UpdateResult":private]=>
+     object(MongoDB\Driver\WriteResult)#12 (9) {
+       ["nInserted"]=>
+       int(0)
+       ["nMatched"]=>
+       int(1)
+       ["nModified"]=>
+       int(1)
+       ["nRemoved"]=>
+       int(0)
+       ["nUpserted"]=>
+       int(0)
+       ["upsertedIds"]=>
+       array(0) {
+       }
+       ["writeErrors"]=>
+       array(0) {
+       }
+       ["writeConcernError"]=>
+       NULL
+       ["writeConcern"]=>
+       array(4) {
+         ["w"]=>
+         NULL
+         ["wmajority"]=>
+         bool(false)
+         ["wtimeout"]=>
+         int(0)
+         ["journal"]=>
+         NULL
+       }
+     }
+     ["isAcknowledged":"MongoDB\UpdateResult":private]=>
+     bool(true)
+   }
+  
+   
+.. seealso::
+   
+   - :phpmethod:`MongoDB\\Collection::bulkWrite`
+   - :phpmethod:`MongoDB\\Collection::replaceOne`
+   - :phpmethod:`MongoDB\\Collection::updateMany`
+   - :doc:`/tutorial/crud`
+   - :manual:`update ` command reference
+     in the MongoDB manual.
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
new file mode 100644
index 00000000..3e133025
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -0,0 +1,49 @@
+==================================
+MongoDB\\Collection::withOptions()
+==================================
+
+.. default-domain:: mongodb
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::withOptions($options)
+
+   Returns a clone of the collection, but with different options.
+   
+   .. code-block:: php
+
+      function withOptions(array $options = []): MongoDB\Collection
+
+   :phpmethod:`MongoDB\\Collection::withOptions` supports the
+   following parameter:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-param.rst
+   
+   The ``$options`` parameter supports the following options:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-option.rst
+
+Example
+-------
+
+The following example creates a new collection based on the
+``restaurants`` collection in the ``example`` database with a custom
+read preference:
+
+.. code-block:: php
+
+   selectCollection('example','restaurants');
+
+   $newCollection = $sourceCollection->withOptions([ 
+   	'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+   ]);
+
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Collection::__construct`
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
new file mode 100644
index 00000000..e06f7bbc
--- /dev/null
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -0,0 +1,44 @@
+==================================
+MongoDB\\Collection::__construct()
+==================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::__construct($manager, $databaseName, $collectionName, $options)
+
+   Constructs a new :phpclass:`Collection ` instance. 
+
+   .. code-block:: php
+
+      function __construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = [])
+
+   :phpmethod:`MongoDB\\Collection::__construct` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-construct-param.rst
+
+   :phpmethod:`MongoDB\\Collection::__construct` supports the following
+   options:
+   
+   .. include:: /includes/apiargs/common-option.rst
+
+   If you construct the Collection explicitly, the Collection inherits
+   any options from the ``Manager`` object. If you select the Collection
+   from a :phpclass:`Client ` or :phpclass:`Database
+   ` object, the Collection inherits its options
+   from that object.
+
+.. todo: add an example
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Collection::withOptions`
+   - :phpmethod:`MongoDB\\Database::selectCollection`
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
new file mode 100644
index 00000000..de4e1467
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -0,0 +1,125 @@
+============================
+MongoDB\\Database::command()
+============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::command
+
+   Execute a :manual:`command ` on the database.
+   
+   .. code-block:: php
+                   
+      function command($command, array $options = []): MongoDB\Driver\Cursor
+
+   :phpmethod:`MongoDB\\Database::command` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-command-param.rst
+   
+   ``command`` supports the following options:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-command-option.rst
+
+Example
+-------
+
+The following operation creates a new user in the database using
+the :dbcommand:`createUser` command:
+
+.. code-block:: php
+
+   $database = (new MongoDB\Client)->example;
+
+   $newUser = $database->command(
+       [
+           'createUser' => 'admin',
+           'pwd' => 'admin123',
+           'roles' => [
+               'readWrite'
+           ]
+       ]
+   );
+
+   
+
+   var_dump($newUser);
+
+The output would resemble::
+  
+  object(MongoDB\Driver\Cursor)#10 (2) {
+     ["cursor"]=>
+     array(17) {
+       ["stamp"]=>
+       int(0)
+       ["is_command"]=>
+       bool(true)
+       ["sent"]=>
+       bool(true)
+       ["done"]=>
+       bool(false)
+       ["end_of_event"]=>
+       bool(false)
+       ["in_exhaust"]=>
+       bool(false)
+       ["has_fields"]=>
+       bool(false)
+       ["query"]=>
+       object(stdClass)#9 (3) {
+         ["createUser"]=>
+         string(5) "admin"
+         ["pwd"]=>
+         string(8) "admin123"
+         ["roles"]=>
+         array(1) {
+           [0]=>
+           string(9) "readWrite"
+         }
+       }
+       ["fields"]=>
+       object(stdClass)#3 (0) {
+       }
+       ["read_preference"]=>
+       array(2) {
+         ["mode"]=>
+         int(1)
+         ["tags"]=>
+         array(0) {
+         }
+       }
+       ["flags"]=>
+       int(0)
+       ["skip"]=>
+       int(0)
+       ["limit"]=>
+       int(1)
+       ["count"]=>
+       int(1)
+       ["batch_size"]=>
+       int(0)
+       ["ns"]=>
+       string(12) "example.$cmd"
+       ["current_doc"]=>
+       object(stdClass)#8 (1) {
+         ["ok"]=>
+         float(1)
+       }
+     }
+     ["server_id"]=>
+     int(1)
+   }
+
+.. seealso::
+   
+   - :doc:`/tutorial/commands`
+   - :manual:`Database Commands ` in the
+     MongoDB manual
+     
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
new file mode 100644
index 00000000..2fc255c2
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -0,0 +1,89 @@
+=====================================
+MongoDB\\Database::createCollection()
+=====================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::createCollection
+
+   Explicitly creates a collection.
+   
+   .. code-block:: php
+
+      function createCollection($collectionName, array $options = []): array|object
+   
+   MongoDB creates collections implicitly when you first reference
+   the collection in a command, such as when inserting a document
+   into a new collection. You may also explicitly create a collection
+   with specific options using the ``createCollection()``
+   method, or using :dbcommand:`create` in the :program:`mongo` shell.
+   
+   Explicitly creating collections enables you to create
+   :manual:`capped collections `, specify
+   :manual:`document validation criteria `,
+   or configure your storage engine or indexing options.
+   
+   :phpmethod:`MongoDB\\Database::createCollection` has the following
+   parameters:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-param.rst
+   
+   The ``$options`` parameter accepts the following options:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-option.rst
+   
+   Note that not all options are available on all versions of MongoDB.
+   Document Validation, for example, was added in MongoDB 3.2;
+   similarly, the WiredTiger storage engine is available only for
+   MongoDB 3.0 and later. Refer to the :manual:`create command
+   ` reference in the MongoDB manual for
+   compatibility considerations.
+
+Output
+------
+
+Returns the command result document as an array.
+
+Example
+-------
+
+The following example creates a ``users`` collection in the ``demo``
+database with document validation criteria:
+
+.. code-block:: php
+
+   $db = (new MongoDB\Client)->demo;
+
+   $result = $db->createCollection('users', [
+       'validator' => [
+           'username' => ['$type' => 'string'],
+           'email' => ['$regex' => '@mongodb\.com$'],
+       ],
+   ]);
+   
+   
+   var_dump($result);
+
+The output would then resemble::
+
+   Object(MongoDB\Model\BSONDocument)#11 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(1) {
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+.. seealso::
+
+   :manual:`create ` command reference in
+   the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
new file mode 100644
index 00000000..cab554d3
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -0,0 +1,68 @@
+=========================
+MongoDB\\Database::drop()
+=========================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::drop
+
+   Drops the database.
+   
+   .. code-block:: php
+   
+      function dropCollection($collectionName, array $options = []): array|object
+   
+   :phpmethod:`MongoDB\\Database::drop` has the following
+   parameters:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-drop-param.rst
+   
+   The ``$options`` parameter accepts the following options:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-drop-option.rst
+
+Output
+------
+
+Returns the command result document as an array.
+
+Example
+-------
+
+The following example drops the ``demo`` database:
+
+.. code-block:: php
+
+   $db = (new MongoDB\Client)->demo;
+
+   $result = $db->drop();
+   
+   
+   var_dump($result);
+
+The output would then resemble::
+
+   object(MongoDB\Model\BSONDocument)#8 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(2) {
+       ["dropped"]=>
+       string(4) "demo"
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Client::dropDatabase`
+   - :manual:`dropDatabase ` command
+     reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
new file mode 100644
index 00000000..99fd71ef
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -0,0 +1,71 @@
+===================================
+MongoDB\\Database::dropCollection()
+===================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::dropCollection
+
+   Drop a collection within the current database.
+   
+   .. code-block:: php
+   
+      function dropCollection($collectionName, array $options = []): array|object
+   
+   :phpmethod:`MongoDB\\Database::dropCollection` has the following
+   parameters:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-param.rst
+   
+   The ``$options`` parameter accepts the following options:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-option.rst
+
+Output
+------
+
+Returns the command result document as an array.
+
+Example
+-------
+
+The following example drops the ``users`` collection in the ``demo``
+database:
+
+.. code-block:: php
+
+   $db = (new MongoDB\Client)->demo;
+
+   $result = $db->dropCollection('users');
+   
+   
+   var_dump($result);
+
+The output would then resemble::
+
+   object(MongoDB\Model\BSONDocument)#8 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(3) {
+       ["ns"]=>
+       string(10) "demo.users"
+       ["nIndexesWas"]=>
+       int(1)
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Collection::drop`
+   - :manual:`drop ` command reference in
+     the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-getDatabaseName.txt b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
new file mode 100644
index 00000000..336e7fbd
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
@@ -0,0 +1,43 @@
+====================================
+MongoDB\\Database::getDatabaseName()
+====================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::getDatabaseName
+
+   Drops the database.
+   
+   .. code-block:: php
+   
+      function getDatabaseName(): string
+
+Output
+------
+
+Returns the name of the database as a string.
+
+Example
+-------
+
+The following example gets the name of the database from the ``$db``
+variable:
+
+.. code-block:: php
+
+   $db = (new MongoDB\Client)->demo;
+
+   echo $db->getDatabaseName();
+
+The output would then resemble::
+
+   demo
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
new file mode 100644
index 00000000..bd03ea4e
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -0,0 +1,85 @@
+====================================
+MongoDB\\Database::listCollections()
+====================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::listCollections
+
+   Returns information for all collections in this database.
+
+   .. code-block:: php
+   
+      function listCollections(array $options=[]): MongoDB\Model\CollectionInfoIterator
+
+   :phpmethod:`MongoDB\\Database::listCollections` has the following
+   parameters:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-param.rst
+   
+   The ``$options`` parameter accepts the following options:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-option.rst
+
+Output
+------
+
+Returns information for all collections in the database. The elements
+in the returned iterator are ``MongoDB\Model\CollectionInfo`` objects.
+
+Example
+-------
+
+The following example lists all of the collections in the ``example``
+database:
+
+.. code-block:: php
+
+   example;
+
+   foreach ($database->listCollections() as $collectionInfo) {
+       var_dump($collectionInfo);
+   }
+
+The output would then resemble::
+
+   object(MongoDB\Model\CollectionInfo)#3 (2) {
+     ["name"]=>
+     string(11) "restaurants"
+     ["options"]=>
+     array(0) {
+     }
+   }
+   object(MongoDB\Model\CollectionInfo)#11 (2) {
+     ["name"]=>
+     string(5) "users"
+     ["options"]=>
+     array(0) {
+     }
+   }
+   object(MongoDB\Model\CollectionInfo)#3 (2) {
+     ["name"]=>
+     string(6) "restos"
+     ["options"]=>
+     array(0) {
+     }
+   }
+   
+.. seealso::
+
+   - :manual:`listCollections `_
\ No newline at end of file
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
new file mode 100644
index 00000000..5f8135b0
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -0,0 +1,140 @@
+=====================================
+MongoDB\\Database::selectCollection()
+=====================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::selectCollection
+
+   Selects a collection within the database. The collection inherits
+   options such as read preference and type map from the Database object
+   unless otherwise specified in the ``$options`` parameter.
+   
+   .. code-block:: php
+   
+      function selectCollection($collectionName, array $options = []): MongoDB\Collection
+   
+   :phpmethod:`MongoDB\\Database::selectCollection` has the following
+   parameters:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-param.rst
+   
+   The ``$options`` parameter accepts the following options:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-option.rst
+
+Output
+------
+
+Returns a :phpclass:`MongoDB\\Collection` object.
+
+Example
+-------
+
+The following example selects the ``users`` collection in the ``demo``
+database with a custom read preference:
+
+.. code-block:: php
+
+   $db = (new MongoDB\Client)->demo;
+
+   $users = $db->selectCollection(
+      'users',
+      [ 
+         'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+      ]
+   );
+   
+   
+   var_dump($users);
+
+The output would then resemble::
+
+   object(MongoDB\Collection)#8 (7) {
+     ["collectionName"]=>
+     string(5) "users"
+     ["databaseName"]=>
+     string(4) "demo"
+     ["manager"]=>
+     object(MongoDB\Driver\Manager)#2 (2) {
+       ["uri"]=>
+       string(25) "mongodb://localhost:27017"
+       ["cluster"]=>
+       array(1) {
+         [0]=>
+         array(11) {
+           ["host"]=>
+           string(9) "localhost"
+           ["port"]=>
+           int(27017)
+           ["type"]=>
+           int(0)
+           ["is_primary"]=>
+           bool(false)
+           ["is_secondary"]=>
+           bool(false)
+           ["is_arbiter"]=>
+           bool(false)
+           ["is_hidden"]=>
+           bool(false)
+           ["is_passive"]=>
+           bool(false)
+           ["tags"]=>
+           array(0) {
+           }
+           ["last_is_master"]=>
+           array(0) {
+           }
+           ["round_trip_time"]=>
+           int(-1)
+         }
+       }
+     }
+     ["readConcern"]=>
+     object(MongoDB\Driver\ReadConcern)#5 (1) {
+       ["level"]=>
+       NULL
+     }
+     ["readPreference"]=>
+     object(MongoDB\Driver\ReadPreference)#3 (2) {
+       ["mode"]=>
+       int(2)
+       ["tags"]=>
+       array(0) {
+       }
+     }
+     ["typeMap"]=>
+     array(3) {
+       ["array"]=>
+       string(23) "MongoDB\Model\BSONArray"
+       ["document"]=>
+       string(26) "MongoDB\Model\BSONDocument"
+       ["root"]=>
+       string(26) "MongoDB\Model\BSONDocument"
+     }
+     ["writeConcern"]=>
+     object(MongoDB\Driver\WriteConcern)#7 (4) {
+       ["w"]=>
+       NULL
+       ["wmajority"]=>
+       bool(false)
+       ["wtimeout"]=>
+       int(0)
+       ["journal"]=>
+       NULL
+     }
+   }   
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Collection::__construct`
+   - :phpmethod:`MongoDB\\Database::__get`
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
new file mode 100644
index 00000000..add91e0f
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -0,0 +1,48 @@
+================================
+MongoDB\\Database::withOptions()
+================================
+
+.. default-domain:: mongodb
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::withOptions
+
+   Returns a clone of the Database object, but with different options.
+   
+   .. code-block:: php
+
+      function withOptions(array $options = []): MongoDB\Database
+
+   :phpmethod:`MongoDB\\Database::withOptions` supports the
+   following parameter:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-param.rst
+   
+   The ``$options`` parameter supports the following options:
+   
+   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-option.rst
+
+Example
+-------
+
+The following example clones the ``$newDb`` Database object with read
+preference ``RP_SECONDARY``.
+
+.. code-block:: php
+
+   withOptions('sample','restaurants');
+
+   $newCollection = $sourceCollection->withOptions([ 
+       'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+   ]);
+   
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Collection::__construct`
diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt
new file mode 100644
index 00000000..78803f3e
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase__construct.txt
@@ -0,0 +1,40 @@
+================================
+MongoDB\\Database::__construct()
+================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::__construct
+
+   Constructs a new :phpclass:`Database ` instance.
+
+   .. code-block:: php
+
+      function __construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = [])
+
+   :phpmethod:`MongoDB\\Database::__construct` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-construct-param.rst
+
+   :phpmethod:`MongoDB\\Database::__construct` supports the following
+   options:
+   
+   .. include:: /includes/apiargs/MongoDBDatabase-method-construct-option.rst
+
+   If you construct the Database explicitly, the Database inherits any
+   options from the ``Manager`` object. If you select the Database
+   from a :phpclass:`Client ` object, the Database
+   inherits its options from that object.
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Database::withOptions`
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
new file mode 100644
index 00000000..3d3920a9
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -0,0 +1,63 @@
+==========================
+MongoDB\\Database::__get()
+==========================
+
+.. default-domain:: mongodb
+
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::__get($collectionName)
+
+   Select a collection from the database.
+
+   .. code-block:: php
+
+      function __get($collectionName): MongoDB\Collection
+
+   :phpmethod:`MongoDB\\Database::__get` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-get-param.rst
+
+Behavior
+--------
+
+The selected database inherits options such as read preference and
+type mapping from the :phpclass:`Database  ` object.
+If you wish to override any options, use the 
+:phpmethod:`MongoDB\\Database::selectCollection` method.
+
+.. note::
+   
+   To select collections whose names contain special characters, such as
+   ``.``, use complex syntax, as in ``$database->{'that.database'}``.
+   
+   Alternatively, :phpmethod:`MongoDB\\Database::selectCollection` supports
+   selecting databases whose names contain special characters.
+
+Examples
+--------
+
+The following example selects the ``users`` and ``system.profile``
+collections from the ``demo`` database:
+
+.. code-block:: php
+
+   demo;
+
+   $users = $db->users;
+   $systemProfile = $db->{'system.profile'};
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Database::selectCollection`
+   - :php:`Property Overloading ` in the PHP Manual.
diff --git a/source/tutorial.txt b/source/tutorial.txt
new file mode 100644
index 00000000..121fc718
--- /dev/null
+++ b/source/tutorial.txt
@@ -0,0 +1,10 @@
+Tutorials
+=========
+
+.. default-domain:: mongodb
+
+.. toctree::
+
+   /tutorial/crud
+   /tutorial/commands
+   /tutorial/indexes
diff --git a/source/tutorial/commands.txt b/source/tutorial/commands.txt
new file mode 100644
index 00000000..e7e6b356
--- /dev/null
+++ b/source/tutorial/commands.txt
@@ -0,0 +1,388 @@
+=========================
+Execute Database Commands
+=========================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 2
+   :class: singlecol
+
+Overview
+--------
+
+The |php-library| provides :ref:`helper methods `
+for common :manual:`database commands `. In
+addition, the |php-library| provides the
+:phpmethod:`MongoDB\\Database::command` method to run database commands
+with PHP that do not have helper methods.
+
+Execute Database Commands
+-------------------------
+
+Basic Command
+~~~~~~~~~~~~~
+
+To execute a command on a :program:`mongod` instance, use the
+:phpmethod:`MongoDB\\Database::command` method. For instance, the
+following operation uses the :dbcommand:`geoNear` HERE command to search for
+the three closest documents to longitude ``-74`` and latitude ``40`` in
+the ``restos`` collection in the ``example`` database:
+
+:readmode:`secondary`
+
+.. code-block:: php
+
+   example;
+
+   $results = $database->command(
+       [
+           'geoNear' => 'restos',
+           'near' => [
+               'type' => 'Point',
+               'coordinates' => [-74.0, 40.0]
+           ],
+           'spherical' => 'true',
+           'num' => 3
+       ]
+   );
+
+   var_dump($results);
+
+The output would resemble::
+  
+  object(MongoDB\Driver\Cursor)#10 (2) {
+    ["cursor"]=>
+    array(17) {
+      ["stamp"]=>
+      int(0)
+      ["is_command"]=>
+      bool(true)
+      ["sent"]=>
+      bool(true)
+      ["done"]=>
+      bool(false)
+      ["end_of_event"]=>
+      bool(false)
+      ["in_exhaust"]=>
+      bool(false)
+      ["has_fields"]=>
+      bool(false)
+      ["query"]=>
+      object(stdClass)#3 (4) {
+        ["geoNear"]=>
+        string(6) "restos"
+        ["near"]=>
+        object(stdClass)#9 (2) {
+          ["type"]=>
+          string(5) "Point"
+          ["coordinates"]=>
+          array(2) {
+            [0]=>
+            float(-74)
+            [1]=>
+            float(40)
+          }
+        }
+        ["spherical"]=>
+        string(4) "true"
+        ["num"]=>
+        int(3)
+      }
+      ["fields"]=>
+      object(stdClass)#8 (0) {
+      }
+      ["read_preference"]=>
+      array(2) {
+        ["mode"]=>
+        int(1)
+        ["tags"]=>
+        array(0) {
+        }
+      }
+      ["flags"]=>
+      int(0)
+      ["skip"]=>
+      int(0)
+      ["limit"]=>
+      int(1)
+      ["count"]=>
+      int(1)
+      ["batch_size"]=>
+      int(0)
+      ["ns"]=>
+      string(12) "example.$cmd"
+      ["current_doc"]=>
+      object(stdClass)#24 (4) {
+        ["waitedMS"]=>
+        int(0)
+        ["results"]=>
+        array(3) {
+          [0]=>
+          object(stdClass)#14 (2) {
+            ["dis"]=>
+            float(66308.6190421)
+            ["obj"]=>
+            object(stdClass)#13 (5) {
+              ["_id"]=>
+              object(MongoDB\BSON\ObjectID)#11 (1) {
+                ["oid"]=>
+                string(24) "57506d62f57802807471dd28"
+              }
+              ["name"]=>
+              string(21) "XYZ Bagels Restaurant"
+              ["contact"]=>
+              object(stdClass)#12 (3) {
+                ["phone"]=>
+                string(12) "435-555-0190"
+                ["email"]=>
+                string(31) "XYZBagelsRestaurant@example.net"
+                ["location"]=>
+                array(2) {
+                  [0]=>
+                  float(-74.0707363)
+                  [1]=>
+                  float(40.5932157)
+                }
+              }
+              ["stars"]=>
+              int(4)
+              ["categories"]=>
+              array(3) {
+                [0]=>
+                string(6) "Bagels"
+                [1]=>
+                string(10) "Sandwiches"
+                [2]=>
+                string(6) "Coffee"
+              }
+            }
+          }
+          [1]=>
+          object(stdClass)#18 (2) {
+            ["dis"]=>
+            float(69014.6014737)
+            ["obj"]=>
+            object(stdClass)#17 (5) {
+              ["_id"]=>
+              object(MongoDB\BSON\ObjectID)#15 (1) {
+                ["oid"]=>
+                string(24) "57506d62f57802807471dd39"
+              }
+              ["name"]=>
+              string(20) "Green Feast Pizzeria"
+              ["contact"]=>
+              object(stdClass)#16 (3) {
+                ["phone"]=>
+                string(12) "840-555-0102"
+                ["email"]=>
+                string(30) "GreenFeastPizzeria@example.com"
+                ["location"]=>
+                array(2) {
+                  [0]=>
+                  float(-74.1220973)
+                  [1]=>
+                  float(40.6129407)
+                }
+              }
+              ["stars"]=>
+              int(2)
+              ["categories"]=>
+              array(2) {
+                [0]=>
+                string(5) "Pizza"
+                [1]=>
+                string(7) "Italian"
+              }
+            }
+          }
+          [2]=>
+          object(stdClass)#22 (2) {
+            ["dis"]=>
+            float(69975.5031089)
+            ["obj"]=>
+            object(stdClass)#21 (5) {
+              ["_id"]=>
+              object(MongoDB\BSON\ObjectID)#19 (1) {
+                ["oid"]=>
+                string(24) "57506d62f57802807471dd35"
+              }
+              ["name"]=>
+              string(14) "XYZ Coffee Bar"
+              ["contact"]=>
+              object(stdClass)#20 (3) {
+                ["phone"]=>
+                string(12) "644-555-0193"
+                ["email"]=>
+                string(24) "XYZCoffeeBar@example.net"
+                ["location"]=>
+                array(2) {
+                  [0]=>
+                  float(-74.0166091)
+                  [1]=>
+                  float(40.6284767)
+                }
+              }
+              ["stars"]=>
+              int(5)
+              ["categories"]=>
+              array(4) {
+                [0]=>
+                string(6) "Coffee"
+                [1]=>
+                string(4) "Cafe"
+                [2]=>
+                string(6) "Bakery"
+                [3]=>
+                string(10) "Chocolates"
+              }
+            }
+          }
+        }
+        ["stats"]=>
+        object(stdClass)#23 (5) {
+          ["nscanned"]=>
+          int(11)
+          ["objectsLoaded"]=>
+          int(10)
+          ["avgDistance"]=>
+          float(68432.9078749)
+          ["maxDistance"]=>
+          float(69975.5031089)
+          ["time"]=>
+          int(0)
+        }
+        ["ok"]=>
+        float(1)
+      }
+    }
+    ["server_id"]=>
+    int(1)
+  }
+
+Commands with Custom Read Preference  
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Some commands, such as :manual:`createUser
+`, may only be executed on a
+:term:`primary` replica set member or a :term:`standalone`.
+
+The command helper methods in the
+|php-library|, such as :phpmethod:`MongoDB\\Database::drop`,
+know to apply their own :term:`read preference` if necessary. However,
+the :phpmethod:`MongoDB\\Database::command` method is a generic method and 
+defaults to the read preference of the
+Database object on which it is invoked. To execute commands that require
+specific read preference, specify the read preference in the ``$options``
+parameter of the method.
+
+The following example adds a user to the ``demo`` database 
+and specifies a custom read preference:
+
+.. code-block:: php
+
+   demo;
+
+   $cursor = $db->command(
+       [
+           'createUser' => 'username',
+           'pwd' => 'password',
+           'roles' => ['readWrite'],
+       ],
+       [
+           'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY),
+       ]
+   );
+
+   var_dump($cursor->toArray()[0]);
+
+The output would then resemble::
+
+   object(MongoDB\Model\BSONDocument)#8 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(1) {
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+View Command Results
+--------------------
+
+View Single Result Documents
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The :phpmethod:`MongoDB\\Database::command()` method returns a
+:php:`MongoDB\\Driver\\Cursor ` object. 
+
+Many MongoDB commands return their responses as a single document in an
+array. To read the command response, you may either iterate on the
+cursor and access the first document, or access the first result in the
+array, as in the following:
+
+.. code-block:: php
+
+   demo;
+
+   $cursor = $database->command(['ping' => 1]);
+
+   var_dump($cursor->toArray()[0]);
+
+The output would then resemble::
+
+   object(MongoDB\Model\BSONDocument)#2 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(1) {
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+Iterate Results from a Cursor
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Some commands, such as :manual:`listCollections
+`,
+return their results via an iterable cursor. To view the results,
+iterate through the cursor. 
+
+The following example lists the collections in the ``demo`` database by
+iterating through the cursor returned by the ``listCollections`` command
+using a ``foreach`` loop:
+
+.. code-block:: php
+
+   demo;
+
+   $cursor = $database->command(['listCollections' => 1]);
+
+   foreach ($cursor as $collection) {
+       echo $collection['name'], "\n";
+   }
+
+The output would then be a list of the values for the ``name`` key,
+for instance::
+
+   persons
+   posts
+   zips
+
+.. note::
+
+   At the *protocol* level, commands that support a cursor
+   return a single result document with the essential ingredients for
+   constructing the command cursor (i.e. the cursor's ID, namespace, and
+   the first batch of results). In the PHP driver implementation, the
+   :php:`executeCommand() `
+   method detects the single result and constructs the iterable command
+   cursor, which is returned rather than the base result document.
diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
new file mode 100644
index 00000000..c7d7213c
--- /dev/null
+++ b/source/tutorial/crud.txt
@@ -0,0 +1,672 @@
+===============
+CRUD Operations
+===============
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 2
+   :class: singlecol
+
+
+CRUD operations *create*, *read*, *update*, and *delete* documents. The
+|php-library|'s :phpclass:`MongoDB\\Collection` class implements
+MongoDB's cross-driver `CRUD specification
+`_, providing access to methods for inserting, finding, updating,
+and deleting documents in MongoDB.
+
+This document provides a general introduction to inserting, querying,
+updating, and deleting documents using the |php-library|. The MongoDB
+Manual's :manual:`CRUD Section ` provides a more thorough
+introduction to CRUD operations with MongoDB.
+
+Insert Documents
+----------------
+
+Insert One Document
+~~~~~~~~~~~~~~~~~~~
+
+The :phpmethod:`MongoDB\\Collection::insertOne` method inserts a single
+document into MongoDB and returns an instance of ``MongoDB\InsertOneResult``,
+which you can use to access the IDs of the inserted document.
+
+.. basic insertOne example:
+
+.. include:: /includes/example-insertOne.rst
+
+The output includes the ``insertedId`` property, which contains the
+ID of the inserted document.
+
+If you include an ``_id`` value when inserting a document, MongoDB checks
+to ensure that the ``_id`` value is unique for the collection. If the
+``_id`` value is not unique, the insert operation fails due to a duplicate
+key error.
+
+The following example inserts a document while specifying the value for the ``_id``:
+
+.. code-block:: php
+
+   demo->users;
+
+   $insertOneResult = $collection->insertOne(['_id' => 1, 'name' => 'Alice']);
+
+   printf("Inserted %d document(s)\n", $insertOneResult->getInsertedCount());
+
+   var_dump($insertOneResult->getInsertedId());
+
+The output would then resemble::
+
+   Inserted 1 document(s)
+   int(1)
+
+.. seealso:: :phpmethod:`MongoDB\\Collection::insertOne` reference.
+
+Insert Many Documents
+~~~~~~~~~~~~~~~~~~~~~
+
+The :phpmethod:`MongoDB\\Collection::insertMany` method allows you to
+insert multiple documents in one write operation and returns an instance
+of ``MongoDB\InsertManyResult``, which you can use to access the
+IDs of the inserted documents.
+
+.. this uses the insertMany example from the method reference:
+
+.. include:: /reference/method/MongoDBCollection-insertMany.txt
+   :start-after: start-crud-include
+   :end-before: end-crud-include
+
+.. seealso:: :phpmethod:`MongoDB\\Collection::insertMany` reference.
+
+Query Documents
+---------------
+
+The |php-library| provides the :phpmethod:`MongoDB\\Collection::findOne`
+and :phpmethod:`MongoDB\\Collection:findMany` methods for querying
+documents and the :phpmethod:`MongoDB\\Collection:aggregate`
+method for performing :manual:`aggregation operations
+` that matches the query or ``null`` if no
+document matches the query.
+
+The following example searches for the document with ``_id: 94301``:
+
+.. code-block:: php
+
+   demo->zips;
+
+   $document = $collection->findOne(['_id' => '94301']);
+
+   var_dump($document);
+
+The output would then resemble::
+
+   object(MongoDB\Model\BSONDocument)#13 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(5) {
+       ["_id"]=>
+       string(5) "94301"
+       ["city"]=>
+       string(9) "PALO ALTO"
+       ["loc"]=>
+       object(MongoDB\Model\BSONArray)#12 (1) {
+         ["storage":"ArrayObject":private]=>
+         array(2) {
+           [0]=>
+           float(-122.149685)
+           [1]=>
+           float(37.444324)
+         }
+       }
+       ["pop"]=>
+       int(15965)
+       ["state"]=>
+       string(2) "CA"
+     }
+   }
+
+.. seealso:: :phpmethod:`MongoDB\\Collection::findMany` reference
+
+Find Many Documents
+~~~~~~~~~~~~~~~~~~~
+
+:phpmethod:`MongoDB\\Collection::find` returns a
+:php:`MongoDB\\Driver\\Cursor ` object, which you
+can iterate upon to access all matched documents.
+
+The following example lists the documents in the ``zips`` collection
+with the specified city and state values:
+
+.. code-block:: php
+                
+   demo->zips;
+
+   $cursor = $collection->find(['city' => 'JERSEY CITY', 'state' => 'NJ']);
+
+   foreach ($cursor as $document) {
+       echo $document['_id'], "\n";
+   }
+
+The output would resemble::
+
+   07302
+   07304
+   07305
+   07306
+   07307
+   07310
+
+.. seealso:: :phpmethod:`MongoDB\\Collection::find` reference
+
+.. _php-query-projection:
+
+Query Projection
+~~~~~~~~~~~~~~~~
+
+By default, queries in MongoDB return all fields in matching documents.
+To limit the amount of data that MongoDB sends to applications, you can
+include a :manual:`projection document
+` in the query operation.
+
+.. note:: 
+
+   MongoDB includes the ``_id`` field by default unless you explicitly
+   exclude it in a projection document.
+
+The following example finds restaurants based on the ``cuisine`` and
+``borough`` fields and uses a :manual:`projection
+` to limit the fields
+that are returned. It also limits the results to 5 documents.
+
+.. code-block:: php
+
+   selectCollection('example','restaurants');
+
+   $restaurants = $collection->find(
+       [ 'cuisine' => 'Italian', 'borough' => 'Manhattan'],
+       [ 
+         'projection' => [
+           'name' => 1, 'borough' => 1, 'cuisine' => 1,
+         ],
+       ]
+   );
+
+   foreach($restaurants as $restaurant) {
+      var_dump($restaurant);
+   };
+
+The output would then resemble::
+                
+   object(MongoDB\Model\BSONDocument)#10 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#8 (1) {
+         ["oid"]=>
+         string(24) "576023c6b02fa9281da3f983"
+       }
+       ["borough"]=>
+       string(9) "Manhattan"
+       ["cuisine"]=>
+       string(7) "Italian"
+       ["name"]=>
+       string(23) "Isle Of Capri Resturant"
+     }
+   }
+   object(MongoDB\Model\BSONDocument)#13 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#12 (1) {
+         ["oid"]=>
+         string(24) "576023c6b02fa9281da3f98d"
+       }
+       ["borough"]=>
+       string(9) "Manhattan"
+       ["cuisine"]=>
+       string(7) "Italian"
+       ["name"]=>
+       string(18) "Marchis Restaurant"
+     }
+   }
+   object(MongoDB\Model\BSONDocument)#8 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#10 (1) {
+         ["oid"]=>
+         string(24) "576023c6b02fa9281da3f99b"
+       }
+       ["borough"]=>
+       string(9) "Manhattan"
+       ["cuisine"]=>
+       string(7) "Italian"
+       ["name"]=>
+       string(19) "Forlinis Restaurant"
+     }
+   }
+   object(MongoDB\Model\BSONDocument)#12 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#13 (1) {
+         ["oid"]=>
+         string(24) "576023c6b02fa9281da3f9a8"
+       }
+       ["borough"]=>
+       string(9) "Manhattan"
+       ["cuisine"]=>
+       string(7) "Italian"
+       ["name"]=>
+       string(22) "Angelo Of Mulberry St."
+     }
+   }
+   ...
+
+Limit, Sort, and Skip Options
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In addition to :ref:`projection criteria `,
+you can specify options to limit, sort, and skip documents during queries.
+
+The following example uses the ``limit`` and ``sort`` options to query
+for the five most populous zip codes in the United States:
+
+.. code-block:: php
+
+   demo->zips;
+
+   $cursor = $collection->find(
+       [],
+       [
+           'limit' => 5,
+           'sort' => ['pop' => -1],
+       ]
+   );
+
+   foreach ($cursor as $document) {
+       echo $document['_id'], "\n";
+   }
+
+The output would then resemble::
+
+   60623: CHICAGO, IL
+   11226: BROOKLYN, NY
+   10021: NEW YORK, NY
+   10025: NEW YORK, NY
+   90201: BELL GARDENS, CA
+
+Complex Queries with Aggregation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+MongoDB's :manual:`Aggregation Framework `
+allows you to issue complex queries that filter, transform, and group
+collection data. The |php-library|\'s
+:phpmethod:`MongoDB\\Collection::aggregate` method returns a
+:php:`traversable ` object, which you can iterate upon to
+access the results of the aggregation operation. Refer to the
+:phpmethod:`MongoDB\\Collection::aggregate` method's :ref:`output
+reference ` for more about the method's output.
+
+The following example lists the 5 US states with the most zip codes
+associated with them:
+
+.. code-block:: php
+
+   demo->zips;
+
+   $cursor = $collection->aggregate([
+       ['$group' => ['_id' => '$state', 'count' => ['$sum' => 1]]],
+       ['$sort' => ['count' => -1]],
+       ['$limit' => 5],
+   ]);
+
+   foreach ($cursor as $state) {
+       printf("%s has %d zip codes\n", $state['_id'], $state['count']);
+   }
+
+The output would then resemble::
+   
+   TX has 1671 zip codes
+   NY has 1595 zip codes
+   CA has 1516 zip codes
+   PA has 1458 zip codes
+   IL has 1237 zip codes
+
+.. seealso:: :phpmethod:`MongoDB\\Collection::aggregate` reference
+
+Update Documents
+----------------
+
+Update One Document
+~~~~~~~~~~~~~~~~~~~
+
+Use the :phpmethod:`MongoDB\\Collection::updateOne` method to update a
+single document matching a filter.
+:phpmethod:`MongoDB\\Collection::updateOne` returns a
+``MongoDB\UpdateResult`` object, which you can use to access statistics
+about the update operation.
+
+Update methods have two required parameters: the query filter that
+identifies the document or documents to update, and an update document
+that specifies what updates to perform. The :phpmethod:`MongoDB\\Collection::updateOne`
+reference describes each parameter in detail.
+
+The following example inserts two documents into an empty ``users`` collection
+in the ``demo`` database using the :phpmethod:`MongoDB\\Collection::insertOne`
+method, and then updates the documents where the value for the ``state``
+field is ``"ny"`` to include
+a ``country`` field set to ``"us"``:
+
+.. code-block:: php
+
+   demo->users;
+   $collection->drop();
+
+   $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
+   $collection->insertOne(['name' => 'Alice', 'state' => 'ny']);
+   $updateResult = $collection->updateOne(
+       ['state' => 'ny'],
+       ['$set' => ['country' => 'us']]
+   );
+
+   printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
+   printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
+
+Since the update operation uses the
+:phpmethod:`MongoDB\\Collection::updateOne` method, which updates the
+first document to match the filter criteria, the results would then
+resemble::
+
+   Matched 1 document(s)
+   Modified 1 document(s)
+
+It is possible for a document to match the filter but *not be modified*
+by an update, as is the case where the update sets a field's value to its
+existing value, as in this example:
+
+.. code-block:: php
+
+   demo->users;
+   $collection->drop();
+
+   $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
+   $updateResult = $collection->updateOne(
+       ['name' => 'Bob'],
+       ['$set' => ['state' => 'ny']]
+   );
+
+   printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
+   printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
+
+The number of matched documents and the number of *modified* documents
+would therefore not be equal, and the output from the operation would
+resemble::
+
+   Matched 1 document(s)
+   Modified 0 document(s)
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Collection::updateOne` reference
+   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate` reference
+
+Update Many Documents
+~~~~~~~~~~~~~~~~~~~~~
+
+:phpmethod:`MongoDB\\Collection::updateMany` updates one or more documents
+matching the filter criteria and returns a ``MongoDB\UpdateResult`` object
+that you can iterate to access statistics about the update operation.
+
+Update methods have two required parameters: the query filter that
+identifies the document or documents to update, and an update document
+that specifies what updates to perform. The :phpmethod:`MongoDB\\Collection::updateMany`
+reference describes each parameter in detail.
+
+The following example inserts three documents into an empty ``users``
+collection in the ``demo`` database and then uses the :query:`$set`
+operator to update the documents matching the filter criteria to
+include the ``country`` field with value ``"us"``:
+
+.. code-block:: php
+
+   demo->users;
+   $collection->drop();
+
+   $collection->insertOne(['name' => 'Bob', 'state' => 'ny', 'country' => 'us']);
+   $collection->insertOne(['name' => 'Alice', 'state' => 'ny']);
+   $collection->insertOne(['name' => 'Sam', 'state' => 'ny']);
+   $updateResult = $collection->updateMany(
+       ['state' => 'ny'],
+       ['$set' => ['country' => 'us']]
+   );
+
+   printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
+   printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
+
+If an update operation results in no change to a document, such as
+setting the value of the field to its current value, the number of
+modified documents can be less than the number of *matched* documents.
+Since the update document with ``name`` of ``"Bob"`` results in no changes
+to the document, the output of the operation therefore resembles::
+
+   Matched 3 document(s)
+   Modified 2 document(s)
+
+.. seealso:: :phpmethod:`MongoDB\\Collection::updateMany` reference
+
+Replace Documents
+~~~~~~~~~~~~~~~~~
+
+Replacement operations are similar to update operations, but instead
+of updating a document to include new fields or new field values, a
+replacement operation replaces the entire document with a new document,
+but retains the original document's ``_id`` value.
+
+The :phpmethod:`MongoDB\\Collection::replaceOne` method replaces a single
+document that matches the filter criteria and returns
+an instance of ``MongoDB\UpdateResult`` that
+you can use to access statistics about the replacement operation.
+
+:phpmethod:`MongoDB\\Collection::replaceOne` has two required
+parameters: the query filter that identifies the document or documents
+to update, and a replacement document that will replace the original
+document in MongoDB. The :phpmethod:`MongoDB\\Collection::replaceOne`
+reference describes each parameter in detail.
+
+.. important:: 
+
+   Replacement operations replace all of the fields in a document
+   except the ``_id`` value. To avoid accidentally overwriting or
+   deleting desired fields, use the
+   :phpmethod:`MongoDB\\Collection::updateOne` or
+   :phpmethod:`MongoDB\\Collection::updateMany` methods to update
+   individual fields in a document rather than replacing the entire
+   document.
+
+The following example inserts one document into an empty ``users`` collection
+in the ``demo`` database, and then replaces that document with a new one:
+
+.. code-block:: php
+
+   demo->users;
+   $collection->drop();
+
+   $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
+   $updateResult = $collection->replaceOne(
+       ['name' => 'Bob'],
+       ['name' => 'Robert', 'state' => 'ca']
+   );
+
+   printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
+   printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
+
+The output would then resemble::
+
+   Matched 1 document(s)
+   Modified 1 document(s)
+
+.. seealso:: 
+
+   - :phpmethod:`MongoDB\\Collection::replaceOne` reference
+   - :phpmethod:`MongoDB\\Collection::findOneAndReplace` reference
+
+Upsert
+~~~~~~
+
+Update and replace operations support an :manual:`upsert
+` option. When ``upsert`` is
+``true`` *and* no documents match the specified filter, then the
+operation creates a new document and inserts it. If there *are* matching
+documents, then the operation modifies or replaces the matching
+document or documents.
+
+When a document is upserted, the ID is accessible via
+``MongoDB\UpdateResult::getUpsertedId()``.
+
+The following example uses :phpmethod:`MongoDB\\Collection::updateOne`
+with the ``upsert`` option set to ``true`` into an empty ``users``
+collection in the ``demo`` database, therefore inserting the document
+into the database:
+
+.. code-block:: php
+
+   demo->users;
+   $collection->drop();
+
+   $updateResult = $collection->updateOne(
+       ['name' => 'Bob'],
+       ['$set' => ['state' => 'ny']],
+       ['upsert' => true]
+   );
+
+   printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
+   printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
+   var_dump($collection->findOne(['_id' => $updateResult->getUpsertedId()]));
+
+The output would then resemble::
+
+   Matched 0 document(s)
+   Modified 0 document(s)
+   object(MongoDB\Model\BSONDocument)#16 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(3) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#15 (1) {
+         ["oid"]=>
+         string(24) "57509c4406d7241dad86e7c3"
+       }
+       ["name"]=>
+       string(3) "Bob"
+       ["state"]=>
+       string(2) "ny"
+     }
+   }
+
+Delete Documents
+----------------
+
+Delete One Document
+~~~~~~~~~~~~~~~~~~~
+
+
+The :phpmethod:`MongoDB\\Collection::deleteOne` method deletes a single
+document that matches the filter criteria and returns a
+``MongoDB\DeleteResult`` object that you can use to access statistics
+about the delete operation. If multiple documents match the filter
+criteria, :phpmethod:`MongoDB\\Collection::deleteOne` deletes the
+:term:`first ` matching document.
+
+:phpmethod:`MongoDB\\Collection::deleteOne` has one required parameter:
+a query filter that specifies the document to delete. Refer to the
+:phpmethod:`MongoDB\\Collection::deleteOne` reference for full method documentation.
+
+
+The following operation deletes the first document where the ``state``
+value is ``ny``:
+
+.. code-block:: php
+
+   demo->users;
+   $collection->drop();
+
+   $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
+   $collection->insertOne(['name' => 'Alice', 'state' => 'ny']);
+   $deleteResult = $collection->deleteOne(['state' => 'ny']);
+
+   printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount());
+
+The output would then resemble::
+
+   Deleted 1 document(s)
+
+.. seealso:: :phpmethod:`MongoDB\\Collection::deleteOne` reference.
+
+Delete Many Documents
+~~~~~~~~~~~~~~~~~~~~~
+
+:phpmethod:`MongoDB\\Collection::deleteMany` deletes all of the
+documents that match the filter criteria and returns a
+``MongodB\DeleteResult`` object that you can use to access statistics
+about the delete op eration.
+
+:phpmethod:`MongoDB\\Collection::deleteMany` has one required
+parameter: a query filter that specifies the document to delete. Refer
+to the :phpmethod:`MongoDB\\Collection::deleteMany` reference for full
+method documentation.
+
+
+The following operation deletes all of the documents where the
+``state`` field has value ``"ny"``:
+
+.. code-block:: php
+
+   demo->users;
+   $collection->drop();
+
+   $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
+   $collection->insertOne(['name' => 'Alice', 'state' => 'ny']);
+   $deleteResult = $collection->deleteMany(['state' => 'ny']);
+
+   printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount());
+
+The output would then resemble::
+
+   Deleted 2 document(s)
+
+.. seealso:: :phpmethod:`MongoDB\\Collection::deleteMany` reference
diff --git a/source/tutorial/example-data.md b/source/tutorial/example-data.md
new file mode 100644
index 00000000..9b2be0f4
--- /dev/null
+++ b/source/tutorial/example-data.md
@@ -0,0 +1,45 @@
+# Example Data
+
+Some examples in this documentation use example data fixtures from
+[zips.json][zips]. This is a dataset comprised of United States postal codes,
+populations, and geographic locations.
+
+Importing the dataset into MongoDB can be done in several ways. The following
+example uses [mongodb extension][ext-mongodb]:
+
+[zips]: http://media.mongodb.org/zips.json
+[ext-mongodb]: http://php.net/mongodb
+
+```
+insert($document);
+}
+
+$manager = new MongoDB\Driver\Manager('mongodb://localhost');
+
+$result = $manager->executeBulkWrite('demo.zips', $bulk);
+printf("Inserted %d documents\n", $result->getInsertedCount());
+```
+
+Executing this script should yield the following output:
+
+```
+Inserted 29353 documents
+```
+
+You may also import the dataset using the [mongoimport][mongoimport] command,
+which is included with MongoDB:
+
+[mongoimport]: http://docs.mongodb.org/manual/reference/program/mongoimport/
+
+```bash
+$ mongoimport --db demo --collection zips --file zips.json --drop
+```
diff --git a/source/tutorial/indexes.txt b/source/tutorial/indexes.txt
new file mode 100644
index 00000000..b3fbf862
--- /dev/null
+++ b/source/tutorial/indexes.txt
@@ -0,0 +1,134 @@
+=======
+Indexes
+=======
+
+.. default-domain:: mongodb
+
+Indexes support the efficient execution of queries in MongoDB. Without
+indexes, MongoDB must perform a *collection scan*, i.e. scan every
+document in a collection, to select those documents that match the
+query statement. If an appropriate index exists for a query,
+MongoDB can use the index to limit the number of documents it must
+inspect.
+
+The PHP driver supports managing indexes through the
+:phpclass:`MongoDB\\Collection` class, which implements MongoDB's
+cross-driver `Index Management
+`_
+and `Enumerating Indexes
+`_
+specifications. 
+
+This document provides an introduction to creating, listing, and
+dropping indexes using the |php-library|. The MongoDB Manual's
+:manual:`Indexes Section ` provides more thorough
+information about indexing in MongoDB.
+
+Create Indexes
+--------------
+
+Create indexes with the :phpmethod:`MongoDB\\Collection::createIndex`
+and :phpmethod:`MongoDB\\Collection::createIndexes` methods. Refer to
+the method reference for more details about each method.
+
+The following example creates an ascending index on the ``state`` field
+using the :phpmethod:`createIndex` method:
+
+.. code-block:: php
+
+   demo->zips;
+
+   $result = $collection->createIndex(['state' => 1]);
+
+   var_dump($result);
+
+When you create an index, the method returns its name, which is
+automatically generated from its specification. The above example would
+output something similar to::
+
+   string(7) "state_1"
+
+List Indexes
+------------
+
+The :phpmethod:`MongoDB\\Collection::listIndexes` method provides
+information about the indexes in a collection.
+:phpmethod:`MongoDB\\Collection::listIndexes` method returns an
+iterator of ``MongoDB\Model\IndexInfo`` objects, which you can use to
+view information about each index. Refer to the method reference for
+more details about each method.
+
+The following example lists all indexes in the ``zips`` collection in
+the ``demo`` database:
+
+.. code-block:: php
+
+   demo->zips;
+
+   foreach ($collection->listIndexes() as $indexInfo) {
+      var_dump($indexInfo);
+   }
+
+The output would resemble::
+
+   object(MongoDB\Model\IndexInfo)#10 (4) {
+     ["v"]=>
+     int(1)
+     ["key"]=>
+     array(1) {
+       ["_id"]=>
+       int(1)
+     }
+     ["name"]=>
+     string(4) "_id_"
+     ["ns"]=>
+     string(9) "demo.zips"
+   }
+   object(MongoDB\Model\IndexInfo)#13 (4) {
+     ["v"]=>
+     int(1)
+     ["key"]=>
+     array(1) {
+       ["state"]=>
+       int(1)
+     }
+     ["name"]=>
+     string(7) "state_1"
+     ["ns"]=>
+     string(9) "demo.zips"
+   }
+
+Drop Indexes
+------------
+
+The :phpmethod:`MongoDB\\Collection::dropIndex` lets you drop a single index while 
+:phpmethod:`MongoDB\\Collection::dropIndexes` drops all of the indexes on a collection.
+Refer to the method reference for more details about each method.
+
+The following example drops a single index by its name, ``state_1``:
+
+.. code-block:: php
+
+   demo->zips;
+
+   $result = $collection->dropIndex('state_1');
+
+   var_dump($result);
+
+The operation's output would resemble::
+
+   object(MongoDB\Model\BSONDocument)#11 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(2) {
+       ["nIndexesWas"]=>
+       int(2)
+       ["ok"]=>
+       float(1)
+     }
+   }
diff --git a/source/tutorial/install-php-library.txt b/source/tutorial/install-php-library.txt
new file mode 100644
index 00000000..39f57246
--- /dev/null
+++ b/source/tutorial/install-php-library.txt
@@ -0,0 +1,64 @@
+=========================
+Install the |php-library|
+=========================
+
+.. default-domain:: mongodb
+
+Prerequisites
+-------------
+
+The MongoDB PHP Library is a high-level abstraction for the
+MongoDB PHP driver. As such, you must install the `mongodb`
+extension to use the |php-library|:
+
+.. code-block:: sh
+
+   pecl install mongodb
+   echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
+
+Instructions for installing the `mongodb` extension on HHVM may be
+found in the :php:`Installation with HHVM
+` article
+in the driver documentation.
+
+Procedure
+---------
+
+Install the Library
+~~~~~~~~~~~~~~~~~~~
+
+The preferred method of installing |php-library| is with `Composer
+`_ by running the following from your project
+root:
+
+.. code-block:: sh
+
+   composer require "mongodb/mongodb=^1.0.0"
+
+While not recommended, you may also manually install the package via
+the source tarballs attached to the `GitHub releases
+`_.
+
+Configure Autoloading
+~~~~~~~~~~~~~~~~~~~~~
+
+Once you have installed the library, ensure that your application
+includes Composer's autoloader. The ``require_once``
+statement should point to Composer's autoloader, as in the following example:
+
+.. code-block:: php
+
+   require_once __DIR__ . "/vendor/autoload.php";
+
+Refer to Composer's `autoloading documentation
+`_ for more
+information about setting up autoloading.
+
+If you installed the library manually from a source tarball, you
+will also need to manually configure autoloading:
+
+#. Map the top-level ``MongoDB\`` namespace to the ``src/`` directory
+   using your preferred autoloader implementation.
+
+#. Manually require the ``src/functions.php`` file, since PHP does not
+   yet support function autoloading.
diff --git a/source/upgrade.txt b/source/upgrade.txt
new file mode 100644
index 00000000..e4df408b
--- /dev/null
+++ b/source/upgrade.txt
@@ -0,0 +1,273 @@
+=============
+Upgrade Guide
+=============
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+The MongoDB PHP Library and underlying :php:`mongodb
+extension ` have notable API differences from
+the legacy :php:`mongo extension `. This page will
+summarizes those differences for the benefit of those
+upgrading rom the legacy driver.
+
+Additionally, a community-developed
+`mongo-php-adapter `__
+library exists, which implements the `mongo
+extension `__ API using this library and the new
+driver. While this adapter library is not officially supported by
+MongoDB, it does bear mentioning.
+
+Collection API
+~~~~~~~~~~~~~~
+
+This library's :phpclass:`MongoDB\\Collection` class
+implements MongoDB's cross-driver
+`CRUD `__
+and `Index
+Management `__
+specifications. Although some method names have changed in accordance
+with the new specifications, the new class provides the same
+functionality as the legacy driver's
+`MongoCollection `__ class with some
+notable exceptions.
+
+Old and New Methods
+~~~~~~~~~~~~~~~~~~~
+
+.. list-table::
+   :header-rows: 1
+   
+   * - :php:`MongoCollection `
+     - :phpclass:`MongoDB\\Collection`
+
+   * - :php:`MongoCollection::aggregate() `
+     - :phpmethod:`MongoDB\\Collection::aggregate`
+
+   * - :php:`MongoCollection::aggregateCursor() `
+     - :phpmethod:`MongoDB\\Collection::aggregate`
+
+   * - :php:`MongoCollection::batchInsert() `
+     - :phpmethod:`MongoDB\\Collection::insertMany`
+
+   * - :php:`MongoCollection::count() `
+     - :phpmethod:`MongoDB\\Collection::count`
+
+   * - :php:`MongoCollection::createDBRef() `
+     - Not yet implemented. See :issue:`PHPLIB-24`
+
+   * - :php:`MongoCollection::createIndex() `
+     - :phpmethod:`MongoDB\\Collection::createIndex`
+
+   * - :php:`MongoCollection::deleteIndex() `
+     - :phpmethod:`MongoDB\\Collection::dropIndex`
+
+   * - :php:`MongoCollection::deleteIndexes() `
+     - :phpmethod:`MongoDB\\Collection::dropIndexes`
+
+   * - :php:`MongoCollection::drop() `
+     - :phpmethod:`MongoDB\\Collection::drop`
+
+   * - :php:`MongoCollection::distinct() `
+     - :phpmethod:`MongoDB\\Collection::distinct`
+
+   * - :php:`MongoCollection::ensureIndex() `
+     - :phpmethod:`MongoDB\\Collection::createIndex`
+
+   * - :php:`MongoCollection::find() `
+     - :phpmethod:`MongoDB\\Collection::find`
+
+   * - :php:`MongoCollection::findAndModify() `
+   
+     - :phpmethod:`MongoDB\\Collection::findOneAndDelete`,
+       :phpmethod:`MongoDB\\Collection::findOneAndReplace`, and
+       :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+
+   * - :php:`MongoCollection::findOne() `
+     - :phpmethod:`MongoDB\\Collection::findOne`
+
+   * - :php:`MongoCollection::getDBRef() `
+     - Not implemented. See :issue:`PHPLIB-24`
+
+   * - :php:`MongoCollection::getIndexInfo() `
+     - :phpmethod:`MongoDB\\Collection::listIndexes`
+
+   * - :php:`MongoCollection::getName() `
+     - :phpmethod:`MongoDB\\Collection::getCollectionName`
+
+   * - :php:`MongoCollection::getReadPreference() `
+     - Not implemented.
+
+   * - :php:`MongoCollection::getSlaveOkay() `
+     - Not implemented.
+
+   * - :php:`MongoCollection::getWriteConcern() `
+     - Not implemented.
+
+   * - :php:`MongoCollection::group() `
+     - Not yet implemented. See :issue:`PHPLIB-177`. 
+       Use :phpmethod:`MongoDB\\Database::command`.
+
+   * - :php:`MongoCollection::insert() `
+     - :phpmethod:`MongoDB\\Collection::insertOne`
+
+   * - :php:`MongoCollection::parallelCollectionScan() `
+     - Not implemented.
+
+   * - :php:`MongoCollection::remove() `
+     - :phpmethod:`MongoDB\\Collection::deleteMany` and
+       :phpmethod:`MongoDB\\Collection::deleteOne`
+
+   * - :php:`MongoCollection::save() `
+     - :phpmethod:`MongoDB\\Collection::insertOne` or
+       :phpmethod:`MongoDB\\Collection::replaceOne` with the ``upsert``
+       option.
+
+   * - :php:`MongoCollection::setReadPreference() `
+     - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`
+
+   * - :php:`MongoCollection::setSlaveOkay() `
+     - Not implemented.
+
+   * - :php:`MongoCollection::setWriteConcern() `
+     - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions`
+
+   * - :php:`MongoCollection::update() `   
+     - :phpmethod:`MongoDB\\Collection::replaceOne`,
+       :phpmethod:`MongoDB\\Collection::updateMany`, and
+       :phpmethod:`MongoDB\\Collection::updateOne`.
+
+   * - :php:`MongoCollection::validate() `
+     - Not implemented.
+
+A guiding principle in designing the new APIs was that explicit method
+names are preferable to overloaded terms found in the old API. For
+instance, :php:`MongoCollection::save() ` and
+:php:`MongoCollection::findAndModify() `
+have different modes of operation, depending on their arguments.
+Methods were also split to distinguish between :manual:`updating
+specific fields ` and :manual:`full-document
+replacement `.
+
+Group Command Helper
+~~~~~~~~~~~~~~~~~~~~
+
+:phpclass:`MongoDB\\Collection` does not
+yet have a helper method for the :manual:`group
+` command; however, it is planned in
+:issue:`PHPLIB-177`. The following example demonstrates how to execute
+a group command using the :phpmethod:`MongoDB\\Database::command()` method:
+
+.. code-block:: php
+
+   selectDatabase('db_name');
+   $cursor = $database->command([
+       'group' => [
+           'ns' => 'collection_name',
+           'key' => ['field_name' => 1],
+           'initial' => ['total' => 0],
+           '$reduce' => new MongoDB\BSON\Javascript('...'),
+       ],
+   ]);
+
+   $resultDocument = $cursor->toArray()[0];
+
+MapReduce Command Helper
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+:phpclass:`MongoDB\\Collection` does not yet have a helper method for
+the :manual:`mapReduce ` command;
+however, that is planned in :issue:`PHPLIB-53`. The following example
+demonstrates how to execute a mapReduce command using the
+:phpmethod:`MongoDB\\Database::command()` method:
+
+.. code-block:: php
+
+   selectDatabase('db_name');
+   $cursor = $database->command([
+       'mapReduce' => 'collection_name',
+       'map' => new MongoDB\BSON\Javascript('...'),
+       'reduce' => new MongoDB\BSON\Javascript('...'),
+       'out' => 'output_collection_name',
+   ]);
+   
+   $resultDocument = $cursor->toArray()[0];
+   
+   ?>
+
+DBRef Helpers
+~~~~~~~~~~~~~
+
+:phpclass:`MongoDB\\Collection` does not yet
+have helper methods for working with
+:manual:`DBRef `
+objects; however, that is planned in
+:issue:`PHPLIB-24`.
+
+MongoCollection::save() Removed
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+:php:`MongoCollection::save() `,
+which was syntactic sugar for an insert or upsert operation, has been
+removed in favor of explicitly using
+:phpmethod:`MongoDB\\Collection::insertOne` or
+:phpmethod:`MongoDB\\Collection::replaceOne` with the ``upsert``
+option).
+
+.. .. figure:: img/save-flowchart.png
+..    :alt: save() flowchart
+
+While the ``save``
+method does have its uses for interactive environments, such as the
+mongo shell, it was intentionally excluded from the
+`CRUD `_
+specification for language drivers. Generally, application code should
+know if the document has an identifier and be able to explicitly insert
+or replace the document and handle the returned InsertResult or
+UpdateResult, respectively. This also helps avoid inadvertent and
+potentially dangerous :manual:`full-document
+replacements `.
+
+Accessing IDs of Inserted Documents
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In the legacy driver, :php:`MongoCollection::insert()
+`, :php:`MongoCollection::batchInsert()
+` (when inserting) would modify their input
+argument by injecting an ``_id`` key containing the generated ObjectId
+(i.e. :php:`MongoId ` object). This behavior was a bit
+of a hack, as it did not rely on the argument being :php:`passed by
+reference `; instead, it directly modified
+memory through the extension API and could not be implemented in PHP
+userland. As such, it is no longer done in the new driver and library.
+
+IDs of inserted documents (whether generated or not) may be accessed
+through the result objects returned by the write methods:
+
+-  ``MongoDB\InsertOneResult::getInsertedId()`` for
+   :phpmethod:`MongoDB\\Collection::insertOne`
+-  ``MongoDB\InsertManyResult::getInsertedIds()`` for
+   :phpmethod:`MongoDB\\Collection::insertMany`
+-  ``MongoDB\BulkWriteResult::getInsertedIds()`` for
+   :phpmethod:`MongoDB\\Collection::bulkWrite`
+
+``MongoWriteBatch``
+~~~~~~~~~~~~~~~~~~~
+
+The legacy driver's
+:php:`MongoWriteBatch `
+classes have been replaced with a general-purpose
+:phpmethod:`MongoDB\\Collection::bulkWrite` method. Whereas the
+legacy driver only allowed bulk operations of the same type, the new
+method allows operations to be mixed (e.g. inserts, updates, and
+deletes).

From 69c0338ab27ee5e30faa4edea02b4d158b98080f Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 15 Aug 2016 17:06:47 +0800
Subject: [PATCH 028/321] Fix typos in upgrade guide

---
 source/upgrade.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/upgrade.txt b/source/upgrade.txt
index e4df408b..900db39b 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -13,8 +13,8 @@ Upgrade Guide
 The MongoDB PHP Library and underlying :php:`mongodb
 extension ` have notable API differences from
 the legacy :php:`mongo extension `. This page will
-summarizes those differences for the benefit of those
-upgrading rom the legacy driver.
+summarize those differences for the benefit of those
+upgrading from the legacy driver.
 
 Additionally, a community-developed
 `mongo-php-adapter `__

From ea8db4954fe7d71a0ef2ee1fba425af7deaf9294 Mon Sep 17 00:00:00 2001
From: Allison Moore 
Date: Thu, 25 Aug 2016 16:37:22 -0400
Subject: [PATCH 029/321] removes links to gen'd API docs

---
 source/index.txt | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/source/index.txt b/source/index.txt
index 2beec9a1..0c1fb363 100644
--- a/source/index.txt
+++ b/source/index.txt
@@ -35,13 +35,6 @@ for PHP and HHVM*:
 - `Part Three: Cursor Behaviour
   `_
 
-API Reference
--------------
-
-Generated API reference documentation for the library is available at:
-`http://mongodb.github.io/mongo-php-library/api
-`_
-
 New to MongoDB?
 ---------------
 

From a19d8e727f81548b9733b6160b19189ab08ffb90 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 27 Oct 2016 11:51:51 -0400
Subject: [PATCH 030/321] Revise Collection and Database class intros

---
 source/reference/class/MongoDBCollection.txt | 42 ++++++++++----------
 source/reference/class/MongoDBDatabase.txt   | 20 +++++-----
 2 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index 032ca878..7c684bda 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -17,35 +17,37 @@ Definition
 
    Provides methods for common operations on collections and documents,
    including CRUD operations and index management.
-   
+
    You can construct collections directly using the PHP extension's
-   ``Manager`` class, select a collection from the |php-library|'s
-   :phpclass:`MongoDB\\Client` or :phpclass:`MongoDB\\Database`
-   classes, or create a collection from an existing collection using the
-   :phpmethod:`withOptions ` clone method.
-    
+   :php:`MongoDB\\Driver\\Manager ` class, select
+   a collection from the |php-library|'s :phpclass:`MongoDB\\Client` or
+   :phpclass:`MongoDB\\Database` classes, or create a collection from an
+   existing collection using the
+   :phpmethod:`withOptions() ` clone method.
+
    :phpclass:`MongoDB\\Collection` supports the :php:`readConcern
    `, :php:`readPreference
    `, :php:`typeMap
-   `, and
-   :php:`writeConcern ` options.
+   `,
+   and :php:`writeConcern ` options.
    If you omit an option, the collection inherits the value from the
    Manager constructor argument or the Database object used to select
    the collection.
 
-   Operations within the ``Collection`` class
-   inherit the Collection's options.
-   
-   The :phpmethod:`MongoDB\\Collection::aggregate` method (when not
-   using a cursor), :phpmethod:`MongoDB\\Collection::distinct`, and
+   Operations within the :phpclass:`MongoDB\\Collection` class inherit the
+   Collection's options.
+
+   The :manual:`aggregate ` (when not using a
+   cursor), :manual:`distinct `, and
    :manual:`findAndModify ` helpers do not
-   support a ``typeMap`` option due to a driver limitation.
-   :phpmethod:`MongoDB\\Collection::aggregate`,
-   :phpmethod:`MongoDB\\Collection::distinct`,
-   :phpmethod:`MongoDB\\Collection::findOneAndReplace`,
-   :phpmethod:`MongoDB\\Collection::findOneAndUpdate`, and
-   :phpmethod:`MongoDB\\Collection::findOneAndDelete`
-   return BSON documents as `stdClass` objects and arrays as arrays.
+   support a ``typeMap`` option due to a driver limitation. The
+   :phpmethod:`aggregate() `,
+   :phpmethod:`distinct() `,
+   :phpmethod:`findOneAndReplace() `,
+   :phpmethod:`findOneAndUpdate() `, and
+   :phpmethod:`findOneAndDelete() `
+   methods return BSON documents as `stdClass` objects and BSON arrays as
+   arrays.
 
 
 Methods
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index 18480f42..f2d9b4a7 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -19,24 +19,22 @@ Definition
 
    Provides methods for common operations on a database,
    such as executing database commands and managing collections.
-   
+
    You can construct a database directly using the PHP extension's
-   ``Manager`` class or select a database from the |php-library|'s
-   :phpclass:`MongoDB\\Client`
-   class.
-   
+   :php:`MongoDB\\Driver\\Manager ` class or
+   select a database from the |php-library|'s :phpclass:`MongoDB\\Client` class.
+
    :phpclass:`MongoDB\\Database` supports the :php:`readConcern
    `, :php:`readPreference
    `, :php:`typeMap
-   `, and
-   :php:`writeConcern ` options.
+   `,
+   and :php:`writeConcern ` options.
    If you omit an option, the database inherits the value from the
    Manager constructor argument or the Client object used to select
    the database.
-   
-   Operations within the ``Database`` class
-   :phpmethod:`MongoDB\\Database::command` method
-   inherit the Database's options.
+
+   Operations within the :phpclass:`MongoDB\\Database` class inherit the
+   Database's options.
 
 .. _database-methods:
 

From 557918d25b1b1dd49f409273d07d61fc51540cf5 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 27 Oct 2016 11:05:58 -0400
Subject: [PATCH 031/321] PHPLIB-186: Document getManager() methods

---
 source/reference/class/MongoDBClient.txt      |  1 +
 source/reference/class/MongoDBCollection.txt  |  1 +
 source/reference/class/MongoDBDatabase.txt    |  3 +-
 .../method/MongoDBClient-getManager.txt       | 33 +++++++++++++++++++
 .../method/MongoDBCollection-getManager.txt   | 33 +++++++++++++++++++
 .../method/MongoDBDatabase-getManager.txt     | 33 +++++++++++++++++++
 6 files changed, 103 insertions(+), 1 deletion(-)
 create mode 100644 source/reference/method/MongoDBClient-getManager.txt
 create mode 100644 source/reference/method/MongoDBCollection-getManager.txt
 create mode 100644 source/reference/method/MongoDBDatabase-getManager.txt

diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
index 2c921d6d..e6159d91 100644
--- a/source/reference/class/MongoDBClient.txt
+++ b/source/reference/class/MongoDBClient.txt
@@ -31,6 +31,7 @@ Methods
    /reference/method/MongoDBClient__construct
    /reference/method/MongoDBClient__get
    /reference/method/MongoDBClient-dropDatabase
+   /reference/method/MongoDBClient-getManager
    /reference/method/MongoDBClient-listDatabases
    /reference/method/MongoDBClient-selectCollection
    /reference/method/MongoDBClient-selectDatabase
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index 7c684bda..d0d5dd41 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -75,6 +75,7 @@ Methods
    /reference/method/MongoDBCollection-findOneAndUpdate
    /reference/method/MongoDBCollection-getCollectionName
    /reference/method/MongoDBCollection-getDatabaseName
+   /reference/method/MongoDBCollection-getManager
    /reference/method/MongoDBCollection-getNamespace
    /reference/method/MongoDBCollection-insertMany
    /reference/method/MongoDBCollection-insertOne
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index f2d9b4a7..0f05ad4b 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -50,7 +50,8 @@ Methods
    /reference/method/MongoDBDatabase-createCollection
    /reference/method/MongoDBDatabase-drop
    /reference/method/MongoDBDatabase-dropCollection
-   /reference/method/MongoDBDatabase-getDatabaseName      
+   /reference/method/MongoDBDatabase-getDatabaseName
+   /reference/method/MongoDBDatabase-getManager
    /reference/method/MongoDBDatabase-listCollections
    /reference/method/MongoDBDatabase-selectCollection
    /reference/method/MongoDBDatabase-withOptions
diff --git a/source/reference/method/MongoDBClient-getManager.txt b/source/reference/method/MongoDBClient-getManager.txt
new file mode 100644
index 00000000..92e21bd7
--- /dev/null
+++ b/source/reference/method/MongoDBClient-getManager.txt
@@ -0,0 +1,33 @@
+=============================
+MongoDB\\Client::getManager()
+=============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::getManager()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\Manager ` used by this
+   :phpclass:`Client `.
+
+   .. code-block:: php
+
+      function getManager(): MongoDB\Manager
+
+   :returns:
+
+      A :php:`MongoDB\\Driver\\Manager ` object.
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Collection::getManager()`
+   - :phpmethod:`MongoDB\\Database::getManager()`
diff --git a/source/reference/method/MongoDBCollection-getManager.txt b/source/reference/method/MongoDBCollection-getManager.txt
new file mode 100644
index 00000000..e2a15ced
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-getManager.txt
@@ -0,0 +1,33 @@
+=================================
+MongoDB\\Collection::getManager()
+=================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::getManager()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\Manager ` used by this
+   :phpclass:`Client `.
+
+   .. code-block:: php
+
+      function getManager(): MongoDB\Manager
+
+   :returns:
+
+      A :php:`MongoDB\\Driver\\Manager ` object.
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Client::getManager()`
+   - :phpmethod:`MongoDB\\Database::getManager()`
diff --git a/source/reference/method/MongoDBDatabase-getManager.txt b/source/reference/method/MongoDBDatabase-getManager.txt
new file mode 100644
index 00000000..e95f789e
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-getManager.txt
@@ -0,0 +1,33 @@
+===============================
+MongoDB\\Database::getManager()
+===============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::getManager()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\Manager ` used by this
+   :phpclass:`Client `.
+
+   .. code-block:: php
+
+      function getManager(): MongoDB\Manager
+
+   :returns:
+
+      A :php:`MongoDB\\Driver\\Manager ` object.
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Client::getManager()`
+   - :phpmethod:`MongoDB\\Collection::getManager()`

From b1eae1fefd85c53858834703f18f51b98dd9cb8e Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 27 Oct 2016 14:19:17 -0400
Subject: [PATCH 032/321] Update MongoDB\Client documentation

---
 ...Client-method-construct-driverOptions.yaml | 22 +++++++++
 ...-MongoDBClient-method-construct-param.yaml | 36 +++++++--------
 ...goDBClient-method-dropDatabase-option.yaml |  8 ++--
 ...ngoDBClient-method-dropDatabase-param.yaml |  9 ++--
 ...piargs-MongoDBClient-method-get-param.yaml |  5 +-
 ...oDBClient-method-listDatabases-option.yaml |  2 +-
 ...goDBClient-method-listDatabases-param.yaml |  4 +-
 ...Client-method-selectCollection-option.yaml | 27 +++++++++++
 ...BClient-method-selectCollection-param.yaml | 18 ++++++++
 ...DBClient-method-selectDatabase-option.yaml | 19 ++++----
 ...oDBClient-method-selectDatabase-param.yaml |  4 +-
 source/includes/apiargs-common-option.yaml    | 17 +++----
 .../method/MongoDBClient-dropDatabase.txt     | 27 ++++++-----
 .../method/MongoDBClient-listDatabases.txt    | 25 +++++-----
 .../method/MongoDBClient-selectCollection.txt | 46 ++++++++++---------
 .../method/MongoDBClient-selectDatabase.txt   | 30 ++++++------
 .../method/MongoDBClient__construct.txt       | 43 ++++++++++-------
 .../reference/method/MongoDBClient__get.txt   | 34 ++++++++------
 18 files changed, 227 insertions(+), 149 deletions(-)
 create mode 100644 source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
 create mode 100644 source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml

diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
new file mode 100644
index 00000000..b8b63931
--- /dev/null
+++ b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
@@ -0,0 +1,22 @@
+arg_name: option
+name: typeMap
+type: array
+description: |
+  Default :php:`type map
+  `
+  to apply to cursors. The type map determines how BSON documents are converted
+  to PHP values which determines. The |php-library| uses the following type map
+  by default:
+
+  .. code-block:: php
+
+     [
+         'array' => 'MongoDB\Model\BSONArray',
+         'document' => 'MongoDB\Model\BSONDocument',
+         'root' => 'MongoDB\Model\BSONDocument',
+     ]
+interface: phpmethod
+operation: MongoDB\\Client::__construct
+optional: true
+position: 1
+...
diff --git a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
index 39d52142..2365d44f 100644
--- a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
@@ -2,11 +2,11 @@ arg_name: param
 name: $uri
 type: string
 description: |
-  The URI of the standalone, replica set, or sharded cluster to which to connect. Refer
-  to the :manual:`MongoDB connection string reference `
-  for formatting.
-  
-  Defaults to ``mongodb://localhost:27017`` if unspecified.
+  The URI of the standalone, replica set, or sharded cluster to which to
+  connect. Refer to the :manual:`MongoDB connection string reference
+  ` for formatting.
+
+  Defaults to ``mongodb://127.0.0.1:27017`` if unspecified.
 interface: phpmethod
 operation: MongoDB\\Client::__construct
 optional: true
@@ -16,15 +16,14 @@ arg_name: param
 name: $uriOptions
 type: array
 description: |
-  Specifies additional URI options, such as authentication credentials
-  or query string parameters. The options specified in ``$uriOptions``
-  take precedence over any analogous options present in the
-  ``$uri`` string.
+  Specifies additional URI options, such as authentication credentials or query
+  string parameters. The options specified in ``$uriOptions`` take precedence
+  over any analogous options present in the ``$uri`` string.
 post: |
   Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
-  ` extension reference and
-  :manual:`MongoDB connection string `
-  documentation for valid options.
+  ` extension reference and :manual:`MongoDB
+  connection string ` documentation for valid
+  options.
 interface: phpmethod
 operation: MongoDB\\Client::__construct
 optional: true
@@ -34,14 +33,13 @@ arg_name: param
 name: $driverOptions
 type: array
 description: |
-  Specify driver-specific options. In addition to any
-  options supported by the :php:`extension `,
-  the |php-library| allows you to specify a default ``typeMap`` to
-  apply to the cursors it creates. Refer to the driver's
-  :php:`Persistence documentation ` for more
-  about type maps.
+  Specify driver-specific options, such as SSL options. In addition to any
+  options supported by the :php:`extension `, the
+  |php-library| allows you to specify a default :php:`type map
+  `
+  to apply to the cursors it creates.
 interface: phpmethod
 operation: MongoDB\\Client::__construct
 optional: true
 position: 3
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
index 52da8b42..de0ceb56 100644
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
@@ -1,8 +1,8 @@
-arg_name: option
-interface: phpmethod
-operation: MongoDB\\Client::dropDatabase
 source:
   file: apiargs-common-option.yaml
   ref: typeMap
-position: 1
+operation: MongoDB\\Client::dropDatabase
+description: |
+  Type map for BSON deserialization. This will be used for the returned command
+  result document. Defaults to the clients's type map.
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
index d588d522..9f7dfbfc 100644
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
@@ -1,15 +1,12 @@
 source:
-  ref: $databaseName
   file: apiargs-common-param.yaml
-arg_name: param
-interface: phpmethod
+  ref: $databaseName
 operation: MongoDB\\Client::dropDatabase
+position: 1
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-arg_name: param
-interface: phpmethod
+  ref: $options
 operation: MongoDB\\Client::dropDatabase
 position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-get-param.yaml b/source/includes/apiargs-MongoDBClient-method-get-param.yaml
index 8a71be55..d95dc17d 100644
--- a/source/includes/apiargs-MongoDBClient-method-get-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-get-param.yaml
@@ -1,7 +1,6 @@
 source:
-  ref: $databaseName
   file: apiargs-common-param.yaml
-arg_name: param
-interface: phpmethod
+  ref: $databaseName
 operation: MongoDB\\Client::__get
+position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
index dff0a84f..0ca09184 100644
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
@@ -1,5 +1,5 @@
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
-position: 1
+operation: MongoDB\\Client::listDatabases
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
index f0dfad50..3297e349 100644
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
@@ -1,8 +1,6 @@
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-arg_name: param
-interface: phpmethod
+  ref: $options
 operation: MongoDB\\Client::listDatabases
 position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml b/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
new file mode 100644
index 00000000..d81d3181
--- /dev/null
+++ b/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
@@ -0,0 +1,27 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: readConcern
+replacement:
+  resource: "collection"
+  parent: "client"
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: readPreference
+replacement:
+  resource: "collection"
+  parent: "client"
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: typeMap
+replacement:
+  parent: "client"
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: writeConcern
+replacement:
+  resource: "collection"
+  parent: "client"
+...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
new file mode 100644
index 00000000..010730f3
--- /dev/null
+++ b/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
@@ -0,0 +1,18 @@
+source:
+  file: apiargs-common-param.yaml
+  ref: $databaseName
+operation: MongoDB\\Client::selectCollection
+position: 1
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $collectionName
+operation: MongoDB\\Client::selectCollection
+position: 2
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+operation: MongoDB\\Client::selectCollection
+position: 3
+...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
index 28ce2f4b..e4ffd3c6 100644
--- a/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
@@ -1,26 +1,27 @@
 source:
-  ref: readConcern
   file: apiargs-common-option.yaml
-operation: MongoDB\\Client::selectDatabase
+  ref: readConcern
 replacement:
   resource: "database"
+  parent: "client"
 ---
 source:
-  ref: readPreference
   file: apiargs-common-option.yaml
-operation: MongoDB\\Client::selectDatabase
+  ref: readPreference
 replacement:
   resource: "database"
+  parent: "client"
 ---
 source:
-  ref: typeMap
   file: apiargs-common-option.yaml
-operation: MongoDB\\Client::selectDatabase
+  ref: typeMap
+replacement:
+  parent: "client"
 ---
 source:
-  ref: writeConcern
   file: apiargs-common-option.yaml
-operation: MongoDB\\Client::selectDatabase
+  ref: writeConcern
 replacement:
   resource: "database"
-...
\ No newline at end of file
+  parent: "client"
+...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
index e79c1972..0f406225 100644
--- a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
@@ -1,12 +1,12 @@
 source:
-  ref: $databaseName
   file: apiargs-common-param.yaml
+  ref: $databaseName
 operation: MongoDB\\Client::selectDatabase
 position: 1
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
+  ref: $options
 operation: MongoDB\\Client::selectDatabase
 position: 2
 ...
diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml
index d1fb0e65..7790e79f 100644
--- a/source/includes/apiargs-common-option.yaml
+++ b/source/includes/apiargs-common-option.yaml
@@ -2,19 +2,20 @@ arg_name: option
 name: readConcern
 type: :php:`MongoDB\\Driver\\ReadConcern `
 description: |
-  The default read concern to use for {{resource}} operations. Defaults
-  to the Client's specified read concern.
+  The default read concern to use for {{resource}} operations. Defaults to the
+  {{parent}}'s read concern.
 interface: phpmethod
 operation: selectCollection
 optional: true
 position: 1
 replacement:
   resource: "collection"
+  parent: "client"
 ---
 arg_name: option
 description: |
-  The default read preference to use for {{resource}} operations.
-  Defaults to the {{parent}}'s read preference.
+  The default read preference to use for {{resource}} operations. Defaults to
+  the {{parent}}'s read preference.
 interface: phpmethod
 name: readPreference
 operation: selectCollection
@@ -23,7 +24,7 @@ position: 2
 type: :php:`MongoDB\\Driver\\ReadPreference `
 replacement:
   resource: "collection"
-  parent: "Client"
+  parent: "client"
 ---
 arg_name: option
 description: |
@@ -36,21 +37,21 @@ optional: true
 position: 3
 type: array
 replacement:
-  parent: "Client"
+  parent: "client"
 ---
 arg_name: option
 name: writeConcern
 type: :php:`MongoDB\\Driver\\WriteConcern `
 description: |
   The default write concern to use for {{resource}} operations. Defaults
-  to the {{parent}}'s specified write concern.
+  to the {{parent}}'s write concern.
 interface: phpmethod
 operation: selectCollection
 optional: true
 position: 4
 replacement:
   resource: "collection"
-  parent: "Client"
+  parent: "client"
 ---
 arg_name: option
 name: maxTimeMS
diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index 127aebfc..0e88a8ca 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -13,26 +13,27 @@ MongoDB\\Client::dropDatabase()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::dropDatabase($databaseName, $options)
+.. phpmethod:: MongoDB\\Client::dropDatabase()
 
-   Drop a MongoDB database.
+   Drop a database on the server.
 
    .. code-block:: php
 
-      function dropDatabase($databaseName, array $options [])
+      function dropDatabase($databaseName, array $options []): array|object
 
-   :phpmethod:`MongoDB\\Client::dropDatabase` has the following parameters:
+   :phpmethod:`MongoDB\\Client::dropDatabase()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-param.rst
 
-   ``dropDatabase`` supports the following values for the ``$options`` array:
+   The ``$options`` parameter supports the following options:
 
    .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-option.rst
 
-Output
-------
+   :returns:
 
-Returns an array or object containing the result document.
+      An array or object with the result document of the :manual:`dropDatabase
+      ` command. The return type will depend on
+      the ``typeMap`` option.
 
 Example
 -------
@@ -49,9 +50,7 @@ The following example drops the ``demo`` database:
 
    var_dump($result);
 
-The ``dropDatabase`` operation would return an object similar to:
-
-.. code-block:: php
+The output would then resemble::
 
    object(MongoDB\Model\BSONDocument)#8 (1) {
      ["storage":"ArrayObject":private]=>
@@ -65,6 +64,6 @@ The ``dropDatabase`` operation would return an object similar to:
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Client::drop`
-   - :manual:`dropDatabase() command reference
-     ` in the MongoDB manual.
+   - :phpmethod:`MongoDB\\Database::drop()`
+   - :manual:`dropDatabase ` command reference
+     in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index e786127a..d98c5dea 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -13,28 +13,27 @@ MongoDB\\Client::listDatabases()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::listDatabases($options)
+.. phpmethod:: MongoDB\\Client::listDatabases()
 
-   Lists the available databases.
+   Returns information for all databases on the server.
 
    .. code-block:: php
 
       function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator
 
-   :phpmethod:`MongoDB\\Client::listDatabases` has the following parameters:
+   :phpmethod:`MongoDB\\Client::listDatabases()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-param.rst
 
-   ``listDatabases`` supports the following values for the ``$options`` array:
+   The ``$options`` parameter supports the following options:
 
    .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-option.rst
 
-Output
-------
+   :returns:
 
-Information for all databases on the :program:`mongod`, replica set,
-or sharded cluster to which you are connected. The returned elements are
-``MongoDB\Model\DatabaseInfo`` objects.
+      A traversable :phpclass:`MongoDB\\Model\DatabaseInfoIterator`, which
+      contains an :phpclass:`MongoDB\\Model\DatabaseInfo` object for each
+      database on the server.
 
 Example
 -------
@@ -51,9 +50,7 @@ The following example lists all databases on the server:
        var_dump($databaseInfo);
    }
 
-The above example would output something similar to:
-
-.. code-block:: php
+The output would then resemble::
 
    object(MongoDB\Model\DatabaseInfo)#4 (3) {
      ["name"]=>
@@ -74,5 +71,5 @@ The above example would output something similar to:
 
 .. seealso::
 
-   :manual:`listDatabases() command reference in the MongoDB
-   manual `
+   - :manual:`listDatabases ` command
+     reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 51d243f5..28b0cc69 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -13,35 +13,37 @@ MongoDB\\Client::selectCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::selectCollection($databaseName, $collectionName, $options)
+.. phpmethod:: MongoDB\\Client::selectCollection()
+
+   Selects a collection on the server.
 
-   Selects a collection on the :program:`mongod` to which your application
-   is connected.
-   
    .. code-block:: php
 
-      function selectCollection($databaseName, $collectionName, array $options = [])
+      function selectCollection($databaseName, $collectionName, array $options = []): MongoDB\Collection
+
+   :phpmethod:`MongoDB\\Client::selectCollection()` has the following parameters:
 
-   :phpmethod:`MongoDB\\Client::selectCollection` has the following parameters:
+   .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-param.rst
 
-   .. include:: /includes/apiargs/common-param.rst
+   The ``$options`` parameter supports the following options:
 
-   The following table describes the options that
-   :phpmethod:`MongoDB\\Client::selectCollection` can accept.
+   .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-option.rst
 
-   .. include:: /includes/apiargs/common-option.rst
+   :returns:
 
-Output
-------
+      A :phpclass:`MongoDB\\Collection` object.
 
-Returns a :phpclass:`MongoDB\\Collection` object.
+Behavior
+--------
+
+The selected collection inherits options such as read preference and type
+mapping from the :phpclass:`Client ` object. Options may be
+overridden via the ``$options`` parameter.
 
 Example
 -------
 
-
-The following example selects the ``users`` collection in the ``demo``
-database:
+The following example selects the ``users`` collection in the ``demo`` database:
 
 .. code-block:: php
 
@@ -51,11 +53,13 @@ database:
 
    $collection = $client->selectCollection('demo', 'users');
 
-The following examples selects the ``users`` collection in the ``demo``
-database with a custom read preference:
+The following example selects the ``users`` collection in the ``demo`` database
+with a custom read preference:
 
 .. code-block:: php
 
+   selectCollection(
@@ -65,8 +69,8 @@ database with a custom read preference:
            'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
        ]
    );
-         
+
 .. seealso::
 
-   - :phpmethod:`Collection::__construct`
-   - :phpmethod:`MongoDB\\Client::__get`
+   - :phpmethod:`MongoDB\\Collection::__construct()`
+   - :phpmethod:`MongoDB\\Database::selectCollection()`
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index b83b60d3..80046a7a 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -13,28 +13,32 @@ MongoDB\\Client::selectDatabase()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::selectDatabase($databaseName, $options)
+.. phpmethod:: MongoDB\\Client::selectDatabase()
+
+   Selects a database on the server.
 
-   Selects a database on the :program:`mongod` instance to which your
-   application is connected.
-   
    .. code-block:: php
 
-      function selectDatabase($databaseName array $options = []): MongoDB\Database
+      function selectDatabase($databaseName, array $options = []): MongoDB\Database
 
-   :phpmethod:`MongoDB\\Client::selectDatabase` has the following parameters:
+   :phpmethod:`MongoDB\\Client::selectDatabase()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-param.rst
 
-   The following table describes the options that
-   :phpmethod:`MongoDB\\Client::selectDatabase` can accept.
+   The ``$options`` parameter supports the following options:
 
    .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-option.rst
 
-Output
-------
+   :returns:
+
+      A :phpclass:`MongoDB\\Database` object.
+
+Behavior
+--------
 
-Returns a :phpclass:`MongoDB\\Database` object.
+The selected database inherits options such as read preference and type mapping
+from the :phpclass:`Client ` object. Options may be overridden
+via the ``$options`` parameter.
 
 Example
 -------
@@ -67,5 +71,5 @@ preference:
 
 .. seealso::
 
-   - :phpmethod:`Collection::__construct`
-   - :phpmethod:`MongoDB\\Client::__get`
+   - :phpmethod:`MongoDB\\Client::__get()`
+   - :phpmethod:`MongoDB\\Database::__construct()`
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index 4130ac9b..17da8911 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -4,7 +4,6 @@ MongoDB\\Client::__construct()
 
 .. default-domain:: mongodb
 
-
 .. contents:: On this page
    :local:
    :backlinks: none
@@ -14,26 +13,28 @@ MongoDB\\Client::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::__construct($uri, $uriOptions, $driverOptions)
+.. phpmethod:: MongoDB\\Client::__construct()
 
    Constructs a new :phpclass:`Client ` instance.
 
    .. code-block:: php
 
-      function __construct($uri = 'mongodb://localhost:27017', array $uriOptions = [], array $driverOptions = [])
+      function __construct($uri = 'mongodb://127.0.0.1/', array $uriOptions = [], array $driverOptions = [])
 
-   :phpmethod:`MongoDB\\Client::__construct` has the following parameters:
+   :phpmethod:`MongoDB\\Client::__construct()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBClient-method-construct-param.rst
 
+   The ``$driverOptions`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-construct-driverOptions.rst
+
 Examples
 --------
 
-If you do not specify a ``$uri`` value, the driver connects to a
-standalone :program:`mongod` on ``localhost`` via port ``27017``. The
-following example demonstrates how to connect to a replica set
-with a custom
-read preference:
+If you do not specify a ``$uri`` value, the driver connects to a standalone
+:program:`mongod` on ``127.0.0.1`` via port ``27017``. The following example
+demonstrates how to connect to a replica set with a custom read preference:
 
 .. code-block:: php
 
@@ -42,15 +43,15 @@ read preference:
    $client = new MongoDB\Client(
        'mongodb://rs1.example.com,rs2.example.com/?replicaSet=myReplicaSet',
        [
-           'readPreference' => 'secondaryPreferred'
+           'readPreference' => 'secondaryPreferred',
        ]
    );
 
 By default, the |php-library| deserializes BSON documents and arrays
-as ``MongoDB\Model\BSONDocument`` and ``MongoDB\Model\BSONArray``
-objects, respectively. The following example demonstrates how to
-have the library unserialize everything as a PHP array, as was done
-in the legacy :php:`mongo extension `.
+as :phpclass:`MongoDB\\Model\\BSONDocument` and
+:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The following
+example demonstrates how to have the library unserialize everything as a PHP
+array, as was done in the legacy :php:`mongo extension `.
 
 .. code-block:: php
 
@@ -59,8 +60,16 @@ in the legacy :php:`mongo extension `.
    $client = new MongoDB\Client(
        null,
        [],
-       [ 'typeMap' => [
-           'root' => 'array', 'document' => 'array', 'array' => 'array'
-         ],
+       [
+           'typeMap' => [
+               'root' => 'array',
+               'document' => 'array',
+               'array' => 'array',
+           ],
        ]
    );
+
+.. seealso::
+
+   - :php:`MongoDB\\Driver\\Manager::__construct()
+     `
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
index c631f34f..5dd92d2a 100644
--- a/source/reference/method/MongoDBClient__get.txt
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -4,7 +4,6 @@ MongoDB\\Client::__get()
 
 .. default-domain:: mongodb
 
-
 .. contents:: On this page
    :local:
    :backlinks: none
@@ -14,39 +13,43 @@ MongoDB\\Client::__get()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::__get($databaseName)
+.. phpmethod:: MongoDB\\Client::__get()
 
-   Select a MongoDB database.
+   Selects a database on the server. This :php:`magic method ` is
+   an alias for the :phpmethod:`selectDatabase()
+   ` method.
 
    .. code-block:: php
 
       function __get($databaseName): MongoDB\Database
 
-   :phpmethod:`MongoDB\\Client::__get` has the following parameters:
+   :phpmethod:`MongoDB\\Client::__get()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBClient-method-get-param.rst
 
+   :returns:
+
+      A :phpclass:`MongoDB\\Database` object.
+
 Behavior
 --------
 
-The selected database inherits options such as read preference and
-type mapping from the :phpclass:`Client ` object.
-If you wish to override any options, use the 
-:phpmethod:`MongoDB\\Client::selectDatabase` method.
+The selected database inherits options such as read preference and type mapping
+from the :phpclass:`Client ` object. If you wish to override
+any options, use the :phpmethod:`MongoDB\\Client::selectDatabase` method.
 
 .. note::
-   
+
    To select databases whose names contain special characters, such as
    ``-``, use complex syntax, as in ``$client->{'that-database'}``.
-   
-   Alternatively, :phpmethod:`MongoDB\\Client::selectDatabase` supports
+
+   Alternatively, :phpmethod:`MongoDB\\Client::selectDatabase()` supports
    selecting databases whose names contain special characters.
 
 Examples
 --------
 
-The following example selects the ``demo`` and ``another-app``
-databases:
+The following example selects the ``demo`` and ``another-app`` databases:
 
 .. code-block:: php
 
@@ -59,5 +62,6 @@ databases:
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Client::selectDatabase`
-   - :php:`Property Overloading ` in the PHP Manual.
+   - :phpmethod:`MongoDB\\Client::selectDatabase()`
+   - :phpmethod:`MongoDB\\Database::__construct()`
+   - :php:`Property Overloading ` in the PHP Manual

From 589911ec0b9fb9e419aa43b689d01a14f7cb5521 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 27 Oct 2016 19:30:23 -0400
Subject: [PATCH 033/321] Fix language for $databaseName and $collectionName
 params

---
 .../apiargs-MongoDBClient-method-dropDatabase-param.yaml  | 2 ++
 .../includes/apiargs-MongoDBClient-method-get-param.yaml  | 2 ++
 ...iargs-MongoDBClient-method-selectCollection-param.yaml | 4 ++++
 ...apiargs-MongoDBClient-method-selectDatabase-param.yaml | 2 ++
 source/includes/apiargs-common-param.yaml                 | 8 ++++----
 5 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
index 9f7dfbfc..c0cf8e34 100644
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
@@ -3,6 +3,8 @@ source:
   ref: $databaseName
 operation: MongoDB\\Client::dropDatabase
 position: 1
+replacement:
+  action: " to drop"
 ---
 source:
   file: apiargs-common-param.yaml
diff --git a/source/includes/apiargs-MongoDBClient-method-get-param.yaml b/source/includes/apiargs-MongoDBClient-method-get-param.yaml
index d95dc17d..7a228e41 100644
--- a/source/includes/apiargs-MongoDBClient-method-get-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-get-param.yaml
@@ -3,4 +3,6 @@ source:
   ref: $databaseName
 operation: MongoDB\\Client::__get
 position: 1
+replacement:
+  action: " to select"
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
index 010730f3..a2cfa687 100644
--- a/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
@@ -3,12 +3,16 @@ source:
   ref: $databaseName
 operation: MongoDB\\Client::selectCollection
 position: 1
+replacement:
+  action: " containing the collection to select"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $collectionName
 operation: MongoDB\\Client::selectCollection
 position: 2
+replacement:
+  action: " to select"
 ---
 source:
   file: apiargs-common-param.yaml
diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
index 0f406225..2432ca4d 100644
--- a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
@@ -3,6 +3,8 @@ source:
   ref: $databaseName
 operation: MongoDB\\Client::selectDatabase
 position: 1
+replacement:
+  action: " to select"
 ---
 source:
   file: apiargs-common-param.yaml
diff --git a/source/includes/apiargs-common-param.yaml b/source/includes/apiargs-common-param.yaml
index a826747f..c633bf2a 100644
--- a/source/includes/apiargs-common-param.yaml
+++ b/source/includes/apiargs-common-param.yaml
@@ -2,24 +2,24 @@ arg_name: param
 name: $databaseName
 type: string
 description: |
-  The name of the database{{select}}.
+  The name of the database{{action}}.
 interface: phpmethod
 operation: selectCollection
 optional: false
 replacement:
-  select: " to select"
+  action: ""
 position: 1
 ---
 arg_name: param
 name: $collectionName
 type: string
 description: |
-  The name of the collection{{select}}.
+  The name of the collection{{action}}.
 interface: phpmethod
 operation: selectCollection
 optional: false
 replacement:
-  select: " to select"
+  action: ""
 position: 2
 ---
 arg_name: param

From 36270d2dff0995934710a2fe97b9fe671a369d56 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 27 Oct 2016 19:32:04 -0400
Subject: [PATCH 034/321] Update MongoDB\Database documentation

---
 ...MongoDBDatabase-method-command-option.yaml |   8 +
 ...-MongoDBDatabase-method-command-param.yaml |   5 +-
 ...ngoDBDatabase-method-construct-option.yaml |  33 ++-
 ...ongoDBDatabase-method-construct-param.yaml |   6 +-
 ...tabase-method-createCollection-option.yaml | 244 +++++++++---------
 ...atabase-method-createCollection-param.yaml |   6 +-
 ...gs-MongoDBDatabase-method-drop-option.yaml |   7 +-
 ...rgs-MongoDBDatabase-method-drop-param.yaml |  14 +-
 ...Database-method-dropCollection-option.yaml |   5 +-
 ...BDatabase-method-dropCollection-param.yaml |   6 +-
 ...args-MongoDBDatabase-method-get-param.yaml |   4 +-
 ...atabase-method-listCollections-option.yaml |  26 +-
 ...Database-method-listCollections-param.yaml |   3 +-
 ...tabase-method-selectCollection-option.yaml |  13 +-
 ...atabase-method-selectCollection-param.yaml |   5 +-
 ...oDBDatabase-method-withOptions-option.yaml |  18 +-
 ...goDBDatabase-method-withOptions-param.yaml |   2 +-
 source/reference/class/MongoDBDatabase.txt    |   2 +-
 .../method/MongoDBDatabase-command.txt        | 175 +++++++------
 .../MongoDBDatabase-createCollection.txt      |  62 ++---
 .../reference/method/MongoDBDatabase-drop.txt |  41 +--
 .../method/MongoDBDatabase-dropCollection.txt |  39 +--
 .../MongoDBDatabase-getDatabaseName.txt       |  18 +-
 .../method/MongoDBDatabase-getManager.txt     |   2 +-
 .../MongoDBDatabase-listCollections.txt       |  79 ++++--
 .../MongoDBDatabase-selectCollection.txt      | 139 +++-------
 .../method/MongoDBDatabase-withOptions.txt    |  40 +--
 .../method/MongoDBDatabase__construct.txt     |  22 +-
 .../reference/method/MongoDBDatabase__get.txt |  30 ++-
 29 files changed, 548 insertions(+), 506 deletions(-)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
index e867e0cb..fa53aeba 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
@@ -3,10 +3,18 @@ source:
   ref: readPreference
 operation: MongoDB\\Database::command
 position: 1
+description: |
+  The read preference to use when executing the command. This may be used when
+  issuing the command to a replica set or shard cluster to ensure that the
+  driver sets the wire protocol accordingly or adds the read preference to the
+  command document, respectively. Defaults to the Database's read preference.
 ---
 source:
   file: apiargs-common-option.yaml
   ref: typeMap
 operation: MongoDB\\Database::command
 position: 2
+description: |
+  Type map for BSON deserialization. This will be applied to the returned
+  cursor. Defaults to the database's type map.
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
index 7d7b6356..bcf5b92c 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
@@ -1,9 +1,8 @@
 arg_name: param
 name: $command
-type: string
+type: array|object
 description: |
-  The name of the :manual:`database command `
-  to execute.
+  The :manual:`database command ` document.
 interface: phpmethod
 operation: MongoDB\\Database::command
 optional: false
diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
index 7c286862..4f52540f 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
@@ -3,17 +3,39 @@ source:
   ref: readConcern
 operation: MongoDB\\Database::__construct
 position: 1
+replacement:
+  resource: "database"
+  parent: "manager"
 ---
 source:
   file: apiargs-common-option.yaml
   ref: readPreference
 operation: MongoDB\\Database::__construct
 position: 2
+replacement:
+  resource: "database"
+  parent: "manager"
 ---
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
+arg_name: option
+name: typeMap
+type: array
+description: |
+  Default :php:`type map
+  `
+  to apply to cursors. The type map determines how BSON documents are converted
+  to PHP values which determines. The |php-library| uses the following type map
+  by default:
+
+  .. code-block:: php
+
+     [
+         'array' => 'MongoDB\Model\BSONArray',
+         'document' => 'MongoDB\Model\BSONDocument',
+         'root' => 'MongoDB\Model\BSONDocument',
+     ]
+interface: phpmethod
 operation: MongoDB\\Database::__construct
+optional: true
 position: 3
 ---
 source:
@@ -21,4 +43,7 @@ source:
   ref: writeConcern
 operation: MongoDB\\Database::__construct
 position: 4
-...
\ No newline at end of file
+replacement:
+  resource: "database"
+  parent: "manager"
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
index 638e6650..872918a5 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
@@ -5,8 +5,8 @@ operation: MongoDB\\Database::__construct
 position: 1
 ---
 source:
-  ref: $databaseName
   file: apiargs-common-param.yaml
+  ref: $databaseName
 operation: MongoDB\\Database::__construct
 position: 2
 ---
@@ -14,5 +14,5 @@ source:
   ref: $options
   file: apiargs-common-param.yaml
 operation: MongoDB\\Database::__construct
-position: 2
-...
\ No newline at end of file
+position: 3
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
index 077a25b0..781c54a4 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
@@ -2,66 +2,77 @@ arg_name: option
 name: autoIndexId
 type: boolean
 description: |
-
-  *Default: true*. Specify false to disable the automatic creation of
-  an index on the _id field.
+  Specify ``false`` to disable the automatic creation of an index on the ``_id``
+  field.
 
   .. important::
-    
-     For replica sets, do not set ``autoIndexId`` to ``false``.
 
-  .. deprecated:: 3.2. The ``autoIndexId`` option will be removed in MongoDB v3.4.
+     For replica sets, do not set ``autoIndexId`` to ``false``.
 
-optional: true
+  .. deprecated:: 3.2. The ``autoIndexId`` option will be removed in MongoDB 3.4.
 interface: phpmethod
 operation: MongoDB\\Database::createCollection
-position: 1
----
-arg_name: option
-name: indexOptionDefaults
-type: array
-description: |
-  Allows users to specify a default configuration for indexes when
-  creating a collection.
-
-  The ``indexOptionDefaults`` option accepts a ``storageEngine`` document,
-  which should take the following form::
-
-    { :  } 
-  
-  Storage engine configurations specified when creating indexes are
-  validated and logged to the :term:`oplog` during replication to support
-  replica sets with members that use different storage engines.
 optional: true
-interface: phpmethod
-operation: MongoDB\\Database::createCollection
-position: 2
+position: 1
 ---
 arg_name: option
 name: capped
 type: boolean
 description: |
-  To create a capped collection, specify ``true``. If you specify
-  ``true``, you must also set a maximum size in the ``size`` option.
-optional: true
+  To create a capped collection, specify ``true``. If you specify ``true``, you
+  must also set a maximum size in the ``size`` option.
 interface: phpmethod
 operation: MongoDB\\Database::createCollection
+optional: true
 position: 3
 ---
 arg_name: option
-name: size
+name: flags
 type: integer
 description: |
-  Specify a maximum size in bytes for a capped collection. Once a
-  capped collection reaches its maximum size, MongoDB removes the older
-  documents to make space for the new documents. The ``size`` option is
-  required for capped collections and ignored for other collections.
-optional: true
+  Available for the MMAPv1 storage engine only to set the ``usePowerOf2Sizes``
+  and ``noPadding`` flags.
+
+  The |php-library| provides constants that you can combine with a :php:`bitwise
+  OR operator ` to set the flag values:
+
+  - ``MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES``: ``1``
+  - ``MongoDB\Operation\CreateCollection::NO_PADDING``: ``2``
+
+  Defaults to ``1``.
+
+  .. note::
+
+     MongoDB 3.0 and later ignores the ``usePowerOf2Sizes`` flag. See
+     :manual:`collMod ` and
+     :manual:`db.createCollection()
+     ` for more information.
 interface: phpmethod
 operation: MongoDB\\Database::createCollection
+optional: true
 position: 4
 ---
 arg_name: option
+name: indexOptionDefaults
+type: array|object
+description: |
+  Allows users to specify a default configuration for indexes when creating a
+  collection.
+
+  The ``indexOptionDefaults`` option accepts a ``storageEngine`` document,
+  which should take the following form::
+
+     { :  }
+
+  Storage engine configurations specified when creating indexes are validated
+  and logged to the :term:`oplog` during replication to support replica sets
+  with members that use different storage engines.
+interface: phpmethod
+operation: MongoDB\\Database::createCollection
+optional: true
+position: 5
+---
+arg_name: option
 name: max
 type: integer
 description: |
@@ -75,11 +86,30 @@ description: |
 interface: phpmethod
 operation: MongoDB\\Database::createCollection
 optional: true
-position: 5
+position: 6
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: maxTimeMS
+operation: MongoDB\\Database::createCollection
+position: 7
+---
+arg_name: option
+name: size
+type: integer
+description: |
+  Specify a maximum size in bytes for a capped collection. Once a capped
+  collection reaches its maximum size, MongoDB removes the older documents to
+  make space for the new documents. The ``size`` option is required for capped
+  collections and ignored for other collections.
+interface: phpmethod
+operation: MongoDB\\Database::createCollection
+optional: true
+position: 8
 ---
 arg_name: option
 name: storageEngine
-type: array
+type: array|object
 description: |
   Available for the WiredTiger storage engine only.
 
@@ -95,144 +125,108 @@ description: |
 interface: phpmethod
 operation: MongoDB\\Database::createCollection
 optional: true
-position: 6
+position: 9
 ---
-arg_name: option
-name: flags
-type: integer
-description: |
-
-  Available for the MMAPv1 storage engine only to set the
-  ``usePowerOf2Sizes`` and ``noPadding`` flags.
-  
-  The |php-library| provides constants that you can combine with a
-  :php:`bitwise OR operator ` to set the
-  flag values:
-  
-  - ``MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES``: ``1``
-  - ``MongoDB\Operation\CreateCollection::NO_PADDING``: ``2``
-
-  Defaults to ``1``.
-  
-  .. note:: 
-
-     MongoDB 3.0 and later ignores the ``usePowerOf2Sizes`` flag. See
-     :manual:`collMod ` and
-     :manual:`db.createCollection()
-     ` for more information.
-
-interface: phpmethod
+source:
+  file: apiargs-common-option.yaml
+  ref: typeMap
 operation: MongoDB\\Database::createCollection
-optional: true
-position: 7
+position: 10
+description: |
+  Type map for BSON deserialization. This will be used for the returned command
+  result document. Defaults to the database's type map.
 ---
 arg_name: option
 name: validator
 type: array
 description: |
   Allows users to specify :manual:`validation rules or expressions
-  ` for the collection. For more information,
-  see :manual:`Document Validation `
-  in the MongoDB manual.
+  ` for the collection. For more information, see
+  :manual:`Document Validation ` in the MongoDB
+  manual.
 
-  The ``validator`` option takes an array that specifies the
-  validation rules or expressions. You can specify the expressions using
-  the same operators as MongoDB's :manual:`query operators `
-  with the exception of :query:`$geoNear`, :query:`$near`,
-  :query:`$nearSphere`, :query:`$text`, and :query:`$where`.
+  The ``validator`` option takes an array that specifies the validation rules or
+  expressions. You can specify the expressions using the same operators as
+  MongoDB's :manual:`query operators ` with the
+  exception of :query:`$geoNear`, :query:`$near`, :query:`$nearSphere`,
+  :query:`$text`, and :query:`$where`.
 
   .. note::
 
-     - Validation occurs during updates and inserts. Existing
-       documents do not undergo validation checks until modification.
+     - Validation occurs during updates and inserts. Existing documents do not
+       undergo validation checks until modification.
 
      - You cannot specify a validator for collections in the ``admin``,
        ``local``, and ``config`` databases.
 
      - You cannot specify a validator for ``system.*`` collections.
-
 operation: MongoDB\\Database::createCollection
 interface: phpmethod
 optional: true
-position: 8
+position: 11
 ---
 arg_name: option
-name: validationLevel
+name: validationAction
 type: string
 description: |
-   Determines how strictly MongoDB applies the
-   validation rules to existing documents during an update.
+   Determines whether to ``error`` on invalid documents or just ``warn`` about
+   the violations but allow invalid documents to be inserted.
+
+   .. important::
+
+      Validation of documents only applies to those documents as determined by
+      the ``validationLevel``.
 
    .. list-table::
       :header-rows: 1
 
-      * - ``validationLevel``
+      * - ``validationAction``
 
         - Description
 
-      * - ``"off"``
-
-        - No validation for inserts or updates.
-
-      * - ``"strict"``
+      * - ``"error"``
 
-        - **Default** Apply validation rules to all inserts and all
-          updates.
-       
-      * - ``"moderate"``
+        - **Default**. Documents must pass validation before the write occurs.
+          Otherwise, the write operation fails.
 
-        - Apply validation rules to inserts and to updates on existing *valid*
-          documents. Do not apply rules to updates on existing *invalid*
-          documents.
+      * - ``"warn"``
 
+        - Documents do not have to pass validation. If the document fails
+          validation, the write operation logs the validation failure.
 interface: phpmethod
 operation: MongoDB\\Database::createCollection
 optional: true
-position: 9
+position: 12
 ---
 arg_name: option
-name: validationAction
+name: validationLevel
 type: string
 description: |
-   Determines whether to ``error`` on invalid documents or just ``warn``
-   about the violations but allow invalid documents to be inserted.
+   Determines how strictly MongoDB applies the validation rules to existing
+   documents during an update.
 
-   .. important::
-
-      Validation of documents only applies to those documents as
-      determined by the ``validationLevel``.
-  
    .. list-table::
       :header-rows: 1
 
-      * - ``validationAction``
+      * - ``validationLevel``
 
         - Description
 
-      * - ``"error"``
+      * - ``"off"``
 
-        - **Default** Documents must pass validation before the write occurs.
-          Otherwise, the write operation fails.
-       
-      * - ``"warn"``
+        - No validation for inserts or updates.
 
-        - Documents do not have to pass validation. If the document fails
-          validation, the write operation logs the validation failure.
+      * - ``"strict"``
 
+        - **Default**. Apply validation rules to all inserts and all updates.
+
+      * - ``"moderate"``
+
+        - Apply validation rules to inserts and to updates on existing *valid*
+          documents. Do not apply rules to updates on existing *invalid*
+          documents.
 interface: phpmethod
 operation: MongoDB\\Database::createCollection
 optional: true
-position: 10
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
-operation: MongoDB\\Database::createCollection
-position: 11
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-operation: MongoDB\\Database::createCollection
-position: 12
-...
\ No newline at end of file
+position: 13
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
index 928092c7..c8c40ce9 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
@@ -3,12 +3,12 @@ source:
   ref: $collectionName
 operation: MongoDB\\Database::createCollection
 position: 1
-optional: false
+replacement:
+  action: " to create"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
 operation: MongoDB\\Database::createCollection
 position: 2
-optional: true
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
index 4e08c693..f9b8e81a 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
@@ -1,6 +1,9 @@
 source:
   file: apiargs-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Database::dropCollection
+operation: MongoDB\\Database::drop
 position: 1
-...
\ No newline at end of file
+description: |
+  Type map for BSON deserialization. This will be used for the returned command
+  result document. Defaults to the database's type map.
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
index 16e22d02..53b1e8a9 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
@@ -1,14 +1,6 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-operation: MongoDB\\Database::dropCollection
-position: 1
-optional: false
----
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Database::dropCollection
-position: 2
-optional: true
-...
\ No newline at end of file
+operation: MongoDB\\Database::drop
+position: 1
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
index 4e08c693..4e8919fe 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
@@ -3,4 +3,7 @@ source:
   ref: typeMap
 operation: MongoDB\\Database::dropCollection
 position: 1
-...
\ No newline at end of file
+description: |
+  Type map for BSON deserialization. This will be used for the returned command
+  result document. Defaults to the database's type map.
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
index 16e22d02..1e260bc3 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
@@ -3,12 +3,12 @@ source:
   ref: $collectionName
 operation: MongoDB\\Database::dropCollection
 position: 1
-optional: false
+replacement:
+  action: " to drop"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
 operation: MongoDB\\Database::dropCollection
 position: 2
-optional: true
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
index 3c6458b6..331e02c8 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
@@ -3,4 +3,6 @@ source:
   ref: $collectionName
 operation: MongoDB\\Database::__get
 position: 1
-...
\ No newline at end of file
+replacement:
+  action: " to select"
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
index 11097786..0d7409d0 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
@@ -1,24 +1,16 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
+arg_name: option
+name: filter
+type: array|object
+description: |
+  Query by which to filter collections.
+interface: phpmethod
 operation: MongoDB\\Database::listCollections
+optional: true
 position: 1
 ---
 source:
   file: apiargs-common-option.yaml
-  ref: readPreference
+  ref: maxTimeMS
 operation: MongoDB\\Database::listCollections
 position: 2
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-operation: MongoDB\\Database::listCollections
-position: 3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-operation: MongoDB\\Database::listCollections
-position: 4
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
index 06178173..e717699d 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
@@ -3,5 +3,4 @@ source:
   ref: $options
 operation: MongoDB\\Database::listCollections
 position: 1
-optional: true
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
index 095708cf..bf8b85e9 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
@@ -3,22 +3,33 @@ source:
   ref: readConcern
 operation: MongoDB\\Database::selectCollection
 position: 1
+replacement:
+  resource: "collection"
+  parent: "database"
 ---
 source:
   file: apiargs-common-option.yaml
   ref: readPreference
 operation: MongoDB\\Database::selectCollection
 position: 2
+replacement:
+  resource: "collection"
+  parent: "database"
 ---
 source:
   file: apiargs-common-option.yaml
   ref: typeMap
 operation: MongoDB\\Database::selectCollection
 position: 3
+replacement:
+  parent: "database"
 ---
 source:
   file: apiargs-common-option.yaml
   ref: writeConcern
 operation: MongoDB\\Database::selectCollection
 position: 4
-...
\ No newline at end of file
+replacement:
+  resource: "collection"
+  parent: "database"
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
index 955b25fb..2f3cd044 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
@@ -3,11 +3,12 @@ source:
   ref: $collectionName
 operation: MongoDB\\Database::selectCollection
 position: 1
-optional: false
+replacement:
+  action: " to select"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
 operation: MongoDB\\Database::selectCollection
 position: 2
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
index bf6207f0..d08427be 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
@@ -3,30 +3,30 @@ source:
   ref: readConcern
 operation: MongoDB\\Database::withOptions
 description: |
-  The default read concern to use for database operations. Defaults
-  to the original Databases's specified read concern.
+  The default read concern to use for database operations. Defaults to the
+  original Databases's read concern.
 ---
 source:
   file: apiargs-common-option.yaml
   ref: readPreference
 operation: MongoDB\\Database::withOptions
 description: |
-  The default read preference to use for database operations.
-  Defaults to the original Database's read preference.
+  The default read preference to use for database operations. Defaults to the
+  original Database's read preference.
 ---
 source:
   file: apiargs-common-option.yaml
   ref: typeMap
 operation: MongoDB\\Database::withOptions
 description: |
-  Default type map for cursors and BSON documents. Defaults to the
-  original Database's type map value.
+  Default type map to use for converting BSON. Defaults to the original
+  Database's type map.
 ---
 source:
   file: apiargs-common-option.yaml
   ref: writeConcern
 operation: MongoDB\\Database::withOptions
 description: |
-  The default write concern to use for database operations. Defaults
-  to the original Database's specified write concern.
-...
\ No newline at end of file
+  The default write concern to use for database operations. Defaults to the
+  original Database's write concern.
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
index d36c1097..53504d42 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
@@ -1,6 +1,6 @@
 source:
-  ref: $options
   file: apiargs-common-param.yaml
+  ref: $options
 operation: MongoDB\\Database::withOptions
 position: 1
 ...
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index 0f05ad4b..2b57ae7c 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -44,8 +44,8 @@ Methods
 .. toctree::
    :titlesonly:
 
-   /reference/method/MongoDBDatabase__get
    /reference/method/MongoDBDatabase__construct
+   /reference/method/MongoDBDatabase__get
    /reference/method/MongoDBDatabase-command
    /reference/method/MongoDBDatabase-createCollection
    /reference/method/MongoDBDatabase-drop
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index de4e1467..56c17a1b 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -13,113 +13,136 @@ MongoDB\\Database::command()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::command
+.. phpmethod:: MongoDB\\Database::command()
 
    Execute a :manual:`command ` on the database.
-   
+
    .. code-block:: php
-                   
+
       function command($command, array $options = []): MongoDB\Driver\Cursor
 
-   :phpmethod:`MongoDB\\Database::command` has the following parameters:
+   :phpmethod:`MongoDB\\Database::command()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-command-param.rst
-   
-   ``command`` supports the following options:
-   
+
+   The ``$options`` parameter supports the following options:
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-command-option.rst
 
+   :returns:
+
+      A :php:`MongoDB\\Driver\\Cursor ` object.
+
 Example
 -------
 
-The following operation creates a new user in the database using
-the :dbcommand:`createUser` command:
+The following example executes an :manual:`isMaster
+` command, which returns a cursor with a single
+result document:
 
 .. code-block:: php
 
-   $database = (new MongoDB\Client)->example;
+   command(
-       [
-           'createUser' => 'admin',
-           'pwd' => 'admin123',
-           'roles' => [
-               'readWrite'
-           ]
-       ]
-   );
+   $database = (new MongoDB\Client)->example;
 
-   
+   $cursor = $database->command(['isMaster' => 1]);
 
-   var_dump($newUser);
+   var_dump($c->toArray()[0]);
 
 The output would resemble::
-  
-  object(MongoDB\Driver\Cursor)#10 (2) {
-     ["cursor"]=>
-     array(17) {
-       ["stamp"]=>
-       int(0)
-       ["is_command"]=>
-       bool(true)
-       ["sent"]=>
+
+   object(MongoDB\Model\BSONDocument)#11 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(8) {
+       ["ismaster"]=>
        bool(true)
-       ["done"]=>
-       bool(false)
-       ["end_of_event"]=>
-       bool(false)
-       ["in_exhaust"]=>
-       bool(false)
-       ["has_fields"]=>
-       bool(false)
-       ["query"]=>
-       object(stdClass)#9 (3) {
-         ["createUser"]=>
-         string(5) "admin"
-         ["pwd"]=>
-         string(8) "admin123"
-         ["roles"]=>
-         array(1) {
-           [0]=>
-           string(9) "readWrite"
-         }
+       ["maxBsonObjectSize"]=>
+       int(16777216)
+       ["maxMessageSizeBytes"]=>
+       int(48000000)
+       ["maxWriteBatchSize"]=>
+       int(1000)
+       ["localTime"]=>
+       object(MongoDB\BSON\UTCDateTime)#3 (1) {
+         ["milliseconds"]=>
+         string(13) "1477608046464"
        }
-       ["fields"]=>
-       object(stdClass)#3 (0) {
+       ["maxWireVersion"]=>
+       int(4)
+       ["minWireVersion"]=>
+       int(0)
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+The following example executes a :manual:`listCollections
+` command, which returns a cursor with
+multiple result documents:
+
+.. code-block:: php
+
+   example;
+
+   $cursor = $database->command(['isMaster' => 1]);
+
+   var_dump($c->toArray());
+
+The output would resemble::
+
+   array(3) {
+     [0]=>
+     object(MongoDB\Model\BSONDocument)#11 (1) {
+       ["storage":"ArrayObject":private]=>
+       array(2) {
+         ["name"]=>
+         string(11) "restaurants"
+         ["options"]=>
+         object(MongoDB\Model\BSONDocument)#3 (1) {
+           ["storage":"ArrayObject":private]=>
+           array(0) {
+           }
+         }
        }
-       ["read_preference"]=>
+     }
+     [1]=>
+     object(MongoDB\Model\BSONDocument)#13 (1) {
+       ["storage":"ArrayObject":private]=>
        array(2) {
-         ["mode"]=>
-         int(1)
-         ["tags"]=>
-         array(0) {
+         ["name"]=>
+         string(5) "users"
+         ["options"]=>
+         object(MongoDB\Model\BSONDocument)#12 (1) {
+           ["storage":"ArrayObject":private]=>
+           array(0) {
+           }
          }
        }
-       ["flags"]=>
-       int(0)
-       ["skip"]=>
-       int(0)
-       ["limit"]=>
-       int(1)
-       ["count"]=>
-       int(1)
-       ["batch_size"]=>
-       int(0)
-       ["ns"]=>
-       string(12) "example.$cmd"
-       ["current_doc"]=>
-       object(stdClass)#8 (1) {
-         ["ok"]=>
-         float(1)
+     }
+     [2]=>
+     object(MongoDB\Model\BSONDocument)#15 (1) {
+       ["storage":"ArrayObject":private]=>
+       array(2) {
+         ["name"]=>
+         string(6) "restos"
+         ["options"]=>
+         object(MongoDB\Model\BSONDocument)#14 (1) {
+           ["storage":"ArrayObject":private]=>
+           array(0) {
+           }
+         }
        }
      }
-     ["server_id"]=>
-     int(1)
    }
 
 .. seealso::
-   
+
    - :doc:`/tutorial/commands`
    - :manual:`Database Commands ` in the
      MongoDB manual
-     
+   - :php:`MongoDB\\Driver\\Cursor `
+   - :php:`MongoDB\\Driver\\Manager::executeCommand()
+     `
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 2fc255c2..47940bfb 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -13,45 +13,45 @@ MongoDB\\Database::createCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::createCollection
+.. phpmethod:: MongoDB\\Database::createCollection()
 
    Explicitly creates a collection.
-   
+
    .. code-block:: php
 
       function createCollection($collectionName, array $options = []): array|object
-   
-   MongoDB creates collections implicitly when you first reference
-   the collection in a command, such as when inserting a document
-   into a new collection. You may also explicitly create a collection
-   with specific options using the ``createCollection()``
-   method, or using :dbcommand:`create` in the :program:`mongo` shell.
-   
+
+   MongoDB creates collections implicitly when you first reference the
+   collection in a command, such as when inserting a document into a new
+   collection. You may also explicitly create a collection with specific options
+   using the :phpmethod:`MongoDB\\Database::createCollection()` method, or using
+   :manual:`db.createCollection() ` in
+   the :program:`mongo` shell.
+
    Explicitly creating collections enables you to create
    :manual:`capped collections `, specify
    :manual:`document validation criteria `,
    or configure your storage engine or indexing options.
-   
-   :phpmethod:`MongoDB\\Database::createCollection` has the following
+
+   :phpmethod:`MongoDB\\Database::createCollection()` has the following
    parameters:
-   
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-param.rst
-   
-   The ``$options`` parameter accepts the following options:
-   
+
+   The ``$options`` parameter supports the following options:
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-option.rst
-   
-   Note that not all options are available on all versions of MongoDB.
-   Document Validation, for example, was added in MongoDB 3.2;
-   similarly, the WiredTiger storage engine is available only for
-   MongoDB 3.0 and later. Refer to the :manual:`create command
-   ` reference in the MongoDB manual for
-   compatibility considerations.
 
-Output
-------
+   Note that not all options are available on all versions of MongoDB. Document
+   validation, for example, was added in MongoDB 3.2; similarly, the WiredTiger
+   storage engine is available only for MongoDB 3.0 and later. Refer to the
+   :manual:`create ` command reference in the MongoDB
+   manual for compatibility considerations.
+
+   :returns:
 
-Returns the command result document as an array.
+      An array or object with the result document of the :manual:`create
+      ` command.
 
 Example
 -------
@@ -61,6 +61,8 @@ database with document validation criteria:
 
 .. code-block:: php
 
+   demo;
 
    $result = $db->createCollection('users', [
@@ -69,13 +71,12 @@ database with document validation criteria:
            'email' => ['$regex' => '@mongodb\.com$'],
        ],
    ]);
-   
-   
+
    var_dump($result);
 
 The output would then resemble::
 
-   Object(MongoDB\Model\BSONDocument)#11 (1) {
+   object(MongoDB\Model\BSONDocument)#11 (1) {
      ["storage":"ArrayObject":private]=>
      array(1) {
        ["ok"]=>
@@ -85,5 +86,6 @@ The output would then resemble::
 
 .. seealso::
 
-   :manual:`create ` command reference in
-   the MongoDB manual
+   - :manual:`create ` command reference in the MongoDB
+     manual
+   - :manual:`db.createCollection() `
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index cab554d3..cb0d57d8 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -13,27 +13,27 @@ MongoDB\\Database::drop()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::drop
+.. phpmethod:: MongoDB\\Database::drop()
+
+   Drop the database.
 
-   Drops the database.
-   
    .. code-block:: php
-   
-      function dropCollection($collectionName, array $options = []): array|object
-   
-   :phpmethod:`MongoDB\\Database::drop` has the following
-   parameters:
-   
+
+      function drop(array $options = []): array|object
+
+   :phpmethod:`MongoDB\\Database::drop()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-drop-param.rst
-   
-   The ``$options`` parameter accepts the following options:
-   
+
+   The ``$options`` parameter supports the following options:
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-drop-option.rst
 
-Output
-------
+   :returns:
 
-Returns the command result document as an array.
+      An array or object with the result document of the :manual:`dropDatabase
+      ` command. The return type will depend on
+      the ``typeMap`` option.
 
 Example
 -------
@@ -42,11 +42,12 @@ The following example drops the ``demo`` database:
 
 .. code-block:: php
 
+   demo;
 
    $result = $db->drop();
-   
-   
+
    var_dump($result);
 
 The output would then resemble::
@@ -63,6 +64,6 @@ The output would then resemble::
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Client::dropDatabase`
-   - :manual:`dropDatabase ` command
-     reference in the MongoDB manual
+   - :phpmethod:`MongoDB\\Client::dropDatabase()`
+   - :manual:`dropDatabase ` command reference
+     in the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 99fd71ef..47c450e6 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -13,41 +13,42 @@ MongoDB\\Database::dropCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::dropCollection
+.. phpmethod:: MongoDB\\Database::dropCollection()
 
    Drop a collection within the current database.
-   
+
    .. code-block:: php
-   
+
       function dropCollection($collectionName, array $options = []): array|object
-   
-   :phpmethod:`MongoDB\\Database::dropCollection` has the following
+
+   :phpmethod:`MongoDB\\Database::dropCollection()` has the following
    parameters:
-   
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-param.rst
-   
-   The ``$options`` parameter accepts the following options:
-   
+
+   The ``$options`` parameter supports the following options:
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-option.rst
 
-Output
-------
+   :returns:
 
-Returns the command result document as an array.
+      An array or object with the result document of the :manual:`drop
+      ` command. The return type will depend on
+      the ``typeMap`` option.
 
 Example
 -------
 
-The following example drops the ``users`` collection in the ``demo``
-database:
+The following example drops the ``users`` collection in the ``demo`` database:
 
 .. code-block:: php
 
+   demo;
 
    $result = $db->dropCollection('users');
-   
-   
+
    var_dump($result);
 
 The output would then resemble::
@@ -66,6 +67,6 @@ The output would then resemble::
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::drop`
-   - :manual:`drop ` command reference in
-     the MongoDB manual
+   - :phpmethod:`MongoDB\\Collection::drop()`
+   - :manual:`drop ` command reference in the MongoDB
+     manual
diff --git a/source/reference/method/MongoDBDatabase-getDatabaseName.txt b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
index 336e7fbd..4371997c 100644
--- a/source/reference/method/MongoDBDatabase-getDatabaseName.txt
+++ b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
@@ -13,27 +13,27 @@ MongoDB\\Database::getDatabaseName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getDatabaseName
+.. phpmethod:: MongoDB\\Database::getDatabaseName()
+
+   Returns the name of this database.
 
-   Drops the database.
-   
    .. code-block:: php
-   
+
       function getDatabaseName(): string
 
-Output
-------
+   :returns:
 
-Returns the name of the database as a string.
+      The name of this database as a string.
 
 Example
 -------
 
-The following example gets the name of the database from the ``$db``
-variable:
+The following example prints the name of a database object:
 
 .. code-block:: php
 
+   demo;
 
    echo $db->getDatabaseName();
diff --git a/source/reference/method/MongoDBDatabase-getManager.txt b/source/reference/method/MongoDBDatabase-getManager.txt
index e95f789e..a2ccc61e 100644
--- a/source/reference/method/MongoDBDatabase-getManager.txt
+++ b/source/reference/method/MongoDBDatabase-getManager.txt
@@ -17,7 +17,7 @@ Definition
 
    Accessor for the
    :php:`MongoDB\\Driver\\Manager ` used by this
-   :phpclass:`Client `.
+   :phpclass:`Database `.
 
    .. code-block:: php
 
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index bd03ea4e..27b7b4ac 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -13,39 +13,38 @@ MongoDB\\Database::listCollections()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::listCollections
+.. phpmethod:: MongoDB\\Database::listCollections()
 
    Returns information for all collections in this database.
 
    .. code-block:: php
-   
-      function listCollections(array $options=[]): MongoDB\Model\CollectionInfoIterator
 
-   :phpmethod:`MongoDB\\Database::listCollections` has the following
+      function listCollections(array $options = []): MongoDB\Model\CollectionInfoIterator
+
+   :phpmethod:`MongoDB\\Database::listCollections()` has the following
    parameters:
-   
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-param.rst
-   
-   The ``$options`` parameter accepts the following options:
-   
+
+   The ``$options`` parameter supports the following options:
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-option.rst
 
-Output
-------
+   :returns:
 
-Returns information for all collections in the database. The elements
-in the returned iterator are ``MongoDB\Model\CollectionInfo`` objects.
+      A traversable :phpclass:`MongoDB\\Model\CollectionInfoIterator`, which
+      contains an :phpclass:`MongoDB\\Model\CollectionInfo` object for each
+      collection in the database.
 
 Example
 -------
 
-The following example lists all of the collections in the ``example``
-database:
+The following example lists all of the collections in the ``example`` database:
 
 .. code-block:: php
 
    example;
 
    foreach ($database->listCollections() as $collectionInfo) {
@@ -61,7 +60,7 @@ The output would then resemble::
      array(0) {
      }
    }
-   object(MongoDB\Model\CollectionInfo)#11 (2) {
+   object(MongoDB\Model\CollectionInfo)#3 (2) {
      ["name"]=>
      string(5) "users"
      ["options"]=>
@@ -75,11 +74,47 @@ The output would then resemble::
      array(0) {
      }
    }
-   
+
+The following example lists all collections whose name starts with ``"rest"``
+in the ``example`` database:
+
+.. code-block:: php
+
+   example;
+
+   $collections = $database->listCollections([
+       'filter' => [
+           'name' => new MongoDB\BSON\Regex('^rest.*'),
+       ],
+   ]);
+
+   foreach ($collections as $collectionInfo) {
+       var_dump($collectionInfo);
+   }
+
+The output would then resemble::
+
+   object(MongoDB\Model\CollectionInfo)#3 (2) {
+     ["name"]=>
+     string(11) "restaurants"
+     ["options"]=>
+     array(0) {
+     }
+   }
+   object(MongoDB\Model\CollectionInfo)#3 (2) {
+     ["name"]=>
+     string(6) "restos"
+     ["options"]=>
+     array(0) {
+     }
+   }
+
 .. seealso::
 
-   - :manual:`listCollections `_
\ No newline at end of file
+   - :manual:`listCollections `_
+     specification
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 5f8135b0..d46df855 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -13,128 +13,65 @@ MongoDB\\Database::selectCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::selectCollection
+.. phpmethod:: MongoDB\\Database::selectCollection()
+
+   Selects a collection within the database.
 
-   Selects a collection within the database. The collection inherits
-   options such as read preference and type map from the Database object
-   unless otherwise specified in the ``$options`` parameter.
-   
    .. code-block:: php
-   
+
       function selectCollection($collectionName, array $options = []): MongoDB\Collection
-   
-   :phpmethod:`MongoDB\\Database::selectCollection` has the following
+
+   :phpmethod:`MongoDB\\Database::selectCollection()` has the following
    parameters:
-   
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-param.rst
-   
-   The ``$options`` parameter accepts the following options:
-   
+
+   The ``$options`` parameter supports the following options:
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-option.rst
 
-Output
-------
+   :returns:
+
+      A :phpclass:`MongoDB\\Collection` object.
+
+Behavior
+--------
 
-Returns a :phpclass:`MongoDB\\Collection` object.
+The selected collection inherits options such as read preference and type
+mapping from the :phpclass:`Database ` object. Options may be
+overridden via the ``$options`` parameter.
 
 Example
 -------
 
+The following example selects the ``users`` collection in the ``demo`` database:
+
+.. code-block:: php
+
+   demo;
+
+   $collection = $db->selectCollection('demo', 'users');
+
 The following example selects the ``users`` collection in the ``demo``
 database with a custom read preference:
 
 .. code-block:: php
 
+   demo;
 
    $users = $db->selectCollection(
-      'users',
-      [ 
-         'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
-      ]
+       'users',
+       [
+           'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+       ]
    );
-   
-   
-   var_dump($users);
-
-The output would then resemble::
-
-   object(MongoDB\Collection)#8 (7) {
-     ["collectionName"]=>
-     string(5) "users"
-     ["databaseName"]=>
-     string(4) "demo"
-     ["manager"]=>
-     object(MongoDB\Driver\Manager)#2 (2) {
-       ["uri"]=>
-       string(25) "mongodb://localhost:27017"
-       ["cluster"]=>
-       array(1) {
-         [0]=>
-         array(11) {
-           ["host"]=>
-           string(9) "localhost"
-           ["port"]=>
-           int(27017)
-           ["type"]=>
-           int(0)
-           ["is_primary"]=>
-           bool(false)
-           ["is_secondary"]=>
-           bool(false)
-           ["is_arbiter"]=>
-           bool(false)
-           ["is_hidden"]=>
-           bool(false)
-           ["is_passive"]=>
-           bool(false)
-           ["tags"]=>
-           array(0) {
-           }
-           ["last_is_master"]=>
-           array(0) {
-           }
-           ["round_trip_time"]=>
-           int(-1)
-         }
-       }
-     }
-     ["readConcern"]=>
-     object(MongoDB\Driver\ReadConcern)#5 (1) {
-       ["level"]=>
-       NULL
-     }
-     ["readPreference"]=>
-     object(MongoDB\Driver\ReadPreference)#3 (2) {
-       ["mode"]=>
-       int(2)
-       ["tags"]=>
-       array(0) {
-       }
-     }
-     ["typeMap"]=>
-     array(3) {
-       ["array"]=>
-       string(23) "MongoDB\Model\BSONArray"
-       ["document"]=>
-       string(26) "MongoDB\Model\BSONDocument"
-       ["root"]=>
-       string(26) "MongoDB\Model\BSONDocument"
-     }
-     ["writeConcern"]=>
-     object(MongoDB\Driver\WriteConcern)#7 (4) {
-       ["w"]=>
-       NULL
-       ["wmajority"]=>
-       bool(false)
-       ["wtimeout"]=>
-       int(0)
-       ["journal"]=>
-       NULL
-     }
-   }   
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::__construct`
-   - :phpmethod:`MongoDB\\Database::__get`
+   - :phpmethod:`MongoDB\\Database::__get()`
+   - :phpmethod:`MongoDB\\Client::selectCollection()`
+   - :phpmethod:`MongoDB\\Collection::__construct()`
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index add91e0f..e6f34f4e 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -4,45 +4,51 @@ MongoDB\\Database::withOptions()
 
 .. default-domain:: mongodb
 
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::withOptions
+.. phpmethod:: MongoDB\\Database::withOptions()
 
    Returns a clone of the Database object, but with different options.
-   
+
    .. code-block:: php
 
       function withOptions(array $options = []): MongoDB\Database
 
-   :phpmethod:`MongoDB\\Database::withOptions` supports the
-   following parameter:
-   
-   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-param.rst
-   
+   :phpmethod:`MongoDB\\Database::withOptions()` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-param.rst
+
    The ``$options`` parameter supports the following options:
-   
-   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-option.rst
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-option.rst
+
+   :returns:
+
+      A :phpclass:`MongoDB\\Database` object.
 
 Example
 -------
 
-The following example clones the ``$newDb`` Database object with read
-preference ``RP_SECONDARY``.
+The following example clones an existing Database object with a new read
+preference:
 
 .. code-block:: php
 
    withOptions('sample','restaurants');
+   $db = (new MongoDB\Client)->demo;
 
-   $newCollection = $sourceCollection->withOptions([ 
+   $newDb = $db->withOptions([
        'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
    ]);
-   
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::__construct`
+   - :phpmethod:`MongoDB\\Database::__construct()`
diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt
index 78803f3e..0669df28 100644
--- a/source/reference/method/MongoDBDatabase__construct.txt
+++ b/source/reference/method/MongoDBDatabase__construct.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::__construct
+.. phpmethod:: MongoDB\\Database::__construct()
 
    Constructs a new :phpclass:`Database ` instance.
 
@@ -25,16 +25,20 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-construct-param.rst
 
-   :phpmethod:`MongoDB\\Database::__construct` supports the following
-   options:
-   
+   The ``$options`` parameter supports the following options:
+
    .. include:: /includes/apiargs/MongoDBDatabase-method-construct-option.rst
 
-   If you construct the Database explicitly, the Database inherits any
-   options from the ``Manager`` object. If you select the Database
-   from a :phpclass:`Client ` object, the Database
-   inherits its options from that object.
+Behavior
+--------
+
+If you construct a Database explicitly, the Database inherits any options from
+the :php:`MongoDB\\Driver\\Manager ` object. If
+you select the Database from a :phpclass:`Client ` object, the
+Database inherits its options from that object.
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Database::withOptions`
+   - :phpmethod:`MongoDB\\Database::withOptions()`
+   - :phpmethod:`MongoDB\\Client::selectDatabase()`
+   - :phpmethod:`MongoDB\\Client::__get()`
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index 3d3920a9..2609d717 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -4,7 +4,6 @@ MongoDB\\Database::__get()
 
 .. default-domain:: mongodb
 
-
 .. contents:: On this page
    :local:
    :backlinks: none
@@ -14,33 +13,37 @@ MongoDB\\Database::__get()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::__get($collectionName)
+.. phpmethod:: MongoDB\\Database::__get()
 
-   Select a collection from the database.
+   Select a collection within the database.
 
    .. code-block:: php
 
       function __get($collectionName): MongoDB\Collection
 
-   :phpmethod:`MongoDB\\Database::__get` has the following parameters:
+   :phpmethod:`MongoDB\\Database::__get()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-get-param.rst
 
+   :returns:
+
+      A :phpclass:`MongoDB\\Collection` object.
+
 Behavior
 --------
 
-The selected database inherits options such as read preference and
-type mapping from the :phpclass:`Database  ` object.
-If you wish to override any options, use the 
-:phpmethod:`MongoDB\\Database::selectCollection` method.
+The selected collection inherits options such as read preference and type
+mapping from the :phpclass:`Database ` object. If you wish to
+override any options, use the :phpmethod:`MongoDB\\Database::selectCollection`
+method.
 
 .. note::
-   
+
    To select collections whose names contain special characters, such as
    ``.``, use complex syntax, as in ``$database->{'that.database'}``.
-   
+
    Alternatively, :phpmethod:`MongoDB\\Database::selectCollection` supports
-   selecting databases whose names contain special characters.
+   selecting collections whose names contain special characters.
 
 Examples
 --------
@@ -59,5 +62,6 @@ collections from the ``demo`` database:
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Database::selectCollection`
-   - :php:`Property Overloading ` in the PHP Manual.
+   - :phpmethod:`MongoDB\\Database::selectCollection()`
+   - :phpmethod:`MongoDB\\Client::selectCollection()`
+   - :php:`Property Overloading ` in the PHP Manual

From 0b93425511db42883f2aedae28b25545d548c198 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 27 Oct 2016 20:57:05 -0400
Subject: [PATCH 035/321] Use common param for $manager

---
 ...piargs-MongoDBDatabase-method-construct-param.yaml |  6 +++---
 source/includes/apiargs-common-param.yaml             | 11 +++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
index 872918a5..4f71dd08 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
@@ -1,5 +1,5 @@
 source:
-  file: apiargs-MongoDBCollection-method-construct-param.yaml
+  file: apiargs-common-param.yaml
   ref: $manager
 operation: MongoDB\\Database::__construct
 position: 1
@@ -11,8 +11,8 @@ operation: MongoDB\\Database::__construct
 position: 2
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Database::__construct
+  ref: $options
+operation: MongoDB\\Collection::__construct
 position: 3
 ...
diff --git a/source/includes/apiargs-common-param.yaml b/source/includes/apiargs-common-param.yaml
index c633bf2a..0bc0f7a2 100644
--- a/source/includes/apiargs-common-param.yaml
+++ b/source/includes/apiargs-common-param.yaml
@@ -1,4 +1,15 @@
 arg_name: param
+name: $manager
+type: :php:`MongoDB\\Driver\\Manager `
+description: |
+  The :php:`Manager ` instance from the driver. The
+  manager maintains connections between the driver and your MongoDB instances.
+interface: phpmethod
+operation: ~
+optional: false
+position: 1
+---
+arg_name: param
 name: $databaseName
 type: string
 description: |

From 85a7ff07cafcb70455657772c931335ce0b09b33 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 27 Oct 2016 20:57:47 -0400
Subject: [PATCH 036/321] Update MongoDB\Collection documentation

---
 ...oDBCollection-method-aggregate-option.yaml |  52 +++++----
 ...goDBCollection-method-aggregate-param.yaml |   8 +-
 ...oDBCollection-method-bulkWrite-option.yaml |  19 +--
 ...goDBCollection-method-bulkWrite-param.yaml |  32 ++---
 ...oDBCollection-method-construct-option.yaml |  49 ++++++++
 ...goDBCollection-method-construct-param.yaml |  24 ++--
 ...MongoDBCollection-method-count-option.yaml |  16 +--
 ...-MongoDBCollection-method-count-param.yaml |   4 +-
 ...BCollection-method-createIndex-option.yaml |  36 ++----
 ...DBCollection-method-createIndex-param.yaml |  13 +--
 ...-MongoDBCollection-method-drop-option.yaml |   2 +-
 ...s-MongoDBCollection-method-drop-param.yaml |   2 +-
 ...oDBCollection-method-dropIndex-option.yaml |   2 +-
 ...goDBCollection-method-dropIndex-param.yaml |   2 +-
 ...BCollection-method-dropIndexes-option.yaml |   2 +-
 ...DBCollection-method-dropIndexes-param.yaml |   2 +-
 ...-MongoDBCollection-method-find-option.yaml |  35 +++---
 ...ngoDBCollection-method-findOne-option.yaml |   2 +-
 ...ection-method-findOneAndDelete-option.yaml |   2 +-
 ...ction-method-findOneAndReplace-option.yaml |  18 ++-
 ...ection-method-findOneAndUpdate-option.yaml |  14 +--
 ...DBCollection-method-insertMany-option.yaml |   2 +-
 ...oDBCollection-method-insertMany-param.yaml |   2 +-
 ...oDBCollection-method-insertOne-option.yaml |   2 +-
 ...goDBCollection-method-insertOne-param.yaml |   2 +-
 ...DBCollection-method-replaceOne-option.yaml |   2 +-
 ...DBCollection-method-updateMany-option.yaml |   2 +-
 ...oDBCollection-method-updateOne-option.yaml |   2 +-
 ...BCollection-method-withOptions-option.yaml |   2 +-
 source/includes/apiargs-common-option.yaml    |   2 +-
 source/includes/apiargs-common-param.yaml     |   8 +-
 source/includes/example-insertOne.rst         |  64 ----------
 .../extracts-bson-deserialization-base.yaml   |  11 +-
 .../extracts-bson-deserialization.yaml        |   6 +-
 .../method/MongoDBCollection-aggregate.txt    |  57 ++++-----
 .../method/MongoDBCollection-bulkWrite.txt    |  31 ++---
 .../method/MongoDBCollection-count.txt        |  22 ++--
 .../method/MongoDBCollection-createIndex.txt  | 109 ++++++++---------
 .../MongoDBCollection-createIndexes.txt       |  95 +++++++--------
 .../method/MongoDBCollection-deleteMany.txt   |  32 +++--
 .../method/MongoDBCollection-deleteOne.txt    |  36 +++---
 .../method/MongoDBCollection-distinct.txt     |  57 ++++-----
 .../method/MongoDBCollection-drop.txt         |  58 +++++----
 .../method/MongoDBCollection-dropIndex.txt    |  56 +++++----
 .../method/MongoDBCollection-dropIndexes.txt  |  56 +++++----
 .../method/MongoDBCollection-find.txt         |  70 ++++++-----
 .../method/MongoDBCollection-findOne.txt      |  98 ++++++++--------
 .../MongoDBCollection-findOneAndDelete.txt    |  69 ++++++-----
 .../MongoDBCollection-findOneAndReplace.txt   |  79 +++++++------
 .../MongoDBCollection-findOneAndUpdate.txt    |  92 +++++++++------
 .../MongoDBCollection-getCollectionName.txt   |  35 ++++--
 .../MongoDBCollection-getDatabaseName.txt     |  36 ++++--
 .../method/MongoDBCollection-getManager.txt   |   2 +-
 .../method/MongoDBCollection-getNamespace.txt |  37 +++---
 .../method/MongoDBCollection-insertMany.txt   |  72 ++++++------
 .../method/MongoDBCollection-insertOne.txt    |  68 +++++++----
 .../method/MongoDBCollection-listIndexes.txt  |  50 ++++----
 .../method/MongoDBCollection-replaceOne.txt   | 104 ++++++-----------
 .../method/MongoDBCollection-updateMany.txt   | 107 ++++++-----------
 .../method/MongoDBCollection-updateOne.txt    | 110 ++++++------------
 .../method/MongoDBCollection-withOptions.txt  |  41 ++++---
 .../method/MongoDBCollection__construct.txt   |  30 ++---
 source/tutorial/crud.txt                      |  13 ++-
 63 files changed, 1037 insertions(+), 1128 deletions(-)
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
 delete mode 100644 source/includes/example-insertOne.rst

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 8804e887..38f00c4c 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -2,9 +2,9 @@ arg_name: option
 name: allowDiskUse
 type: boolean
 description: |
-  Enables writing to temporary files. When set to true, aggregation
-  stages can write data to the ``_tmp`` sub-directory in the dbPath
-  directory. The default is ``false``.
+  Enables writing to temporary files. When set to ``true``, aggregation stages
+  can write data to the ``_tmp`` sub-directory in the dbPath directory.
+  The default is ``false``.
 interface: phpmethod
 operation: MongoDB\\Collection::aggregate
 optional: true
@@ -21,53 +21,63 @@ optional: true
 position: 2
 ---
 source:
-  ref: bypassDocumentValidation
   file: apiargs-common-option.yaml
+  ref: bypassDocumentValidation
 operation: MongoDB\\Collection::aggregate
-position: 5
+position: 3
 ---
 source:
-  ref: maxTimeMS
   file: apiargs-common-option.yaml
+  ref: maxTimeMS
 operation: MongoDB\\Collection::aggregate
 position: 4
 ---
 source:
-  ref: readConcern
   file: apiargs-common-option.yaml
-operation: MongoDB\\Collection::selectDatabase
+  ref: readConcern
+operation: MongoDB\\Collection::aggregate
+position: 5
 replacement:
   resource: "aggregation"
-position: 5
+  parent: "collection"
 ---
 source:
-  ref: readPreference
   file: apiargs-common-option.yaml
-operation: MongoDB\\Collection::selectDatabase
+  ref: readPreference
+operation: MongoDB\\Collection::aggregate
+position: 6
 replacement:
   resource: "aggregation"
-position: 6
+  parent: "collection"
 ---
 source:
-  ref: typeMap
   file: apiargs-common-option.yaml
-operation: MongoDB\\Collection::selectDatabase
+  ref: typeMap
+operation: MongoDB\\Collection::aggregate
 position: 7
+description: |
+  Type map for BSON deserialization. This will be applied to the returned
+  cursor. Defaults to the collections's type map.
+
+  .. note::
+
+     This is not supported for inline aggregation results (i.e. ``useCursor``
+     option is ``false`` or the server version is < 2.6).
 ---
 arg_name: param
 name: useCursor
 type: boolean
 description: |
-  Indicates whether the command will request that the server provide
-  results using a cursor. The default is ``true``.
+  Indicates whether the command will request that the server provide results
+  using a cursor. The default is ``true``.
 
-  For MongoDB version 2.6 or later, ``useCursor`` allows users to turn
-  off cursors if necessary to aid in mongod/mongos upgrades.
+  For MongoDB version 2.6 or later, ``useCursor`` allows users to turn off
+  cursors if necessary to aid in replica set or shard cluster upgrades.
 
-  ``useCursor`` is ignored for MongoDB versions prior to 2.6 as
-  aggregation cursors are not available pre-2.6.
+  ``useCursor`` is ignored for MongoDB versions prior to 2.6 as aggregation
+  cursors are not available.
 interface: phpmethod
 operation: MongoDB\\Collection::aggregate
 optional: true
-position: 8  
+position: 8
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
index b7fdfb88..65433abb 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
@@ -2,15 +2,15 @@ arg_name: param
 name: $pipeline
 type: array
 description: |
-  Specifies an :manual:`aggregation pipeline ` operation.
+  Specifies an :manual:`aggregation pipeline `
+  operation.
 interface: phpmethod
 operation: MongoDB\\Collection::aggregate
-optional: true
 position: 1
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
+  ref: $options
 operation: MongoDB\\Collection::aggregate
 position: 2
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
index 93cec712..afc90708 100644
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
@@ -1,6 +1,6 @@
 source:
-  ref: bypassDocumentValidation
   file: apiargs-common-option.yaml
+  ref: bypassDocumentValidation
 operation: MongoDB\\Collection::bulkWrite
 position: 1
 ---
@@ -8,23 +8,24 @@ arg_name: option
 name: ordered
 type: boolean
 description: |
-  If ``true``: when an insert fails, the operation returns without performing the
-  remaining writes. 
-  
-  If ``false``: when a write fails, the operation will continue with the
-  remaining writes, if any. 
-  
+  If ``true``: when a single write fails, the operation returns without
+  performing the remaining writes.
+
+  If ``false``: when a single write fails, the operation will continue with the
+  remaining writes, if any.
+
   The default is ``true``.
-optional: true
 interface: phpmethod
 operation: MongoDB\\Collection::bulkWrite
+optional: true
 position: 2
 ---
 source:
-  ref: writeConcern
   file: apiargs-common-option.yaml
+  ref: writeConcern
 operation: MongoDB\\Collection::bulkWrite
 replacement:
   resource: "write"
+  parent: "collection"
 position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
index f9996c2d..7f115862 100644
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
@@ -2,17 +2,18 @@ arg_name: param
 name: $operations
 type: array
 description: |
-  An array containing the write operations to perform. {{role}}
-  supports :phpmethod:`deleteMany `,
-  :phpmethod:`deleteOne `, :phpmethod:`insertOne
-  `, :phpmethod:`replaceOne
-  `, :phpmethod:`updateMany
-  `, and :phpmethod:`updateOne
-  ` operations in the following array
-  structure:
-    
+  An array containing the write operations to perform.
+  :phpmethod:`MongoDB\\Collection::bulkWrite()` supports
+  :phpmethod:`deleteMany() `,
+  :phpmethod:`deleteOne() `,
+  :phpmethod:`insertOne() `,
+  :phpmethod:`replaceOne() `,
+  :phpmethod:`updateMany() `, and
+  :phpmethod:`updateOne() ` operations in the
+  following array structure:
+
   .. code-block:: php
-  
+
      [
          [ 'deleteMany' => [ $filter ] ],
          [ 'deleteOne'  => [ $filter ] ],
@@ -22,18 +23,19 @@ description: |
          [ 'updateOne'  => [ $filter, $update, $options ] ],
      ]
 post: |
-  Arguments correspond to the respective operation methods. However,
-  the ``writeConcern`` option is specified for the top-level bulk write
-  operation instead of each individual operation.
+  Arguments correspond to the respective operation methods. However, the
+  ``writeConcern`` option is specified as a top-level option to
+  :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
+  operation.
 interface: phpmethod
 operation: MongoDB\\Collection::bulkWrite
 optional: true
 position: 1
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
+  ref: $options
 operation: MongoDB\\Collection::bulkWrite
 interface: phpmethod
 position: 2
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
new file mode 100644
index 00000000..006a71eb
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
@@ -0,0 +1,49 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: readConcern
+operation: MongoDB\\Collection::__construct
+position: 1
+replacement:
+  resource: "collection"
+  parent: "manager"
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: readPreference
+operation: MongoDB\\Collection::__construct
+position: 2
+replacement:
+  resource: "collection"
+  parent: "manager"
+---
+arg_name: option
+name: typeMap
+type: array
+description: |
+  Default :php:`type map
+  `
+  to apply to cursors. The type map determines how BSON documents are converted
+  to PHP values which determines. The |php-library| uses the following type map
+  by default:
+
+  .. code-block:: php
+
+     [
+         'array' => 'MongoDB\Model\BSONArray',
+         'document' => 'MongoDB\Model\BSONDocument',
+         'root' => 'MongoDB\Model\BSONDocument',
+     ]
+interface: phpmethod
+operation: MongoDB\\Collection::__construct
+optional: true
+position: 3
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: writeConcern
+operation: MongoDB\\Collection::__construct
+position: 4
+replacement:
+  resource: "collection"
+  parent: "manager"
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml b/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
index 7c2ecfd6..d72ed636 100644
--- a/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
@@ -1,34 +1,24 @@
-arg_name: param
-name: $manager
-type: :php:`MongoDB\\Driver\\Manager `
-description: |
-  The :php:`Manager ` instance from the driver.
-  The manager maintains connections between the driver and your MongoDB
-  instances.
-interface: phpmethod
+source:
+  file: apiargs-common-param.yaml
+  ref: $manager
 operation: MongoDB\\Collection::__construct
-optional: false
 position: 1
 ---
 source:
-  ref: $databaseName
   file: apiargs-common-param.yaml
+  ref: $databaseName
 operation: MongoDB\\Collection::__construct
-replacement:
-  select: ""
 position: 2
 ---
 source:
-  ref: $collectionName
   file: apiargs-common-param.yaml
+  ref: $collectionName
 operation: MongoDB\\Collection::__construct
-replacement:
-  select: ""
 position: 3
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
+  ref: $options
 operation: MongoDB\\Collection::__construct
 position: 4
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
index 36cc82cb..098e9d21 100644
--- a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
@@ -1,12 +1,12 @@
 arg_name: option
 name: hint
-type: string or array|object
+type: string|array|object
 description: |
-  The index to use. If you specify a document, it is interpreted as
-  an index specification and a name will be generated.
-optional: true
+  The index to use. If you specify a document, it is interpreted as an index
+  specification and a name will be generated.
 interface: phpmethod
 operation: MongoDB\\Collection::count
+optional: true
 position: 1
 ---
 arg_name: option
@@ -14,14 +14,14 @@ name: limit
 type: integer
 description: |
   The maximum number of documents to return.
-optional: true
 interface: phpmethod
 operation: MongoDB\\Collection::count
+optional: true
 position: 2
 ---
 source:
-  ref: maxTimeMS
   file: apiargs-common-option.yaml
+  ref: maxTimeMS
 operation: MongoDB\\Collection::count
 position: 3
 ---
@@ -31,6 +31,7 @@ source:
 operation: MongoDB\\Collection::count
 replacement:
   resource: "count"
+  parent: "collection"
 position: 4
 ---
 source:
@@ -38,6 +39,7 @@ source:
   file: apiargs-common-option.yaml
 replacement:
   resource: "count"
+  parent: "collection"
 position: 5
 ---
 arg_name: option
@@ -45,8 +47,8 @@ name: skip
 type: integer
 description: |
   The number of documents to skip before returning the documents.
-optional: true
 interface: phpmethod
 operation: MongoDB\\Collection::count
+optional: true
 position: 6
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-param.yaml b/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
index bc666678..75f281d8 100644
--- a/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
@@ -1,12 +1,12 @@
 source:
-  ref: $filter
   file: apiargs-common-param.yaml
+  ref: $filter
 operation: MongoDB\\Collection::count
 position: 1
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
+  ref: $options
 operation: MongoDB\\Collection::count
 position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
index 1c22e6e8..65b38892 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
@@ -41,9 +41,9 @@ position: 4
 arg_name: option
 name: name
 type: string
-description: |  
-  Specifies the name for the index. By default, MongoDB creates index
-  names based on the key.
+description: |
+  Specifies the name for the index. By default, MongoDB creates index names
+  based on the key.
 interface: phpmethod
 operation: MongoDB\\Collection::createIndex
 optional: true
@@ -52,7 +52,7 @@ position: 5
 arg_name: option
 name: background
 type: string
-description: |  
+description: |
   Instructs MongoDB to build the index :manual:`as a background
   ` process.
 interface: phpmethod
@@ -64,36 +64,20 @@ arg_name: option
 name: 2dsphereIndexVersion
 type: integer
 description: |
-  Specifies the :manual:`version of a 2dsphere ` index
-  to create.
+  Specifies the :manual:`version of a 2dsphere ` index to
+  create.
 
-  MongoDB 2.6 introduced version 2 of 2dsphere indexes. Version 2 is
-  the default version of 2dsphere indexes created in MongoDB 2.6 and
-  later series. ``2dsphereIndexVersion`` enables you to overrride the
-  default version 2.
+  MongoDB 2.6 introduced version 2 of 2dsphere indexes. Version 2 is the default
+  version of 2dsphere indexes created in MongoDB 2.6 and later versions.
+  ``2dsphereIndexVersion`` enables you to overrride the default version 2.
 interface: phpmethod
 operation: MongoDB\\Collection::createIndex
 optional: true
 position: 7
 ---
-arg_name: option
-name: socketTimeoutMS
-type: integer
-description: |
-  Specifies the time limit, in milliseconds, for socket
-  communication. If the :program:`mongod` does not respond within the
-  timeout period, a ``MongoCursorTimeoutException`` is thrown and
-  there will be no way to determine if the server actually handled the
-  write or not. Specify ``-1`` to block indefinitely. The default value
-  is 30000 (30 seconds).
-interface: phpmethod
-operation: MongoDB\\Collection::createIndex
-optional: true
-position: 8
----
 source:
   ref: maxTimeMS
   file: apiargs-common-option.yaml
 operation: MongoDB\\Collection::createIndex
-position: 9
+position: 8
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
index 23a75281..5d1d0deb 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
@@ -3,14 +3,13 @@ name: $key
 type: array|object
 description: |
   Specifies the field or fields to index and the index order.
-  
-  For example, the following specifies a descending index
-  on the ``username`` field:
-  
+
+  For example, the following specifies a descending index on the ``username``
+  field:
+
   .. code-block:: php
-  
-     $key = [ 'username' => -1 ];
 
+     [ 'username' => -1 ]
 operation: MongoDB\\Collection::createIndex
 interface: phpmethod
 optional: false
@@ -21,4 +20,4 @@ source:
   ref: $options
 operation: MongoDB\\Collection::createIndex
 position: 2
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
index a73e6b98..5286e3d4 100644
--- a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
@@ -3,4 +3,4 @@ source:
   ref: typeMap
 operation: MongoDB\\Collection::drop
 position: 1
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
index 8f0f8afd..8d7bb4a3 100644
--- a/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
@@ -4,4 +4,4 @@ source:
 interface: phpmethod
 operation: MongoDB\\Collection::drop
 position: 1
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
index a88f9759..ba694f7f 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
@@ -3,4 +3,4 @@ source:
   ref: typeMap
 operation: MongoDB\\Collection::dropIndex
 position: 1
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
index 85a6b386..316f5caa 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
@@ -16,4 +16,4 @@ source:
 interface: phpmethod
 operation: MongoDB\\Collection::dropIndex
 position: 2
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
index 1b228492..a7284fa0 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
@@ -3,4 +3,4 @@ source:
   ref: typeMap
 operation: MongoDB\\Collection::dropIndexes
 position: 1
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
index db7a73d8..02215c56 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
@@ -3,4 +3,4 @@ source:
   ref: $options
 operation: MongoDB\\Collection::dropIndexes
 position: 1
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index 4ccc8aea..bcd01a65 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -16,7 +16,7 @@ description: |
    which fields to include in the returned documents. See
    :manual:`Project Fields to Return from Query
    ` in the MongoDB
-   manual.   
+   manual.
 arg_name: field
 operation: MongoDB\\Collection::find
 interface: phpmethod
@@ -74,12 +74,11 @@ arg_name: option
 name: cursorType
 type: integer
 description: |
-  Indicates the type of cursor to use. The cursor types are
-  ``MongoDB\Operation\Find`` class constants. 
-  
-  Must be either
-  ``NON_TAILABLE``, ``TAILABLE``, or ``TAILABLE_AWAIT``. The default is
-  ``NON_TAILABLE``.
+   Indicates the type of cursor to use. ``cursorType`` supports the following
+   values:
+
+   - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
+   - ``MongoDB\Operation\Find::TAILABLE``
 interface: phpmethod
 operation: MongoDB\\Collection::find
 optional: true
@@ -109,16 +108,16 @@ name: oplogReplay
 type: boolean
 optional: true
 description: |
-  Internal use for replica sets. To use oplogReplay, you must include
-  the following condition in the filter:
+   Internal use for replica sets. To use oplogReplay, you must include
+   the following condition in the filter:
+
+   .. code-block:: javascript
 
-  .. code-block:: javascript
+      { ts: { $gte:  } }
 
-     { ts: { $gte:  } }
-     
-  The :php:`MongoDB\\BSON\\Timestamp `
-  class reference describes how to represent MongoDB's BSON
-  timestamp type with PHP.
+   The :php:`MongoDB\\BSON\\Timestamp `
+   class reference describes how to represent MongoDB's BSON
+   timestamp type with PHP.
 arg_name: field
 operation: MongoDB\\Collection::find
 interface: phpmethod
@@ -157,9 +156,9 @@ arg_name: option
 name: modifiers
 type: array
 description: |
-  Meta-operators that modify the output or behavior of a query.
-  :manual:`Cursor Methods  describes the
-  query modification methods available in MongoDB.
+   Meta-operators that modify the output or behavior of a query.
+   :manual:`Cursor Methods  describes the
+   query modification methods available in MongoDB.
 interface: phpmethod
 operation: MongoDB\\Collection::find
 optional: true
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
index 751cb510..425b19e2 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
@@ -53,4 +53,4 @@ source:
   ref: typeMap
 operation: MongoDB\\Collection::findOne
 position: 9
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
index ba3e662e..f75b78c3 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
@@ -21,4 +21,4 @@ source:
   ref: writeConcern
 operation: MongoDB\\Collection::findOneAndDelete
 position: 4
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
index 670465bc..11cacf60 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
@@ -22,10 +22,18 @@ source:
 operation: MongoDB\\Collection::findOneAndReplace
 position: 4
 ---
-source:
-  file: apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
-  ref: returnDocument
-operation: MongoDB\\Collection::findOneAndReplace
+arg_name: option
+name: returnDocument
+type: integer
+description: |
+  Specifies whether to return the document before the replacementi applied, or
+  after. ``returnDocument`` supports the following values:
+
+  - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*)
+  - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
+interface: phpmethod
+operation: MongoDB\Collection::findOneAndUpdate
+optional: true
 position: 5
 ---
 source:
@@ -39,4 +47,4 @@ source:
   ref: writeConcern
 operation: MongoDB\\Collection::findOneAndReplace
 position: 7
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
index b4b550e0..3dcd30fa 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
@@ -26,16 +26,14 @@ arg_name: option
 name: returnDocument
 type: integer
 description: |
-  Specifies whether to return the document before the {{event}}, or
+  Specifies whether to return the document before the update is applied, or
   after. ``returnDocument`` supports the following values:
-  
-  - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*)
-  - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
-optional: true
-replacement:
-  event: "update is applied"
+
+  - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*)
+  - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
 interface: phpmethod
 operation: MongoDB\Collection::findOneAndUpdate
+optional: true
 position: 5
 ---
 source:
@@ -49,4 +47,4 @@ source:
   ref: writeConcern
 operation: MongoDB\Collection::findOneAndUpdate
 position: 7
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
index a037bead..01330fcf 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
@@ -15,4 +15,4 @@ source:
   ref: writeConcern
 operation: MongoDB\\Collection::insertMany
 position: 3
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
index dc307700..35d8f609 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
@@ -13,4 +13,4 @@ source:
   ref: $options
 operation: MongoDB\\Collection::insertMany
 position: 2
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
index 2195625f..33b3cb9a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
@@ -9,4 +9,4 @@ source:
   ref: writeConcern
 operation: MongoDB\\Collection::insertOne
 position: 2
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
index 2b0b77e9..1ab57000 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
@@ -13,4 +13,4 @@ source:
   ref: $options
 operation: MongoDB\\Collection::insertOne
 position: 2
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
index 8b81b920..09ca49f3 100644
--- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
@@ -15,4 +15,4 @@ source:
   ref: writeConcern
 operation: MongoDB\\Collection::replaceOne
 position: 3
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
index e432a263..128c8ea2 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
@@ -15,4 +15,4 @@ source:
   ref: writeConcern
 operation: MongoDB\\Collection::updateMany
 position: 3
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
index 75670747..80ce3e62 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
@@ -15,4 +15,4 @@ source:
   ref: writeConcern
 operation: MongoDB\\Collection::updateOne
 position: 3
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
index ec3bb573..53128b2d 100644
--- a/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
@@ -29,4 +29,4 @@ operation: MongoDB\\Collection::withOptions
 description: |
   The default write concern to use for collection operations. Defaults
   to the original Collection's specified write concern.
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml
index 7790e79f..c3709b4b 100644
--- a/source/includes/apiargs-common-option.yaml
+++ b/source/includes/apiargs-common-option.yaml
@@ -93,4 +93,4 @@ optional: true
 interface: phpmethod
 operation: MongoDB\\Collection::findOneAndUpdate
 position: 7
-...
\ No newline at end of file
+...
diff --git a/source/includes/apiargs-common-param.yaml b/source/includes/apiargs-common-param.yaml
index 0bc0f7a2..397aff3f 100644
--- a/source/includes/apiargs-common-param.yaml
+++ b/source/includes/apiargs-common-param.yaml
@@ -15,7 +15,7 @@ type: string
 description: |
   The name of the database{{action}}.
 interface: phpmethod
-operation: selectCollection
+operation: ~
 optional: false
 replacement:
   action: ""
@@ -27,7 +27,7 @@ type: string
 description: |
   The name of the collection{{action}}.
 interface: phpmethod
-operation: selectCollection
+operation: ~
 optional: false
 replacement:
   action: ""
@@ -39,7 +39,7 @@ type: array
 description: |
   An array specifying the desired options.
 interface: phpmethod
-operation: selectCollection
+operation: ~
 optional: true
 position: 3
 ---
@@ -49,7 +49,7 @@ type: array|object
 description: |
   The filter criteria that specifies the documents to {{verb}}.
 interface: phpmethod
-operation: count
+operation: ~
 optional: false
 position: 4
 replacement:
diff --git a/source/includes/example-insertOne.rst b/source/includes/example-insertOne.rst
deleted file mode 100644
index 85c68aa2..00000000
--- a/source/includes/example-insertOne.rst
+++ /dev/null
@@ -1,64 +0,0 @@
-.. code-block:: php
-                
-   selectCollection('users','restaurants');
-
-   $newUser = $collection->insertOne(
-       [
-           'username' => 'admin',
-           'email' => 'admin@example.com',
-           'name' => 'Anna Bennett'
-       ],
-   );
-
-   echo "
";
-   var_dump($newUser);
-
-The output would resemble:
-
-.. code-block:: none
-                
-   object(MongoDB\InsertOneResult)#13 (3) {
-     ["writeResult":"MongoDB\InsertOneResult":private]=>
-     object(MongoDB\Driver\WriteResult)#12 (9) {
-       ["nInserted"]=>
-       int(1)
-       ["nMatched"]=>
-       int(0)
-       ["nModified"]=>
-       int(0)
-       ["nRemoved"]=>
-       int(0)
-       ["nUpserted"]=>
-       int(0)
-       ["upsertedIds"]=>
-       array(0) {
-       }
-       ["writeErrors"]=>
-       array(0) {
-       }
-       ["writeConcernError"]=>
-       NULL
-       ["writeConcern"]=>
-       array(4) {
-         ["w"]=>
-         NULL
-         ["wmajority"]=>
-         bool(false)
-         ["wtimeout"]=>
-         int(0)
-         ["journal"]=>
-         NULL
-       }
-     }
-     ["insertedId":"MongoDB\InsertOneResult":private]=>
-     object(MongoDB\BSON\ObjectID)#11 (1) {
-       ["oid"]=>
-       string(24) "577282631f417d1823121691"
-     }
-     ["isAcknowledged":"MongoDB\InsertOneResult":private]=>
-     bool(true)
-   }
\ No newline at end of file
diff --git a/source/includes/extracts-bson-deserialization-base.yaml b/source/includes/extracts-bson-deserialization-base.yaml
index d66954d4..26712a37 100644
--- a/source/includes/extracts-bson-deserialization-base.yaml
+++ b/source/includes/extracts-bson-deserialization-base.yaml
@@ -1,13 +1,12 @@
 ref: _bson-deserialization
 content: |
   .. note::
-      
-      {{method}} does not
-      yet support a ``typeMap`` option for BSON deserialization of the
-      returned document. 
-      
+
+      {{method}} does not yet support a ``typeMap`` option for BSON
+      deserialization of the returned document.
+
       Classes implementing
       :php:`MongoDB\\BSON\\Persistable `
       are deserialized according to the :php:`persistance
       ` specification.
-...
\ No newline at end of file
+...
diff --git a/source/includes/extracts-bson-deserialization.yaml b/source/includes/extracts-bson-deserialization.yaml
index 3d5bfacc..6b665352 100644
--- a/source/includes/extracts-bson-deserialization.yaml
+++ b/source/includes/extracts-bson-deserialization.yaml
@@ -3,19 +3,19 @@ source:
   file: extracts-bson-deserialization-base.yaml
   ref: _bson-deserialization
 replacement:
-  method: ":phpmethod:`MongoDB\\Collection::findOneAndDelete`"
+  method: ":phpmethod:`MongoDB\\Collection::findOneAndDelete()`"
 ---
 ref: bson-deserialization-findOneAndReplace
 source:
   file: extracts-bson-deserialization-base.yaml
   ref: _bson-deserialization
 replacement:
-  method: ":phpmethod:`MongoDB\\Collection::findOneAndReplace`"
+  method: ":phpmethod:`MongoDB\\Collection::findOneAndReplace()`"
 ---
 ref: bson-deserialization-findOneAndUpdate
 source:
   file: extracts-bson-deserialization-base.yaml
   ref: _bson-deserialization
 replacement:
-  method: ":phpmethod:`MongoDB\\Collection::findOneAndUpdate`"
+  method: ":phpmethod:`MongoDB\\Collection::findOneAndUpdate()`"
 ...
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index 480481c8..e15f1a14 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::aggregate()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::aggregate($pipeline, $options)
+.. phpmethod:: MongoDB\\Collection::aggregate()
 
    Executes an :manual:`aggregation framework pipeline
    ` operation on the collection.
@@ -21,46 +21,47 @@ Definition
    .. code-block:: php
 
       function aggregate(array $pipeline, array $options = []): Traversable
-      
-   :phpmethod:`MongoDB\\Collection::aggregate` has the following
-   parameters:
+
+   :phpmethod:`MongoDB\\Collection::aggregate()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-param.rst
-   
-   :phpmethod:`MongoDB\\Collection::aggregate` supports the following
-   options:
+
+   The ``$options`` parameter supports the following options:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-option.rst
 
-.. _php-agg-method-output:
+   :returns:
+
+      A :php:`MongoDB\\Driver\\Cursor ` or
+      :php:`ArrayIterator ` object. In both cases, the return
+      value will be :php:`Traversable `.
 
-Output
-------
+.. _php-agg-method-behavior:
 
-:phpmethod:`MongoDB\\Collection::aggregate`'s return value depends on
-the MongoDB server version and whether the ``useCursor`` option is
-specified. If ``useCursor`` is true,
-:phpmethod:`MongoDB\\Collection::aggregate` returns a
-``MongoDB\Driver\Cursor`` object. If ``useCursor`` is false,
-:phpmethod:`MongoDB\\Collection::aggregate` returns an
-``ArrayIterator`` that wraps the ``result`` array from the command
-response document.
+Behavior
+--------
+
+:phpmethod:`MongoDB\\Collection::aggregate()`'s return value depends on the
+MongoDB server version and whether the ``useCursor`` option is specified. If
+``useCursor`` is ``true``, a :php:`MongoDB\\Driver\\Cursor
+` object is returned. If ``useCursor`` is
+``false``, an :php:`ArrayIterator ` is returned that wraps the
+``result`` array from the command response document. In both cases, the return
+value will be :php:`Traversable `.
 
 .. note::
 
-   BSON deserialization of inline aggregation results (i.e. not using a
-   command cursor) does not yet support a ``typeMap`` option. Classes
-   implementing :php:`MongoDB\\BSON\\Persistable
-   ` will still be deserialized according to
-   the :php:`Persistence `
-   specification.
+   BSON deserialization of inline aggregation results (i.e. not using a command
+   cursor) does not yet support a ``typeMap`` option. Classes implementing
+   :php:`MongoDB\\BSON\\Persistable ` will still be
+   deserialized according to the
+   :php:`Persistence ` specification.
 
 .. todo: add examples
 
 .. seealso::
 
-   - :manual:`aggregate command reference
-     ` in the MongoDB manual and
-
+   - :manual:`aggregate ` command reference in the
+     MongoDB manual
    - :manual:`Aggregation Pipeline `
-     documentation in the MongoDB Manual.
+     documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index db8c714f..05336a5a 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::bulkWrite()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::bulkWrite($operations, $options)
+.. phpmethod:: MongoDB\\Collection::bulkWrite()
 
    Executes multiple write operations.
 
@@ -21,24 +21,29 @@ Definition
 
       function bulkWrite(array $operations, array $options = []): MongoDB\BulkWriteResult
 
-   :phpmethod:`MongoDB\\Collection::bulkWrite` has the following
-   parameters:
+   :phpmethod:`MongoDB\\Collection::bulkWrite()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-param.rst
-   
-   :phpmethod:`MongoDB\\Collection::bulkWrite` supports the following
-   options:
+
+   The ``$options`` parameter supports the following options:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-option.rst
 
+   :returns:
+
+      A :phpclass:`MongoDB\\BulkWriteResult` object, which encapsulates a
+      :php:`MongoDB\\Driver\\WriteResult `
+      object.
+
 .. todo: add output and examples
 
 .. seealso::
-   
-   - :phpmethod:`deleteMany `
-   - :phpmethod:`deleteOne ` 
-   - :phpmethod:`insertOne `
-   - :phpmethod:`replaceOne `
-   - :phpmethod:`updateMany `
-   - :phpmethod:`updateOne `
+
+   - :phpmethod:`MongoDB\\Collection::deleteMany()`
+   - :phpmethod:`MongoDB\\Collection::deleteOne()`
+   - :phpmethod:`MongoDB\\Collection::insertMany()`
+   - :phpmethod:`MongoDB\\Collection::insertOne()`
+   - :phpmethod:`MongoDB\\Collection::replaceOne()`
+   - :phpmethod:`MongoDB\\Collection::updateMany()`
+   - :phpmethod:`MongoDB\\Collection::updateOne()`
    - :doc:`/tutorial/crud`
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 49c5767f..4917ed00 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -13,27 +13,29 @@ MongoDB\\Collection::count()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::count($filter, $options)
+.. phpmethod:: MongoDB\\Collection::count()
 
-   Counts the number of documents that match filter criteria.
+   Count the number of documents that match the filter criteria.
 
    .. code-block:: php
 
       function count($filter = [], array $options = []): integer
 
-   :phpmethod:`MongoDB\\Collection::count` has the following
-   parameters:
+   :phpmethod:`MongoDB\\Collection::count()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-count-param.rst
-   
-   :phpmethod:`MongoDB\\Collection::count` supports the following
-   options:
+
+   The ``$options`` parameter supports the following options:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-count-option.rst
 
+   :returns:
+
+      The number of documents matching the filter criteria.
+
 .. todo: add output and examples
 
 .. seealso::
-   
-   - :manual:`count command reference `
-     in the MongoDB manual.
+
+   - :manual:`count ` command reference in the MongoDB
+     manual
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index 85c0b244..fb5d1781 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -9,99 +9,92 @@ MongoDBCollection::createIndex()
    :backlinks: none
    :depth: 1
    :class: singlecol
-                    
+
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::createIndex($key, $options)
-               
+.. phpmethod:: MongoDB\\Collection::createIndex()
+
    Create an index for the collection.
-   
+
    .. code-block:: php
-                   
+
       function createIndex($key, array $options = []): string
 
-   ``createIndex()`` accepts the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::createIndex()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-param.rst
 
-   The ``$options`` parameter accepts all index options that your
-   MongoDB version supports. MongoDB 3.2 includes the following options:
-                
+   The ``$options`` parameter accepts all index options that your MongoDB
+   version supports. MongoDB 3.2 includes the following options:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst
 
-   For a full list of the supported index creation options, refer to
-   the :manual:`createIndexes `
-   command reference in the MongoDB manual.
+   For a full list of the supported index creation options, refer to the
+   :manual:`createIndexes ` command reference
+   in the MongoDB manual.
 
-Output
-------
+   :returns:
+
+      The name of the created index as a string.
 
-Returns the name of the created index as a string.
-                
 Examples
 --------
 
 Create a Compound Index
 ~~~~~~~~~~~~~~~~~~~~~~~
 
-The following operation creates a :manual:`compound index
-` on the ``borough`` and ``cuisine`` fields
-in the ``restaurants`` collection.
+The following example creates a :manual:`compound index `
+on the ``borough`` and ``cuisine`` fields in the ``restaurants`` collection in
+the ``example`` database.
 
 .. code-block:: php
-                
-   selectCollection('example','restaurants');
+    1, 'cuisine' => 1];
+   $collection = (new MongoDB\Client)->selectCollection('example', 'restaurants');
 
-   $indexString = $collection->createIndex($keys, ['name' => 'compound']);
+   $indexName = $collection->createIndex(['borough' => 1, 'cuisine' => 1]);
 
-   var_dump($indexString);
+   var_dump($indexName);
 
-The output would resemble the following:
+The output would then resemble::
 
-.. code-block:: none
-                
-   string(8) "compound"
+   string(19) "borough_1_cuisine_1"
 
 Create a Partial Index
 ~~~~~~~~~~~~~~~~~~~~~~
 
-The following operation adds a :manual:`partial index
-` on the ``borough`` field in the ``restaurants``
-collection in the ``example`` database. The partial index indexes only
-fields where the ``borough`` field exists.
+The following example adds a :manual:`partial index ` on
+the ``borough`` field in the ``restaurants`` collection in the ``example``
+database. The partial index indexes only documents where the ``borough`` field
+exists.
 
 .. code-block:: php
-                
+
    selectCollection('example','restaurants');
-
-   $indexString = $collection->createIndex(
-      ['borough' => 1], 
-      ['partialFilterExpression'=>
-         ['borough'=>
-            ['$exists'=>true]
-   ]]);
-   
-   var_dump($indexString);
-
-The output would resemble::
-                
+
+   $collection = (new MongoDB\Client)->selectCollection('example, 'restaurants');
+
+   $indexName = $collection->createIndex(
+      ['borough' => 1],
+      [
+          'partialFilterExpression' => [
+              'borough' => ['$exists' => true],
+          ],
+      ]
+   );
+
+   var_dump($indexName);
+
+The output would then resemble::
+
    string(9) "borough_1"
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::createIndexes`
+
+   - :phpmethod:`MongoDB\\Collection::createIndexes()`
    - :doc:`/tutorial/indexes`
-   - :manual:`createIndexes ` 
-     command reference in the MongoDB manual
-   - :manual:`Index documentation `
+   - :manual:`createIndexes ` command
+     reference in the MongoDB manual
+   - :manual:`Index ` documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index 6fc65ac1..0d25e7d1 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -9,78 +9,69 @@ MongoDBCollection::createIndexes()
    :backlinks: none
    :depth: 1
    :class: singlecol
-                    
+
 Definition
 ----------
 
 .. phpmethod:: MongoDB\\Collection::createIndexes($indexes)
-               
+
    Create one or more indexes for the collection.
-   
+
    .. code-block:: php
 
       function createIndexes(array $indexes): string[]
 
-   ``createIndex()`` has one parameter: ``$indexes``, which is an array
-   or object.
-   Each element in the ``$indexes`` array|object must have a
-   "``key`` document" that specifies the fields to index and the
-   array direction or type. You can then specify index options as
-   additional key-value pairs in that element.
-
-   For example, the following ``$indexes`` parameter creates an ascending
-   unique index on the ``username`` field:
-   
-   .. code-block:: none
-                   
-      [ 'key' => ['username => 1 '], 'unique' => true ],
-   
-   The following ``$indexes`` parameter creates a 2dsphere index on the ``loc`` field and
-   specifies a custom index name:
-   
-   .. code-block:: none
-                   
-      [ 'key' => [ 'loc' => '2dsphere'], 'name' => 'geo_index' ],
-   
+   ``createIndex()`` has one parameter, ``$indexes``, which is an array. Each
+   element in ``$indexes`` must itself be an array that specifies an index. The
+   specification array requires a ``key`` field, which corresponds to the
+   ``$key`` parameter of :phpmethod:`MongoDB\\Collection::createIndex()`, and
+   may have other fields that correspond to options of
+   :phpmethod:`MongoDB\\Collection::createIndex()`.
+
+   For example, the following ``$indexes`` parameter creates two indexes. The
+   first is an ascending unique index on the ``username`` field and the second
+   is a 2dsphere index on the ``loc`` field with a custom name::
+
+      [
+          [ 'key' => [ 'username' => 1 ], 'unique' => true ],
+          [ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo_index' ],
+      ]
+
    You can specify any index options that your MongoDB version
    supports. MongoDB 3.2 includes the following options:
-                
+
    .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst
 
-   For a full list of the supported index creation options, refer to
-   the :manual:`createIndexes `
-   command reference in the MongoDB manual.
+   For a full list of the supported index creation options, refer to the
+   :manual:`createIndexes ` command reference
+   in the MongoDB manual.
+
+   :returns:
 
-Output
-------
+      The names of the created indexes as an array of strings.
 
-Returns the name of the created indexes as an array of strings.
-                
 Example
 -------
 
-The following creates two indexes on the ``restaurants`` collection in
-the ``example`` database. One index is a compound index on the
-``borough`` and ``cuisine`` fields and the other is 2dsphere index
-on the ``location`` field with a custom name.
+The following example creates two indexes on the ``restaurants`` collection in
+the ``example`` database. One index is a compound index on the ``borough`` and
+``cuisine`` fields and the other is 2dsphere index on the ``loc`` field with a
+custom name.
 
 .. code-block:: php
-                
+
    selectCollection('example','restaurants');
+   $collection = (new MongoDB\Client)->selectCollection('example', 'restaurants');
 
-   $index = $collection->createIndexes(
-       [ 
-           [ 'key' => [ 'borough' => 1, 'cuisine' => 1] ],
-           [ 'key' => [ 'location' => '2dsphere'], 'name' => 'geo_index'],
-       ]);
+   $indexNames = $collection->createIndexes([
+       [ 'key' => [ 'borough' => 1, 'cuisine' => 1] ],
+       [ 'key' => [ 'loc' => '2dsphere'], 'name' => 'geo_index' ],
+   ]);
 
-   var_dump($index);
+   var_dump($indexNames);
 
-The output would resemble the following::
+The output would then resemble::
 
    array(2) {
      [0]=>
@@ -90,9 +81,9 @@ The output would resemble the following::
    }
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::createIndex`
+
+   - :phpmethod:`MongoDB\\Collection::createIndex()`
    - :doc:`/tutorial/indexes`
-   - :manual:`createIndexes ` 
-     command reference in the MongoDB manual
-   - :manual:`Index documentation `
+   - :manual:`createIndexes ` command
+     reference in the MongoDB manual
+   - :manual:`Index ` documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index 29a2c882..2e12d307 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::deleteMany()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::deleteMany($filter, $options)
+.. phpmethod:: MongoDB\\Collection::deleteMany()
 
    Deletes all documents that match the filter criteria.
 
@@ -21,26 +21,25 @@ Definition
 
       function deleteMany($filter, array $options = []): MongoDB\DeleteResult
 
-   :phpmethod:`MongoDB\\Collection::deleteMany` has the following
-   parameters:
+   :phpmethod:`MongoDB\\Collection::deleteMany()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-param.rst
-   
-   :phpmethod:`MongoDB\\Collection::deleteMany` supports the following
-   options:
+
+   The ``$options`` parameter supports the following options:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-option.rst
 
-Output
-------
+   :returns:
 
-Returns a ``MongoDB\DeleteResult`` object.
+      A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
+      :php:`MongoDB\\Driver\\WriteResult `
+      object.
 
 Example
 -------
 
-The following operation deletes all of the documents in the ``users``
-collection that have ``ny`` as the value for the ``state`` field:
+The following example deletes all of the documents in the ``users`` collection
+that have ``"ny"`` as the value for the ``state`` field:
 
 .. code-block:: php
 
@@ -59,11 +58,10 @@ The output would then resemble::
 
    Deleted 2 document(s)
 
-
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::bulkWrite`
-   - :phpmethod:`MongoDB\\Collection::deleteOne`
+
+   - :phpmethod:`MongoDB\\Collection::deleteOne()`
+   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
    - :doc:`/tutorial/crud`
-   - :manual:`delete command reference ` matching document.
+   Deletes at most one document that matches the filter criteria. If multiple
+   documents match the filter criteria, only the :term:`first `
+   matching document will be deleted.
 
    .. code-block:: php
 
       function deleteOne($filter, array $options = []): MongoDB\DeleteResult
 
-   :phpmethod:`MongoDB\\Collection::deleteMany` has the following
-   parameters:
+   :phpmethod:`MongoDB\\Collection::deleteOne()` has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-param.rst
-   
-   :phpmethod:`MongoDB\\Collection::deleteMany` supports the following
-   options:
+
+   The ``$options`` parameter supports the following options:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-option.rst
 
-Output
-------
+   :returns:
 
-Returns a ``MongoDB\DeleteResult`` object.
+      A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
+      :php:`MongoDB\\Driver\\WriteResult `
+      object.
 
 Example
 -------
 
-The following operation deletes the first documents in the ``users``
-collection that has ``ny`` as the value for the ``state`` field:
+The following example deletes one document in the ``users`` collection that has
+has ``"ny"`` as the value for the ``state`` field:
 
 .. code-block:: php
 
@@ -63,9 +61,9 @@ The output would then resemble::
    Deleted 1 document(s)
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::bulkWrite`
-   - :phpmethod:`MongoDB\\Collection::deleteMany`
+
+   - :phpmethod:`MongoDB\\Collection::deleteMany()`
+   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
    - :doc:`/tutorial/crud`
    - :manual:`delete command reference selectCollection('example','restaurants');
+   $collection = (new MongoDB\Client)->example->restaurants;
 
    $distinct = $collection->distinct('borough');
 
    var_dump($distinct);
 
-The output would resemble::
-            
+The output would then resemble::
+
    array(6) {
      [0]=>
      string(5) "Bronx"
@@ -72,30 +68,26 @@ The output would resemble::
      [5]=>
      string(13) "Staten Island"
    }
-  
-   
+
 Return Distinct Values Using a Filter
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-The following example identifies the distinct values for the
-``cuisine`` field in the ``restaurants`` collection in the ``example``
-database for documents where the ``borough`` is ``Queens``:
+The following example identifies the distinct values for the ``cuisine`` field
+in the ``restaurants`` collection in the ``example`` database for documents
+where the ``borough`` is ``Queens``:
 
 .. code-block:: php
-                
+
    selectCollection('example','restaurants');
+   $collection = (new MongoDB\Client)->example->restaurants;
+
+   $distinct = $collection->distinct('cuisine', ['borough' => 'Queens']);
 
-   $distinct = $collection->distinct('cuisine', ['borough'=>'Queens']);
+   var_dump($distinct);
 
-   
-   var_dump($distinct);   
-                
 The output would then resemble::
-                
+
    array(75) {
      [0]=>
      string(6) "Afghan"
@@ -248,9 +240,8 @@ The output would then resemble::
      [74]=>
      string(29) "Vietnamese/Cambodian/Malaysia"
    }
-   
 
 .. seealso::
-   
-   - :manual:`distinct ` command
-     reference in the MongoDB manual.
+
+   - :manual:`distinct ` command reference in the
+     MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index 6a65b303..f9d12289 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -3,7 +3,7 @@ MongoDB\\Collection::drop()
 ===========================
 
 .. default-domain:: mongodb
-                   
+
 .. contents:: On this page
    :local:
    :backlinks: none
@@ -13,49 +13,46 @@ MongoDB\\Collection::drop()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::drop
-               
-   Drops the collection.
-   
+.. phpmethod:: MongoDB\\Collection::drop()
+
+   Drop the collection.
+
    .. code-block:: php
-                   
+
       function drop(array $options = []): array|object
-      
-   ``drop()`` supports the following parameter:
-   
+
+   :phpmethod:`MongoDB\\Collection::drop()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-drop-param.rst
-      
-   The ``$options`` parameter supports the following option:
-   
+
+   The ``$options`` parameter supports the following options:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-drop-option.rst
-      
-Output
-------
 
-Returns the command result document as an array or object, depending
-on the ``typeMap`` specification.
+   :returns:
+
+      An array or object with the result document of the :manual:`drop
+      ` command. The return type will depend on the
+      ``typeMap`` option.
 
 Example
 -------
 
-The following operation drops the ``restaurants`` collection in the
-``example`` database:
+The following operation drops the ``restaurants`` collection in the ``example``
+database:
 
 .. code-block:: php
 
    selectCollection('example','restaurants');
+   $collection = (new MongoDB\Client)->example->restaurants;
+
+   $result = $collection->drop();
 
-   $output = $collection->drop();
+   var_dump($result);
 
-   
-   var_dump($output);
+The output would then resemble::
 
-The output would resemble::
-                
    object(MongoDB\Model\BSONDocument)#9 (1) {
      ["storage":"ArrayObject":private]=>
      array(3) {
@@ -69,8 +66,7 @@ The output would resemble::
    }
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Database::dropCollection`
-   - :manual:`drop ` command reference in
-     the MongoDB manual.
 
+   - :phpmethod:`MongoDB\\Database::dropCollection()`
+   - :manual:`drop ` command reference in the MongoDB
+     manual
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index ef320fdb..27fbd236 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -3,7 +3,7 @@ MongoDB\\Collection::dropIndex()
 ================================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
@@ -13,50 +13,46 @@ MongoDB\\Collection::dropIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::dropIndex($indexName, $options)
-   
-   Drops an index from the collection.
-   
+.. phpmethod:: MongoDB\\Collection::dropIndex()
+
+   Drop an index from the collection.
+
    .. code-block:: php
-      
+
       function dropIndex($indexName, array $options = []): array|object
 
-   ``dropIndex()`` supports the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::dropIndex()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
-   
-   The ``$options`` parameter supports the following option:
-                
+
+   The ``$options`` parameter supports the following options:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
 
-Output
-------
+   :returns:
 
-Returns the command result document as an array or object, depending
-on the ``typeMap`` specification.
+      An array or object with the result document of the :manual:`dropIndexes
+      ` command. The return type will depend on
+      the ``typeMap`` option.
 
 Example
 -------
 
-The following drops an indexes with name ``borough_1`` from the
-``restaurants`` collection in the ``example`` database:
+The following drops an indexes with name ``borough_1`` from the ``restaurants``
+collection in the ``example`` database:
 
 .. code-block:: php
 
    example->restaurants;
 
-   $collection = $database->selectCollection('example','restaurants');
+   $result = $collection->dropIndex('borough_1');
 
-   $index = $collection->dropIndex( "borough_1" );
+   var_dump($result);
 
-   
-   var_dump($index);
+The output would then resemble::
 
-                
-The output would resemble the following::
-  
    object(MongoDB\Model\BSONDocument)#9 (1) {
      ["storage":"ArrayObject":private]=>
      array(2) {
@@ -68,9 +64,9 @@ The output would resemble the following::
    }
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::dropIndexes`
+
+   - :phpmethod:`MongoDB\\Collection::dropIndexes()`
    - :doc:`/tutorial/indexes`
-   - :manual:`dropIndexes ` command
-     references in the MongoDB manual.
-   - :manual:`Index documentation `
+   - :manual:`dropIndexes ` command reference
+     in the MongoDB manual
+   - :manual:`Index documentation ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index 3d25b328..b226a27b 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -3,7 +3,7 @@ MongoDB\\Collection::dropIndexes()
 ==================================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
@@ -13,49 +13,47 @@ MongoDB\\Collection::dropIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::dropIndexes($options)
-   
-   Drops **all indexes** in the collection.
-   
+.. phpmethod:: MongoDB\\Collection::dropIndexes()
+
+   Drop all indexes in the collection, except for the required index on the
+   ``_id`` field.
+
    .. code-block:: php
-      
+
       function dropIndexes(array $options = []): array|object
 
-   ``dropIndexes()`` supports the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::dropIndexes()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
-   
-   The ``$options`` parameter supports the following option:
-                
+
+   The ``$options`` parameter supports the following options:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
 
-Output
-------
+   :returns:
 
-Returns the command result document as an array or object, depending
-on the ``typeMap`` specification.
+      An array or object with the result document of the :manual:`dropIndexes
+      ` command. The return type will depend on
+      the ``typeMap`` option.
 
 Example
 -------
 
-The following drops all indexes from the ``restaurants`` collection in
-the ``example`` database:
+The following drops all indexes from the ``restaurants`` collection in the
+``example`` database:
 
 .. code-block:: php
 
    example->restaurants;
 
-   $collection = $database->selectCollection('example','restaurants');
+   $result = $collection->dropIndexes();
 
-   $response = $collection->dropIndexes();
+   var_dump($result);
 
-   var_dump($response);
+The output would then resemble::
 
-                
-The output would resemble the following::
-  
    object(MongoDB\Model\BSONDocument)#9 (1) {
      ["storage":"ArrayObject":private]=>
      array(3) {
@@ -69,9 +67,9 @@ The output would resemble the following::
    }
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::dropIndex`
+
+   - :phpmethod:`MongoDB\\Collection::dropIndex()`
    - :doc:`/tutorial/indexes`
-   - :manual:`dropIndexes ` command
-     references in the MongoDB manual.
-   - :manual:`Index documentation `
+   - :manual:`dropIndexes ` command reference
+     in the MongoDB manual
+   - :manual:`Index documentation ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 2a090489..49a388f9 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -3,71 +3,69 @@ MongoDB\\Collection::find()
 ===========================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
    :depth: 1
    :class: singlecol
 
-              
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::find
-               
+.. phpmethod:: MongoDB\\Collection::find()
+
    Finds documents matching the query.
-   
+
    .. code-block:: php
-                   
+
       function find($filter = [], array $options = []): MongoDB\Driver\Cursor
 
-   ``find()`` supports the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::find()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
 
    The ``$options`` parameter supports the following options:
-                
+
    .. include:: /includes/apiargs/MongoDBCollection-method-find-option.rst
 
-                
-Output
-------
+   :returns:
 
-Returns a ``MongoDB\Driver\Cursor`` object.
+      A :php:`MongoDB\\Driver\\Cursor ` object.
 
 Examples
 --------
 
-The following example finds restaurants based on the ``cuisine`` and
-``borough`` fields and uses a :manual:`projection
-` to limit the fields
-that are returned. It also limits the results to 5 documents.
+The following example finds restaurants based on the ``cuisine`` and ``borough``
+fields and uses a :manual:`projection
+` to limit the fields that are
+returned. It also limits the results to 5 documents.
 
 .. code-block:: php
-                
-   $database = new MongoDB\Client;
 
-   $collection = $database->selectCollection('example','restaurants');
-
-   $restaurants = $collection->find(
-       [ 'cuisine' => 'Italian', 'borough' => 'Manhattan' ],
-       [ 'limit' => 5, 
-         'projection' => [
-           'name' => 1, 'borough' => 1, 'cuisine' => 1,
-         ],
+   $collection = (new MongoDB\Client)->example->restaurants;
+
+   $cursor = $collection->find(
+       [
+           'cuisine' => 'Italian',
+           'borough' => 'Manhattan',
+       ],
+       [
+           'limit' => 5,
+           'projection' => [
+               'name' => 1,
+               'borough' => 1,
+               'cuisine' => 1,
+           ],
        ]
    );
 
-   
-   foreach ($restaurants as $restaurant) {
+   foreach ($cursor as $restaurant) {
       var_dump($restaurant);
    };
 
-The output would resemble:
+The output would then resemble::
 
-.. code-block:: none
-                
    object(MongoDB\Model\BSONDocument)#10 (1) {
      ["storage":"ArrayObject":private]=>
      array(4) {
@@ -150,7 +148,7 @@ The output would resemble:
    }
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::findOne`
-   - :manual:`find ` command reference
-     in the MongoDB manual
+
+   - :phpmethod:`MongoDB\\Collection::findOne()`
+   - :manual:`find ` command reference in the MongoDB
+     manual
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index e77d04b9..acdb45d2 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -3,83 +3,87 @@ MongoDB\\Collection::findOne()
 ==============================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
    :depth: 1
    :class: singlecol
 
-              
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOne
-   
+.. phpmethod:: MongoDB\\Collection::findOne()
+
    Finds a single document matching the query.
-   
+
    .. code-block:: php
-                   
-      function findOne($filter = [], array $options = []): array|object
 
-   ``findOne()`` supports the following parameters:
-   
+      function findOne($filter = [], array $options = []): array|object|null
+
+   :phpmethod:`MongoDB\\Collection::findOne()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst
 
    The ``$options`` parameter supports the following options:
-                
+
    .. include:: /includes/apiargs/MongoDBCollection-method-findOne-option.rst
 
-                
-Output
-------
+   :returns:
 
-Returns the :term:`first document ` that matches the
-query or ``null`` if no document matches the query.
+      An array or object for the :term:`first document ` document
+      that matched the query, or ``null`` if no document matched the query. The
+      return type will depend on the ``typeMap`` option.
 
 Examples
 --------
 
 The following example finds a restaurant based on the ``cuisine`` and
 ``borough`` fields and uses a :manual:`projection
-` to limit the fields
-that are returned.
+` to limit the fields that are
+returned.
 
 .. code-block:: php
-                
-   $database = new MongoDB\Client;
 
-   $collection = $database->selectCollection('example','restaurants');
-
-   $restaurants = $collection->findOne(
-       [ 'cuisine' => 'Italian', 'borough' => 'Manhattan'],
-       [ 'limit' => 5, 
-         'projection' => [
-           'name' => 1, 'borough' => 1, 'cuisine' => 1,
-         ],
+   $collection = (new MongoDB\Client)->example->restaurants;
+
+   $restaurant = $collection->findOne(
+       [
+           'cuisine' => 'Italian',
+           'borough' => 'Manhattan',
+       ],
+       [
+           'projection' => [
+               'name' => 1,
+               'borough' => 1,
+               'cuisine' => 1,
+           ],
        ]
    );
 
-   
-   foreach ($restaurants as $restaurant) {
-      var_dump($restaurant);
-   };
-
-The output would resemble:
-
-.. code-block:: none
-                
-   object(MongoDB\BSON\ObjectID)#11 (1) {
-     ["oid"]=>
-     string(24) "576023c6b02fa9281da3f983"
+   var_dump($restaurant);
+
+The output would then resemble::
+
+   object(MongoDB\Model\BSONDocument)#10 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#8 (1) {
+         ["oid"]=>
+         string(24) "576023c6b02fa9281da3f983"
+       }
+       ["borough"]=>
+       string(9) "Manhattan"
+       ["cuisine"]=>
+       string(7) "Italian"
+       ["name"]=>
+       string(23) "Isle Of Capri Resturant"
+     }
    }
-   string(9) "Manhattan"
-   string(7) "Italian"
-   string(23) "Isle Of Capri Resturant"
-
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::findOne`
-   - :manual:`find ` command reference
-     in the MongoDB manual
+
+   - :phpmethod:`MongoDB\\Collection::find()`
+   - :manual:`find ` command reference in the MongoDB
+     manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index 05e7c355..fd863376 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -3,69 +3,67 @@ MongoDB\\Collection::findOneAndDelete()
 =======================================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
    :depth: 1
    :class: singlecol
 
-              
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndDelete
-   
-   Finds a single document and deletes it.
-   
+.. phpmethod:: MongoDB\\Collection::findOneAndDelete()
+
+   Finds a single document matching the query and deletes it.
+
    .. code-block:: php
-                   
+
       function findOneAndDelete($filter = [], array $options = []): object|null
 
-   ``findOne()`` supports the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::findOneAndDelete()` has the following
+   parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-param.rst
 
    The ``$options`` parameter supports the following options:
-                
+
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-option.rst
 
    .. include:: /includes/extracts/bson-deserialization-findOneAndDelete.rst
-                 
-Output
-------
 
-Returns the document that was deleted. If no document matched the
-filter, the returned document is ``null``.
+   :returns:
+
+      An object for the document that was deleted, or ``null`` if no document
+      matched the query.
 
 Examples
 --------
 
-The following example deletes the document with ``restaurant_id`` of
-``40375376`` from the ``restaurants`` collection in the ``example``
-database:
+The following example finds and deletes the document with ``restaurant_id`` of
+``"40375376"`` from the ``restaurants`` collection in the ``example`` database:
 
 .. code-block:: php
-   
+
    selectCollection('example','restaurants');
+   $collection = (new MongoDB\Client)->example->restaurants;
 
    $deletedRestaurant = $collection->findOneAndDelete(
        [ 'restaurant_id' => '40375376' ],
-       [ 'projection' => [ 'name' => 1, 
-                           'borough' => 1, 
-                           'restaurant_id' => 1
-                         ] 
+       [
+           'projection' => [
+               'name' => 1,
+               'borough' => 1,
+               'restaurant_id' => 1,
+           ],
        ]
    );
 
-The output would resemble:
+   var_dump($deletedRestaurant);
+
+The output would then resemble::
 
-.. code-block:: none
-                
    object(stdClass)#14 (4) {
      ["_id"]=>
      object(MongoDB\BSON\ObjectID)#11 (1) {
@@ -78,12 +76,11 @@ The output would resemble:
      string(15) "Agra Restaurant"
      ["restaurant_id"]=>
      string(8) "40375376"
-   }   
-  
+   }
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate`
-   - :phpmethod:`MongoDB\\Collection::findOneAndReplace`
-   - :manual:`findAndModify `
-     command reference in the MongoDB manual
+
+   - :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+   - :manual:`findAndModify ` command
+     reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index c6411d0d..e85cb713 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -3,50 +3,50 @@ MongoDB\\Collection::findOneAndReplace()
 ========================================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
    :depth: 1
    :class: singlecol
 
-              
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndReplace
-   
+.. phpmethod:: MongoDB\\Collection::findOneAndReplace()
+
    Finds a single document matching the query and replaces it.
-   
+
    .. code-block:: php
-                   
+
       function findOneAndReplace($filter, $replacement, array $options = []): object|null
 
-   ``findOneAndReplace()`` supports the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::findOneAndReplace()` has the following
+   parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-param.rst
 
    The ``$options`` parameter supports the following options:
-                
+
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-option.rst
 
    .. include:: /includes/extracts/bson-deserialization-findOneAndReplace.rst
 
-Output
-------
+   :returns:
 
-By default, returns the original document. To return the *new*
-document, use the ``returnDocument`` option. If no document matched
-the query, returns ``null``.
+      An object for either the original or the replaced document, depending on
+      the specified value of the ``returnDocument`` option. By default, the
+      original document is returned. If no document matched the query, ``null``
+      is returned.
 
 Examples
 --------
 
-Consider the following document in the ``restaurants`` collection in
-the ``example`` database:
+Consider the following document in the ``restaurants`` collection in the
+``example`` database:
 
 .. code-block:: javascript
-                
+
    {
      "_id" : ObjectId("576023c7b02fa9281da4139e"),
      "address" : {
@@ -81,32 +81,31 @@ the ``example`` database:
      "restaurant_id" : "41220906"
    }
 
-The following operation replaces the document with ``restaurant_id :
-41220906`` with the new specified document:
+The following operation replaces the document with ``restaurant_id`` of
+``"41220906"`` with a new document:
 
 .. code-block:: php
-                
+
    selectCollection('example','restaurants');
 
-   $updateRestaurant = $collection->findOneAndReplace(
+   $collection = (new MongoDB\Client)->example->restaurants;
+
+   $replacedRestaurant = $collection->findOneAndReplace(
        [ 'restaurant_id' => '41220906' ],
-       [ 'Borough' => 'Staten Island', 
-         'cuisine' => 'Italian',
-         'grades' => [],
-         'name' => 'Staten Island Pastaria',
-         'restaurant_id' => '999999999',
+       [
+           'Borough' => 'Staten Island',
+           'cuisine' => 'Italian',
+           'grades' => [],
+           'name' => 'Staten Island Pastaria',
+           'restaurant_id' => '999999999',
        ],
-       [ 'returnDocument' => MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER ]
-   );  
+       [ 'returnDocument' => MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER ]
+   );
 
-   
+   var_dump($replacedRestaurant)
+
+The output would then resemble::
 
-   var_dump($updateRestaurant)
-      
-The ``var_dump()`` output contains the new document, as in the following::
-   
    object(stdClass)#14 (6) {
      ["_id"]=>
      object(MongoDB\BSON\ObjectID)#11 (1) {
@@ -127,8 +126,8 @@ The ``var_dump()`` output contains the new document, as in the following::
    }
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::findOneAndDelete`
-   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate`
-   - :manual:`findAndModify `
-     command reference in the MongoDB manual
+
+   - :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
+   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+   - :manual:`findAndModify ` command
+     reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index 56d8a423..66915705 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -3,71 +3,95 @@ MongoDB\\Collection::findOneAndUpdate()
 =======================================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
    :depth: 1
    :class: singlecol
 
-              
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndUpdate
-   
+.. phpmethod:: MongoDB\\Collection::findOneAndUpdate()
+
    Finds a single document matching the query and updates it.
-   
+
    .. code-block:: php
-                   
+
       function findOneAndUpdate($filter, $update, array $options = []): object|null
 
-   ``findOneAndUpdate()`` supports the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::findOneAndUpdate()` has the following
+   parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-param.rst
 
    The ``$options`` parameter supports the following options:
-                
+
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-option.rst
 
    .. include:: /includes/extracts/bson-deserialization-findOneAndUpdate.rst
-                
-Output
-------
 
-Returns either the original or the updated document, depending on the
-specified value for the ``returnDocument`` option. By default, the
-original document is returned.
+   :returns:
+
+      An object for either the original or the updated document, depending on
+      the specified value of the ``returnDocument`` option. By default, the
+      original document is returned. If no document matched the query, ``null``
+      is returned.
 
 Examples
 --------
 
-The following operation updates the building number of the restaurant
-with ``restaurant_id : 40361708`` in the ``restaurants`` collection in
-the ``example`` database to ``761``:
+The following operation updates the restaurant with ``restaurant_id`` of
+``"40361708"`` in the ``restaurants`` collection in the ``example`` database by
+setting its building number to ``"761"``:
 
 .. code-block:: php
-                
-   selectCollection('example','restaurants');
+   example->restaurants;
 
-   $updateRestaurant = $collection->findOneAndUpdate(
+   $updatedRestaurant = $collection->findOneAndUpdate(
        [ 'restaurant_id' => '40361708' ],
-       [ '$set' => ['address.building' => '761']],
-       [ 'returnDocument' => MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER ]
+       [ '$set' => [ 'address.building' => '761' ]],
+       [
+           'projection' => [ 'address' => 1 ],
+           'returnDocument' => MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER
+       ]
    );
 
-   
-   var_dump($updateRestaurant)
-                
+   var_dump($updatedRestaurant)
 
+The output would then resemble::
+
+   object(stdClass)#16 (2) {
+     ["_id"]=>
+     object(MongoDB\BSON\ObjectID)#10 (1) {
+       ["oid"]=>
+       string(24) "5813a08d29032c6e72d566a7"
+     }
+     ["address"]=>
+     object(stdClass)#15 (4) {
+       ["building"]=>
+       string(3) "761"
+       ["coord"]=>
+       array(2) {
+         [0]=>
+         float(-73.9925306)
+         [1]=>
+         float(40.7309346)
+       }
+       ["street"]=>
+       string(8) "Broadway"
+       ["zipcode"]=>
+       string(5) "10003"
+     }
+   }
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::findOneAndDelete`
-   - :phpmethod:`MongoDB\\Collection::findOneAndReplace`
-   - :manual:`findAndModify ` command reference
-     in the MongoDB manual
+
+   - :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
+   - :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+   - :manual:`findAndModify ` command
+     reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-getCollectionName.txt b/source/reference/method/MongoDBCollection-getCollectionName.txt
index 8e58b1ad..1ed9d5c1 100644
--- a/source/reference/method/MongoDBCollection-getCollectionName.txt
+++ b/source/reference/method/MongoDBCollection-getCollectionName.txt
@@ -4,35 +4,46 @@ MongoDB\\Collection::getCollectionName()
 
 .. default-domain:: mongodb
 
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
 Definition
 ----------
 
 .. phpmethod:: MongoDB\\Collection::getCollectionName()
 
-   Returns the name of the current collection.
-   
+   Returns the name of this collection.
+
    .. code-block:: php
 
       function getCollectionName(): string
 
+   :returns:
+
+      The name of this collection as a string.
+
 Example
 -------
 
-The following returns the name of the collection assigned to the
-``$collection`` variable
+The following returns the collection name for the ``zips`` collection in the
+``demo`` database.
 
 .. code-block:: php
 
    demo->zips;   
-   echo $collection->getCollectionName();
 
-The ``$collection`` variable uses the :phpmethod:`constructor
-` method to select the ``zips``
-collection in the ``demo`` database, as such, the printed output would
-resemble:
+   $collection = (new MongoDB\Client)->demo->zips;
 
-.. code-block:: none
+   echo $collection->getCollectionName();
+
+The output would then resemble::
 
    zips
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Collection::getDatabaseName()`
+   - :phpmethod:`MongoDB\\Collection::getNamespace()`
diff --git a/source/reference/method/MongoDBCollection-getDatabaseName.txt b/source/reference/method/MongoDBCollection-getDatabaseName.txt
index 024cde9f..221d2a80 100644
--- a/source/reference/method/MongoDBCollection-getDatabaseName.txt
+++ b/source/reference/method/MongoDBCollection-getDatabaseName.txt
@@ -4,35 +4,47 @@ MongoDB\\Collection::getDatabaseName()
 
 .. default-domain:: mongodb
 
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
 Definition
 ----------
 
 .. phpmethod:: MongoDB\\Collection::getDatabaseName()
 
-   Returns the name of the current database.
-   
+   Returns the name of the database containing this collection.
+
    .. code-block:: php
 
       function getDatabaseName(): string
 
+   :returns:
+
+      The name of the database containing this collection as a string.
+
 Example
 -------
 
-The following returns the name of the database of the collection
-assigned to the ``$collection`` variable
+The following returns the database name for the ``zips`` collection in the
+``demo`` database.
 
 .. code-block:: php
 
    demo->zips;   
-   echo $collection->getDatabaseName();
 
-The ``$collection`` variable uses the :phpmethod:`constructor
-` method to select the ``zips``
-collection in the ``demo`` database, as such, the printed output would
-resemble:
+   $collection = (new MongoDB\Client)->demo->zips;
 
-.. code-block:: none
+   echo $collection->getDatabaseName();
+
+The output would then resemble::
 
    demo
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Collection::getCollectionName()`
+   - :phpmethod:`MongoDB\\Collection::getNamespace()`
+
diff --git a/source/reference/method/MongoDBCollection-getManager.txt b/source/reference/method/MongoDBCollection-getManager.txt
index e2a15ced..9783df64 100644
--- a/source/reference/method/MongoDBCollection-getManager.txt
+++ b/source/reference/method/MongoDBCollection-getManager.txt
@@ -17,7 +17,7 @@ Definition
 
    Accessor for the
    :php:`MongoDB\\Driver\\Manager ` used by this
-   :phpclass:`Client `.
+   :phpclass:`Collection `.
 
    .. code-block:: php
 
diff --git a/source/reference/method/MongoDBCollection-getNamespace.txt b/source/reference/method/MongoDBCollection-getNamespace.txt
index f3d5cce2..cfa323ce 100644
--- a/source/reference/method/MongoDBCollection-getNamespace.txt
+++ b/source/reference/method/MongoDBCollection-getNamespace.txt
@@ -4,36 +4,47 @@ MongoDB\\Collection::getNamespace()
 
 .. default-domain:: mongodb
 
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
 Definition
 ----------
 
 .. phpmethod:: MongoDB\\Collection::getNamespace()
 
-   Returns the :term:`namespace` of the collection. A namespace
-   is the canonical name of an index or collection in MongoDB.
-   
+   Returns the :term:`namespace` of the collection. A namespace is the canonical
+   name of an index or collection in MongoDB.
+
    .. code-block:: php
 
       function getNamespace(): string
 
+   :returns:
+
+      The namespace of this collection as a string.
+
 Example
 -------
 
-The following returns the namespace of the collection
-assigned to the ``$collection`` variable
+The following returns the namespace of the ``zips`` collection in the ``demo``
+database.
 
 .. code-block:: php
 
    demo->zips;   
-   echo $collection->getNamespace();
 
-The ``$collection`` variable uses the :phpmethod:`constructor
-` method to select the ``zips``
-collection in the ``demo`` database, as such, the printed output would
-resemble:
+   $collection = (new MongoDB\Client)->demo->zips;
 
-.. code-block:: none
+   echo $collection->getNamespace();
+
+The output would then resemble::
 
    demo.zips
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Collection::getCollectionName()`
+   - :phpmethod:`MongoDB\\Collection::getDatabaseName()`
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 1644a2d3..cee347be 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -3,74 +3,70 @@ MongoDB\\Collection::insertMany()
 =================================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
    :depth: 1
    :class: singlecol
 
-              
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::insertMany
-   
-   Inserts one document.
-   
+.. phpmethod:: MongoDB\\Collection::insertMany()
+
+   Insert multiple documents.
+
    .. code-block:: php
-                   
+
       function insertMany(array $documents, array $options = []): MongoDB\InsertManyResult
 
-   ``insertMany()`` supports the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::insertMany()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-param.rst
 
    The ``$options`` parameter supports the following options:
-                
+
    .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-option.rst
 
-Output
-------
+   :returns:
 
-Returns a ``MongoDB\InsertManyResult`` object.
+      A :phpclass:`MongoDB\\InsertManyResult` object, which encapsulates a
+      :php:`MongoDB\\Driver\\WriteResult `
+      object.
 
 Example
 -------
 
 .. start-crud-include
 
-The following operation inserts two documents into the ``users``
-collection in the ``example`` database:
+The following operation inserts two documents into the ``users`` collection
+in the ``example`` database:
 
 .. code-block:: php
-                
+
    selectCollection('users','restaurants');
+   $collection = (new MongoDB\Client)->example->users;
 
-   $newUsers = $collection->insertMany(
+   $insertManyResult = $collection->insertMany([
        [
-         [
            'username' => 'admin',
            'email' => 'admin@example.com',
-           'name' => 'Admin User'
-         ],
-         [
+           'name' => 'Admin User',
+       ],
+       [
            'username' => 'test',
            'email' => 'test@example.com',
-           'name' => 'Test User'
-   
-         ],
-       ]
-   );
+           'name' => 'Test User',
+       ],
+   ]);
 
-   printf("Inserted %d document(s)\n", $newUsers->getInsertedCount());
-   var_dump($newUsers->getInsertedIds());
+   printf("Inserted %d document(s)\n", $insertManyResult->getInsertedCount());
 
-The output would resemble::
+   var_dump($insertManyResult->getInsertedIds());
+
+The output would then resemble::
 
    Inserted 2 document(s)
    array(2) {
@@ -86,12 +82,12 @@ The output would resemble::
      }
    }
 
-.. end-crud-include  
+.. end-crud-include
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::bulkWrite`
-   - :phpmethod:`MongoDB\\Collection::insertOne`
+
+   - :phpmethod:`MongoDB\\Collection::insertOne()`
+   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
    - :doc:`/tutorial/crud`
-   - :manual:`insert ` command reference
-     in the MongoDB manual
+   - :manual:`insert ` command reference in the
+     MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index 59c58406..9ca556f4 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -3,50 +3,76 @@ MongoDB\\Collection::insertOne()
 ================================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
    :depth: 1
    :class: singlecol
 
-              
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::insertOne
-   
-   Inserts one document.
-   
+.. phpmethod:: MongoDB\\Collection::insertOne()
+
+   Insert one document.
+
    .. code-block:: php
-                   
+
       function insertOne($document, array $options = []): MongoDB\InsertOneResult
 
-   ``insertOne()`` supports the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::insertOne()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-param.rst
 
    The ``$options`` parameter supports the following options:
-                
+
    .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-option.rst
 
-Output
-------
+   :returns:
 
-Returns a ``MongoDB\InsertOneResult`` object.
+      A :phpclass:`MongoDB\\InsertOneResult` object, which encapsulates a
+      :php:`MongoDB\\Driver\\WriteResult `
+      object.
 
 Example
 -------
 
-The following operation inserts a document into the ``users``
-collection in the ``example`` database:
+.. start-crud-include
+
+The following operation inserts a document into the ``users`` collection in the
+``example`` database:
+
+.. code-block:: php
 
-.. include:: /includes/example-insertOne.rst
+   example->users;
+
+   $insertOneResult = $collection->insertOne([
+       'username' => 'admin',
+       'email' => 'admin@example.com',
+       'name' => 'Admin User',
+   ]);
+
+   printf("Inserted %d document(s)\n", $insertOneResult->getInsertedCount());
+
+   var_dump($insertOneResult->getInsertedId());
+
+The output would then resemble::
+
+   Inserted 1 document(s)
+   object(MongoDB\BSON\ObjectID)#11 (1) {
+     ["oid"]=>
+     string(24) "579a25921f417dd1e5518141"
+   }
+
+.. end-crud-include
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::bulkWrite`
-   - :phpmethod:`MongoDB\\Collection::insertMany`
+
+   - :phpmethod:`MongoDB\\Collection::insertMany()`
+   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
    - :doc:`/tutorial/crud`
-   - :manual:`insert ` command reference
-     in the MongoDB manual
+   - :manual:`insert ` command reference in the
+     MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index c2a3a2f8..567909b8 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -4,7 +4,7 @@ MongoDB\\Collection::listIndexes()
 
 .. default-domain:: mongodb
 
-.. contents::
+.. contents:: On this page
    :local:
    :backlinks: none
    :depth: 1
@@ -13,47 +13,41 @@ MongoDB\\Collection::listIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::listIndexes($options)
+.. phpmethod:: MongoDB\\Collection::listIndexes()
+
+   Returns information for all indexes for this collection.
 
-   Returns information for all indexes for the collection.
-   
    .. code-block:: php
 
       function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator
 
-   :phpmethod:`MongoDB\\Collection::listIndexes` supports the
-   following parameter:
-   
+   :phpmethod:`MongoDB\\Collection::listIndexes()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-param.rst
-   
+
    The ``$options`` parameter supports the following options:
-   
+
    .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-option.rst
 
-Output
-------
+   :returns:
 
-Elements in the returned iterator are ``MongoDB\Model\IndexInfo``
-objects.
+      A traversable :phpclass:`MongoDB\\Model\IndexInfoIterator`, which
+      contains an :phpclass:`MongoDB\\Model\IndexInfo` object for each index for
+      the collection.
 
-                
 Example
 -------
 
-The following lists information about the indexes on the collection
-assigned to the ``$collection`` variable
+The following example lists all of the indexes for the ``restaurants``
+collection in the ``example`` database:
 
 .. code-block:: php
 
    selectCollection('example','restaurants');
+   $collection = (new MongoDB\Client)->example->restaurants;
 
-   $indexes = $collection->listIndexes();
-
-   foreach ($indexes as $index) {
+   foreach ($collection->listIndexes() as $index) {
       var_dump($index);
    }
 
@@ -99,14 +93,12 @@ The output would then resemble::
      string(19) "example.restaurants"
    }
 
-
 .. seealso::
 
    - :doc:`/tutorial/indexes`
-
-   - :manual:`listIndexes command ` in the MongoDB manual.
-   
-   - :manual:`Index documentation ` in the MongoDB manual.
-   
-   - `MongoDB Specification: Enumerating Collections
+   - :manual:`listIndexes ` command reference in
+     the MongoDB manual
+   - :manual:`Index documentation ` in the MongoDB manual
+   - `Enumerating Collections
      `_
+     specification
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index e84ff3aa..a6f79daa 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -3,54 +3,54 @@ MongoDB\\Collection::replaceOne()
 =================================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
    :depth: 1
    :class: singlecol
 
-              
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::replaceOne
-   
-   Replaces at most one document that matches the filter.
-   
+.. phpmethod:: MongoDB\\Collection::replaceOne()
+
+   Replace at most one document that matches the filter criteria. If multiple
+   documents match the filter criteria, only the :term:`first `
+   matching document will be replaced.
+
    .. code-block:: php
-                   
+
       function replaceOne($filter, $replacement, array $options = []): MongoDB\UpdateResult
 
-   ``replaceOne()`` supports the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::replaceOne()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-param.rst
 
    The ``$options`` parameter supports the following options:
-                
+
    .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-option.rst
 
-Output
-------
+   :returns:
 
-Returns a ``MongoDB\UpdateResult`` object.
+      A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
+      :php:`MongoDB\\Driver\\WriteResult `
+      object.
 
 Example
 -------
 
-The following operation replaces the document with ``restaurant_id``
-``40356068`` in the ``restaurants`` collection in the ``example`` database:
+The following example replaces the document with ``restaurant_id`` of
+``"40356068"`` in the ``restaurants`` collection in the ``example`` database:
 
 .. code-block:: php
-                
+
    selectCollection('users','restaurants');
+   $collection = (new MongoDB\Client)->example->restaurants;
 
-   $replacement = $collection->replaceOne(
-       [   'restaurant_id' => '40356068'],
+   $updateResult = $collection->replaceOne(
+       [ 'restaurant_id' => '40356068' ],
        [
            'name' => 'New Restaurant',
            'restaurant_id' => '99988877',
@@ -60,55 +60,19 @@ The following operation replaces the document with ``restaurant_id``
        ]
    );
 
-   
-   var_dump($replacement);
-
-The output would resemble:
-
-.. code-block:: none
-                
-   object(MongoDB\UpdateResult)#13 (2) {
-     ["writeResult":"MongoDB\UpdateResult":private]=>
-     object(MongoDB\Driver\WriteResult)#12 (9) {
-       ["nInserted"]=>
-       int(0)
-       ["nMatched"]=>
-       int(1)
-       ["nModified"]=>
-       int(1)
-       ["nRemoved"]=>
-       int(0)
-       ["nUpserted"]=>
-       int(0)
-       ["upsertedIds"]=>
-       array(0) {
-       }
-       ["writeErrors"]=>
-       array(0) {
-       }
-       ["writeConcernError"]=>
-       NULL
-       ["writeConcern"]=>
-       array(4) {
-         ["w"]=>
-         NULL
-         ["wmajority"]=>
-         bool(false)
-         ["wtimeout"]=>
-         int(0)
-         ["journal"]=>
-         NULL
-       }
-     }
-     ["isAcknowledged":"MongoDB\UpdateResult":private]=>
-     bool(true)
-   }
+   printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
+   printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
+
+The output would then resemble::
+
+   Matched 1 document(s)
+   Modified 1 document(s)
 
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::bulkWrite`
-   - :phpmethod:`MongoDB\\Collection::updateMany`
-   - :phpmethod:`MongoDB\\Collection::updateOne`
+
+   - :phpmethod:`MongoDB\\Collection::updateMany()`
+   - :phpmethod:`MongoDB\\Collection::updateOne()`
+   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
    - :doc:`/tutorial/crud`
-   - :manual:`update ` command reference
-     in the MongoDB manual
+   - :manual:`update ` command reference in the
+     MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 7460afbb..934357c9 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -3,107 +3,66 @@ MongoDB\\Collection::updateMany()
 =================================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
    :depth: 1
    :class: singlecol
 
-              
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::updateMany
-   
-   Updates all documents that match the filter criteria.
-   
+.. phpmethod:: MongoDB\\Collection::updateMany()
+
+   Update all documents that match the filter criteria.
+
    .. code-block:: php
-                   
+
       function updateMany($filter, $update, array $options = []): MongoDB\UpdateResult
 
-   ``updateMany()`` supports the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::updateMany()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-param.rst
 
    The ``$options`` parameter supports the following options:
-                
+
    .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-option.rst
-                
-Output
-------
 
-Returns a ``MongoDB\UpdateResult`` object.
+   :returns:
+
+      A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
+      :php:`MongoDB\\Driver\\WriteResult `
+      object.
 
 Examples
 --------
 
-The following operation adds a an ``active`` field to all of the documents
-with ``borough: Queens`` with value ``true``:
+The following example updates all of the documents with the ``borough`` of
+``"Queens"`` by setting the ``active`` field to ``true``:
 
 .. code-block:: php
-                
-   $database = new MongoDB\Client;
-
-   $collection = $database->selectCollection('example','restaurants');
 
-   $update = $collection->updateMany(
-          [   'borough' => 'Queens'],
-          [
-              '$set' => [
-                   'active' => 'True'
-              ]
-          ]
-      );
+   $collection = (new MongoDB\Client)->example->restaurants;
 
-   
+   $updateResult = $collection->updateMany(
+       [ 'borough' => 'Queens' ],
+       [ '$set' => [ 'active' => 'True' ]]
+   );
 
-   var_dump($update);
+   printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
+   printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
 
 The output would then resemble::
-  
-   object(MongoDB\UpdateResult)#13 (2) {
-     ["writeResult":"MongoDB\UpdateResult":private]=>
-     object(MongoDB\Driver\WriteResult)#12 (9) {
-       ["nInserted"]=>
-       int(0)
-       ["nMatched"]=>
-       int(5656)
-       ["nModified"]=>
-       int(5656)
-       ["nRemoved"]=>
-       int(0)
-       ["nUpserted"]=>
-       int(0)
-       ["upsertedIds"]=>
-       array(0) {
-       }
-       ["writeErrors"]=>
-       array(0) {
-       }
-       ["writeConcernError"]=>
-       NULL
-       ["writeConcern"]=>
-       array(4) {
-         ["w"]=>
-         NULL
-         ["wmajority"]=>
-         bool(false)
-         ["wtimeout"]=>
-         int(0)
-         ["journal"]=>
-         NULL
-       }
-     }
-     ["isAcknowledged":"MongoDB\UpdateResult":private]=>
-     bool(true)
-   }
-   
+
+   Matched 5656 document(s)
+   Modified 5656 document(s)
+
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::bulkWrite`
-   - :phpmethod:`MongoDB\\Collection::replaceOne`
-   - :phpmethod:`MongoDB\\Collection::updateOne`
+
+   - :phpmethod:`MongoDB\\Collection::replaceOne()`
+   - :phpmethod:`MongoDB\\Collection::updateOne()`
+   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
    - :doc:`/tutorial/crud`
-   - :manual:`update ` command reference
-     in the MongoDB manual.
+   - :manual:`update ` command reference in the
+     MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index cef82ad5..bfbbf021 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -3,108 +3,68 @@ MongoDB\\Collection::updateOne()
 ================================
 
 .. default-domain:: mongodb
-                    
+
 .. contents:: On this page
    :local:
    :backlinks: none
    :depth: 1
    :class: singlecol
 
-              
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::updateOne
-   
-   Finds a single document matching the query and updates it.
-   
+.. phpmethod:: MongoDB\\Collection::updateOne()
+
+   Update at most one document that matches the filter criteria. If multiple
+   documents match the filter criteria, only the :term:`first `
+   matching document will be updated.
+
    .. code-block:: php
-                   
+
       function updateOne($filter, $update, array $options = []): MongoDB\UpdateResult
 
-   ``updateOne()`` supports the following parameters:
-   
+   :phpmethod:`MongoDB\\Collection::updateOne()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-param.rst
 
    The ``$options`` parameter supports the following options:
-                
+
    .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-option.rst
-                
-Output
-------
 
-Returns a ``MongoDB\UpdateResult`` object.
+   :returns:
+
+      A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
+      :php:`MongoDB\\Driver\\WriteResult `
+      object.
 
 Examples
 --------
 
-The following operation updates the ``name`` of the restaurant with
-``restaurant_id: 40356151`` to "Brunos on Astoria":
+The following example updates one document with the ``restaurant_id`` of
+``"40356151"`` by setting the ``name`` field to ``"Brunos on Astoria"``:
 
 .. code-block:: php
-                
-   $database = new MongoDB\Client;
-
-   $collection = $database->selectCollection('example','restaurants');
 
-   $update = $collection->updateOne(
-          [   'restaurant_id' => '40356151'],
-          [
-              '$set' => [
-                   'name' => 'Brunos on Astoria'
-              ]
-          ]
-      );
+   $collection = (new MongoDB\Client)->example->restaurants;
 
-   
+   $updateResult = $collection->updateOne(
+       [ 'restaurant_id' => '40356151' ],
+       [ '$set' => [ 'name' => 'Brunos on Astoria' ]]
+   );
 
-   var_dump($update);
+   printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
+   printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
 
 The output would then resemble::
-  
-  object(MongoDB\UpdateResult)#13 (2) {
-     ["writeResult":"MongoDB\UpdateResult":private]=>
-     object(MongoDB\Driver\WriteResult)#12 (9) {
-       ["nInserted"]=>
-       int(0)
-       ["nMatched"]=>
-       int(1)
-       ["nModified"]=>
-       int(1)
-       ["nRemoved"]=>
-       int(0)
-       ["nUpserted"]=>
-       int(0)
-       ["upsertedIds"]=>
-       array(0) {
-       }
-       ["writeErrors"]=>
-       array(0) {
-       }
-       ["writeConcernError"]=>
-       NULL
-       ["writeConcern"]=>
-       array(4) {
-         ["w"]=>
-         NULL
-         ["wmajority"]=>
-         bool(false)
-         ["wtimeout"]=>
-         int(0)
-         ["journal"]=>
-         NULL
-       }
-     }
-     ["isAcknowledged":"MongoDB\UpdateResult":private]=>
-     bool(true)
-   }
-  
-   
+
+   Matched 1 document(s)
+   Modified 1 document(s)
+
 .. seealso::
-   
-   - :phpmethod:`MongoDB\\Collection::bulkWrite`
-   - :phpmethod:`MongoDB\\Collection::replaceOne`
-   - :phpmethod:`MongoDB\\Collection::updateMany`
+
+   - :phpmethod:`MongoDB\\Collection::replaceOne()`
+   - :phpmethod:`MongoDB\\Collection::updateMany()`
+   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
    - :doc:`/tutorial/crud`
-   - :manual:`update ` command reference
-     in the MongoDB manual.
+   - :manual:`update ` command reference in the
+     MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index 3e133025..a9aac1fa 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -4,46 +4,51 @@ MongoDB\\Collection::withOptions()
 
 .. default-domain:: mongodb
 
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::withOptions($options)
+.. phpmethod:: MongoDB\\Collection::withOptions()
+
+   Returns a clone of the Collection object, but with different options.
 
-   Returns a clone of the collection, but with different options.
-   
    .. code-block:: php
 
       function withOptions(array $options = []): MongoDB\Collection
 
-   :phpmethod:`MongoDB\\Collection::withOptions` supports the
-   following parameter:
-   
+   :phpmethod:`MongoDB\\Collection::withOptions()` has the following parameters:
+
    .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-param.rst
-   
+
    The ``$options`` parameter supports the following options:
-   
+
    .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-option.rst
 
+   :returns:
+
+      A :phpclass:`MongoDB\\Collection` object.
+
 Example
 -------
 
-The following example creates a new collection based on the
-``restaurants`` collection in the ``example`` database with a custom
-read preference:
+The following example clones an existing Collection object with a new read
+preference:
 
 .. code-block:: php
 
    selectCollection('example','restaurants');
+   $collection = (new MongoDB\Client)->selectCollect('demo', 'restaurants');
 
-   $newCollection = $sourceCollection->withOptions([ 
-   	'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+   $newCollection = $sourceCollection->withOptions([
+       'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
    ]);
 
-
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::__construct`
+   - :phpmethod:`MongoDB\\Collection::__construct()`
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
index e06f7bbc..fac9d3ac 100644
--- a/source/reference/method/MongoDBCollection__construct.txt
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\Collection::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::__construct($manager, $databaseName, $collectionName, $options)
+.. phpmethod:: MongoDB\\Collection::__construct()
 
-   Constructs a new :phpclass:`Collection ` instance. 
+   Constructs a new :phpclass:`Collection ` instance.
 
    .. code-block:: php
 
@@ -25,20 +25,24 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-construct-param.rst
 
-   :phpmethod:`MongoDB\\Collection::__construct` supports the following
-   options:
-   
-   .. include:: /includes/apiargs/common-option.rst
+   The ``$options`` parameter supports the following options:
 
-   If you construct the Collection explicitly, the Collection inherits
-   any options from the ``Manager`` object. If you select the Collection
-   from a :phpclass:`Client ` or :phpclass:`Database
-   ` object, the Collection inherits its options
-   from that object.
+   .. include:: /includes/apiargs/MongoDBCollection-method-construct-option.rst
+
+Behavior
+--------
+
+If you construct a Collection explicitly, the Collection inherits any options
+from the :php:`MongoDB\\Driver\\Manager ` object.
+If you select the Collection from a :phpclass:`Client ` or
+:phpclass:`Database ` object, the Collection inherits its
+options from that object.
 
 .. todo: add an example
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::withOptions`
-   - :phpmethod:`MongoDB\\Database::selectCollection`
+   - :phpmethod:`MongoDB\\Collection::withOptions()`
+   - :phpmethod:`MongoDB\\Client::selectCollection()`
+   - :phpmethod:`MongoDB\\Database::selectCollection()`
+   - :phpmethod:`MongoDB\\Database::__get()`
diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index c7d7213c..8c2b0a29 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -33,12 +33,13 @@ The :phpmethod:`MongoDB\\Collection::insertOne` method inserts a single
 document into MongoDB and returns an instance of ``MongoDB\InsertOneResult``,
 which you can use to access the IDs of the inserted document.
 
-.. basic insertOne example:
+.. this uses the insertMany example from the method reference:
 
-.. include:: /includes/example-insertOne.rst
+.. include:: /reference/method/MongoDBCollection-insertOne.txt
+   :start-after: start-crud-include
+   :end-before: end-crud-include
 
-The output includes the ``insertedId`` property, which contains the
-ID of the inserted document.
+The output includes the ID of the inserted document.
 
 If you include an ``_id`` value when inserting a document, MongoDB checks
 to ensure that the ``_id`` value is unique for the collection. If the
@@ -324,8 +325,8 @@ collection data. The |php-library|\'s
 :phpmethod:`MongoDB\\Collection::aggregate` method returns a
 :php:`traversable ` object, which you can iterate upon to
 access the results of the aggregation operation. Refer to the
-:phpmethod:`MongoDB\\Collection::aggregate` method's :ref:`output
-reference ` for more about the method's output.
+:phpmethod:`MongoDB\\Collection::aggregate` method's :ref:`behavior
+reference ` for more about the method's output.
 
 The following example lists the 5 US states with the most zip codes
 associated with them:

From 3020787fc6bbcb14e94209aba978ace53cabe874 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 28 Oct 2016 19:14:53 -0400
Subject: [PATCH 037/321] PHPLIB-221: API documentation for
 MongoDB\GridFS\Bucket

---
 ...base-method-selectGridFSBucket-option.yaml | 48 ++++++++++++
 ...abase-method-selectGridFSBucket-param.yaml |  6 ++
 ...BGridFSBucket-method-construct-option.yaml | 48 ++++++++++++
 ...DBGridFSBucket-method-construct-param.yaml | 18 +++++
 ...ngoDBGridFSBucket-method-delete-param.yaml | 10 +++
 ...SBucket-method-downloadToStream-param.yaml | 20 +++++
 ...-method-downloadToStreamByName-option.yaml | 22 ++++++
 ...t-method-downloadToStreamByName-param.yaml | 26 +++++++
 ...method-getFileDocumentForStream-param.yaml | 10 +++
 ...ucket-method-getFileIdForStream-param.yaml | 10 +++
 ...ucket-method-openDownloadStream-param.yaml | 10 +++
 ...ethod-openDownloadStreamByName-option.yaml | 22 ++++++
 ...method-openDownloadStreamByName-param.yaml | 16 ++++
 ...Bucket-method-openUploadStream-option.yaml | 32 ++++++++
 ...SBucket-method-openUploadStream-param.yaml | 16 ++++
 ...ngoDBGridFSBucket-method-rename-param.yaml | 20 +++++
 ...Bucket-method-uploadFromStream-option.yaml | 32 ++++++++
 ...SBucket-method-uploadFromStream-param.yaml | 26 +++++++
 source/reference.txt                          |  1 +
 source/reference/class/MongoDBDatabase.txt    |  1 +
 .../reference/class/MongoDBGridFSBucket.txt   | 51 +++++++++++++
 .../MongoDBDatabase-selectGridFSBucket.txt    | 74 +++++++++++++++++++
 .../method/MongoDBGridFSBucket-delete.txt     | 34 +++++++++
 .../MongoDBGridFSBucket-downloadToStream.txt  | 36 +++++++++
 ...oDBGridFSBucket-downloadToStreamByName.txt | 40 ++++++++++
 .../method/MongoDBGridFSBucket-drop.txt       | 24 ++++++
 .../method/MongoDBGridFSBucket-find.txt       | 40 ++++++++++
 .../MongoDBGridFSBucket-getBucketName.txt     | 28 +++++++
 .../MongoDBGridFSBucket-getDatabaseName.txt   | 28 +++++++
 ...BGridFSBucket-getFileDocumentForStream.txt | 37 ++++++++++
 ...MongoDBGridFSBucket-getFileIdForStream.txt | 38 ++++++++++
 ...MongoDBGridFSBucket-openDownloadStream.txt | 39 ++++++++++
 ...BGridFSBucket-openDownloadStreamByName.txt | 43 +++++++++++
 .../MongoDBGridFSBucket-openUploadStream.txt  | 47 ++++++++++++
 .../method/MongoDBGridFSBucket-rename.txt     | 28 +++++++
 .../MongoDBGridFSBucket-uploadFromStream.txt  | 44 +++++++++++
 .../method/MongoDBGridFSBucket__construct.txt | 45 +++++++++++
 37 files changed, 1070 insertions(+)
 create mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
 create mode 100644 source/reference/class/MongoDBGridFSBucket.txt
 create mode 100644 source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-delete.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-drop.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-find.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-getBucketName.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-rename.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket__construct.txt

diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
new file mode 100644
index 00000000..e43b2467
--- /dev/null
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
@@ -0,0 +1,48 @@
+arg_name: option
+name: bucketName
+type: string
+description: |
+  The bucket name, which will be used as a prefix for the files and chunks
+  collections. Defaults to ``"fs"``.
+interface: phpmethod
+operation: MongoDB\\Database::selectGridFSBucket
+optional: true
+position: 1
+---
+arg_name: option
+name: chunkSizeBytes
+type: integer
+description: |
+  The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
+interface: phpmethod
+operation: MongoDB\\Database::selectGridFSBucket
+optional: true
+position: 2
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: readConcern
+operation: MongoDB\\Database::selectGridFSBucket
+position: 3
+replacement:
+  resource: "bucket"
+  parent: "database"
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: readPreference
+operation: MongoDB\\Database::selectGridFSBucket
+position: 4
+replacement:
+  resource: "bucket"
+  parent: "database"
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: writeConcern
+operation: MongoDB\\Database::selectGridFSBucket
+position: 5
+replacement:
+  resource: "bucket"
+  parent: "database"
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
new file mode 100644
index 00000000..9b1a67b3
--- /dev/null
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
@@ -0,0 +1,6 @@
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+operation: MongoDB\\Database::selectGridFSBucket
+position: 1
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
new file mode 100644
index 00000000..467800d7
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
@@ -0,0 +1,48 @@
+arg_name: option
+name: bucketName
+type: string
+description: |
+  The bucket name, which will be used as a prefix for the files and chunks
+  collections. Defaults to ``"fs"``.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::__construct
+optional: true
+position: 1
+---
+arg_name: option
+name: chunkSizeBytes
+type: integer
+description: |
+  The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::__construct
+optional: true
+position: 2
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: readConcern
+operation: MongoDB\\GridFS\\Bucket::__construct
+position: 3
+replacement:
+  resource: "bucket"
+  parent: "database"
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: readPreference
+operation: MongoDB\\GridFS\\Bucket::__construct
+position: 4
+replacement:
+  resource: "bucket"
+  parent: "database"
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: writeConcern
+operation: MongoDB\\GridFS\\Bucket::__construct
+position: 5
+replacement:
+  resource: "bucket"
+  parent: "database"
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
new file mode 100644
index 00000000..f22a31bc
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
@@ -0,0 +1,18 @@
+source:
+  file: apiargs-common-param.yaml
+  ref: $manager
+operation: MongoDB\\GridFS\\Bucket::__construct
+position: 1
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $databaseName
+operation: MongoDB\\GridFS\\Bucket::__construct
+position: 2
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+operation: MongoDB\\GridFS\\Bucket::__construct
+position: 3
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
new file mode 100644
index 00000000..b8d289f8
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
@@ -0,0 +1,10 @@
+arg_name: param
+name: $id
+type: mixed
+description: |
+  The ``_id`` of the file to delete.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::delete
+optional: false
+position: 1
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
new file mode 100644
index 00000000..4eda59ba
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
@@ -0,0 +1,20 @@
+arg_name: param
+name: $id
+type: mixed
+description: |
+  The ``_id`` of the file to download.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::downloadToStream
+optional: false
+position: 1
+---
+arg_name: param
+name: $destination
+type: resource
+description: |
+  Writable stream where the GridFS file's contents will be written.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::downloadToStream
+optional: false
+position: 2
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
new file mode 100644
index 00000000..3ad8a220
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
@@ -0,0 +1,22 @@
+arg_name: option
+name: revision
+type: integer
+description: |
+  The revision of the file to retrieve. Files with the name ``filename`` will be
+  differentiated by their ``uploadDate`` field.
+
+  Revision numbers are defined as follows:
+
+  - 0 = the original stored file
+  - 1 = the first revision
+  - 2 = the second revision
+  - etc...
+  - -2 = the second most recent revision
+  - -1 = the most recent revision
+
+   Defaults to -1 (i.e. the most recent revision).
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
+optional: true
+position: 1
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
new file mode 100644
index 00000000..b09f9a37
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
@@ -0,0 +1,26 @@
+arg_name: param
+name: $filename
+type: string
+description: |
+  The ``filename`` of the file to download.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
+optional: false
+position: 1
+---
+arg_name: param
+name: $destination
+type: resource
+description: |
+  Writable stream where the GridFS file's contents will be written.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
+optional: false
+position: 2
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
+position: 3
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
new file mode 100644
index 00000000..e6604881
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
@@ -0,0 +1,10 @@
+arg_name: param
+name: $stream
+type: resource
+description: |
+  The GridFS stream resource.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::getFileDocumentForStream
+optional: false
+position: 1
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
new file mode 100644
index 00000000..98c5fb65
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
@@ -0,0 +1,10 @@
+arg_name: param
+name: $stream
+type: resource
+description: |
+  The GridFS stream resource.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::getFileIdForStream
+optional: false
+position: 1
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
new file mode 100644
index 00000000..a138da9b
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
@@ -0,0 +1,10 @@
+arg_name: param
+name: $id
+type: mixed
+description: |
+  The ``_id`` of the file to download.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::openDownloadStream
+optional: false
+position: 1
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
new file mode 100644
index 00000000..2fb37083
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
@@ -0,0 +1,22 @@
+arg_name: option
+name: revision
+type: integer
+description: |
+  The revision of the file to retrieve. Files with the name ``filename`` will be
+  differentiated by their ``uploadDate`` field.
+
+  Revision numbers are defined as follows:
+
+  - 0 = the original stored file
+  - 1 = the first revision
+  - 2 = the second revision
+  - etc...
+  - -2 = the second most recent revision
+  - -1 = the most recent revision
+
+   Defaults to -1 (i.e. the most recent revision).
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName
+optional: true
+position: 1
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
new file mode 100644
index 00000000..2ca8b28d
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
@@ -0,0 +1,16 @@
+arg_name: param
+name: $filename
+type: string
+description: |
+  The ``filename`` of the file to download.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName
+optional: false
+position: 1
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName
+position: 2
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
new file mode 100644
index 00000000..ef03e8e4
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
@@ -0,0 +1,32 @@
+arg_name: option
+name: _id
+type: mixed
+description: |
+  Value to use as the file document identifier. Defaults to a new
+  :php:`MongoDB\\BSON\\ObjectID ` object.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::openUploadStream
+optional: true
+position: 1
+---
+arg_name: option
+name: chunkSizeBytes
+type: integer
+description: |
+  The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::openUploadStream
+optional: true
+position: 2
+---
+arg_name: option
+name: metadata
+type: array|object
+description: |
+  User data for the ``metadata`` field of the file document. If not specified,
+  the ``metadata`` field will not be set on the file document.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::openUploadStream
+optional: true
+position: 3
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
new file mode 100644
index 00000000..e97103dc
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
@@ -0,0 +1,16 @@
+arg_name: param
+name: $filename
+type: string
+description: |
+  The ``filename`` of the file to create.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::openUploadStream
+optional: false
+position: 1
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+operation: MongoDB\\GridFS\\Bucket::openUploadStream
+position: 2
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
new file mode 100644
index 00000000..5dc7e42c
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
@@ -0,0 +1,20 @@
+arg_name: param
+name: $id
+type: mixed
+description: |
+  The ``_id`` of the file to rename.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::rename
+optional: false
+position: 1
+---
+arg_name: param
+name: $newFilename
+type: string
+description: |
+  The new ``filename`` value.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::rename
+optional: false
+position: 2
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
new file mode 100644
index 00000000..546f0d6a
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
@@ -0,0 +1,32 @@
+arg_name: option
+name: _id
+type: mixed
+description: |
+  Value to use as the file document identifier. Defaults to a new
+  :php:`MongoDB\\BSON\\ObjectID ` object.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::uploadFromStream
+optional: true
+position: 1
+---
+arg_name: option
+name: chunkSizeBytes
+type: integer
+description: |
+  The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::uploadFromStream
+optional: true
+position: 2
+---
+arg_name: option
+name: metadata
+type: array|object
+description: |
+  User data for the ``metadata`` field of the file document. If not specified,
+  the ``metadata`` field will not be set on the file document.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::uploadFromStream
+optional: true
+position: 3
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
new file mode 100644
index 00000000..90419575
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
@@ -0,0 +1,26 @@
+arg_name: param
+name: $filename
+type: string
+description: |
+  The ``filename`` of the file to create.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::uploadFromStream
+optional: false
+position: 1
+---
+arg_name: param
+name: $source
+type: resource
+description: |
+  Readable stream where the file's contents will be read.
+interface: phpmethod
+operation: MongoDB\\GridFS\\Bucket::uploadFromStream
+optional: false
+position: 2
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+operation: MongoDB\\GridFS\\Bucket::uploadFromStream
+position: 3
+...
diff --git a/source/reference.txt b/source/reference.txt
index 445ad373..f986dcf2 100644
--- a/source/reference.txt
+++ b/source/reference.txt
@@ -11,3 +11,4 @@ Reference
    /reference/class/MongoDBClient
    /reference/class/MongoDBDatabase
    /reference/class/MongoDBCollection
+   /reference/class/MongoDBGridFSBucket
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index 2b57ae7c..bb709273 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -54,5 +54,6 @@ Methods
    /reference/method/MongoDBDatabase-getManager
    /reference/method/MongoDBDatabase-listCollections
    /reference/method/MongoDBDatabase-selectCollection
+   /reference/method/MongoDBDatabase-selectGridFSBucket
    /reference/method/MongoDBDatabase-withOptions
 
diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
new file mode 100644
index 00000000..6f889cba
--- /dev/null
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -0,0 +1,51 @@
+============================
+MongoDB\\GridFS\Bucket Class
+============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\GridFS\\Bucket
+
+   :manual:`GridFS ` is a specification for storing and
+   retrieving files in MongoDB. GridFS uses two collections to store files. One
+   collection stores the file chunks (e.g. ``fs.chunks``), and the other stores
+   file metadata (e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket`
+   class provides an interface around these collections for working with the
+   files as PHP :php:`Streams `.
+
+   You can construct a GridFS bucket using the PHP extension's
+   :php:`MongoDB\\Driver\\Manager ` class, or
+   select a bucket from the |php-library|'s :phpclass:`MongoDB\\Database` class
+   via the :phpmethod:`selectGridFSBucket()
+   ` method.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBGridFSBucket__construct
+   /reference/method/MongoDBGridFSBucket-delete
+   /reference/method/MongoDBGridFSBucket-downloadToStream
+   /reference/method/MongoDBGridFSBucket-downloadToStreamByName
+   /reference/method/MongoDBGridFSBucket-drop
+   /reference/method/MongoDBGridFSBucket-find
+   /reference/method/MongoDBGridFSBucket-getBucketName
+   /reference/method/MongoDBGridFSBucket-getDatabaseName
+   /reference/method/MongoDBGridFSBucket-getFileDocumentForStream
+   /reference/method/MongoDBGridFSBucket-getFileIdForStream
+   /reference/method/MongoDBGridFSBucket-openDownloadStream
+   /reference/method/MongoDBGridFSBucket-openDownloadStreamByName
+   /reference/method/MongoDBGridFSBucket-openUploadStream
+   /reference/method/MongoDBGridFSBucket-rename
+   /reference/method/MongoDBGridFSBucket-uploadFromStream
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
new file mode 100644
index 00000000..1444515e
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -0,0 +1,74 @@
+=======================================
+MongoDB\\Database::selectGridFSBucket()
+=======================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::selectGridFSBucket()
+
+   Selects a GridFS bucket within the database.
+
+   .. code-block:: php
+
+      function selectGridFSBucket(array $options = []): MongoDB\GridFS\Bucket
+
+   :phpmethod:`MongoDB\\Database::selectGridFSBucket()` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-option.rst
+
+   :returns:
+
+      A :phpclass:`MongoDB\\GridFS\\Bucket` object.
+
+Behavior
+--------
+
+The selected bucket inherits options such as read preference and write concern
+from the :phpclass:`Database ` object. Options may be
+overridden via the ``$options`` parameter.
+
+Example
+-------
+
+The following example selects the default ``fs.files`` bucket in the ``demo``
+database:
+
+.. code-block:: php
+
+   demo;
+
+   $bucket = $db->selectGridFSBucket();
+
+The following example selects the custom ``images.files`` bucket in the ``demo``
+database with a custom read preference:
+
+.. code-block:: php
+
+   demo;
+
+   $imagesBucket = $db->selectGridFSBucket([
+       'bucketName' => 'images',
+       'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+   ]);
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
diff --git a/source/reference/method/MongoDBGridFSBucket-delete.txt b/source/reference/method/MongoDBGridFSBucket-delete.txt
new file mode 100644
index 00000000..87ee2507
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-delete.txt
@@ -0,0 +1,34 @@
+=================================
+MongoDB\\GridFS\\Bucket::delete()
+=================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::delete()
+
+   Delete a file and its chunks from the GridFS bucket.
+
+   .. code-block:: php
+
+      function delete($id): void
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::delete()` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-delete-param.rst
+
+Behavior
+--------
+
+If the files collection document is not found, this method will still attempt to
+delete orphaned chunks.
+
+.. todo: add examples
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
new file mode 100644
index 00000000..2deb364a
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
@@ -0,0 +1,36 @@
+===========================================
+MongoDB\\GridFS\\Bucket::downloadToStream()
+===========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStream()
+
+   Selects a GridFS file by its ``_id`` and copies its contents to a writable
+   stream.
+
+   .. code-block:: php
+
+      function downloadToStream($id, $destination): void
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStream-param.rst
+
+.. todo: add examples
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
new file mode 100644
index 00000000..cbdac678
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -0,0 +1,40 @@
+===========================================
+MongoDB\\GridFS\\Bucket::downloadToStream()
+===========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStreamByName()
+
+   Selects a GridFS file by its ``filename`` and copies its contents to a
+   writable stream.
+
+   .. code-block:: php
+
+      function downloadToStreamByName($filename, $destination, array $options = []): void
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()` has the
+   following parameters:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-option.rst
+
+.. todo: add examples
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-drop.txt b/source/reference/method/MongoDBGridFSBucket-drop.txt
new file mode 100644
index 00000000..6ec90561
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-drop.txt
@@ -0,0 +1,24 @@
+===============================
+MongoDB\\GridFS\\Bucket::drop()
+===============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::drop()
+
+   Drops the files and chunks collections associated with this GridFS bucket.
+
+   .. code-block:: php
+
+      function drop(): void
+
+.. todo: add examples
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
new file mode 100644
index 00000000..91c710d7
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -0,0 +1,40 @@
+===============================
+MongoDB\\GridFS\\Bucket::find()
+===============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::find()
+
+   Finds documents from the GridFS bucket's files collection matching the query.
+
+   .. code-block:: php
+
+      function find($filter = [], array $options = []): MongoDB\Driver\Cursor
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::find()` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-find-option.rst
+
+   :returns:
+
+      A :php:`MongoDB\\Driver\\Cursor ` object.
+
+.. todo: add examples
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Collection::find()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
new file mode 100644
index 00000000..0cd59884
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
@@ -0,0 +1,28 @@
+===========================================
+MongoDB\\GridFS\\Bucket::downloadToStream()
+===========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::getBucketName()
+
+   Returns the name of this bucket.
+
+   .. code-block:: php
+
+      function getBucketName(): string
+
+   :returns:
+
+      The name of this bucket as a string.
+
+.. todo: add examples
diff --git a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
new file mode 100644
index 00000000..09238171
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
@@ -0,0 +1,28 @@
+==========================================
+MongoDB\\GridFS\\Bucket::getDatabaseName()
+==========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::getDatabaseName()
+
+   Returns the name of the database containing this bucket.
+
+   .. code-block:: php
+
+      function getDatabaseName(): string
+
+   :returns:
+
+      The name of the database containing this bucket as a string.
+
+.. todo: add examples
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
new file mode 100644
index 00000000..7915cdd7
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -0,0 +1,37 @@
+===================================================
+MongoDB\\GridFS\\Bucket::getFileDocumentForStream()
+===================================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileDocumentForStream()
+
+   Gets the file document of the GridFS file associated with a stream.
+
+   .. code-block:: php
+
+      function getFileDocumentForStream($stream): object
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()` has the
+   following parameters:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileDocumentForStream-param.rst
+
+   :returns:
+
+      The metadata document associated with the GridFS stream.
+
+.. todo: add examples
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
new file mode 100644
index 00000000..3fbec9ef
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -0,0 +1,38 @@
+=============================================
+MongoDB\\GridFS\\Bucket::getFileIdForStream()
+=============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileIdForStream()
+
+   Gets the file document's ID of the GridFS file associated with a stream.
+
+   .. code-block:: php
+
+      function getFileIdForStream($stream): mixed
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileIdForStream-param.rst
+
+   :returns:
+
+      The ``_id`` field of the metadata document associated with the GridFS
+      stream.
+
+.. todo: add examples
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
new file mode 100644
index 00000000..e81d20d6
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -0,0 +1,39 @@
+=============================================
+MongoDB\\GridFS\\Bucket::openDownloadStream()
+=============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStream()
+
+   Selects a GridFS file by its ``_id`` and opens it as a readable stream.
+
+   .. code-block:: php
+
+      function openDownloadStream($id): resource
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStream-param.rst
+
+   :returns:
+
+      A readable stream resource.
+
+.. todo: add examples
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
new file mode 100644
index 00000000..89e8ed56
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -0,0 +1,43 @@
+===================================================
+MongoDB\\GridFS\\Bucket::openDownloadStreamByName()
+===================================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStreamByName()
+
+   Selects a GridFS file by its ``filename`` and opens it as a readable stream.
+
+   .. code-block:: php
+
+      function openDownloadStreamByName($filename, array $options = []): resource
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()` has the
+   following parameters:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-option.rst
+
+   :returns:
+
+      A readable stream resource.
+
+.. todo: add examples
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
new file mode 100644
index 00000000..3ead7405
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -0,0 +1,47 @@
+===========================================
+MongoDB\\GridFS\\Bucket::openUploadStream()
+===========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::openUploadStream()
+
+   Opens a writable stream for a new GridFS file.
+
+   .. code-block:: php
+
+      function openUploadStream($filename, array $options = []): resource
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-option.rst
+
+   :returns:
+
+      A writable stream resource.
+
+Behavior
+--------
+
+Chunk documents will be created as data is written to the writable stream. The
+metadata document will be created when the writable stream is closed.
+
+.. todo: add examples
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt
new file mode 100644
index 00000000..b2f3984a
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-rename.txt
@@ -0,0 +1,28 @@
+=================================
+MongoDB\\GridFS\\Bucket::rename()
+=================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::rename()
+
+   Selects a GridFS file by its ``_id`` and alters its ``filename``.
+
+   .. code-block:: php
+
+      function rename($id, $newFilename): void
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::rename()` has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-rename-param.rst
+
+.. todo: add examples
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
new file mode 100644
index 00000000..9037bf29
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -0,0 +1,44 @@
+===========================================
+MongoDB\\GridFS\\Bucket::uploadFromStream()
+===========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::uploadFromStream()
+
+   Creates a new GridFS file and copies the contents of a readable stream to it.
+
+   .. code-block:: php
+
+      function uploadFromStream($filename, $source, array $options = []): mixed
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-option.rst
+
+   :returns:
+
+      The ``_id`` field of the metadata document associated with the newly
+      created GridFS file. If the ``_id`` option is not specified, a new
+      :php:`MongoDB\\BSON\\ObjectID ` object will
+      be used by default.
+
+.. todo: add examples
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
new file mode 100644
index 00000000..37777ea3
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -0,0 +1,45 @@
+======================================
+MongoDB\\GridFS\\Bucket::__construct()
+======================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::__construct()
+
+   Constructs a new :phpclass:`Bucket ` instance.
+
+   .. code-block:: php
+
+      function __construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = [])
+
+   :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()` has the following
+   parameters:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-option.rst
+
+Behavior
+--------
+
+If you construct a Bucket explicitly, the Bucket inherits any options
+from the :php:`MongoDB\\Driver\\Manager ` object.
+If you select the Bucket from a :phpclass:`Database ` object,
+the Bucket inherits its options from that object.
+
+.. todo: add an example
+
+.. seealso::
+
+   - :phpmethod:`MongoDB\\Database::selectGridFSBucket()`

From 80e040b7fb5c7dbdc01c26e3d2a758ae313694d5 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 31 Oct 2016 16:48:12 -0400
Subject: [PATCH 038/321] PHPLIB-221: GridFS tutorial documentation

---
 source/tutorial.txt        |   1 +
 source/tutorial/gridfs.txt | 214 +++++++++++++++++++++++++++++++++++++
 2 files changed, 215 insertions(+)
 create mode 100644 source/tutorial/gridfs.txt

diff --git a/source/tutorial.txt b/source/tutorial.txt
index 121fc718..b5ae43c6 100644
--- a/source/tutorial.txt
+++ b/source/tutorial.txt
@@ -7,4 +7,5 @@ Tutorials
 
    /tutorial/crud
    /tutorial/commands
+   /tutorial/gridfs
    /tutorial/indexes
diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt
new file mode 100644
index 00000000..a1f3a4ee
--- /dev/null
+++ b/source/tutorial/gridfs.txt
@@ -0,0 +1,214 @@
+======
+GridFS
+======
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+:manual:`GridFS ` is a specification for storing and retrieving
+files in MongoDB. GridFS uses two collections to store files. One collection
+stores the file chunks (e.g. ``fs.chunks``), and the other stores file metadata
+(e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket` class provides an
+interface around these collections for working with the files as PHP
+:php:`Streams `.
+
+Creating a GridFS Bucket
+------------------------
+
+You can construct a GridFS bucket using the PHP extension's
+:php:`MongoDB\\Driver\\Manager ` class, or select
+a bucket from the |php-library|'s :phpclass:`MongoDB\\Database` class via the
+:phpmethod:`selectGridFSBucket() `
+method.
+
+The bucket can be constructed with various options:
+
+ - ``bucketName`` determines the prefix for the buckey's metadata and chunk
+   collections. The default value is ``"fs"``.
+ - ``chunkSizeBytes`` determines the size of each chunk. GridFS divides the
+   file into chunks of this length, except for the last, which is only as large
+   as needed. The default size is ``261120`` (i.e. 255 KiB).
+ - ``readConcern``, ``readPreference`` and ``writeConcern`` options can be used
+   to specify defaults for read and write operations, much like the
+   :phpclass:`MongoDB\\GridFS\\Collection` options.
+
+Uploading Files with Writable Streams
+-------------------------------------
+
+To upload a file to GridFS using a writable stream, you can either open a stream
+and write to it directly or write the entire contents of another readable stream
+to GridFS all at once.
+
+To open an upload stream and write to it:
+
+.. code-block:: php
+
+   example->selectGridFSBucket();
+
+   $stream = $bucket->openUploadStream('my-file.txt');
+
+   $contents = file_get_contents('/path/to/my-file.txt');
+   fwrite($stream, $contents);
+   fclose($stream);
+
+To upload the entire contents of a readable stream in one call:
+
+.. code-block:: php
+
+   example->selectGridFSBucket();
+
+   $file = fopen('/path/to/my-file.txt', 'rb');
+   $bucket->uploadFromStream('my-file.txt', $file);
+
+Downloading Files with Readable Streams
+---------------------------------------
+
+To download a file from GridFS using a readable stream, you can either open a
+stream and read from it directly or download the entire file all at once.
+
+To open a download stream and read from it:
+
+.. code-block:: php
+
+   example->selectGridFSBucket();
+
+   $stream = $bucket->openDownloadStream($fileId);
+   $contents = file_get_contents($stream);
+
+To download the file all at once and write it to an writable stream:
+
+.. code-block:: php
+
+   example->selectGridFSBucket();
+
+   $file = fopen('/path/to/my-output-file.txt', 'wb');
+
+   $bucket->downloadToStream($fileId, $file);
+
+Selecting Files by Filename and Revision
+----------------------------------------
+
+You can also download a file specified by filename and (optionally) revision
+number. Revision numbers are used to distinguish between files sharing the same
+``filename`` metadata field, ordered by date of upload (i.e. the ``uploadDate``
+metadata field). The ``revision`` option accepted by
+:phpmethod:`openDownloadStreamByName()
+` and
+:phpmethod:`downloadToStreamByName()
+` can be positive or negative.
+
+A positive ``revision`` number may be used to select files in order of the
+oldest upload date. A revision of ``0`` would denote the file with the oldest
+upload date, a revision of ``1`` would denote the second oldest upload, and so
+on.
+
+A negative revision may be used to select files in order of the most recent
+upload date. A revision of ``-1`` would denote a file with the most recent
+upload date, a revision of ``-2`` would denote the second most recent upload,
+and so on. The ``revision`` option defaults to ``-1`` if not specified.
+
+The following example downloads the contents of the oldest version of a
+particular file:
+
+.. code-block:: php
+
+   example->selectGridFSBucket();
+
+   $stream = $bucket->openDownloadStreamByName('my-file.txt', ['revision' => 0]);
+   $contents = file_get_contents($stream);
+
+Deleting Files
+--------------
+
+You can delete a GridFS file by its ``_id``.
+
+.. code-block:: php
+
+   example->selectGridFSBucket();
+
+   $bucket->delete($fileId);
+
+Finding File Metadata
+---------------------
+
+The :phpmethod:`find() ` method allows you to
+retrieve documents from the GridFS files collection, which contain metadata
+about the GridFS files.
+
+.. code-block:: php
+
+   example->selectGridFSBucket();
+
+   $cursor = $bucket->find(['filename' => 'my-file.txt']);
+
+Accessing File Metadata for an Existing Stream
+----------------------------------------------
+
+The :phpmethod:`getFileDocumentForStream()
+` method may be used to get
+the file document for an existing readable or writable GridFS stream.
+
+.. code-block:: php
+
+   example->selectGridFSBucket();
+
+   $stream = $bucket->openDownloadStream($fileId);
+   $metadata = $bucket->getFileDocumentForStream($stream);
+
+.. note::
+
+   Since the file document for a writable stream is not committed to MongoDB
+   until the stream is closed,
+   :phpmethod:`getFileDocumentForStream()
+   ` can only return an
+   in-memory document, which will be missing some fields (e.g. ``length``,
+   ``md5``).
+
+The :phpmethod:`getFileIdForStream()
+` method may be used to get the
+``_id`` for an existing readable or writable GridFS stream. This is a
+convenience for accessing the ``_id`` property of the object returned by
+:phpmethod:`getFileDocumentForStream()
+`.
+
+.. code-block:: php
+
+   example->selectGridFSBucket();
+
+   $stream = $bucket->openDownloadStreamByName('my-file.txt');
+   $fileId = $bucket->getFileIdForStream($stream);

From 39f1c63ff598c99dd5dfedd3d7ce004c9b5c1003 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 1 Nov 2016 02:50:51 -0400
Subject: [PATCH 039/321] Refactor option/param includes and document MongoDB
 3.4 features

---
 ...Client-method-construct-driverOptions.yaml |   8 +-
 ...-MongoDBClient-method-construct-param.yaml |  15 +-
 ...goDBClient-method-dropDatabase-option.yaml |  17 +-
 ...ngoDBClient-method-dropDatabase-param.yaml |   4 -
 ...piargs-MongoDBClient-method-get-param.yaml |   2 -
 ...oDBClient-method-listDatabases-option.yaml |   1 -
 ...goDBClient-method-listDatabases-param.yaml |   2 -
 ...BClient-method-selectCollection-param.yaml |   6 -
 ...oDBClient-method-selectDatabase-param.yaml |   4 -
 ...iargs-MongoDBCollection-common-option.yaml |  79 +++++++++
 ...piargs-MongoDBCollection-common-param.yaml |  31 ++++
 ...oDBCollection-method-aggregate-option.yaml |  67 ++++----
 ...goDBCollection-method-aggregate-param.yaml |   6 +-
 ...oDBCollection-method-bulkWrite-option.yaml |  14 +-
 ...goDBCollection-method-bulkWrite-param.yaml |   8 +-
 ...oDBCollection-method-construct-option.yaml |  30 +---
 ...goDBCollection-method-construct-param.yaml |   8 -
 ...MongoDBCollection-method-count-option.yaml |  34 ++--
 ...-MongoDBCollection-method-count-param.yaml |   9 +-
 ...BCollection-method-createIndex-option.yaml |  43 ++---
 ...DBCollection-method-createIndex-param.yaml |   5 +-
 ...ollection-method-createIndexes-option.yaml |   7 +
 ...Collection-method-createIndexes-param.yaml |  23 +++
 ...DBCollection-method-deleteMany-option.yaml |  10 +-
 ...oDBCollection-method-deleteMany-param.yaml |  11 +-
 ...oDBCollection-method-deleteOne-option.yaml |  10 +-
 ...goDBCollection-method-deleteOne-param.yaml |  11 +-
 ...goDBCollection-method-distinct-option.yaml |  19 +--
 ...ngoDBCollection-method-distinct-param.yaml |  12 +-
 ...-MongoDBCollection-method-drop-option.yaml |  13 +-
 ...s-MongoDBCollection-method-drop-param.yaml |   3 -
 ...oDBCollection-method-dropIndex-option.yaml |  13 +-
 ...goDBCollection-method-dropIndex-param.yaml |  12 +-
 ...BCollection-method-dropIndexes-option.yaml |  13 +-
 ...DBCollection-method-dropIndexes-param.yaml |   2 -
 ...-MongoDBCollection-method-find-option.yaml | 160 ++++++++----------
 ...s-MongoDBCollection-method-find-param.yaml |  11 +-
 ...ngoDBCollection-method-findOne-option.yaml |  38 ++---
 ...ongoDBCollection-method-findOne-param.yaml |  11 +-
 ...ection-method-findOneAndDelete-option.yaml |  17 +-
 ...lection-method-findOneAndDelete-param.yaml |  11 +-
 ...ction-method-findOneAndReplace-option.yaml |  30 ++--
 ...ection-method-findOneAndReplace-param.yaml |  24 +--
 ...ection-method-findOneAndUpdate-option.yaml |  28 ++-
 ...lection-method-findOneAndUpdate-param.yaml |  26 +--
 ...DBCollection-method-insertMany-option.yaml |  10 +-
 ...oDBCollection-method-insertMany-param.yaml |   5 +-
 ...oDBCollection-method-insertOne-option.yaml |   8 +-
 ...goDBCollection-method-insertOne-param.yaml |   5 +-
 ...BCollection-method-listIndexes-option.yaml |   4 +-
 ...DBCollection-method-listIndexes-param.yaml |   4 +-
 ...DBCollection-method-replaceOne-option.yaml |  18 +-
 ...oDBCollection-method-replaceOne-param.yaml |  24 +--
 ...DBCollection-method-updateMany-option.yaml |  18 +-
 ...oDBCollection-method-updateMany-param.yaml |  17 +-
 ...oDBCollection-method-updateOne-option.yaml |  18 +-
 ...goDBCollection-method-updateOne-param.yaml |  17 +-
 ...BCollection-method-withOptions-option.yaml |  27 ++-
 ...DBCollection-method-withOptions-param.yaml |   4 +-
 ...apiargs-MongoDBDatabase-common-option.yaml |  16 ++
 ...MongoDBDatabase-method-command-option.yaml |  15 +-
 ...-MongoDBDatabase-method-command-param.yaml |   5 +-
 ...ngoDBDatabase-method-construct-option.yaml |  30 +---
 ...ongoDBDatabase-method-construct-param.yaml |   6 -
 ...tabase-method-createCollection-option.yaml |  68 ++++----
 ...atabase-method-createCollection-param.yaml |   4 -
 ...gs-MongoDBDatabase-method-drop-option.yaml |  16 +-
 ...rgs-MongoDBDatabase-method-drop-param.yaml |   2 -
 ...Database-method-dropCollection-option.yaml |  16 +-
 ...BDatabase-method-dropCollection-param.yaml |   4 -
 ...args-MongoDBDatabase-method-get-param.yaml |   2 -
 ...atabase-method-listCollections-option.yaml |   9 +-
 ...Database-method-listCollections-param.yaml |   2 -
 ...tabase-method-selectCollection-option.yaml |   8 -
 ...atabase-method-selectCollection-param.yaml |   4 -
 ...base-method-selectGridFSBucket-option.yaml |  12 +-
 ...abase-method-selectGridFSBucket-param.yaml |   2 -
 ...oDBDatabase-method-withOptions-option.yaml |  27 ++-
 ...goDBDatabase-method-withOptions-param.yaml |   2 -
 ...rgs-MongoDBGridFSBucket-common-option.yaml |  50 ++++++
 ...args-MongoDBGridFSBucket-common-param.yaml |  39 +++++
 ...BGridFSBucket-method-construct-option.yaml |  12 +-
 ...DBGridFSBucket-method-construct-param.yaml |   6 -
 ...ngoDBGridFSBucket-method-delete-param.yaml |  14 +-
 ...SBucket-method-downloadToStream-param.yaml |  26 +--
 ...-method-downloadToStreamByName-option.yaml |  24 +--
 ...t-method-downloadToStreamByName-param.yaml |  28 +--
 ...method-getFileDocumentForStream-param.yaml |  12 +-
 ...ucket-method-getFileIdForStream-param.yaml |  12 +-
 ...ucket-method-openDownloadStream-param.yaml |  14 +-
 ...ethod-openDownloadStreamByName-option.yaml |  24 +--
 ...method-openDownloadStreamByName-param.yaml |  16 +-
 ...Bucket-method-openUploadStream-option.yaml |  38 +----
 ...SBucket-method-openUploadStream-param.yaml |  16 +-
 ...ngoDBGridFSBucket-method-rename-param.yaml |  17 +-
 ...Bucket-method-uploadFromStream-option.yaml |  38 +----
 ...SBucket-method-uploadFromStream-param.yaml |  21 +--
 source/includes/apiargs-common-option.yaml    |  76 +++------
 source/includes/apiargs-common-param.yaml     |  16 --
 .../method/MongoDBCollection-createIndex.txt  |   2 +-
 .../MongoDBCollection-createIndexes.txt       |  47 ++---
 101 files changed, 820 insertions(+), 1065 deletions(-)
 create mode 100644 source/includes/apiargs-MongoDBCollection-common-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-common-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBDatabase-common-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml

diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
index b8b63931..33b1bae3 100644
--- a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
@@ -4,9 +4,8 @@ type: array
 description: |
   Default :php:`type map
   `
-  to apply to cursors. The type map determines how BSON documents are converted
-  to PHP values which determines. The |php-library| uses the following type map
-  by default:
+  to apply to cursors, which determines how BSON documents are converted to PHP
+  values. The |php-library| uses the following type map by default:
 
   .. code-block:: php
 
@@ -16,7 +15,6 @@ description: |
          'root' => 'MongoDB\Model\BSONDocument',
      ]
 interface: phpmethod
-operation: MongoDB\\Client::__construct
+operation: ~
 optional: true
-position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
index 2365d44f..03f2d572 100644
--- a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
@@ -6,11 +6,10 @@ description: |
   connect. Refer to the :manual:`MongoDB connection string reference
   ` for formatting.
 
-  Defaults to ``mongodb://127.0.0.1:27017`` if unspecified.
+  Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified.
 interface: phpmethod
-operation: MongoDB\\Client::__construct
+operation: ~
 optional: true
-position: 1
 ---
 arg_name: param
 name: $uriOptions
@@ -19,15 +18,14 @@ description: |
   Specifies additional URI options, such as authentication credentials or query
   string parameters. The options specified in ``$uriOptions`` take precedence
   over any analogous options present in the ``$uri`` string.
-post: |
+
   Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
   ` extension reference and :manual:`MongoDB
-  connection string ` documentation for valid
+  connection string ` documentation for accepted
   options.
 interface: phpmethod
-operation: MongoDB\\Client::__construct
+operation: ~
 optional: true
-position: 2
 ---
 arg_name: param
 name: $driverOptions
@@ -39,7 +37,6 @@ description: |
   `
   to apply to the cursors it creates.
 interface: phpmethod
-operation: MongoDB\\Client::__construct
+operation: ~
 optional: true
-position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
index de0ceb56..22141f1a 100644
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
@@ -1,8 +1,19 @@
 source:
   file: apiargs-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Client::dropDatabase
+post: |
+  This will be used for the returned command result document.
+---
+arg_name: option
+name: writeConcern
+type: :php:`MongoDB\\Driver\\WriteConcern `
 description: |
-  Type map for BSON deserialization. This will be used for the returned command
-  result document. Defaults to the clients's type map.
+  :manual:`Write concern ` to use for the operation.
+  Defaults to the client's write concern.
+
+  This is not supported for server versions prior to 3.4 and will result in an
+  exception at execution time if used.
+interface: phpmethod
+operation: ~
+optional: true
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
index c0cf8e34..07b76834 100644
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
@@ -1,14 +1,10 @@
 source:
   file: apiargs-common-param.yaml
   ref: $databaseName
-operation: MongoDB\\Client::dropDatabase
-position: 1
 replacement:
   action: " to drop"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Client::dropDatabase
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-get-param.yaml b/source/includes/apiargs-MongoDBClient-method-get-param.yaml
index 7a228e41..e9d3ccc6 100644
--- a/source/includes/apiargs-MongoDBClient-method-get-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-get-param.yaml
@@ -1,8 +1,6 @@
 source:
   file: apiargs-common-param.yaml
   ref: $databaseName
-operation: MongoDB\\Client::__get
-position: 1
 replacement:
   action: " to select"
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
index 0ca09184..4eb407fe 100644
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
@@ -1,5 +1,4 @@
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
-operation: MongoDB\\Client::listDatabases
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
index 3297e349..73ad04d0 100644
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
@@ -1,6 +1,4 @@
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Client::listDatabases
-position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
index a2cfa687..99c76446 100644
--- a/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
@@ -1,22 +1,16 @@
 source:
   file: apiargs-common-param.yaml
   ref: $databaseName
-operation: MongoDB\\Client::selectCollection
-position: 1
 replacement:
   action: " containing the collection to select"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $collectionName
-operation: MongoDB\\Client::selectCollection
-position: 2
 replacement:
   action: " to select"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Client::selectCollection
-position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
index 2432ca4d..8e5f9d45 100644
--- a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
@@ -1,14 +1,10 @@
 source:
   file: apiargs-common-param.yaml
   ref: $databaseName
-operation: MongoDB\\Client::selectDatabase
-position: 1
 replacement:
   action: " to select"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Client::selectDatabase
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
new file mode 100644
index 00000000..559c138b
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-common-option.yaml
@@ -0,0 +1,79 @@
+arg_name: option
+name: bypassDocumentValidation
+type: boolean
+description: |
+   If ``true``, allows the write operation to circumvent document level
+   validation. Defaults to ``false``.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: collation
+type: array|object
+description: |
+   :manual:`Collation ` allows users to specify
+   language-specific rules for string comparison, such as rules for lettercase
+   and accent marks. When specifying collation, the ``locale`` field is
+   mandatory; all other collation fields are optional. For descriptions of the
+   fields, see :manual:`Collation Document
+   `.
+
+   If the collation is unspecified but the collection has a default collation,
+   the operation uses the collation specified for the collection. If no
+   collation is specified for the collection or for the operation, MongoDB uses
+   the simple binary comparison used in prior versions for string comparisons.
+
+   This option is available in MongoDB 3.4+ and will result in an exception at
+   execution time if specified for an older server version.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: readConcern
+type: :php:`MongoDB\\Driver\\ReadConcern `
+description: |
+   :manual:`Read concern ` to use for the operation.
+   Defaults to the collection's read concern.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: readPreference
+type: :php:`MongoDB\\Driver\\ReadPreference `
+description: |
+   :manual:`Read preference ` to use for the
+   operation. Defaults to the collection's read preference.
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: typeMap
+replacement:
+  parent: "collection"
+---
+arg_name: option
+name: writeConcern
+type: :php:`MongoDB\\Driver\\WriteConcern `
+description: |
+   :manual:`Write concern ` to use for the operation.
+   Defaults to the collection's write concern.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: upsert
+type: boolean
+description: |
+   If set to ``true``, creates a new document when no document matches the query
+   criteria. The default value is ``false``, which does not insert a new
+   document when no match is found.
+interface: phpmethod
+operation: ~
+optional: true
+...
diff --git a/source/includes/apiargs-MongoDBCollection-common-param.yaml b/source/includes/apiargs-MongoDBCollection-common-param.yaml
new file mode 100644
index 00000000..73c18fa4
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-common-param.yaml
@@ -0,0 +1,31 @@
+arg_name: param
+name: $filter
+type: array|object
+description: |
+  The filter criteria that specifies the documents{{action}}.
+interface: phpmethod
+operation: ~
+optional: false
+replacement:
+  action: ""
+---
+arg_name: param
+name: $replacement
+type: array|object
+description: |
+  The replacement document.
+interface: phpmethod
+operation: ~
+optional: false
+---
+arg_name: param
+name: $update
+type: array|object
+description: |
+  Specifies the field and value combinations to update and any relevant update
+  operators. ``$update`` uses MongoDB's :method:`update operators
+  `.
+interface: phpmethod
+operation: ~
+optional: false
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 38f00c4c..0d440197 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -3,68 +3,59 @@ name: allowDiskUse
 type: boolean
 description: |
   Enables writing to temporary files. When set to ``true``, aggregation stages
-  can write data to the ``_tmp`` sub-directory in the dbPath directory.
-  The default is ``false``.
+  can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory. The
+  default is ``false``.
 interface: phpmethod
-operation: MongoDB\\Collection::aggregate
+operation: ~
 optional: true
-position: 1
 ---
 arg_name: option
 name: batchSize
 type: integer
 description: |
-  The number of documents to return per batch
+  Specifies the initial batch size for the cursor. A batchSize of ``0`` means an
+  empty first batch and is useful for quickly returning a cursor or failure
+  message without doing significant server-side work.
+
+  .. note::
+
+     This is not supported for inline aggregation results (i.e. ``useCursor``
+     option is ``false`` or the server version is < 2.6).
 interface: phpmethod
-operation: MongoDB\\Collection::aggregate
+operation: ~
 optional: true
-position: 2
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
-operation: MongoDB\\Collection::aggregate
-position: 3
+post: |
+  This only applies when using the :pipeline:`$out` stage.
+
+  Document validation requires MongoDB 3.2 or later: if you are using an earlier
+  version of MongoDB, this option will be ignored.
 ---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
-operation: MongoDB\\Collection::aggregate
-position: 4
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: readConcern
-operation: MongoDB\\Collection::aggregate
-position: 5
-replacement:
-  resource: "aggregation"
-  parent: "collection"
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
-operation: MongoDB\\Collection::aggregate
-position: 6
-replacement:
-  resource: "aggregation"
-  parent: "collection"
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Collection::aggregate
-position: 7
-description: |
-  Type map for BSON deserialization. This will be applied to the returned
-  cursor. Defaults to the collections's type map.
-
+post: |
   .. note::
 
      This is not supported for inline aggregation results (i.e. ``useCursor``
      option is ``false`` or the server version is < 2.6).
 ---
-arg_name: param
+arg_name: option
 name: useCursor
 type: boolean
 description: |
@@ -77,7 +68,15 @@ description: |
   ``useCursor`` is ignored for MongoDB versions prior to 2.6 as aggregation
   cursors are not available.
 interface: phpmethod
-operation: MongoDB\\Collection::aggregate
+operation: ~
 optional: true
-position: 8
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: writeConcern
+post: |
+  This only applies when the ``$out`` stage is specified.
+
+  This is not supported for server versions prior to 3.4 and will result in an
+  exception at execution time if used.
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
index 65433abb..cbad3b49 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
@@ -5,12 +5,10 @@ description: |
   Specifies an :manual:`aggregation pipeline `
   operation.
 interface: phpmethod
-operation: MongoDB\\Collection::aggregate
-position: 1
+operation: ~
+optional: false
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Collection::aggregate
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
index afc90708..680769cf 100644
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
@@ -1,8 +1,6 @@
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
-operation: MongoDB\\Collection::bulkWrite
-position: 1
 ---
 arg_name: option
 name: ordered
@@ -16,16 +14,10 @@ description: |
 
   The default is ``true``.
 interface: phpmethod
-operation: MongoDB\\Collection::bulkWrite
+operation: ~
 optional: true
-position: 2
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Collection::bulkWrite
-replacement:
-  resource: "write"
-  parent: "collection"
-position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
index 7f115862..79423a63 100644
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
@@ -22,20 +22,16 @@ description: |
          [ 'updateMany' => [ $filter, $update, $options ] ],
          [ 'updateOne'  => [ $filter, $update, $options ] ],
      ]
-post: |
+
   Arguments correspond to the respective operation methods. However, the
   ``writeConcern`` option is specified as a top-level option to
   :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
   operation.
 interface: phpmethod
-operation: MongoDB\\Collection::bulkWrite
+operation: ~
 optional: true
-position: 1
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Collection::bulkWrite
-interface: phpmethod
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
index 006a71eb..7d422ca0 100644
--- a/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
@@ -1,8 +1,6 @@
 source:
   file: apiargs-common-option.yaml
   ref: readConcern
-operation: MongoDB\\Collection::__construct
-position: 1
 replacement:
   resource: "collection"
   parent: "manager"
@@ -10,39 +8,17 @@ replacement:
 source:
   file: apiargs-common-option.yaml
   ref: readPreference
-operation: MongoDB\\Collection::__construct
-position: 2
 replacement:
   resource: "collection"
   parent: "manager"
 ---
-arg_name: option
-name: typeMap
-type: array
-description: |
-  Default :php:`type map
-  `
-  to apply to cursors. The type map determines how BSON documents are converted
-  to PHP values which determines. The |php-library| uses the following type map
-  by default:
-
-  .. code-block:: php
-
-     [
-         'array' => 'MongoDB\Model\BSONArray',
-         'document' => 'MongoDB\Model\BSONDocument',
-         'root' => 'MongoDB\Model\BSONDocument',
-     ]
-interface: phpmethod
-operation: MongoDB\\Collection::__construct
-optional: true
-position: 3
+source:
+  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
+  ref: typeMap
 ---
 source:
   file: apiargs-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Collection::__construct
-position: 4
 replacement:
   resource: "collection"
   parent: "manager"
diff --git a/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml b/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
index d72ed636..0827800b 100644
--- a/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
@@ -1,24 +1,16 @@
 source:
   file: apiargs-common-param.yaml
   ref: $manager
-operation: MongoDB\\Collection::__construct
-position: 1
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $databaseName
-operation: MongoDB\\Collection::__construct
-position: 2
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $collectionName
-operation: MongoDB\\Collection::__construct
-position: 3
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Collection::__construct
-position: 4
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
index 098e9d21..a3598c59 100644
--- a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
@@ -1,54 +1,44 @@
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+---
 arg_name: option
 name: hint
 type: string|array|object
 description: |
   The index to use. If you specify a document, it is interpreted as an index
-  specification and a name will be generated.
+  specification from which a name will be derived.
 interface: phpmethod
-operation: MongoDB\\Collection::count
+operation: ~
 optional: true
-position: 1
 ---
 arg_name: option
 name: limit
 type: integer
 description: |
-  The maximum number of documents to return.
+  The maximum number of matching documents to return.
 interface: phpmethod
-operation: MongoDB\\Collection::count
+operation: ~
 optional: true
-position: 2
 ---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
-operation: MongoDB\\Collection::count
-position: 3
 ---
 source:
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: readConcern
-  file: apiargs-common-option.yaml
-operation: MongoDB\\Collection::count
-replacement:
-  resource: "count"
-  parent: "collection"
-position: 4
 ---
 source:
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
-  file: apiargs-common-option.yaml
-replacement:
-  resource: "count"
-  parent: "collection"
-position: 5
 ---
 arg_name: option
 name: skip
 type: integer
 description: |
-  The number of documents to skip before returning the documents.
+  The number of matching documents to skip before returning results.
 interface: phpmethod
-operation: MongoDB\\Collection::count
+operation: ~
 optional: true
-position: 6
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-param.yaml b/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
index 75f281d8..e18c616b 100644
--- a/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
@@ -1,12 +1,11 @@
 source:
-  file: apiargs-common-param.yaml
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-operation: MongoDB\\Collection::count
-position: 1
+optional: true
+replacement:
+  action: " to count"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Collection::count
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
index 65b38892..a7364a66 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
@@ -4,9 +4,15 @@ type: boolean
 description: |
   Creates a :manual:`unique ` index.
 interface: phpmethod
-operation: MongoDB\\Collection::createIndex
+operation: ~
 optional: true
-position: 1
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+pre: |
+  Specifies the :manual:`collation
+  ` for the index.
 ---
 arg_name: option
 name: partialFilterExpression
@@ -14,9 +20,8 @@ type: array|object
 description: |
   Creates a :manual:`partial ` index.
 interface: phpmethod
-operation: MongoDB\\Collection::createIndex
+operation: ~
 optional: true
-position: 2
 ---
 arg_name: option
 name: sparse
@@ -24,9 +29,8 @@ type: boolean
 description: |
   Creates a :manual:`sparse ` index.
 interface: phpmethod
-operation: MongoDB\\Collection::createIndex
+operation: ~
 optional: true
-position: 3
 ---
 arg_name: option
 name: expireAfterSeconds
@@ -34,20 +38,18 @@ type: integer
 description: |
   Creates a :manual:`TTL ` index.
 interface: phpmethod
-operation: MongoDB\\Collection::createIndex
+operation: ~
 optional: true
-position: 4
 ---
 arg_name: option
 name: name
 type: string
 description: |
-  Specifies the name for the index. By default, MongoDB creates index names
-  based on the key.
+  A name that uniquely identifies the index. By default, MongoDB creates index
+  names based on the key.
 interface: phpmethod
-operation: MongoDB\\Collection::createIndex
+operation: ~
 optional: true
-position: 5
 ---
 arg_name: option
 name: background
@@ -56,9 +58,8 @@ description: |
   Instructs MongoDB to build the index :manual:`as a background
   ` process.
 interface: phpmethod
-operation: MongoDB\\Collection::createIndex
+operation: ~
 optional: true
-position: 6
 ---
 arg_name: option
 name: 2dsphereIndexVersion
@@ -69,15 +70,15 @@ description: |
 
   MongoDB 2.6 introduced version 2 of 2dsphere indexes. Version 2 is the default
   version of 2dsphere indexes created in MongoDB 2.6 and later versions.
-  ``2dsphereIndexVersion`` enables you to overrride the default version 2.
+  ``2dsphereIndexVersion`` enables you to override the default version 2.
 interface: phpmethod
-operation: MongoDB\\Collection::createIndex
+operation: ~
 optional: true
-position: 7
 ---
 source:
-  ref: maxTimeMS
-  file: apiargs-common-option.yaml
-operation: MongoDB\\Collection::createIndex
-position: 8
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: writeConcern
+post: |
+  This is not supported for server versions prior to 3.4 and will result in an
+  exception at execution time if used.
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
index 5d1d0deb..c2979d91 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
@@ -10,14 +10,11 @@ description: |
   .. code-block:: php
 
      [ 'username' => -1 ]
-operation: MongoDB\\Collection::createIndex
 interface: phpmethod
+operation: ~
 optional: false
-position: 1
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Collection::createIndex
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
new file mode 100644
index 00000000..2be24cba
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
@@ -0,0 +1,7 @@
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: writeConcern
+post: |
+  This is not supported for server versions prior to 3.4 and will result in an
+  exception at execution time if used.
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
new file mode 100644
index 00000000..e98d9aad
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
@@ -0,0 +1,23 @@
+arg_name: param
+name: $indexes
+type: array
+description: |
+  The indexes to create on the collection.
+
+  For example, the following specifies a unique index on the ``username`` field
+  and a compound index on the ``email`` and ``createdAt`` fields:
+
+  .. code-block:: php
+
+     [
+         [ 'key' => [ 'username' => -1 ], 'unique' => true ],
+         [ 'key' => [ 'email' => 1, 'createdAt' => 1 ] ],
+     ]
+interface: phpmethod
+operation: ~
+optional: false
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
index 1593a191..8c775dde 100644
--- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
@@ -1,8 +1,8 @@
 source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
-  file: apiargs-common-option.yaml
-operation: MongoDB\\Collection::deleteMany
-replacement:
-  resource: "delete"
-position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
index c304607c..92797eb5 100644
--- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
@@ -1,14 +1,11 @@
 source:
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-  file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::deleteMany
+optional: false
 replacement:
-  verb: "delete"
-position: 1
+  action: " to delete"
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::deleteMany
-position: 2
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
index 55bd14ad..8c775dde 100644
--- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
@@ -1,8 +1,8 @@
 source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
-  file: apiargs-common-option.yaml
-operation: MongoDB\\Collection::deleteOne
-replacement:
-  resource: "delete"
-position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
index 1ab60699..92797eb5 100644
--- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
@@ -1,14 +1,11 @@
 source:
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-  file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::deleteOne
+optional: false
 replacement:
-  verb: "delete"
-position: 1
+  action: " to delete"
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::deleteOne
-position: 2
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
index 6c1ad568..e8608b38 100644
--- a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
@@ -1,21 +1,16 @@
 source:
-  ref: maxTimeMS
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+---
+source:
   file: apiargs-common-option.yaml
-operation: MongoDB\\Collection::distinct
-position: 1
+  ref: maxTimeMS
 ---
 source:
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: readConcern
-  file: apiargs-common-option.yaml
-operation: MongoDB\\Collection::distinct
-replacement:
-  resource: "distinct"
-position: 2
 ---
 source:
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
-  file: apiargs-common-option.yaml
-replacement:
-  resource: "distinct"
-position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
index c5396306..37cd9b50 100644
--- a/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
@@ -4,19 +4,17 @@ type: string
 description: |
   The field for which to return distinct values.
 interface: phpmethod
-operation: MongoDB\\Collection::distinct
+operation: ~
 optional: false
-position: 1
 ---
 source:
-  file: apiargs-common-param.yaml
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-position: 2
 optional: true
+replacement:
+  action: " from which to retrieve the distinct values"
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::count
-position: 3
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
index 5286e3d4..6460329f 100644
--- a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
@@ -1,6 +1,13 @@
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Collection::drop
-position: 1
+post: |
+  This will be used for the returned command result document.
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: writeConcern
+post: |
+  This is not supported for server versions prior to 3.4 and will result in an
+  exception at execution time if used.
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
index 8d7bb4a3..73ad04d0 100644
--- a/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
@@ -1,7 +1,4 @@
 source:
   file: apiargs-common-param.yaml
   ref: $options
-interface: phpmethod
-operation: MongoDB\\Collection::drop
-position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
index ba694f7f..6460329f 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
@@ -1,6 +1,13 @@
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Collection::dropIndex
-position: 1
+post: |
+  This will be used for the returned command result document.
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: writeConcern
+post: |
+  This is not supported for server versions prior to 3.4 and will result in an
+  exception at execution time if used.
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
index 316f5caa..53061d16 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
@@ -2,18 +2,14 @@ arg_name: param
 name: $indexName
 type: string
 description: |
-  The name of the index to drop. View the existing indexes on the
-  collection using the :phpmethod:`listIndexes
-  ` method.
+  The name of the index to drop. View the existing indexes on the collection
+  using the :phpmethod:`listIndexes() `
+  method.
 interface: phpmethod
-operation: MongoDB\\Collection::dropIndex
+operation: ~
 optional: false
-position: 1
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-interface: phpmethod
-operation: MongoDB\\Collection::dropIndex
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
index a7284fa0..6460329f 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
@@ -1,6 +1,13 @@
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Collection::dropIndexes
-position: 1
+post: |
+  This will be used for the returned command result document.
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: writeConcern
+post: |
+  This is not supported for server versions prior to 3.4 and will result in an
+  exception at execution time if used.
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
index 02215c56..73ad04d0 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
@@ -1,6 +1,4 @@
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Collection::dropIndexes
-position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index bcd01a65..b5ffe9c9 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -1,166 +1,146 @@
-name: sort
+arg_name: option
+name: projection
 type: array|object
-optional: true
 description: |
-   The sort specification for the ordering of the results.
-arg_name: field
-operation: MongoDB\\Collection::find
+  The :ref:`projection specification ` to determine which fields to
+  include in the returned documents. See :manual:`Project Fields to Return from
+  Query ` and
+  :manual:`Projection Operators ` in the MongoDB
+  manual.
 interface: phpmethod
-position: 2
+operation: ~
+optional: true
 ---
-name: projection
+arg_name: option
+name: sort
 type: array|object
-optional: true
 description: |
-   The :ref:`projection specification ` to determine
-   which fields to include in the returned documents. See
-   :manual:`Project Fields to Return from Query
-   ` in the MongoDB
-   manual.
-arg_name: field
-operation: MongoDB\\Collection::find
+  The sort specification for the ordering of the results.
 interface: phpmethod
-position: 1
+operation: ~
+optional: true
 ---
+arg_name: option
 name: skip
 type: integer
-optional: true
 description: |
-   Number of documents to skip. Defaults to 0.
-arg_name: field
-operation: MongoDB\\Collection::find
+  Number of documents to skip. Defaults to ``0``.
 interface: phpmethod
-position: 3
+operation: ~
+optional: true
 ---
+arg_name: option
 name: limit
 type: integer
-optional: true
 description: |
-   The maximum number of documents to return. If unspecified,
-   then defaults to no limit. A limit of 0 is equivalent to setting no
-   limit.
-arg_name: field
-operation: MongoDB\\Collection::find
+  The maximum number of documents to return. If unspecified, then defaults to no
+  limit. A limit of ``0`` is equivalent to setting no limit.
 interface: phpmethod
-position: 4
+operation: ~
+optional: true
 ---
+arg_name: option
 name: batchSize
 type: integer
-optional: true
 description: |
-   The number of documents to return in the first batch.
-   Defaults to 101. A batchSize of 0 means that the cursor will be
-   established, but no documents will be returned in the first batch.
+  The number of documents to return in the first batch. Defaults to ``101``. A
+  batchSize of ``0`` means that the cursor will be established, but no documents
+  will be returned in the first batch.
 
-   Unlike the previous wire protocol version, a batchSize of 1 for
-   the :dbcommand:`find` command does not close the cursor.
-arg_name: field
-operation: MongoDB\\Collection::find
+  Unlike the previous wire protocol version, a batchSize of ``1`` for the
+  :dbcommand:`find` command does not close the cursor.
 interface: phpmethod
-position: 5
+operation: ~
+optional: true
 ---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+---
+arg_name: option
 name: comment
 type: string
-optional: true
 description: |
-   A comment to attach to the query to help interpret and trace query
-   :dbcommand:`profile` data.
-arg_name: field
-operation: MongoDB\\Collection::find
+  A comment to attach to the query to help interpret and trace query
+  :dbcommand:`profile` data.
 interface: phpmethod
-position: 6
+operation: ~
+optional: true
 ---
 arg_name: option
 name: cursorType
 type: integer
 description: |
-   Indicates the type of cursor to use. ``cursorType`` supports the following
-   values:
+  Indicates the type of cursor to use. ``cursorType`` supports the following
+  values:
 
    - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
    - ``MongoDB\Operation\Find::TAILABLE``
 interface: phpmethod
-operation: MongoDB\\Collection::find
+operation: ~
 optional: true
-position: 7
 ---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
-operation: MongoDB\\Collection::find
-position: 8
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: readConcern
-operation: MongoDB\\Collection::find
-position: 9
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
-pre: |
-  For use with MongoDB 3.0 and earlier.
-operation: MongoDB\\Collection::find
-position: 10
 ---
+arg_name: option
 name: oplogReplay
 type: boolean
-optional: true
 description: |
-   Internal use for replica sets. To use oplogReplay, you must include
-   the following condition in the filter:
+  Internal use for replica sets. To use ``oplogReplay``, you must include the
+  following condition in the filter:
 
-   .. code-block:: javascript
+  .. code-block:: javascript
 
-      { ts: { $gte:  } }
+     { ts: { $gte:  } }
 
-   The :php:`MongoDB\\BSON\\Timestamp `
-   class reference describes how to represent MongoDB's BSON
-   timestamp type with PHP.
-arg_name: field
-operation: MongoDB\\Collection::find
+  The :php:`MongoDB\\BSON\\Timestamp ` class
+  reference describes how to represent MongoDB's BSON timestamp type with PHP.
 interface: phpmethod
-position: 11
+operation: ~
+optional: true
 ---
+arg_name: option
 name: noCursorTimeout
 type: boolean
-optional: true
 description: |
-   Prevents the server from timing out idle cursors after an inactivity
-   period (10 minutes).
-arg_name: field
-operation: MongoDB\\Collection::find
+  Prevents the server from timing out idle cursors after an inactivity period
+  (10 minutes).
 interface: phpmethod
-position: 12
+operation: ~
+optional: true
 ---
+arg_name: option
 name: allowPartialResults
 type: boolean
-optional: true
 description: |
-   For queries against a sharded collection, returns partial results from
-   the :program:`mongos` if some shards are unavailable instead of
-   throwing an error.
-arg_name: field
-operation: MongoDB\\Collection::find
+  For queries against a sharded collection, returns partial results from the
+  :program:`mongos` if some shards are unavailable instead of throwing an error.
 interface: phpmethod
-position: 13
+operation: ~
+optional: true
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Collection::find
-position: 14
 ---
 arg_name: option
 name: modifiers
-type: array
+type: array|object
 description: |
-   Meta-operators that modify the output or behavior of a query.
-   :manual:`Cursor Methods  describes the
-   query modification methods available in MongoDB.
+  Meta-operators that modify the output or behavior of a query. :manual:`Cursor
+  Methods  describes the query modification
+  methods available in MongoDB.
 interface: phpmethod
-operation: MongoDB\\Collection::find
+operation: ~
 optional: true
-position: 15
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-find-param.yaml b/source/includes/apiargs-MongoDBCollection-method-find-param.yaml
index 4c2e6c51..5683a7bb 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-param.yaml
@@ -1,14 +1,11 @@
 source:
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-  file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::find
+optional: true
 replacement:
-  verb: "query"
-position: 1
+  action: " to query"
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::find
-position: 2
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
index 425b19e2..4e3793e3 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
@@ -1,56 +1,42 @@
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: projection
-operation: MongoDB\\Collection::findOne
-position: 1
 ---
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: sort
-operation: MongoDB\\Collection::findOne
-position: 2
 ---
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: skip
-operation: MongoDB\\Collection::findOne
-position: 3
 ---
 source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: comment
-operation: MongoDB\\Collection::findOne
-position: 4
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
 ---
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: modifiers
-operation: MongoDB\\Collection::findOne
-position: 5
+  ref: comment
 ---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
-operation: MongoDB\\Collection::findOne
-position: 6
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: readConcern
-operation: MongoDB\\Collection::findOne
-position: 7
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
-pre: |
-  For use with MongoDB 3.0 and earlier.
-operation: MongoDB\\Collection::findOne
-position: 8
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Collection::findOne
-position: 9
+post: |
+  This will be used for the returned result document.
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: modifiers
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
index fc934334..5683a7bb 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
@@ -1,14 +1,11 @@
 source:
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-  file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::findOne
+optional: true
 replacement:
-  verb: "query"
-position: 1
+  action: " to query"
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::findOne
-position: 2
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
index f75b78c3..066a4714 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
@@ -1,24 +1,23 @@
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: projection
-operation: MongoDB\\Collection::findOneAndDelete
-position: 1
 ---
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: sort
-operation: MongoDB\\Collection::findOneAndDelete
-position: 2
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
 ---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
-operation: MongoDB\\Collection::findOneAndDelete
-position: 3
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Collection::findOneAndDelete
-position: 4
+post: |
+  This is not supported for server versions prior to 3.2 and will be ignored if
+  used.
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
index 296ecf51..92797eb5 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
@@ -1,14 +1,11 @@
 source:
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-  file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::findOneAndDelete
+optional: false
 replacement:
-  verb: "query"
-position: 1
+  action: " to delete"
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::findOneAndDelete
-position: 2
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
index 11cacf60..8dd5745a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
@@ -1,50 +1,44 @@
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: projection
-operation: MongoDB\\Collection::findOneAndReplace
-position: 1
 ---
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: sort
-operation: MongoDB\\Collection::findOneAndReplace
-position: 2
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
 ---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
-operation: MongoDB\\Collection::findOneAndReplace
-position: 3
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
-operation: MongoDB\\Collection::findOneAndReplace
-position: 4
 ---
 arg_name: option
 name: returnDocument
 type: integer
 description: |
-  Specifies whether to return the document before the replacementi applied, or
+  Specifies whether to return the document before the replacement is applied, or
   after. ``returnDocument`` supports the following values:
 
   - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*)
   - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
 interface: phpmethod
-operation: MongoDB\Collection::findOneAndUpdate
+operation: ~
 optional: true
-position: 5
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: upsert
-operation: MongoDB\\Collection::findOneAndReplace
-position: 6
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Collection::findOneAndReplace
-position: 7
+post: |
+  This is not supported for server versions prior to 3.2 and will be ignored if
+  used.
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
index 9d6d9366..32ed6b35 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
@@ -1,25 +1,15 @@
 source:
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-  file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::findOneAndReplace
-replacement:
-  verb: "query"
 optional: false
-position: 1
+replacement:
+  action: " to replace"
 ---
-arg_name: param
-name: $replacement
-type: array|object
-description: |
-  The document to replace.
-interface: phpmethod
-operation: MongoDB\\Collection::findOneAndReplace
-optional: false
-position: 2
+source:
+  file: apiargs-MongoDBCollection-common-param.yaml
+  ref: $replacement
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::findOneAndReplace
-position: 3
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
index 3dcd30fa..4da7703f 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
@@ -1,26 +1,22 @@
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: projection
-operation: MongoDB\Collection::findOneAndUpdate
-position: 1
 ---
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: sort
-operation: MongoDB\Collection::findOneAndUpdate
-position: 2
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
 ---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
-operation: MongoDB\Collection::findOneAndUpdate
-position: 3
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
-operation: MongoDB\Collection::findOneAndUpdate
-position: 4
 ---
 arg_name: option
 name: returnDocument
@@ -32,19 +28,17 @@ description: |
   - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*)
   - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
 interface: phpmethod
-operation: MongoDB\Collection::findOneAndUpdate
+operation: ~
 optional: true
-position: 5
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: upsert
-operation: MongoDB\\Collection::findOneAndUpdate
-position: 6
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
-operation: MongoDB\Collection::findOneAndUpdate
-position: 7
+post: |
+  This is not supported for server versions prior to 3.2 and will be ignored if
+  used.
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
index 399cef06..a335678a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
@@ -1,27 +1,15 @@
 source:
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-  file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::findOneAndUpdate
-replacement:
-  verb: "query"
 optional: false
-position: 1
+replacement:
+  action: " to update"
 ---
-arg_name: param
-name: $update
-type: array|object
-description: |
-  Specifies the field and value combinations to update and any
-  relevant update operators. ``$update`` uses MongoDB's
-  :method:`update operators `.
-interface: phpmethod
-operation: MongoDB\\Collection::findOneAndUpdate
-optional: false
-position: 2
+source:
+  file: apiargs-MongoDBCollection-common-param.yaml
+  ref: $update
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::findOneAndUpdate
-position: 3
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
index 01330fcf..1b32b97a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
@@ -1,18 +1,12 @@
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
-operation: MongoDB\\Collection::insertMany
-position: 1
 ---
 source:
   file: apiargs-MongoDBCollection-method-bulkWrite-option.yaml
   ref: ordered
-operation: MongoDB\\Collection::insertMany
-position: 2
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Collection::insertMany
-position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
index 35d8f609..78246d30 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
@@ -4,13 +4,10 @@ type: array
 description: |
   The documents to insert into the collection.
 interface: phpmethod
-operation: MongoDB\\Collection::insertMany
+operation: ~
 optional: false
-position: 1
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Collection::insertMany
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
index 33b3cb9a..ee47d575 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
@@ -1,12 +1,8 @@
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
-operation: MongoDB\\Collection::insertOne
-position: 1
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Collection::insertOne
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
index 1ab57000..5dc231d3 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
@@ -4,13 +4,10 @@ type: array|object
 description: |
   The document to insert into the collection.
 interface: phpmethod
-operation: MongoDB\\Collection::insertOne
+operation: ~
 optional: false
-position: 1
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Collection::insertOne
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
index 97a3be6e..4eb407fe 100644
--- a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
@@ -1,6 +1,4 @@
 source:
-  ref: maxTimeMS
   file: apiargs-common-option.yaml
-operation: MongoDB\\Collection::listIndexes
-position: 1
+  ref: maxTimeMS
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
index b708486e..73ad04d0 100644
--- a/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
@@ -1,6 +1,4 @@
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::listIndexes
-position: 1
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
index 09ca49f3..4fec2f05 100644
--- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
@@ -1,18 +1,16 @@
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: upsert
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
-operation: MongoDB\\Collection::replaceOne
-position: 1
 ---
 source:
-  file: apiargs-common-option.yaml
-  ref: upsert
-operation: MongoDB\\Collection::replaceOne
-position: 2
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Collection::replaceOne
-position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
index 7a730cfc..32ed6b35 100644
--- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
@@ -1,25 +1,15 @@
 source:
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-  file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::replaceOne
-replacement:
-  verb: "query"
 optional: false
-position: 1
+replacement:
+  action: " to replace"
 ---
-arg_name: param
-name: $replacement
-type: array
-description: |
-  The document to replace.
-interface: phpmethod
-operation: MongoDB\\Collection::replaceOne
-optional: false
-position: 2
+source:
+  file: apiargs-MongoDBCollection-common-param.yaml
+  ref: $replacement
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::replaceOne
-position: 3
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
index 128c8ea2..4fec2f05 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
@@ -1,18 +1,16 @@
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: upsert
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
-operation: MongoDB\\Collection::updateMany
-position: 1
 ---
 source:
-  file: apiargs-common-option.yaml
-  ref: upsert
-operation: MongoDB\\Collection::updateMany
-position: 2
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Collection::updateMany
-position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
index 12137ffc..a335678a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
@@ -1,22 +1,15 @@
 source:
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-  file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::updateMany
-replacement:
-  verb: "query"
 optional: false
-position: 1
+replacement:
+  action: " to update"
 ---
 source:
-  file: apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $update
-operation: MongoDB\\Collection::updateMany
-optional: false
-position: 2
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::updateMany
-position: 3
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
index 80ce3e62..4fec2f05 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
@@ -1,18 +1,16 @@
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: upsert
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
-operation: MongoDB\\Collection::updateOne
-position: 1
 ---
 source:
-  file: apiargs-common-option.yaml
-  ref: upsert
-operation: MongoDB\\Collection::updateOne
-position: 2
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Collection::updateOne
-position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
index d61c8b2a..a335678a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
@@ -1,22 +1,15 @@
 source:
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $filter
-  file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::updateOne
-replacement:
-  verb: "query"
 optional: false
-position: 1
+replacement:
+  action: " to update"
 ---
 source:
-  file: apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
+  file: apiargs-MongoDBCollection-common-param.yaml
   ref: $update
-operation: MongoDB\\Collection::updateOne
-optional: false
-position: 2
 ---
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::updateOne
-position: 3
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
index 53128b2d..681144f3 100644
--- a/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
@@ -1,32 +1,27 @@
 source:
   file: apiargs-common-option.yaml
   ref: readConcern
-operation: MongoDB\\Collection::withOptions
-description: |
-  The default read concern to use for collection operations. Defaults
-  to the original Collection's specified read concern.
+replacement:
+  resource: "collection"
+  parent: "original collection"
 ---
 source:
   file: apiargs-common-option.yaml
   ref: readPreference
-operation: MongoDB\\Collection::withOptions
-description: |
-  The default read preference to use for collection operations.
-  Defaults to the original Collection's read preference.
+replacement:
+  resource: "collection"
+  parent: "original collection"
 ---
 source:
   file: apiargs-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Collection::withOptions
-description: |
-  Default type map for cursors and BSON documents. Defaults to the
-  original Collection's type map value.
+replacement:
+  parent: "original collection"
 ---
 source:
   file: apiargs-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Collection::withOptions
-description: |
-  The default write concern to use for collection operations. Defaults
-  to the original Collection's specified write concern.
+replacement:
+  resource: "collection"
+  parent: "original collection"
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml b/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
index 72c3a453..73ad04d0 100644
--- a/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
@@ -1,6 +1,4 @@
 source:
-  ref: $options
   file: apiargs-common-param.yaml
-operation: MongoDB\\Collection::withOptions
-position: 1
+  ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-common-option.yaml b/source/includes/apiargs-MongoDBDatabase-common-option.yaml
new file mode 100644
index 00000000..c18bd678
--- /dev/null
+++ b/source/includes/apiargs-MongoDBDatabase-common-option.yaml
@@ -0,0 +1,16 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: typeMap
+replacement:
+  parent: "database"
+---
+arg_name: option
+name: writeConcern
+type: :php:`MongoDB\\Driver\\WriteConcern `
+description: |
+   :manual:`Write concern ` to use for the operation.
+   Defaults to the database's write concern.
+interface: phpmethod
+operation: ~
+optional: true
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
index fa53aeba..7dc5b5a0 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
@@ -1,20 +1,11 @@
 source:
   file: apiargs-common-option.yaml
   ref: readPreference
-operation: MongoDB\\Database::command
-position: 1
 description: |
-  The read preference to use when executing the command. This may be used when
-  issuing the command to a replica set or shard cluster to ensure that the
-  driver sets the wire protocol accordingly or adds the read preference to the
-  command document, respectively. Defaults to the Database's read preference.
+   :manual:`Read preference ` to use for the
+   operation. Defaults to the database's read preference.
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBDatabase-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Database::command
-position: 2
-description: |
-  Type map for BSON deserialization. This will be applied to the returned
-  cursor. Defaults to the database's type map.
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
index bcf5b92c..5a4b03d7 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
@@ -4,13 +4,10 @@ type: array|object
 description: |
   The :manual:`database command ` document.
 interface: phpmethod
-operation: MongoDB\\Database::command
+operation: ~
 optional: false
-position: 1
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Database::command
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
index 4f52540f..d398069a 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
@@ -1,8 +1,6 @@
 source:
   file: apiargs-common-option.yaml
   ref: readConcern
-operation: MongoDB\\Database::__construct
-position: 1
 replacement:
   resource: "database"
   parent: "manager"
@@ -10,39 +8,17 @@ replacement:
 source:
   file: apiargs-common-option.yaml
   ref: readPreference
-operation: MongoDB\\Database::__construct
-position: 2
 replacement:
   resource: "database"
   parent: "manager"
 ---
-arg_name: option
-name: typeMap
-type: array
-description: |
-  Default :php:`type map
-  `
-  to apply to cursors. The type map determines how BSON documents are converted
-  to PHP values which determines. The |php-library| uses the following type map
-  by default:
-
-  .. code-block:: php
-
-     [
-         'array' => 'MongoDB\Model\BSONArray',
-         'document' => 'MongoDB\Model\BSONDocument',
-         'root' => 'MongoDB\Model\BSONDocument',
-     ]
-interface: phpmethod
-operation: MongoDB\\Database::__construct
-optional: true
-position: 3
+source:
+  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
+  ref: typeMap
 ---
 source:
   file: apiargs-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Database::__construct
-position: 4
 replacement:
   resource: "database"
   parent: "manager"
diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
index 4f71dd08..5ef826c1 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
@@ -1,18 +1,12 @@
 source:
   file: apiargs-common-param.yaml
   ref: $manager
-operation: MongoDB\\Database::__construct
-position: 1
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $databaseName
-operation: MongoDB\\Database::__construct
-position: 2
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Collection::__construct
-position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
index 781c54a4..d70a905f 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
@@ -11,9 +11,8 @@ description: |
 
   .. deprecated:: 3.2. The ``autoIndexId`` option will be removed in MongoDB 3.4.
 interface: phpmethod
-operation: MongoDB\\Database::createCollection
+operation: ~
 optional: true
-position: 1
 ---
 arg_name: option
 name: capped
@@ -22,9 +21,15 @@ description: |
   To create a capped collection, specify ``true``. If you specify ``true``, you
   must also set a maximum size in the ``size`` option.
 interface: phpmethod
-operation: MongoDB\\Database::createCollection
+operation: ~
 optional: true
-position: 3
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+pre: |
+  Specifies the :manual:`collation
+  ` for the collection.
 ---
 arg_name: option
 name: flags
@@ -48,9 +53,8 @@ description: |
      :manual:`db.createCollection()
      ` for more information.
 interface: phpmethod
-operation: MongoDB\\Database::createCollection
+operation: ~
 optional: true
-position: 4
 ---
 arg_name: option
 name: indexOptionDefaults
@@ -68,31 +72,26 @@ description: |
   and logged to the :term:`oplog` during replication to support replica sets
   with members that use different storage engines.
 interface: phpmethod
-operation: MongoDB\\Database::createCollection
+operation: ~
 optional: true
-position: 5
 ---
 arg_name: option
 name: max
 type: integer
 description: |
-   The maximum number of documents allowed in the capped collection. The
-   ``size`` option takes precedence over this limit. If a capped
-   collection reaches the ``size`` limit before it reaches the maximum
-   number of documents, MongoDB removes old documents. If you prefer to
-   use the ``max`` limit, ensure that the ``size`` limit, which is
-   required for a capped collection, is sufficient to contain the
-   maximum number of documents.
+  The maximum number of documents allowed in the capped collection. The ``size``
+  option takes precedence over this limit. If a capped collection reaches the
+  ``size`` limit before it reaches the maximum number of documents, MongoDB
+  removes old documents. If you prefer to use the ``max`` limit, ensure that the
+  ``size`` limit, which is required for a capped collection, is sufficient to
+  contain the maximum number of documents.
 interface: phpmethod
-operation: MongoDB\\Database::createCollection
+operation: ~
 optional: true
-position: 6
 ---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
-operation: MongoDB\\Database::createCollection
-position: 7
 ---
 arg_name: option
 name: size
@@ -103,9 +102,8 @@ description: |
   make space for the new documents. The ``size`` option is required for capped
   collections and ignored for other collections.
 interface: phpmethod
-operation: MongoDB\\Database::createCollection
+operation: ~
 optional: true
-position: 8
 ---
 arg_name: option
 name: storageEngine
@@ -123,18 +121,14 @@ description: |
   validated and logged to the :term:`oplog` during replication to support
   replica sets with members that use different storage engines.
 interface: phpmethod
-operation: MongoDB\\Database::createCollection
+operation: ~
 optional: true
-position: 9
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBDatabase-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Database::createCollection
-position: 10
-description: |
-  Type map for BSON deserialization. This will be used for the returned command
-  result document. Defaults to the database's type map.
+post: |
+  This will be used for the returned command result document.
 ---
 arg_name: option
 name: validator
@@ -160,10 +154,9 @@ description: |
        ``local``, and ``config`` databases.
 
      - You cannot specify a validator for ``system.*`` collections.
-operation: MongoDB\\Database::createCollection
+operation: ~
 interface: phpmethod
 optional: true
-position: 11
 ---
 arg_name: option
 name: validationAction
@@ -194,9 +187,8 @@ description: |
         - Documents do not have to pass validation. If the document fails
           validation, the write operation logs the validation failure.
 interface: phpmethod
-operation: MongoDB\\Database::createCollection
+operation: ~
 optional: true
-position: 12
 ---
 arg_name: option
 name: validationLevel
@@ -226,7 +218,13 @@ description: |
           documents. Do not apply rules to updates on existing *invalid*
           documents.
 interface: phpmethod
-operation: MongoDB\\Database::createCollection
+operation: ~
 optional: true
-position: 13
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: writeConcern
+post: |
+  This is not supported for server versions prior to 3.4 and will result in an
+  exception at execution time if used.
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
index c8c40ce9..b6bb2dcc 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
@@ -1,14 +1,10 @@
 source:
   file: apiargs-common-param.yaml
   ref: $collectionName
-operation: MongoDB\\Database::createCollection
-position: 1
 replacement:
   action: " to create"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Database::createCollection
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
index f9b8e81a..630c1bd1 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
@@ -1,9 +1,13 @@
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBDatabase-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Database::drop
-position: 1
-description: |
-  Type map for BSON deserialization. This will be used for the returned command
-  result document. Defaults to the database's type map.
+post: |
+  This will be used for the returned command result document.
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: writeConcern
+post: |
+  This is not supported for server versions prior to 3.4 and will result in an
+  exception at execution time if used.
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
index 53b1e8a9..73ad04d0 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
@@ -1,6 +1,4 @@
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Database::drop
-position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
index 4e8919fe..630c1bd1 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
@@ -1,9 +1,13 @@
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBDatabase-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Database::dropCollection
-position: 1
-description: |
-  Type map for BSON deserialization. This will be used for the returned command
-  result document. Defaults to the database's type map.
+post: |
+  This will be used for the returned command result document.
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: writeConcern
+post: |
+  This is not supported for server versions prior to 3.4 and will result in an
+  exception at execution time if used.
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
index 1e260bc3..c8e0a614 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
@@ -1,14 +1,10 @@
 source:
   file: apiargs-common-param.yaml
   ref: $collectionName
-operation: MongoDB\\Database::dropCollection
-position: 1
 replacement:
   action: " to drop"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Database::dropCollection
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
index 331e02c8..651c85f9 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
@@ -1,8 +1,6 @@
 source:
   file: apiargs-common-param.yaml
   ref: $collectionName
-operation: MongoDB\\Database::__get
-position: 1
 replacement:
   action: " to select"
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
index 0d7409d0..c8bcc2c5 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
@@ -2,15 +2,14 @@ arg_name: option
 name: filter
 type: array|object
 description: |
-  Query by which to filter collections.
+  A query expression to filter the list of collections.
+
+  You can specify a query expression on the collection ``name`` and ``options``.
 interface: phpmethod
-operation: MongoDB\\Database::listCollections
+operation: ~
 optional: true
-position: 1
 ---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
-operation: MongoDB\\Database::listCollections
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
index e717699d..73ad04d0 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
@@ -1,6 +1,4 @@
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Database::listCollections
-position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
index bf8b85e9..932c1b16 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
@@ -1,8 +1,6 @@
 source:
   file: apiargs-common-option.yaml
   ref: readConcern
-operation: MongoDB\\Database::selectCollection
-position: 1
 replacement:
   resource: "collection"
   parent: "database"
@@ -10,8 +8,6 @@ replacement:
 source:
   file: apiargs-common-option.yaml
   ref: readPreference
-operation: MongoDB\\Database::selectCollection
-position: 2
 replacement:
   resource: "collection"
   parent: "database"
@@ -19,16 +15,12 @@ replacement:
 source:
   file: apiargs-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Database::selectCollection
-position: 3
 replacement:
   parent: "database"
 ---
 source:
   file: apiargs-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Database::selectCollection
-position: 4
 replacement:
   resource: "collection"
   parent: "database"
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
index 2f3cd044..46d4e72a 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
@@ -1,14 +1,10 @@
 source:
   file: apiargs-common-param.yaml
   ref: $collectionName
-operation: MongoDB\\Database::selectCollection
-position: 1
 replacement:
   action: " to select"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Database::selectCollection
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
index e43b2467..999b2c1f 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
@@ -5,9 +5,8 @@ description: |
   The bucket name, which will be used as a prefix for the files and chunks
   collections. Defaults to ``"fs"``.
 interface: phpmethod
-operation: MongoDB\\Database::selectGridFSBucket
+operation: ~
 optional: true
-position: 1
 ---
 arg_name: option
 name: chunkSizeBytes
@@ -15,15 +14,12 @@ type: integer
 description: |
   The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
 interface: phpmethod
-operation: MongoDB\\Database::selectGridFSBucket
+operation: ~
 optional: true
-position: 2
 ---
 source:
   file: apiargs-common-option.yaml
   ref: readConcern
-operation: MongoDB\\Database::selectGridFSBucket
-position: 3
 replacement:
   resource: "bucket"
   parent: "database"
@@ -31,8 +27,6 @@ replacement:
 source:
   file: apiargs-common-option.yaml
   ref: readPreference
-operation: MongoDB\\Database::selectGridFSBucket
-position: 4
 replacement:
   resource: "bucket"
   parent: "database"
@@ -40,8 +34,6 @@ replacement:
 source:
   file: apiargs-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Database::selectGridFSBucket
-position: 5
 replacement:
   resource: "bucket"
   parent: "database"
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
index 9b1a67b3..73ad04d0 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
@@ -1,6 +1,4 @@
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Database::selectGridFSBucket
-position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
index d08427be..c048182c 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
@@ -1,32 +1,27 @@
 source:
   file: apiargs-common-option.yaml
   ref: readConcern
-operation: MongoDB\\Database::withOptions
-description: |
-  The default read concern to use for database operations. Defaults to the
-  original Databases's read concern.
+replacement:
+  resource: "database"
+  parent: "original database"
 ---
 source:
   file: apiargs-common-option.yaml
   ref: readPreference
-operation: MongoDB\\Database::withOptions
-description: |
-  The default read preference to use for database operations. Defaults to the
-  original Database's read preference.
+replacement:
+  resource: "database"
+  parent: "original database"
 ---
 source:
   file: apiargs-common-option.yaml
   ref: typeMap
-operation: MongoDB\\Database::withOptions
-description: |
-  Default type map to use for converting BSON. Defaults to the original
-  Database's type map.
+replacement:
+  parent: "original database"
 ---
 source:
   file: apiargs-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\Database::withOptions
-description: |
-  The default write concern to use for database operations. Defaults to the
-  original Database's write concern.
+replacement:
+  resource: "database"
+  parent: "original database"
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
index 53504d42..73ad04d0 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
@@ -1,6 +1,4 @@
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\Database::withOptions
-position: 1
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
new file mode 100644
index 00000000..8c6470d8
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
@@ -0,0 +1,50 @@
+arg_name: option
+name: _id
+type: mixed
+description: |
+  Value to use as the file document identifier. Defaults to a new
+  :php:`MongoDB\\BSON\\ObjectID ` object.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: chunkSizeBytes
+type: integer
+description: |
+  The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: metadata
+type: array|object
+description: |
+  User data for the ``metadata`` field of the file document. If not specified,
+  the ``metadata`` field will not be set on the file document.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: revision
+type: integer
+description: |
+  The revision of the file to retrieve. Files with the name ``filename`` will be
+  differentiated by their ``uploadDate`` field.
+
+  Revision numbers are defined as follows:
+
+  - 0 = the original stored file
+  - 1 = the first revision
+  - 2 = the second revision
+  - etc...
+  - -2 = the second most recent revision
+  - -1 = the most recent revision
+
+   Defaults to -1 (i.e. the most recent revision).
+interface: phpmethod
+operation: ~
+optional: true
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml
new file mode 100644
index 00000000..f1d6b136
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml
@@ -0,0 +1,39 @@
+arg_name: param
+name: $filename
+type: string
+description: |
+  The ``filename`` of the file{{action}}.
+interface: phpmethod
+operation: ~
+optional: false
+replacement:
+  action: ""
+---
+arg_name: param
+name: $id
+type: mixed
+description: |
+  The ``_id`` of the file{{action}}.
+interface: phpmethod
+operation: ~
+optional: false
+replacement:
+  action: ""
+---
+arg_name: param
+name: $stream
+type: resource
+description: |
+  The GridFS stream resource.
+interface: phpmethod
+operation: ~
+---
+arg_name: param
+name: $destination
+type: resource
+description: |
+  Writable stream, to which the GridFS file's contents will be written.
+interface: phpmethod
+operation: ~
+optional: false
+...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
index 467800d7..999b2c1f 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
@@ -5,9 +5,8 @@ description: |
   The bucket name, which will be used as a prefix for the files and chunks
   collections. Defaults to ``"fs"``.
 interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::__construct
+operation: ~
 optional: true
-position: 1
 ---
 arg_name: option
 name: chunkSizeBytes
@@ -15,15 +14,12 @@ type: integer
 description: |
   The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
 interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::__construct
+operation: ~
 optional: true
-position: 2
 ---
 source:
   file: apiargs-common-option.yaml
   ref: readConcern
-operation: MongoDB\\GridFS\\Bucket::__construct
-position: 3
 replacement:
   resource: "bucket"
   parent: "database"
@@ -31,8 +27,6 @@ replacement:
 source:
   file: apiargs-common-option.yaml
   ref: readPreference
-operation: MongoDB\\GridFS\\Bucket::__construct
-position: 4
 replacement:
   resource: "bucket"
   parent: "database"
@@ -40,8 +34,6 @@ replacement:
 source:
   file: apiargs-common-option.yaml
   ref: writeConcern
-operation: MongoDB\\GridFS\\Bucket::__construct
-position: 5
 replacement:
   resource: "bucket"
   parent: "database"
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
index f22a31bc..5ef826c1 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
@@ -1,18 +1,12 @@
 source:
   file: apiargs-common-param.yaml
   ref: $manager
-operation: MongoDB\\GridFS\\Bucket::__construct
-position: 1
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $databaseName
-operation: MongoDB\\GridFS\\Bucket::__construct
-position: 2
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\GridFS\\Bucket::__construct
-position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
index b8d289f8..7e8baa21 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
@@ -1,10 +1,6 @@
-arg_name: param
-name: $id
-type: mixed
-description: |
-  The ``_id`` of the file to delete.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::delete
-optional: false
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $id
+replacement:
+  resource: " to delete"
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
index 4eda59ba..39d48dc5 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
@@ -1,20 +1,10 @@
-arg_name: param
-name: $id
-type: mixed
-description: |
-  The ``_id`` of the file to download.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::downloadToStream
-optional: false
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $id
+replacement:
+  resource: " to download"
 ---
-arg_name: param
-name: $destination
-type: resource
-description: |
-  Writable stream where the GridFS file's contents will be written.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::downloadToStream
-optional: false
-position: 2
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $destination
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
index 3ad8a220..9dc941d9 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
@@ -1,22 +1,4 @@
-arg_name: option
-name: revision
-type: integer
-description: |
-  The revision of the file to retrieve. Files with the name ``filename`` will be
-  differentiated by their ``uploadDate`` field.
-
-  Revision numbers are defined as follows:
-
-  - 0 = the original stored file
-  - 1 = the first revision
-  - 2 = the second revision
-  - etc...
-  - -2 = the second most recent revision
-  - -1 = the most recent revision
-
-   Defaults to -1 (i.e. the most recent revision).
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
-optional: true
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: revision
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
index b09f9a37..2704877b 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
@@ -1,26 +1,14 @@
-arg_name: param
-name: $filename
-type: string
-description: |
-  The ``filename`` of the file to download.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
-optional: false
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $filename
+replacement:
+  resource: " to download"
 ---
-arg_name: param
-name: $destination
-type: resource
-description: |
-  Writable stream where the GridFS file's contents will be written.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
-optional: false
-position: 2
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $destination
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
-position: 3
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
index e6604881..0801cb21 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
@@ -1,10 +1,4 @@
-arg_name: param
-name: $stream
-type: resource
-description: |
-  The GridFS stream resource.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::getFileDocumentForStream
-optional: false
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $stream
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
index 98c5fb65..0801cb21 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
@@ -1,10 +1,4 @@
-arg_name: param
-name: $stream
-type: resource
-description: |
-  The GridFS stream resource.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::getFileIdForStream
-optional: false
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $stream
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
index a138da9b..54e7c8c2 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
@@ -1,10 +1,6 @@
-arg_name: param
-name: $id
-type: mixed
-description: |
-  The ``_id`` of the file to download.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::openDownloadStream
-optional: false
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $id
+replacement:
+  resource: " to download"
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
index 2fb37083..9dc941d9 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
@@ -1,22 +1,4 @@
-arg_name: option
-name: revision
-type: integer
-description: |
-  The revision of the file to retrieve. Files with the name ``filename`` will be
-  differentiated by their ``uploadDate`` field.
-
-  Revision numbers are defined as follows:
-
-  - 0 = the original stored file
-  - 1 = the first revision
-  - 2 = the second revision
-  - etc...
-  - -2 = the second most recent revision
-  - -1 = the most recent revision
-
-   Defaults to -1 (i.e. the most recent revision).
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName
-optional: true
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: revision
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
index 2ca8b28d..eb8ec932 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
@@ -1,16 +1,10 @@
-arg_name: param
-name: $filename
-type: string
-description: |
-  The ``filename`` of the file to download.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName
-optional: false
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $filename
+replacement:
+  resource: " to download"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
index ef03e8e4..6c4d2ff6 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
@@ -1,32 +1,12 @@
-arg_name: option
-name: _id
-type: mixed
-description: |
-  Value to use as the file document identifier. Defaults to a new
-  :php:`MongoDB\\BSON\\ObjectID ` object.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::openUploadStream
-optional: true
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: _id
 ---
-arg_name: option
-name: chunkSizeBytes
-type: integer
-description: |
-  The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::openUploadStream
-optional: true
-position: 2
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: chunkSizeBytes
 ---
-arg_name: option
-name: metadata
-type: array|object
-description: |
-  User data for the ``metadata`` field of the file document. If not specified,
-  the ``metadata`` field will not be set on the file document.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::openUploadStream
-optional: true
-position: 3
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: metadata
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
index e97103dc..6b8efb34 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
@@ -1,16 +1,10 @@
-arg_name: param
-name: $filename
-type: string
-description: |
-  The ``filename`` of the file to create.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::openUploadStream
-optional: false
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $filename
+replacement:
+  resource: " to create"
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\GridFS\\Bucket::openUploadStream
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
index 5dc7e42c..e1b140ae 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
@@ -1,12 +1,8 @@
-arg_name: param
-name: $id
-type: mixed
-description: |
-  The ``_id`` of the file to rename.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::rename
-optional: false
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $id
+replacement:
+  resource: " to rename"
 ---
 arg_name: param
 name: $newFilename
@@ -14,7 +10,6 @@ type: string
 description: |
   The new ``filename`` value.
 interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::rename
+operation: ~
 optional: false
-position: 2
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
index 546f0d6a..6c4d2ff6 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
@@ -1,32 +1,12 @@
-arg_name: option
-name: _id
-type: mixed
-description: |
-  Value to use as the file document identifier. Defaults to a new
-  :php:`MongoDB\\BSON\\ObjectID ` object.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::uploadFromStream
-optional: true
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: _id
 ---
-arg_name: option
-name: chunkSizeBytes
-type: integer
-description: |
-  The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::uploadFromStream
-optional: true
-position: 2
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: chunkSizeBytes
 ---
-arg_name: option
-name: metadata
-type: array|object
-description: |
-  User data for the ``metadata`` field of the file document. If not specified,
-  the ``metadata`` field will not be set on the file document.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::uploadFromStream
-optional: true
-position: 3
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: metadata
 ...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
index 90419575..48fa2db4 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
@@ -1,26 +1,19 @@
-arg_name: param
-name: $filename
-type: string
-description: |
-  The ``filename`` of the file to create.
-interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::uploadFromStream
-optional: false
-position: 1
+source:
+  file: apiargs-MongoDBGridFSBucket-common-param.yaml
+  ref: $filename
+replacement:
+  resource: " to create"
 ---
 arg_name: param
 name: $source
 type: resource
 description: |
-  Readable stream where the file's contents will be read.
+  Readable stream, from which the new GridFS file's contents will be read.
 interface: phpmethod
-operation: MongoDB\\GridFS\\Bucket::uploadFromStream
+operation: ~
 optional: false
-position: 2
 ---
 source:
   file: apiargs-common-param.yaml
   ref: $options
-operation: MongoDB\\GridFS\\Bucket::uploadFromStream
-position: 3
 ...
diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml
index c3709b4b..54d6bd89 100644
--- a/source/includes/apiargs-common-option.yaml
+++ b/source/includes/apiargs-common-option.yaml
@@ -1,4 +1,15 @@
 arg_name: option
+name: maxTimeMS
+type: integer
+description: |
+   The cumulative time limit in milliseconds for processing operations on the
+   cursor. MongoDB aborts the operation at the earliest following
+   :term:`interrupt point`.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
 name: readConcern
 type: :php:`MongoDB\\Driver\\ReadConcern `
 description: |
@@ -7,35 +18,34 @@ description: |
 interface: phpmethod
 operation: selectCollection
 optional: true
-position: 1
 replacement:
   resource: "collection"
   parent: "client"
 ---
 arg_name: option
+name: readPreference
+type: :php:`MongoDB\\Driver\\ReadPreference `
 description: |
   The default read preference to use for {{resource}} operations. Defaults to
   the {{parent}}'s read preference.
 interface: phpmethod
-name: readPreference
-operation: selectCollection
+operation: ~
 optional: true
-position: 2
-type: :php:`MongoDB\\Driver\\ReadPreference `
 replacement:
   resource: "collection"
   parent: "client"
 ---
 arg_name: option
+name: typeMap
+type: array
 description: |
-  Default type map for cursors and BSON documents. Defaults to the
-  {{parent}}'s type map.
+  The :php:`type map
+  `
+  to apply to cursors, which determines how BSON documents are converted to PHP
+  values. Defaults to the {{parent}}'s type map.
 interface: phpmethod
-name: typeMap
-operation: selectCollection
+operation: ~
 optional: true
-position: 3
-type: array
 replacement:
   parent: "client"
 ---
@@ -46,51 +56,9 @@ description: |
   The default write concern to use for {{resource}} operations. Defaults
   to the {{parent}}'s write concern.
 interface: phpmethod
-operation: selectCollection
+operation: ~
 optional: true
-position: 4
 replacement:
   resource: "collection"
   parent: "client"
----
-arg_name: option
-name: maxTimeMS
-description: |
-   The cumulative time limit in milliseconds for processing operations on
-   the cursor. MongoDB aborts the operation at the earliest following
-   :term:`interrupt point`.
-interface: phpmethod
-operation: listDatabases
-type: integer
-optional: true
-position: 5
----
-arg_name: option
-name: bypassDocumentValidation
-type: boolean
-description: |
-  If ``true``, allows the write operation to circumvent document level
-  validation. This only applies when using the :pipeline:`$out` stage.
-
-  Document validation requires MongoDB v3.2 or later: if you are using
-  an earlier version of MongoDB, this option will be ignored.
-interface: phpmethod
-operation: aggregate
-optional: true
-position: 6
----
-arg_name: option
-name: upsert
-type: boolean
-description: |
-  When true, {{role}} creates a new document if no document
-  matches the query. If a document matches the query, {{role}}
-  performs an update. To avoid multiple upserts, ensure that the query
-  fields are uniquely indexed.
-
-  The default is ``false``.
-optional: true
-interface: phpmethod
-operation: MongoDB\\Collection::findOneAndUpdate
-position: 7
 ...
diff --git a/source/includes/apiargs-common-param.yaml b/source/includes/apiargs-common-param.yaml
index 397aff3f..0f152c82 100644
--- a/source/includes/apiargs-common-param.yaml
+++ b/source/includes/apiargs-common-param.yaml
@@ -7,7 +7,6 @@ description: |
 interface: phpmethod
 operation: ~
 optional: false
-position: 1
 ---
 arg_name: param
 name: $databaseName
@@ -19,7 +18,6 @@ operation: ~
 optional: false
 replacement:
   action: ""
-position: 1
 ---
 arg_name: param
 name: $collectionName
@@ -31,7 +29,6 @@ operation: ~
 optional: false
 replacement:
   action: ""
-position: 2
 ---
 arg_name: param
 name: $options
@@ -41,17 +38,4 @@ description: |
 interface: phpmethod
 operation: ~
 optional: true
-position: 3
----
-arg_name: param
-name: $filter
-type: array|object
-description: |
-  The filter criteria that specifies the documents to {{verb}}.
-interface: phpmethod
-operation: ~
-optional: false
-position: 4
-replacement:
-  verb: "count"
 ...
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index fb5d1781..3b9b3d96 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -26,7 +26,7 @@ Definition
    .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-param.rst
 
    The ``$options`` parameter accepts all index options that your MongoDB
-   version supports. MongoDB 3.2 includes the following options:
+   version supports. MongoDB includes the following options:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst
 
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index 0d25e7d1..9c9e1477 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -19,37 +19,40 @@ Definition
 
    .. code-block:: php
 
-      function createIndexes(array $indexes): string[]
+      function createIndexes(array $indexes, array $options = []): string[]
 
-   ``createIndex()`` has one parameter, ``$indexes``, which is an array. Each
-   element in ``$indexes`` must itself be an array that specifies an index. The
-   specification array requires a ``key`` field, which corresponds to the
-   ``$key`` parameter of :phpmethod:`MongoDB\\Collection::createIndex()`, and
-   may have other fields that correspond to options of
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\\Collection::createIndexes()` has the following
+   parameters:
 
-   For example, the following ``$indexes`` parameter creates two indexes. The
-   first is an ascending unique index on the ``username`` field and the second
-   is a 2dsphere index on the ``loc`` field with a custom name::
+   .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-param.rst
 
-      [
-          [ 'key' => [ 'username' => 1 ], 'unique' => true ],
-          [ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo_index' ],
-      ]
+   The ``$options`` parameter supports the following options:
 
-   You can specify any index options that your MongoDB version
-   supports. MongoDB 3.2 includes the following options:
-
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst
-
-   For a full list of the supported index creation options, refer to the
-   :manual:`createIndexes ` command reference
-   in the MongoDB manual.
+   .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-option.rst
 
    :returns:
 
       The names of the created indexes as an array of strings.
 
+``$indexes`` parameter
+----------------------
+
+The ``$indexes`` parameter is an array of index specification documents. Each
+element in ``$indexes`` must itself be an array or object with a ``key`` field,
+which corresponds to the ``$key`` parameter of :phpmethod:`createIndex()
+`. The array or object may include other
+fields that correspond to index options accepted by :phpmethod:`createIndex()
+` (excluding ``writeConcern``).
+
+For example, the following ``$indexes`` parameter creates two indexes. The first
+is an ascending unique index on the ``username`` field and the second is a
+2dsphere index on the ``loc`` field with a custom name::
+
+   [
+       [ 'key' => [ 'username' => 1 ], 'unique' => true ],
+       [ 'key' => [ 'loc' => '2dsphere' ], 'name' => 'geo_index' ],
+   ]
+
 Example
 -------
 

From 9636599a99d51ecce7e3c21a5f53800f9e2bbc9d Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 1 Nov 2016 15:08:28 -0400
Subject: [PATCH 040/321] Use "agg-out" reference in MongoDB manual

See: https://github.com/mongodb/docs/commit/2a912319800d932b5fd5dc2dfee3d591e4311b9f
---
 .../apiargs-MongoDBCollection-method-aggregate-option.yaml    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 0d440197..9779a9eb 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -29,7 +29,7 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
 post: |
-  This only applies when using the :pipeline:`$out` stage.
+  This only applies when using the :ref:`$out ` stage.
 
   Document validation requires MongoDB 3.2 or later: if you are using an earlier
   version of MongoDB, this option will be ignored.
@@ -75,7 +75,7 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
 post: |
-  This only applies when the ``$out`` stage is specified.
+  This only applies when the :ref:`$out ` stage is specified.
 
   This is not supported for server versions prior to 3.4 and will result in an
   exception at execution time if used.

From a9fda2c38ed447b01d17d1afe7b96d4edf7b932e Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 1 Nov 2016 15:39:20 -0400
Subject: [PATCH 041/321] Use generic language for documenting method params

---
 source/reference/method/MongoDBClient-dropDatabase.txt         | 2 +-
 source/reference/method/MongoDBClient-listDatabases.txt        | 2 +-
 source/reference/method/MongoDBClient-selectCollection.txt     | 2 +-
 source/reference/method/MongoDBClient-selectDatabase.txt       | 2 +-
 source/reference/method/MongoDBClient__construct.txt           | 2 +-
 source/reference/method/MongoDBClient__get.txt                 | 2 +-
 source/reference/method/MongoDBCollection-aggregate.txt        | 2 +-
 source/reference/method/MongoDBCollection-bulkWrite.txt        | 2 +-
 source/reference/method/MongoDBCollection-count.txt            | 2 +-
 source/reference/method/MongoDBCollection-createIndex.txt      | 2 +-
 source/reference/method/MongoDBCollection-createIndexes.txt    | 3 +--
 source/reference/method/MongoDBCollection-deleteMany.txt       | 2 +-
 source/reference/method/MongoDBCollection-deleteOne.txt        | 2 +-
 source/reference/method/MongoDBCollection-distinct.txt         | 2 +-
 source/reference/method/MongoDBCollection-drop.txt             | 2 +-
 source/reference/method/MongoDBCollection-dropIndex.txt        | 2 +-
 source/reference/method/MongoDBCollection-dropIndexes.txt      | 2 +-
 source/reference/method/MongoDBCollection-find.txt             | 2 +-
 source/reference/method/MongoDBCollection-findOne.txt          | 2 +-
 source/reference/method/MongoDBCollection-findOneAndDelete.txt | 3 +--
 .../reference/method/MongoDBCollection-findOneAndReplace.txt   | 3 +--
 source/reference/method/MongoDBCollection-findOneAndUpdate.txt | 3 +--
 source/reference/method/MongoDBCollection-insertMany.txt       | 2 +-
 source/reference/method/MongoDBCollection-insertOne.txt        | 2 +-
 source/reference/method/MongoDBCollection-listIndexes.txt      | 2 +-
 source/reference/method/MongoDBCollection-replaceOne.txt       | 2 +-
 source/reference/method/MongoDBCollection-updateMany.txt       | 2 +-
 source/reference/method/MongoDBCollection-updateOne.txt        | 2 +-
 source/reference/method/MongoDBCollection-withOptions.txt      | 2 +-
 source/reference/method/MongoDBCollection__construct.txt       | 2 +-
 source/reference/method/MongoDBDatabase-command.txt            | 2 +-
 source/reference/method/MongoDBDatabase-createCollection.txt   | 3 +--
 source/reference/method/MongoDBDatabase-drop.txt               | 2 +-
 source/reference/method/MongoDBDatabase-dropCollection.txt     | 3 +--
 source/reference/method/MongoDBDatabase-listCollections.txt    | 3 +--
 source/reference/method/MongoDBDatabase-selectCollection.txt   | 3 +--
 source/reference/method/MongoDBDatabase-selectGridFSBucket.txt | 3 +--
 source/reference/method/MongoDBDatabase-withOptions.txt        | 2 +-
 source/reference/method/MongoDBDatabase__construct.txt         | 2 +-
 source/reference/method/MongoDBDatabase__get.txt               | 2 +-
 source/reference/method/MongoDBGridFSBucket-delete.txt         | 2 +-
 .../reference/method/MongoDBGridFSBucket-downloadToStream.txt  | 3 +--
 .../method/MongoDBGridFSBucket-downloadToStreamByName.txt      | 3 +--
 source/reference/method/MongoDBGridFSBucket-find.txt           | 2 +-
 .../method/MongoDBGridFSBucket-getFileDocumentForStream.txt    | 3 +--
 .../method/MongoDBGridFSBucket-getFileIdForStream.txt          | 3 +--
 .../method/MongoDBGridFSBucket-openDownloadStream.txt          | 3 +--
 .../method/MongoDBGridFSBucket-openDownloadStreamByName.txt    | 3 +--
 .../reference/method/MongoDBGridFSBucket-openUploadStream.txt  | 3 +--
 source/reference/method/MongoDBGridFSBucket-rename.txt         | 2 +-
 .../reference/method/MongoDBGridFSBucket-uploadFromStream.txt  | 3 +--
 source/reference/method/MongoDBGridFSBucket__construct.txt     | 3 +--
 52 files changed, 52 insertions(+), 70 deletions(-)

diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index 0e88a8ca..d455ad1f 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -21,7 +21,7 @@ Definition
 
       function dropDatabase($databaseName, array $options []): array|object
 
-   :phpmethod:`MongoDB\\Client::dropDatabase()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-param.rst
 
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index d98c5dea..1d32d432 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -21,7 +21,7 @@ Definition
 
       function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator
 
-   :phpmethod:`MongoDB\\Client::listDatabases()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-param.rst
 
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 28b0cc69..5413f839 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -21,7 +21,7 @@ Definition
 
       function selectCollection($databaseName, $collectionName, array $options = []): MongoDB\Collection
 
-   :phpmethod:`MongoDB\\Client::selectCollection()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-param.rst
 
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index 80046a7a..50c42487 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -21,7 +21,7 @@ Definition
 
       function selectDatabase($databaseName, array $options = []): MongoDB\Database
 
-   :phpmethod:`MongoDB\\Client::selectDatabase()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-param.rst
 
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index 17da8911..9eaec154 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -21,7 +21,7 @@ Definition
 
       function __construct($uri = 'mongodb://127.0.0.1/', array $uriOptions = [], array $driverOptions = [])
 
-   :phpmethod:`MongoDB\\Client::__construct()` has the following parameters:
+   This constructor has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBClient-method-construct-param.rst
 
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
index 5dd92d2a..cf135c25 100644
--- a/source/reference/method/MongoDBClient__get.txt
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -23,7 +23,7 @@ Definition
 
       function __get($databaseName): MongoDB\Database
 
-   :phpmethod:`MongoDB\\Client::__get()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBClient-method-get-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index e15f1a14..7d694fc9 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -22,7 +22,7 @@ Definition
 
       function aggregate(array $pipeline, array $options = []): Traversable
 
-   :phpmethod:`MongoDB\\Collection::aggregate()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index 05336a5a..550b36b4 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -21,7 +21,7 @@ Definition
 
       function bulkWrite(array $operations, array $options = []): MongoDB\BulkWriteResult
 
-   :phpmethod:`MongoDB\\Collection::bulkWrite()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 4917ed00..98aac470 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -21,7 +21,7 @@ Definition
 
       function count($filter = [], array $options = []): integer
 
-   :phpmethod:`MongoDB\\Collection::count()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-count-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index 3b9b3d96..e783b5ff 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -21,7 +21,7 @@ Definition
 
       function createIndex($key, array $options = []): string
 
-   :phpmethod:`MongoDB\\Collection::createIndex()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index 9c9e1477..46521748 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -21,8 +21,7 @@ Definition
 
       function createIndexes(array $indexes, array $options = []): string[]
 
-   :phpmethod:`MongoDB\\Collection::createIndexes()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index 2e12d307..31c54cff 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -21,7 +21,7 @@ Definition
 
       function deleteMany($filter, array $options = []): MongoDB\DeleteResult
 
-   :phpmethod:`MongoDB\\Collection::deleteMany()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index c28e12b5..d799a91a 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -23,7 +23,7 @@ Definition
 
       function deleteOne($filter, array $options = []): MongoDB\DeleteResult
 
-   :phpmethod:`MongoDB\\Collection::deleteOne()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index c0580310..b171ac0a 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -21,7 +21,7 @@ Definition
 
       function distinct($fieldName, $filter = [], array $options = []): mixed[]
 
-   :phpmethod:`MongoDB\\Collection::distinct()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-distinct-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index f9d12289..a551ab8b 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -21,7 +21,7 @@ Definition
 
       function drop(array $options = []): array|object
 
-   :phpmethod:`MongoDB\\Collection::drop()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-drop-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index 27fbd236..516ef286 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -21,7 +21,7 @@ Definition
 
       function dropIndex($indexName, array $options = []): array|object
 
-   :phpmethod:`MongoDB\\Collection::dropIndex()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index b226a27b..7276cc44 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -22,7 +22,7 @@ Definition
 
       function dropIndexes(array $options = []): array|object
 
-   :phpmethod:`MongoDB\\Collection::dropIndexes()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 49a388f9..e44a7af9 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -21,7 +21,7 @@ Definition
 
       function find($filter = [], array $options = []): MongoDB\Driver\Cursor
 
-   :phpmethod:`MongoDB\\Collection::find()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index acdb45d2..e30ae8a9 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -21,7 +21,7 @@ Definition
 
       function findOne($filter = [], array $options = []): array|object|null
 
-   :phpmethod:`MongoDB\\Collection::findOne()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index fd863376..55b4dcbf 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -21,8 +21,7 @@ Definition
 
       function findOneAndDelete($filter = [], array $options = []): object|null
 
-   :phpmethod:`MongoDB\\Collection::findOneAndDelete()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index e85cb713..ae24d622 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -21,8 +21,7 @@ Definition
 
       function findOneAndReplace($filter, $replacement, array $options = []): object|null
 
-   :phpmethod:`MongoDB\\Collection::findOneAndReplace()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index 66915705..bb18defb 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -21,8 +21,7 @@ Definition
 
       function findOneAndUpdate($filter, $update, array $options = []): object|null
 
-   :phpmethod:`MongoDB\\Collection::findOneAndUpdate()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index cee347be..26a9ff84 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -21,7 +21,7 @@ Definition
 
       function insertMany(array $documents, array $options = []): MongoDB\InsertManyResult
 
-   :phpmethod:`MongoDB\\Collection::insertMany()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index 9ca556f4..582291d5 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -21,7 +21,7 @@ Definition
 
       function insertOne($document, array $options = []): MongoDB\InsertOneResult
 
-   :phpmethod:`MongoDB\\Collection::insertOne()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index 567909b8..8c819319 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -21,7 +21,7 @@ Definition
 
       function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator
 
-   :phpmethod:`MongoDB\\Collection::listIndexes()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index a6f79daa..b78ea911 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -23,7 +23,7 @@ Definition
 
       function replaceOne($filter, $replacement, array $options = []): MongoDB\UpdateResult
 
-   :phpmethod:`MongoDB\\Collection::replaceOne()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 934357c9..0f9974f0 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -21,7 +21,7 @@ Definition
 
       function updateMany($filter, $update, array $options = []): MongoDB\UpdateResult
 
-   :phpmethod:`MongoDB\\Collection::updateMany()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index bfbbf021..b9baed53 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -23,7 +23,7 @@ Definition
 
       function updateOne($filter, $update, array $options = []): MongoDB\UpdateResult
 
-   :phpmethod:`MongoDB\\Collection::updateOne()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-param.rst
 
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index a9aac1fa..a9625c60 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -21,7 +21,7 @@ Definition
 
       function withOptions(array $options = []): MongoDB\Collection
 
-   :phpmethod:`MongoDB\\Collection::withOptions()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-param.rst
 
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
index fac9d3ac..3f16e356 100644
--- a/source/reference/method/MongoDBCollection__construct.txt
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -21,7 +21,7 @@ Definition
 
       function __construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = [])
 
-   :phpmethod:`MongoDB\\Collection::__construct` has the following parameters:
+   This constructor has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-construct-param.rst
 
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index 56c17a1b..599ef23c 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -21,7 +21,7 @@ Definition
 
       function command($command, array $options = []): MongoDB\Driver\Cursor
 
-   :phpmethod:`MongoDB\\Database::command()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-command-param.rst
 
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 47940bfb..90588484 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -33,8 +33,7 @@ Definition
    :manual:`document validation criteria `,
    or configure your storage engine or indexing options.
 
-   :phpmethod:`MongoDB\\Database::createCollection()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-param.rst
 
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index cb0d57d8..daa1c7a5 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -21,7 +21,7 @@ Definition
 
       function drop(array $options = []): array|object
 
-   :phpmethod:`MongoDB\\Database::drop()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-drop-param.rst
 
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 47c450e6..2666ccad 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -21,8 +21,7 @@ Definition
 
       function dropCollection($collectionName, array $options = []): array|object
 
-   :phpmethod:`MongoDB\\Database::dropCollection()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-param.rst
 
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index 27b7b4ac..16c9a7b0 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -21,8 +21,7 @@ Definition
 
       function listCollections(array $options = []): MongoDB\Model\CollectionInfoIterator
 
-   :phpmethod:`MongoDB\\Database::listCollections()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-param.rst
 
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index d46df855..e447d70c 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -21,8 +21,7 @@ Definition
 
       function selectCollection($collectionName, array $options = []): MongoDB\Collection
 
-   :phpmethod:`MongoDB\\Database::selectCollection()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-param.rst
 
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index 1444515e..f071697c 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -21,8 +21,7 @@ Definition
 
       function selectGridFSBucket(array $options = []): MongoDB\GridFS\Bucket
 
-   :phpmethod:`MongoDB\\Database::selectGridFSBucket()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-param.rst
 
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index e6f34f4e..9661ac88 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -21,7 +21,7 @@ Definition
 
       function withOptions(array $options = []): MongoDB\Database
 
-   :phpmethod:`MongoDB\\Database::withOptions()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-param.rst
 
diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt
index 0669df28..0a836175 100644
--- a/source/reference/method/MongoDBDatabase__construct.txt
+++ b/source/reference/method/MongoDBDatabase__construct.txt
@@ -21,7 +21,7 @@ Definition
 
       function __construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = [])
 
-   :phpmethod:`MongoDB\\Database::__construct` has the following parameters:
+   This constructor has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-construct-param.rst
 
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index 2609d717..9ed4b196 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -21,7 +21,7 @@ Definition
 
       function __get($collectionName): MongoDB\Collection
 
-   :phpmethod:`MongoDB\\Database::__get()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-get-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket-delete.txt b/source/reference/method/MongoDBGridFSBucket-delete.txt
index 87ee2507..5f3cde2b 100644
--- a/source/reference/method/MongoDBGridFSBucket-delete.txt
+++ b/source/reference/method/MongoDBGridFSBucket-delete.txt
@@ -21,7 +21,7 @@ Definition
 
       function delete($id): void
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::delete()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-delete-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
index 2deb364a..b7b154fc 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
@@ -22,8 +22,7 @@ Definition
 
       function downloadToStream($id, $destination): void
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStream-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index cbdac678..064be31d 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -22,8 +22,7 @@ Definition
 
       function downloadToStreamByName($filename, $destination, array $options = []): void
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()` has the
-   following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index 91c710d7..53ea4593 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -21,7 +21,7 @@ Definition
 
       function find($filter = [], array $options = []): MongoDB\Driver\Cursor
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::find()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index 7915cdd7..ff0f63fc 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -21,8 +21,7 @@ Definition
 
       function getFileDocumentForStream($stream): object
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()` has the
-   following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileDocumentForStream-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index 3fbec9ef..3c650999 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -21,8 +21,7 @@ Definition
 
       function getFileIdForStream($stream): mixed
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileIdForStream-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
index e81d20d6..6e7f2e9c 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -21,8 +21,7 @@ Definition
 
       function openDownloadStream($id): resource
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStream-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
index 89e8ed56..5dfcf821 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -21,8 +21,7 @@ Definition
 
       function openDownloadStreamByName($filename, array $options = []): resource
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()` has the
-   following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 3ead7405..6eb61c23 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -21,8 +21,7 @@ Definition
 
       function openUploadStream($filename, array $options = []): resource
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt
index b2f3984a..3815ee0c 100644
--- a/source/reference/method/MongoDBGridFSBucket-rename.txt
+++ b/source/reference/method/MongoDBGridFSBucket-rename.txt
@@ -21,7 +21,7 @@ Definition
 
       function rename($id, $newFilename): void
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::rename()` has the following parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-rename-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index 9037bf29..f2913c37 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -21,8 +21,7 @@ Definition
 
       function uploadFromStream($filename, $source, array $options = []): mixed
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()` has the following
-   parameters:
+   This method has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-param.rst
 
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index 37777ea3..ebe1562f 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -21,8 +21,7 @@ Definition
 
       function __construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = [])
 
-   :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()` has the following
-   parameters:
+   This constructor has the following parameters:
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-param.rst
 

From 1a964b4995ad57ef00610c892bc674fbb864baef Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 1 Nov 2016 15:39:48 -0400
Subject: [PATCH 042/321] Extend Collection::find() options for Bucket instead
 of including as-is

---
 ...ongoDBGridFSBucket-method-find-option.yaml | 72 +++++++++++++++++++
 .../method/MongoDBGridFSBucket-find.txt       |  2 +-
 2 files changed, 73 insertions(+), 1 deletion(-)
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml

diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml
new file mode 100644
index 00000000..84bab2c3
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml
@@ -0,0 +1,72 @@
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: projection
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: sort
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: skip
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: limit
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: batchSize
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: collation
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: comment
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: cursorType
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: maxTimeMS
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: readConcern
+description: |
+   :manual:`Read concern ` to use for the operation.
+   Defaults to the bucket's read concern.
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: readPreference
+description: |
+   :manual:`Read preference ` to use for the
+   operation. Defaults to the bucket's read preference.
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: oplogReplay
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: noCursorTimeout
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: allowPartialResults
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: typeMap
+replacement:
+  parent: "bucket"
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: modifiers
+...
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index 53ea4593..8a65c1b2 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -27,7 +27,7 @@ Definition
 
    The ``$options`` parameter supports the following options:
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-find-option.rst
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-find-option.rst
 
    :returns:
 

From a4d8e559ba2c28b84a1e71790fcfe2fbdece3472 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 8 Nov 2016 14:55:53 -0500
Subject: [PATCH 043/321] PHPLIB-187: Remind users to encode connection URIs

---
 .../apiargs-MongoDBClient-method-construct-param.yaml       | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
index 03f2d572..ef674897 100644
--- a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
@@ -7,6 +7,12 @@ description: |
   ` for formatting.
 
   Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified.
+
+  Any special characters in the URI components need to be encoded according to
+  `RFC 3986 `_. This is particularly
+  relevant to the username and password, which can often include special
+  characters such as ``@``, ``:``, or ``%``. The :php:`rawurlencode()
+  ` function may be used to encode constituent parts of the URI.
 interface: phpmethod
 operation: ~
 optional: true

From d6d8b29728be78b3ecd6c251ef56bb7ba420b250 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 8 Nov 2016 15:11:40 -0500
Subject: [PATCH 044/321] PHPLIB-195: Document SSL driver options for
 MongoDB\Client

---
 ...Client-method-construct-driverOptions.yaml | 95 +++++++++++++++++++
 1 file changed, 95 insertions(+)

diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
index 33b1bae3..318d9d50 100644
--- a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
@@ -17,4 +17,99 @@ description: |
 interface: phpmethod
 operation: ~
 optional: true
+---
+arg_name: option
+name: allow_invalid_hostname
+type: boolean
+description: |
+  Disables hostname validation if ``true``. Defaults to ``false``.
+
+  Allowing invalid hostnames may expose the driver to a `man-in-the-middle
+  attack `_.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: ca_dir
+type: string
+description: |
+  Path to a correctly hashed certificate directory. The system certificate store
+  will be used by default.
+
+  Falls back to the deprecated ``capath`` SSL context option if not specified.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: ca_file
+type: string
+description: |
+  Path to a certificate authority file. The system certificate store will be
+  used by default.
+
+  Falls back to the deprecated ``cafile`` SSL context option if not specified.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: crl_file
+type: string
+description: |
+  Path to a certificate revocation list file.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: pem_file
+type: string
+description: |
+  Path to a PEM encoded certificate to use for client authentication.
+
+  Falls back to the deprecated ``local_cert`` SSL context option if not
+  specified.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: pem_pwd
+type: string
+description: |
+  Passphrase for the PEM encoded certificate (if applicable).
+
+  Falls back to the deprecated ``passphrase`` SSL context option if not
+  specified.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: weak_cert_validation
+type: boolean
+description: |
+  Disables certificate validation ``true``. Defaults to ``false``.
+
+  Falls back to the deprecated ``allow_self_signed`` SSL context option if not
+  specified.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: context
+type: resource
+description: |
+  :php:`SSL context options ` to be used as fallbacks
+  for other driver options (as specified). Note that the driver does not consult
+  the default stream context.
+
+  This option is supported for backwards compatibility, but should be considered
+  deprecated.
+interface: phpmethod
+operation: ~
+optional: true
 ...

From 3ff5fcac837b4037ae347ad1cdad16f4b6a706ce Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 8 Nov 2016 15:58:20 -0500
Subject: [PATCH 045/321] PHPLIB-174: Document that socket paths must be
 URL-encoded

---
 .../apiargs-MongoDBClient-method-construct-param.yaml       | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
index ef674897..8bd8bee6 100644
--- a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
@@ -11,8 +11,10 @@ description: |
   Any special characters in the URI components need to be encoded according to
   `RFC 3986 `_. This is particularly
   relevant to the username and password, which can often include special
-  characters such as ``@``, ``:``, or ``%``. The :php:`rawurlencode()
-  ` function may be used to encode constituent parts of the URI.
+  characters such as ``@``, ``:``, or ``%``. When connecting via a Unix domain
+  socket, the socket path may contain special characters such as slashes and
+  must be encoded. The :php:`rawurlencode() ` function may be used
+  to encode constituent parts of the URI.
 interface: phpmethod
 operation: ~
 optional: true

From 3937f0ce9b647f97a8ee56e44ee5dfefdb2dacbf Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 8 Nov 2016 19:19:58 -0500
Subject: [PATCH 046/321] Revise tutorial articles

---
 source/tutorial/commands.txt | 469 +++++++++++++++--------------------
 source/tutorial/crud.txt     | 358 +++++++++++++-------------
 source/tutorial/indexes.txt  |  61 +++--
 3 files changed, 412 insertions(+), 476 deletions(-)

diff --git a/source/tutorial/commands.txt b/source/tutorial/commands.txt
index e7e6b356..f4d55d80 100644
--- a/source/tutorial/commands.txt
+++ b/source/tutorial/commands.txt
@@ -13,11 +13,12 @@ Execute Database Commands
 Overview
 --------
 
-The |php-library| provides :ref:`helper methods `
-for common :manual:`database commands `. In
-addition, the |php-library| provides the
-:phpmethod:`MongoDB\\Database::command` method to run database commands
-with PHP that do not have helper methods.
+The |php-library| provides helper methods across the :phpclass:`Client
+`, :phpclass:`Database `, and
+:phpclass:`Collection ` classes for common
+:manual:`database commands `. In addition, the
+:phpmethod:`MongoDB\\Database::command()` method may be used to run database
+commands that do not have a helper method.
 
 Execute Database Commands
 -------------------------
@@ -26,12 +27,10 @@ Basic Command
 ~~~~~~~~~~~~~
 
 To execute a command on a :program:`mongod` instance, use the
-:phpmethod:`MongoDB\\Database::command` method. For instance, the
-following operation uses the :dbcommand:`geoNear` HERE command to search for
-the three closest documents to longitude ``-74`` and latitude ``40`` in
-the ``restos`` collection in the ``example`` database:
-
-:readmode:`secondary`
+:phpmethod:`MongoDB\\Database::command()` method. For instance, the following
+operation uses the :manual:`geoNear ` command to
+search for the three closest documents to longitude ``-74`` and latitude ``40``
+in the ``restos`` collection in the ``example`` database:
 
 .. code-block:: php
 
@@ -39,249 +38,188 @@ the ``restos`` collection in the ``example`` database:
 
    $database = (new MongoDB\Client)->example;
 
-   $results = $database->command(
-       [
-           'geoNear' => 'restos',
-           'near' => [
-               'type' => 'Point',
-               'coordinates' => [-74.0, 40.0]
-           ],
-           'spherical' => 'true',
-           'num' => 3
-       ]
-   );
+   $cursor = $database->command([
+       'geoNear' => 'restos',
+       'near' => [
+           'type' => 'Point',
+           'coordinates' => [-74.0, 40.0],
+       ],
+       'spherical' => 'true',
+       'num' => 3,
+   ]);
+
+   $results = $cursor->toArray()[0];
 
    var_dump($results);
 
-The output would resemble::
-  
-  object(MongoDB\Driver\Cursor)#10 (2) {
-    ["cursor"]=>
-    array(17) {
-      ["stamp"]=>
-      int(0)
-      ["is_command"]=>
-      bool(true)
-      ["sent"]=>
-      bool(true)
-      ["done"]=>
-      bool(false)
-      ["end_of_event"]=>
-      bool(false)
-      ["in_exhaust"]=>
-      bool(false)
-      ["has_fields"]=>
-      bool(false)
-      ["query"]=>
-      object(stdClass)#3 (4) {
-        ["geoNear"]=>
-        string(6) "restos"
-        ["near"]=>
-        object(stdClass)#9 (2) {
-          ["type"]=>
-          string(5) "Point"
-          ["coordinates"]=>
-          array(2) {
-            [0]=>
-            float(-74)
-            [1]=>
-            float(40)
-          }
-        }
-        ["spherical"]=>
-        string(4) "true"
-        ["num"]=>
-        int(3)
-      }
-      ["fields"]=>
-      object(stdClass)#8 (0) {
-      }
-      ["read_preference"]=>
-      array(2) {
-        ["mode"]=>
-        int(1)
-        ["tags"]=>
-        array(0) {
-        }
-      }
-      ["flags"]=>
-      int(0)
-      ["skip"]=>
-      int(0)
-      ["limit"]=>
-      int(1)
-      ["count"]=>
-      int(1)
-      ["batch_size"]=>
-      int(0)
-      ["ns"]=>
-      string(12) "example.$cmd"
-      ["current_doc"]=>
-      object(stdClass)#24 (4) {
-        ["waitedMS"]=>
-        int(0)
-        ["results"]=>
-        array(3) {
-          [0]=>
-          object(stdClass)#14 (2) {
-            ["dis"]=>
-            float(66308.6190421)
-            ["obj"]=>
-            object(stdClass)#13 (5) {
-              ["_id"]=>
-              object(MongoDB\BSON\ObjectID)#11 (1) {
-                ["oid"]=>
-                string(24) "57506d62f57802807471dd28"
-              }
-              ["name"]=>
-              string(21) "XYZ Bagels Restaurant"
-              ["contact"]=>
-              object(stdClass)#12 (3) {
-                ["phone"]=>
-                string(12) "435-555-0190"
-                ["email"]=>
-                string(31) "XYZBagelsRestaurant@example.net"
-                ["location"]=>
-                array(2) {
-                  [0]=>
-                  float(-74.0707363)
-                  [1]=>
-                  float(40.5932157)
-                }
-              }
-              ["stars"]=>
-              int(4)
-              ["categories"]=>
-              array(3) {
-                [0]=>
-                string(6) "Bagels"
-                [1]=>
-                string(10) "Sandwiches"
-                [2]=>
-                string(6) "Coffee"
-              }
-            }
-          }
-          [1]=>
-          object(stdClass)#18 (2) {
-            ["dis"]=>
-            float(69014.6014737)
-            ["obj"]=>
-            object(stdClass)#17 (5) {
-              ["_id"]=>
-              object(MongoDB\BSON\ObjectID)#15 (1) {
-                ["oid"]=>
-                string(24) "57506d62f57802807471dd39"
-              }
-              ["name"]=>
-              string(20) "Green Feast Pizzeria"
-              ["contact"]=>
-              object(stdClass)#16 (3) {
-                ["phone"]=>
-                string(12) "840-555-0102"
-                ["email"]=>
-                string(30) "GreenFeastPizzeria@example.com"
-                ["location"]=>
-                array(2) {
-                  [0]=>
-                  float(-74.1220973)
-                  [1]=>
-                  float(40.6129407)
-                }
-              }
-              ["stars"]=>
-              int(2)
-              ["categories"]=>
-              array(2) {
-                [0]=>
-                string(5) "Pizza"
-                [1]=>
-                string(7) "Italian"
-              }
-            }
-          }
-          [2]=>
-          object(stdClass)#22 (2) {
-            ["dis"]=>
-            float(69975.5031089)
-            ["obj"]=>
-            object(stdClass)#21 (5) {
-              ["_id"]=>
-              object(MongoDB\BSON\ObjectID)#19 (1) {
-                ["oid"]=>
-                string(24) "57506d62f57802807471dd35"
-              }
-              ["name"]=>
-              string(14) "XYZ Coffee Bar"
-              ["contact"]=>
-              object(stdClass)#20 (3) {
-                ["phone"]=>
-                string(12) "644-555-0193"
-                ["email"]=>
-                string(24) "XYZCoffeeBar@example.net"
-                ["location"]=>
-                array(2) {
-                  [0]=>
-                  float(-74.0166091)
-                  [1]=>
-                  float(40.6284767)
-                }
-              }
-              ["stars"]=>
-              int(5)
-              ["categories"]=>
-              array(4) {
-                [0]=>
-                string(6) "Coffee"
-                [1]=>
-                string(4) "Cafe"
-                [2]=>
-                string(6) "Bakery"
-                [3]=>
-                string(10) "Chocolates"
-              }
-            }
-          }
-        }
-        ["stats"]=>
-        object(stdClass)#23 (5) {
-          ["nscanned"]=>
-          int(11)
-          ["objectsLoaded"]=>
-          int(10)
-          ["avgDistance"]=>
-          float(68432.9078749)
-          ["maxDistance"]=>
-          float(69975.5031089)
-          ["time"]=>
-          int(0)
-        }
-        ["ok"]=>
-        float(1)
-      }
-    }
-    ["server_id"]=>
-    int(1)
-  }
-
-Commands with Custom Read Preference  
+The output would then resemble::
+
+   object(MongoDB\Model\BSONDocument)#27 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["waitedMS"]=>
+       int(0)
+       ["results"]=>
+       object(MongoDB\Model\BSONArray)#25 (1) {
+         ["storage":"ArrayObject":private]=>
+         array(3) {
+           [0]=>
+           object(MongoDB\Model\BSONDocument)#14 (1) {
+             ["storage":"ArrayObject":private]=>
+             array(2) {
+               ["dis"]=>
+               float(39463.618389163)
+               ["obj"]=>
+               object(MongoDB\Model\BSONDocument)#13 (1) {
+                 ["storage":"ArrayObject":private]=>
+                 array(3) {
+                   ["_id"]=>
+                   object(MongoDB\BSON\ObjectID)#3 (1) {
+                     ["oid"]=>
+                     string(24) "55cba2486c522cafdb059bed"
+                   }
+                   ["location"]=>
+                   object(MongoDB\Model\BSONDocument)#12 (1) {
+                     ["storage":"ArrayObject":private]=>
+                     array(2) {
+                       ["coordinates"]=>
+                       object(MongoDB\Model\BSONArray)#11 (1) {
+                         ["storage":"ArrayObject":private]=>
+                         array(2) {
+                           [0]=>
+                           float(-74.1641319)
+                           [1]=>
+                           float(39.6686512)
+                         }
+                       }
+                       ["type"]=>
+                       string(5) "Point"
+                     }
+                   }
+                   ["name"]=>
+                   string(32) "Soul Food Kitchen Seafood Heaven"
+                 }
+               }
+             }
+           }
+           [1]=>
+           object(MongoDB\Model\BSONDocument)#19 (1) {
+             ["storage":"ArrayObject":private]=>
+             array(2) {
+               ["dis"]=>
+               float(50686.851650416)
+               ["obj"]=>
+               object(MongoDB\Model\BSONDocument)#18 (1) {
+                 ["storage":"ArrayObject":private]=>
+                 array(3) {
+                   ["_id"]=>
+                   object(MongoDB\BSON\ObjectID)#15 (1) {
+                     ["oid"]=>
+                     string(24) "55cba2476c522cafdb0544df"
+                   }
+                   ["location"]=>
+                   object(MongoDB\Model\BSONDocument)#17 (1) {
+                     ["storage":"ArrayObject":private]=>
+                     array(2) {
+                       ["coordinates"]=>
+                       object(MongoDB\Model\BSONArray)#16 (1) {
+                         ["storage":"ArrayObject":private]=>
+                         array(2) {
+                           [0]=>
+                           float(-74.2566332)
+                           [1]=>
+                           float(40.4109872)
+                         }
+                       }
+                       ["type"]=>
+                       string(5) "Point"
+                     }
+                   }
+                   ["name"]=>
+                   string(20) "Seguine Bagel Bakery"
+                 }
+               }
+             }
+           }
+           [2]=>
+           object(MongoDB\Model\BSONDocument)#24 (1) {
+             ["storage":"ArrayObject":private]=>
+             array(2) {
+               ["dis"]=>
+               float(58398.379630263)
+               ["obj"]=>
+               object(MongoDB\Model\BSONDocument)#23 (1) {
+                 ["storage":"ArrayObject":private]=>
+                 array(3) {
+                   ["_id"]=>
+                   object(MongoDB\BSON\ObjectID)#20 (1) {
+                     ["oid"]=>
+                     string(24) "55cba2476c522cafdb053c92"
+                   }
+                   ["location"]=>
+                   object(MongoDB\Model\BSONDocument)#22 (1) {
+                     ["storage":"ArrayObject":private]=>
+                     array(2) {
+                       ["coordinates"]=>
+                       object(MongoDB\Model\BSONArray)#21 (1) {
+                         ["storage":"ArrayObject":private]=>
+                         array(2) {
+                           [0]=>
+                           float(-74.3731727)
+                           [1]=>
+                           float(40.4404759)
+                         }
+                       }
+                       ["type"]=>
+                       string(5) "Point"
+                     }
+                   }
+                   ["name"]=>
+                   string(17) "Water'S Edge Club"
+                 }
+               }
+             }
+           }
+         }
+       }
+       ["stats"]=>
+       object(MongoDB\Model\BSONDocument)#26 (1) {
+         ["storage":"ArrayObject":private]=>
+         array(5) {
+           ["nscanned"]=>
+           int(25139)
+           ["objectsLoaded"]=>
+           int(25134)
+           ["avgDistance"]=>
+           float(49516.283223281)
+           ["maxDistance"]=>
+           float(58398.379630263)
+           ["time"]=>
+           int(126)
+         }
+       }
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+Commands with Custom Read Preference
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Some commands, such as :manual:`createUser
-`, may only be executed on a
-:term:`primary` replica set member or a :term:`standalone`.
+Some commands, such as :manual:`createUser `,
+may only be executed on a :term:`primary` replica set member or a
+:term:`standalone`.
 
-The command helper methods in the
-|php-library|, such as :phpmethod:`MongoDB\\Database::drop`,
-know to apply their own :term:`read preference` if necessary. However,
-the :phpmethod:`MongoDB\\Database::command` method is a generic method and 
-defaults to the read preference of the
-Database object on which it is invoked. To execute commands that require
-specific read preference, specify the read preference in the ``$options``
-parameter of the method.
+The command helper methods in the |php-library|, such as
+:phpmethod:`MongoDB\\Database::drop()`, know to apply their own :term:`read
+preference` if necessary. However, the :phpmethod:`MongoDB\\Database::command()`
+method is a generic method and defaults to the read preference of the Database
+object on which it is invoked. To execute commands that require a specific read
+preference, specify the read preference in the ``$options`` parameter of the
+method.
 
-The following example adds a user to the ``demo`` database 
-and specifies a custom read preference:
+The following example adds a user to the ``demo`` database and specifies a
+custom read preference:
 
 .. code-block:: php
 
@@ -319,12 +257,11 @@ View Single Result Documents
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 The :phpmethod:`MongoDB\\Database::command()` method returns a
-:php:`MongoDB\\Driver\\Cursor ` object. 
+:php:`MongoDB\\Driver\\Cursor ` object.
 
-Many MongoDB commands return their responses as a single document in an
-array. To read the command response, you may either iterate on the
-cursor and access the first document, or access the first result in the
-array, as in the following:
+Many MongoDB commands return their responses as a single document. To read the
+command response, you may either iterate on the cursor and access the first
+document, or access the first result in the array, as in the following:
 
 .. code-block:: php
 
@@ -350,13 +287,12 @@ Iterate Results from a Cursor
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 Some commands, such as :manual:`listCollections
-`,
-return their results via an iterable cursor. To view the results,
-iterate through the cursor. 
+`, return their results via an iterable
+cursor. To view the results, iterate through the cursor.
 
 The following example lists the collections in the ``demo`` database by
-iterating through the cursor returned by the ``listCollections`` command
-using a ``foreach`` loop:
+iterating through the cursor returned by the ``listCollections`` command using a
+``foreach`` loop:
 
 .. code-block:: php
 
@@ -370,8 +306,8 @@ using a ``foreach`` loop:
        echo $collection['name'], "\n";
    }
 
-The output would then be a list of the values for the ``name`` key,
-for instance::
+The output would then be a list of the values for the ``name`` key, for
+instance::
 
    persons
    posts
@@ -379,10 +315,11 @@ for instance::
 
 .. note::
 
-   At the *protocol* level, commands that support a cursor
-   return a single result document with the essential ingredients for
-   constructing the command cursor (i.e. the cursor's ID, namespace, and
-   the first batch of results). In the PHP driver implementation, the
-   :php:`executeCommand() `
-   method detects the single result and constructs the iterable command
-   cursor, which is returned rather than the base result document.
+   At the *protocol* level, commands that support a cursor return a single
+   result document with the essential ingredients for constructing the command
+   cursor (i.e. the cursor's ID, namespace, and the first batch of results). In
+   the PHP driver implementation, the
+   :php:`MongoDB\Driver\Manager::executeCommand()
+   ` method detects such a result and
+   constructs the iterable command cursor, which is returned rather than the
+   base result document.
diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index 8c2b0a29..cc026dd6 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -12,16 +12,16 @@ CRUD Operations
 
 
 CRUD operations *create*, *read*, *update*, and *delete* documents. The
-|php-library|'s :phpclass:`MongoDB\\Collection` class implements
-MongoDB's cross-driver `CRUD specification
-`_, providing access to methods for inserting, finding, updating,
-and deleting documents in MongoDB.
+|php-library|'s :phpclass:`MongoDB\\Collection` class implements MongoDB's
+cross-driver `CRUD specification
+`_,
+providing access to methods for inserting, finding, updating, and deleting
+documents in MongoDB.
 
-This document provides a general introduction to inserting, querying,
-updating, and deleting documents using the |php-library|. The MongoDB
-Manual's :manual:`CRUD Section ` provides a more thorough
-introduction to CRUD operations with MongoDB.
+This document provides a general introduction to inserting, querying, updating,
+and deleting documents using the |php-library|. The MongoDB Manual's
+:manual:`CRUD Section ` provides a more thorough introduction to CRUD
+operations with MongoDB.
 
 Insert Documents
 ----------------
@@ -29,11 +29,12 @@ Insert Documents
 Insert One Document
 ~~~~~~~~~~~~~~~~~~~
 
-The :phpmethod:`MongoDB\\Collection::insertOne` method inserts a single
-document into MongoDB and returns an instance of ``MongoDB\InsertOneResult``,
-which you can use to access the IDs of the inserted document.
+The :phpmethod:`MongoDB\\Collection::insertOne()` method inserts a single
+document into MongoDB and returns an instance of
+:phpclass:`MongoDB\\InsertOneResult`, which you can use to access the ID of the
+inserted document.
 
-.. this uses the insertMany example from the method reference:
+.. this uses the insertOne example from the method reference:
 
 .. include:: /reference/method/MongoDBCollection-insertOne.txt
    :start-after: start-crud-include
@@ -41,12 +42,12 @@ which you can use to access the IDs of the inserted document.
 
 The output includes the ID of the inserted document.
 
-If you include an ``_id`` value when inserting a document, MongoDB checks
-to ensure that the ``_id`` value is unique for the collection. If the
-``_id`` value is not unique, the insert operation fails due to a duplicate
-key error.
+If you include an ``_id`` value when inserting a document, MongoDB checks to
+ensure that the ``_id`` value is unique for the collection. If the ``_id`` value
+is not unique, the insert operation fails due to a duplicate key error.
 
-The following example inserts a document while specifying the value for the ``_id``:
+The following example inserts a document while specifying the value for the
+``_id``:
 
 .. code-block:: php
 
@@ -65,15 +66,15 @@ The output would then resemble::
    Inserted 1 document(s)
    int(1)
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::insertOne` reference.
+.. seealso:: :phpmethod:`MongoDB\\Collection::insertOne()`
 
 Insert Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-The :phpmethod:`MongoDB\\Collection::insertMany` method allows you to
-insert multiple documents in one write operation and returns an instance
-of ``MongoDB\InsertManyResult``, which you can use to access the
-IDs of the inserted documents.
+The :phpmethod:`MongoDB\\Collection::insertMany()` method allows you to insert
+multiple documents in one write operation and returns an instance of
+:phpclass:`MongoDB\\InsertManyResult`, which you can use to access the IDs of
+the inserted documents.
 
 .. this uses the insertMany example from the method reference:
 
@@ -81,25 +82,24 @@ IDs of the inserted documents.
    :start-after: start-crud-include
    :end-before: end-crud-include
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::insertMany` reference.
+.. seealso:: :phpmethod:`MongoDB\\Collection::insertMany()`
 
 Query Documents
 ---------------
 
-The |php-library| provides the :phpmethod:`MongoDB\\Collection::findOne`
-and :phpmethod:`MongoDB\\Collection:findMany` methods for querying
-documents and the :phpmethod:`MongoDB\\Collection:aggregate`
-method for performing :manual:`aggregation operations
-`.
 
 Find One Document
 ~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::findOne` returns the :term:`first
-document ` that matches the query or ``null`` if no
-document matches the query.
+:phpmethod:`MongoDB\\Collection::findOne()` returns the :term:`first document
+` that matches the query or ``null`` if no document matches the
+query.
 
-The following example searches for the document with ``_id: 94301``:
+The following example searches for the document with ``_id`` of ``"94301"``:
 
 .. code-block:: php
 
@@ -137,20 +137,20 @@ The output would then resemble::
      }
    }
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::findMany` reference
+.. seealso:: :phpmethod:`MongoDB\\Collection::findOne()`
 
 Find Many Documents
 ~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::find` returns a
-:php:`MongoDB\\Driver\\Cursor ` object, which you
-can iterate upon to access all matched documents.
+:phpmethod:`MongoDB\\Collection::find()` returns a
+:php:`MongoDB\\Driver\\Cursor ` object, which you can
+iterate upon to access all matched documents.
 
-The following example lists the documents in the ``zips`` collection
-with the specified city and state values:
+The following example lists the documents in the ``zips`` collection with the
+specified city and state values:
 
 .. code-block:: php
-                
+
    demo->zips;
@@ -170,51 +170,55 @@ The output would resemble::
    07307
    07310
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::find` reference
+.. seealso:: :phpmethod:`MongoDB\\Collection::find()`
 
 .. _php-query-projection:
 
 Query Projection
 ~~~~~~~~~~~~~~~~
 
-By default, queries in MongoDB return all fields in matching documents.
-To limit the amount of data that MongoDB sends to applications, you can
-include a :manual:`projection document
-` in the query operation.
+By default, queries in MongoDB return all fields in matching documents. To limit
+the amount of data that MongoDB sends to applications, you can include a
+:manual:`projection document ` in
+the query operation.
 
-.. note:: 
+.. note::
 
-   MongoDB includes the ``_id`` field by default unless you explicitly
-   exclude it in a projection document.
+   MongoDB includes the ``_id`` field by default unless you explicitly exclude
+   it in a projection document.
 
-The following example finds restaurants based on the ``cuisine`` and
-``borough`` fields and uses a :manual:`projection
-` to limit the fields
-that are returned. It also limits the results to 5 documents.
+The following example finds restaurants based on the ``cuisine`` and ``borough``
+fields and uses a :manual:`projection
+` to limit the fields that are
+returned. It also limits the results to 5 documents.
 
 .. code-block:: php
 
    example->restaurants;
 
-   $collection = $database->selectCollection('example','restaurants');
-
-   $restaurants = $collection->find(
-       [ 'cuisine' => 'Italian', 'borough' => 'Manhattan'],
-       [ 
-         'projection' => [
-           'name' => 1, 'borough' => 1, 'cuisine' => 1,
-         ],
+   $cursor = $collection->find(
+       [
+           'cuisine' => 'Italian',
+           'borough' => 'Manhattan',
+       ],
+       [
+           'projection' => [
+               'name' => 1,
+               'borough' => 1,
+               'cuisine' => 1,
+           ],
+           'limit' => 4,
        ]
    );
 
-   foreach($restaurants as $restaurant) {
+   foreach($cursor as $restaurant) {
       var_dump($restaurant);
    };
 
 The output would then resemble::
-                
+
    object(MongoDB\Model\BSONDocument)#10 (1) {
      ["storage":"ArrayObject":private]=>
      array(4) {
@@ -279,16 +283,15 @@ The output would then resemble::
        string(22) "Angelo Of Mulberry St."
      }
    }
-   ...
 
 Limit, Sort, and Skip Options
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-In addition to :ref:`projection criteria `,
-you can specify options to limit, sort, and skip documents during queries.
+In addition to :ref:`projection criteria `, you can
+specify options to limit, sort, and skip documents during queries.
 
-The following example uses the ``limit`` and ``sort`` options to query
-for the five most populous zip codes in the United States:
+The following example uses the ``limit`` and ``sort`` options to query for the
+five most populous zip codes in the United States:
 
 .. code-block:: php
 
@@ -305,7 +308,7 @@ for the five most populous zip codes in the United States:
    );
 
    foreach ($cursor as $document) {
-       echo $document['_id'], "\n";
+       printf("%s: %s, %s\n", $document['_id'], $document['city'], $document['state']);
    }
 
 The output would then resemble::
@@ -319,17 +322,16 @@ The output would then resemble::
 Complex Queries with Aggregation
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-MongoDB's :manual:`Aggregation Framework `
-allows you to issue complex queries that filter, transform, and group
-collection data. The |php-library|\'s
-:phpmethod:`MongoDB\\Collection::aggregate` method returns a
-:php:`traversable ` object, which you can iterate upon to
+MongoDB's :manual:`Aggregation Framework ` allows
+you to issue complex queries that filter, transform, and group collection data.
+The |php-library|\'s :phpmethod:`MongoDB\\Collection::aggregate()` method
+returns a :php:`Traversable ` object, which you can iterate upon to
 access the results of the aggregation operation. Refer to the
-:phpmethod:`MongoDB\\Collection::aggregate` method's :ref:`behavior
+:phpmethod:`MongoDB\\Collection::aggregate()` method's :ref:`behavior
 reference ` for more about the method's output.
 
-The following example lists the 5 US states with the most zip codes
-associated with them:
+The following example lists the 5 US states with the most zip codes associated
+with them:
 
 .. code-block:: php
 
@@ -348,14 +350,14 @@ associated with them:
    }
 
 The output would then resemble::
-   
+
    TX has 1671 zip codes
    NY has 1595 zip codes
    CA has 1516 zip codes
    PA has 1458 zip codes
    IL has 1237 zip codes
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::aggregate` reference
+.. seealso:: :phpmethod:`MongoDB\\Collection::aggregate()`
 
 Update Documents
 ----------------
@@ -363,22 +365,20 @@ Update Documents
 Update One Document
 ~~~~~~~~~~~~~~~~~~~
 
-Use the :phpmethod:`MongoDB\\Collection::updateOne` method to update a
-single document matching a filter.
-:phpmethod:`MongoDB\\Collection::updateOne` returns a
-``MongoDB\UpdateResult`` object, which you can use to access statistics
-about the update operation.
+Use the :phpmethod:`MongoDB\\Collection::updateOne()` method to update a single
+document matching a filter. :phpmethod:`MongoDB\\Collection::updateOne()`
+returns a :phpclass:`MongoDB\\UpdateResult` object, which you can use to access
+statistics about the update operation.
 
-Update methods have two required parameters: the query filter that
-identifies the document or documents to update, and an update document
-that specifies what updates to perform. The :phpmethod:`MongoDB\\Collection::updateOne`
-reference describes each parameter in detail.
+Update methods have two required parameters: the query filter that identifies
+the document or documents to update, and an update document that specifies what
+updates to perform. The :phpmethod:`MongoDB\\Collection::updateOne()` reference
+describes each parameter in detail.
 
 The following example inserts two documents into an empty ``users`` collection
-in the ``demo`` database using the :phpmethod:`MongoDB\\Collection::insertOne`
-method, and then updates the documents where the value for the ``state``
-field is ``"ny"`` to include
-a ``country`` field set to ``"us"``:
+in the ``demo`` database using the :phpmethod:`MongoDB\\Collection::insertOne()`
+method, and then updates the documents where the value for the ``state`` field
+is ``"ny"`` to include a ``country`` field set to ``"us"``:
 
 .. code-block:: php
 
@@ -398,16 +398,15 @@ a ``country`` field set to ``"us"``:
    printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
 
 Since the update operation uses the
-:phpmethod:`MongoDB\\Collection::updateOne` method, which updates the
-first document to match the filter criteria, the results would then
-resemble::
+:phpmethod:`MongoDB\\Collection::updateOne()` method, which updates the first
+document to match the filter criteria, the results would then resemble::
 
    Matched 1 document(s)
    Modified 1 document(s)
 
-It is possible for a document to match the filter but *not be modified*
-by an update, as is the case where the update sets a field's value to its
-existing value, as in this example:
+It is possible for a document to match the filter but *not be modified* by an
+update, as is the case where the update sets a field's value to its existing
+value, as in this example:
 
 .. code-block:: php
 
@@ -425,34 +424,33 @@ existing value, as in this example:
    printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
    printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
 
-The number of matched documents and the number of *modified* documents
-would therefore not be equal, and the output from the operation would
-resemble::
+The number of matched documents and the number of *modified* documents would
+therefore not be equal, and the output from the operation would resemble::
 
    Matched 1 document(s)
    Modified 0 document(s)
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::updateOne` reference
-   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate` reference
+   - :phpmethod:`MongoDB\\Collection::updateOne()`
+   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
 
 Update Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::updateMany` updates one or more documents
-matching the filter criteria and returns a ``MongoDB\UpdateResult`` object
-that you can iterate to access statistics about the update operation.
+:phpmethod:`MongoDB\\Collection::updateMany()` updates one or more documents
+matching the filter criteria and returns a :phpclass:`MongoDB\\UpdateResult`
+object, which you can use to access statistics about the update operation.
 
-Update methods have two required parameters: the query filter that
-identifies the document or documents to update, and an update document
-that specifies what updates to perform. The :phpmethod:`MongoDB\\Collection::updateMany`
-reference describes each parameter in detail.
+Update methods have two required parameters: the query filter that identifies
+the document or documents to update, and an update document that specifies what
+updates to perform. The :phpmethod:`MongoDB\\Collection::updateMany()` reference
+describes each parameter in detail.
 
-The following example inserts three documents into an empty ``users``
-collection in the ``demo`` database and then uses the :query:`$set`
-operator to update the documents matching the filter criteria to
-include the ``country`` field with value ``"us"``:
+The following example inserts three documents into an empty ``users`` collection
+in the ``demo`` database and then uses the :query:`$set` operator to update the
+documents matching the filter criteria to include the ``country`` field with
+value ``"us"``:
 
 .. code-block:: php
 
@@ -472,48 +470,46 @@ include the ``country`` field with value ``"us"``:
    printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
    printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
 
-If an update operation results in no change to a document, such as
-setting the value of the field to its current value, the number of
-modified documents can be less than the number of *matched* documents.
-Since the update document with ``name`` of ``"Bob"`` results in no changes
-to the document, the output of the operation therefore resembles::
+If an update operation results in no change to a document, such as setting the
+value of the field to its current value, the number of modified documents can be
+less than the number of *matched* documents. Since the update document with
+``name`` of ``"Bob"`` results in no changes to the document, the output of the
+operation therefore resembles::
 
    Matched 3 document(s)
    Modified 2 document(s)
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::updateMany` reference
+.. seealso:: :phpmethod:`MongoDB\\Collection::updateMany()`
 
 Replace Documents
 ~~~~~~~~~~~~~~~~~
 
-Replacement operations are similar to update operations, but instead
-of updating a document to include new fields or new field values, a
-replacement operation replaces the entire document with a new document,
-but retains the original document's ``_id`` value.
+Replacement operations are similar to update operations, but instead of updating
+a document to include new fields or new field values, a replacement operation
+replaces the entire document with a new document, but retains the original
+document's ``_id`` value.
 
-The :phpmethod:`MongoDB\\Collection::replaceOne` method replaces a single
-document that matches the filter criteria and returns
-an instance of ``MongoDB\UpdateResult`` that
-you can use to access statistics about the replacement operation.
+The :phpmethod:`MongoDB\\Collection::replaceOne()` method replaces a single
+document that matches the filter criteria and returns an instance of
+:phpclass:`MongoDB\\UpdateResult`, which you can use to access statistics about
+the replacement operation.
 
-:phpmethod:`MongoDB\\Collection::replaceOne` has two required
-parameters: the query filter that identifies the document or documents
-to update, and a replacement document that will replace the original
-document in MongoDB. The :phpmethod:`MongoDB\\Collection::replaceOne`
-reference describes each parameter in detail.
+:phpmethod:`MongoDB\\Collection::replaceOne()` has two required parameters: the
+query filter that identifies the document or documents to replace, and a
+replacement document that will replace the original document in MongoDB. The
+:phpmethod:`MongoDB\\Collection::replaceOne()` reference describes each
+parameter in detail.
 
 .. important:: 
 
-   Replacement operations replace all of the fields in a document
-   except the ``_id`` value. To avoid accidentally overwriting or
-   deleting desired fields, use the
-   :phpmethod:`MongoDB\\Collection::updateOne` or
-   :phpmethod:`MongoDB\\Collection::updateMany` methods to update
-   individual fields in a document rather than replacing the entire
-   document.
+   Replacement operations replace all of the fields in a document except the
+   ``_id`` value. To avoid accidentally overwriting or deleting desired fields,
+   use the :phpmethod:`MongoDB\\Collection::updateOne()` or
+   :phpmethod:`MongoDB\\Collection::updateMany()` methods to update individual
+   fields in a document rather than replacing the entire document.
 
-The following example inserts one document into an empty ``users`` collection
-in the ``demo`` database, and then replaces that document with a new one:
+The following example inserts one document into an empty ``users`` collection in
+the ``demo`` database, and then replaces that document with a new one:
 
 .. code-block:: php
 
@@ -538,26 +534,24 @@ The output would then resemble::
 
 .. seealso:: 
 
-   - :phpmethod:`MongoDB\\Collection::replaceOne` reference
-   - :phpmethod:`MongoDB\\Collection::findOneAndReplace` reference
+   - :phpmethod:`MongoDB\\Collection::replaceOne()`
+   - :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
 
 Upsert
 ~~~~~~
 
 Update and replace operations support an :manual:`upsert
-` option. When ``upsert`` is
-``true`` *and* no documents match the specified filter, then the
-operation creates a new document and inserts it. If there *are* matching
-documents, then the operation modifies or replaces the matching
-document or documents.
+` option. When ``upsert`` is ``true``
+*and* no documents match the specified filter, the operation creates a new
+document and inserts it. If there *are* matching documents, then the operation
+modifies or replaces the matching document or documents.
 
 When a document is upserted, the ID is accessible via
-``MongoDB\UpdateResult::getUpsertedId()``.
+:phpmethod:`MongoDB\\UpdateResult::getUpsertedId()`.
 
-The following example uses :phpmethod:`MongoDB\\Collection::updateOne`
-with the ``upsert`` option set to ``true`` into an empty ``users``
-collection in the ``demo`` database, therefore inserting the document
-into the database:
+The following example uses :phpmethod:`MongoDB\\Collection::updateOne()` with
+the ``upsert`` option set to ``true`` and an empty ``users`` collection in the
+``demo`` database, therefore inserting the document into the database:
 
 .. code-block:: php
 
@@ -574,12 +568,19 @@ into the database:
 
    printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
    printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
-   var_dump($collection->findOne(['_id' => $updateResult->getUpsertedId()]));
+   printf("Upserted %d document(s)\n", $updateResult->getUpsertedCount());
+
+   $upsertedDocument = $collection->findOne([
+       '_id' => $updateResult->getUpsertedId(),
+   ]);
+
+   var_dump($upsertedDocument);
 
 The output would then resemble::
 
    Matched 0 document(s)
    Modified 0 document(s)
+   Upserted 1 document(s)
    object(MongoDB\Model\BSONDocument)#16 (1) {
      ["storage":"ArrayObject":private]=>
      array(3) {
@@ -601,21 +602,22 @@ Delete Documents
 Delete One Document
 ~~~~~~~~~~~~~~~~~~~
 
-
-The :phpmethod:`MongoDB\\Collection::deleteOne` method deletes a single
+The :phpmethod:`MongoDB\\Collection::deleteOne()` method deletes a single
 document that matches the filter criteria and returns a
-``MongoDB\DeleteResult`` object that you can use to access statistics
-about the delete operation. If multiple documents match the filter
-criteria, :phpmethod:`MongoDB\\Collection::deleteOne` deletes the
-:term:`first ` matching document.
+:phpclass:`MongoDB\\DeleteResult`, which you can use to access statistics about
+the delete operation.
 
-:phpmethod:`MongoDB\\Collection::deleteOne` has one required parameter:
-a query filter that specifies the document to delete. Refer to the
-:phpmethod:`MongoDB\\Collection::deleteOne` reference for full method documentation.
+If multiple documents match the filter criteria,
+:phpmethod:`MongoDB\\Collection::deleteOne()` deletes the :term:`first
+` matching document.
 
+:phpmethod:`MongoDB\\Collection::deleteOne()` has one required parameter: a
+query filter that specifies the document to delete. Refer to the
+:phpmethod:`MongoDB\\Collection::deleteOne()` reference for full method
+documentation.
 
-The following operation deletes the first document where the ``state``
-value is ``ny``:
+The following operation deletes the first document where the ``state`` field's
+value is ``"ny"``:
 
 .. code-block:: php
 
@@ -634,24 +636,22 @@ The output would then resemble::
 
    Deleted 1 document(s)
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::deleteOne` reference.
+.. seealso:: :phpmethod:`MongoDB\\Collection::deleteOne()`
 
 Delete Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::deleteMany` deletes all of the
-documents that match the filter criteria and returns a
-``MongodB\DeleteResult`` object that you can use to access statistics
-about the delete op eration.
-
-:phpmethod:`MongoDB\\Collection::deleteMany` has one required
-parameter: a query filter that specifies the document to delete. Refer
-to the :phpmethod:`MongoDB\\Collection::deleteMany` reference for full
-method documentation.
+:phpmethod:`MongoDB\\Collection::deleteMany()` deletes all of the documents that
+match the filter criteria and returns a :phpclass:`MongoDB\\DeleteResult`, which
+you can use to access statistics about the delete operation.
 
+:phpmethod:`MongoDB\\Collection::deleteMany()` has one required parameter: a
+query filter that specifies the document to delete. Refer to the
+:phpmethod:`MongoDB\\Collection::deleteMany()` reference for full method
+documentation.
 
-The following operation deletes all of the documents where the
-``state`` field has value ``"ny"``:
+The following operation deletes all of the documents where the ``state`` field's
+value is ``"ny"``:
 
 .. code-block:: php
 
@@ -670,4 +670,4 @@ The output would then resemble::
 
    Deleted 2 document(s)
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::deleteMany` reference
+.. seealso:: :phpmethod:`MongoDB\\Collection::deleteMany()`
diff --git a/source/tutorial/indexes.txt b/source/tutorial/indexes.txt
index b3fbf862..733bfb43 100644
--- a/source/tutorial/indexes.txt
+++ b/source/tutorial/indexes.txt
@@ -4,12 +4,11 @@ Indexes
 
 .. default-domain:: mongodb
 
-Indexes support the efficient execution of queries in MongoDB. Without
-indexes, MongoDB must perform a *collection scan*, i.e. scan every
-document in a collection, to select those documents that match the
-query statement. If an appropriate index exists for a query,
-MongoDB can use the index to limit the number of documents it must
-inspect.
+Indexes support the efficient execution of queries in MongoDB. Without indexes,
+MongoDB must perform a *collection scan*, i.e. scan every document in a
+collection, to select those documents that match the query statement. If an
+appropriate index exists for a query, MongoDB can use the index to limit the
+number of documents it must inspect.
 
 The PHP driver supports managing indexes through the
 :phpclass:`MongoDB\\Collection` class, which implements MongoDB's
@@ -17,22 +16,22 @@ cross-driver `Index Management
 `_
 and `Enumerating Indexes
 `_
-specifications. 
+specifications.
 
-This document provides an introduction to creating, listing, and
-dropping indexes using the |php-library|. The MongoDB Manual's
-:manual:`Indexes Section ` provides more thorough
-information about indexing in MongoDB.
+This document provides an introduction to creating, listing, and dropping
+indexes using the |php-library|. The MongoDB Manual's :manual:`Indexes
+` reference provides more thorough information about indexing in
+MongoDB.
 
 Create Indexes
 --------------
 
-Create indexes with the :phpmethod:`MongoDB\\Collection::createIndex`
-and :phpmethod:`MongoDB\\Collection::createIndexes` methods. Refer to
-the method reference for more details about each method.
+Create indexes with the :phpmethod:`MongoDB\\Collection::createIndex()` or
+:phpmethod:`MongoDB\\Collection::createIndexes()` methods. Refer to the method
+reference for more details about each method.
 
-The following example creates an ascending index on the ``state`` field
-using the :phpmethod:`createIndex` method:
+The following example creates an ascending index on the ``state`` field using
+the :phpmethod:`createIndex() ` method:
 
 .. code-block:: php
 
@@ -44,24 +43,23 @@ using the :phpmethod:`createIndex` method:
 
    var_dump($result);
 
-When you create an index, the method returns its name, which is
-automatically generated from its specification. The above example would
-output something similar to::
+When you create an index, the method returns its name, which is automatically
+generated from its specification. The above example would output something
+similar to::
 
    string(7) "state_1"
 
 List Indexes
 ------------
 
-The :phpmethod:`MongoDB\\Collection::listIndexes` method provides
-information about the indexes in a collection.
-:phpmethod:`MongoDB\\Collection::listIndexes` method returns an
-iterator of ``MongoDB\Model\IndexInfo`` objects, which you can use to
-view information about each index. Refer to the method reference for
-more details about each method.
+The :phpmethod:`MongoDB\\Collection::listIndexes()` method provides information
+about the indexes in a collection. The
+:phpmethod:`MongoDB\\Collection::listIndexes()` method returns an iterator of
+:phpclass:`MongoDB\\Model\\IndexInfo` objects, which you can use to view
+information about each index. Refer to the method reference for more details.
 
-The following example lists all indexes in the ``zips`` collection in
-the ``demo`` database:
+The following example lists all indexes in the ``zips`` collection in the
+``demo`` database:
 
 .. code-block:: php
 
@@ -70,7 +68,7 @@ the ``demo`` database:
    $collection = (new MongoDB\Client)->demo->zips;
 
    foreach ($collection->listIndexes() as $indexInfo) {
-      var_dump($indexInfo);
+       var_dump($indexInfo);
    }
 
 The output would resemble::
@@ -105,9 +103,10 @@ The output would resemble::
 Drop Indexes
 ------------
 
-The :phpmethod:`MongoDB\\Collection::dropIndex` lets you drop a single index while 
-:phpmethod:`MongoDB\\Collection::dropIndexes` drops all of the indexes on a collection.
-Refer to the method reference for more details about each method.
+The :phpmethod:`MongoDB\\Collection::dropIndex()` method lets you drop a single
+index while :phpmethod:`MongoDB\\Collection::dropIndexes()` drops all of the
+indexes on a collection. Refer to the method reference for more details about
+each method.
 
 The following example drops a single index by its name, ``state_1``:
 

From a79802cb30e220d8f013db71219177616fe8e93f Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 14 Nov 2016 17:11:59 -0500
Subject: [PATCH 047/321] Fix escaping in PHP class references

---
 source/reference/method/MongoDBClient-listDatabases.txt     | 4 ++--
 source/reference/method/MongoDBCollection-listIndexes.txt   | 6 +++---
 source/reference/method/MongoDBDatabase-listCollections.txt | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index 1d32d432..3e5d331f 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -31,8 +31,8 @@ Definition
 
    :returns:
 
-      A traversable :phpclass:`MongoDB\\Model\DatabaseInfoIterator`, which
-      contains an :phpclass:`MongoDB\\Model\DatabaseInfo` object for each
+      A traversable :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`, which
+      contains an :phpclass:`MongoDB\\Model\\DatabaseInfo` object for each
       database on the server.
 
 Example
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index 8c819319..de616b5e 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -31,9 +31,9 @@ Definition
 
    :returns:
 
-      A traversable :phpclass:`MongoDB\\Model\IndexInfoIterator`, which
-      contains an :phpclass:`MongoDB\\Model\IndexInfo` object for each index for
-      the collection.
+      A traversable :phpclass:`MongoDB\\Model\\IndexInfoIterator`, which
+      contains an :phpclass:`MongoDB\\Model\\IndexInfo` object for each index
+      for the collection.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index 16c9a7b0..5463847d 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -31,8 +31,8 @@ Definition
 
    :returns:
 
-      A traversable :phpclass:`MongoDB\\Model\CollectionInfoIterator`, which
-      contains an :phpclass:`MongoDB\\Model\CollectionInfo` object for each
+      A traversable :phpclass:`MongoDB\\Model\\CollectionInfoIterator`, which
+      contains an :phpclass:`MongoDB\\Model\\CollectionInfo` object for each
       collection in the database.
 
 Example

From fef4c102c0a61f9e514042c7949df510a23907e3 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 14 Nov 2016 23:10:17 -0500
Subject: [PATCH 048/321] Use section heading for "See Also" links

---
 .../method/MongoDBClient-dropDatabase.txt     |  9 ++++----
 .../method/MongoDBClient-getManager.txt       |  7 ++++---
 .../method/MongoDBClient-listDatabases.txt    |  7 ++++---
 .../method/MongoDBClient-selectCollection.txt |  7 ++++---
 .../method/MongoDBClient-selectDatabase.txt   |  7 ++++---
 .../method/MongoDBClient__construct.txt       |  7 ++++---
 .../reference/method/MongoDBClient__get.txt   |  9 ++++----
 .../method/MongoDBCollection-aggregate.txt    | 11 +++++-----
 .../method/MongoDBCollection-bulkWrite.txt    | 21 ++++++++++---------
 .../method/MongoDBCollection-count.txt        |  7 ++++---
 .../method/MongoDBCollection-createIndex.txt  | 13 ++++++------
 .../MongoDBCollection-createIndexes.txt       | 15 ++++++-------
 .../method/MongoDBCollection-deleteMany.txt   | 15 ++++++-------
 .../method/MongoDBCollection-deleteOne.txt    | 15 ++++++-------
 .../method/MongoDBCollection-distinct.txt     |  7 ++++---
 .../method/MongoDBCollection-drop.txt         |  9 ++++----
 .../method/MongoDBCollection-dropIndex.txt    | 15 ++++++-------
 .../method/MongoDBCollection-dropIndexes.txt  | 15 ++++++-------
 .../method/MongoDBCollection-find.txt         |  9 ++++----
 .../method/MongoDBCollection-findOne.txt      |  9 ++++----
 .../MongoDBCollection-findOneAndDelete.txt    | 11 +++++-----
 .../MongoDBCollection-findOneAndReplace.txt   | 11 +++++-----
 .../MongoDBCollection-findOneAndUpdate.txt    | 11 +++++-----
 .../MongoDBCollection-getCollectionName.txt   |  7 ++++---
 .../MongoDBCollection-getDatabaseName.txt     |  7 ++++---
 .../method/MongoDBCollection-getManager.txt   |  7 ++++---
 .../method/MongoDBCollection-getNamespace.txt |  7 ++++---
 .../method/MongoDBCollection-insertMany.txt   | 15 ++++++-------
 .../method/MongoDBCollection-insertOne.txt    | 15 ++++++-------
 .../method/MongoDBCollection-listIndexes.txt  | 19 +++++++++--------
 .../method/MongoDBCollection-replaceOne.txt   | 17 ++++++++-------
 .../method/MongoDBCollection-updateMany.txt   | 17 ++++++++-------
 .../method/MongoDBCollection-updateOne.txt    | 17 ++++++++-------
 .../method/MongoDBCollection-withOptions.txt  |  5 +++--
 .../method/MongoDBCollection__construct.txt   | 11 +++++-----
 .../method/MongoDBDatabase-command.txt        | 16 +++++++-------
 .../MongoDBDatabase-createCollection.txt      |  9 ++++----
 .../reference/method/MongoDBDatabase-drop.txt |  9 ++++----
 .../method/MongoDBDatabase-dropCollection.txt |  9 ++++----
 .../method/MongoDBDatabase-getManager.txt     |  7 ++++---
 .../MongoDBDatabase-listCollections.txt       | 15 ++++++-------
 .../MongoDBDatabase-selectCollection.txt      |  9 ++++----
 .../MongoDBDatabase-selectGridFSBucket.txt    |  5 +++--
 .../method/MongoDBDatabase-withOptions.txt    |  5 +++--
 .../method/MongoDBDatabase__construct.txt     |  9 ++++----
 .../reference/method/MongoDBDatabase__get.txt |  9 ++++----
 .../MongoDBGridFSBucket-downloadToStream.txt  |  9 ++++----
 ...oDBGridFSBucket-downloadToStreamByName.txt |  9 ++++----
 .../method/MongoDBGridFSBucket-find.txt       |  5 +++--
 ...BGridFSBucket-getFileDocumentForStream.txt |  5 +++--
 ...MongoDBGridFSBucket-getFileIdForStream.txt |  5 +++--
 ...MongoDBGridFSBucket-openDownloadStream.txt |  9 ++++----
 ...BGridFSBucket-openDownloadStreamByName.txt |  9 ++++----
 .../MongoDBGridFSBucket-openUploadStream.txt  |  5 +++--
 .../MongoDBGridFSBucket-uploadFromStream.txt  |  5 +++--
 .../method/MongoDBGridFSBucket__construct.txt |  5 +++--
 56 files changed, 307 insertions(+), 252 deletions(-)

diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index d455ad1f..e80fb8e5 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -62,8 +62,9 @@ The output would then resemble::
      }
    }
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Database::drop()`
-   - :manual:`dropDatabase ` command reference
-     in the MongoDB manual
+- :phpmethod:`MongoDB\\Database::drop()`
+- :manual:`dropDatabase ` command reference in
+  the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-getManager.txt b/source/reference/method/MongoDBClient-getManager.txt
index 92e21bd7..84f07ffb 100644
--- a/source/reference/method/MongoDBClient-getManager.txt
+++ b/source/reference/method/MongoDBClient-getManager.txt
@@ -27,7 +27,8 @@ Definition
 
       A :php:`MongoDB\\Driver\\Manager ` object.
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::getManager()`
-   - :phpmethod:`MongoDB\\Database::getManager()`
+- :phpmethod:`MongoDB\\Collection::getManager()`
+- :phpmethod:`MongoDB\\Database::getManager()`
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index 3e5d331f..6af8a61b 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -69,7 +69,8 @@ The output would then resemble::
      bool(false)
    }
 
-.. seealso::
+See Also
+--------
 
-   - :manual:`listDatabases ` command
-     reference in the MongoDB manual
+- :manual:`listDatabases ` command reference
+  in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 5413f839..33ec540d 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -70,7 +70,8 @@ with a custom read preference:
        ]
    );
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::__construct()`
-   - :phpmethod:`MongoDB\\Database::selectCollection()`
+- :phpmethod:`MongoDB\\Collection::__construct()`
+- :phpmethod:`MongoDB\\Database::selectCollection()`
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index 50c42487..f6c76f7b 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -69,7 +69,8 @@ preference:
        ]
    );
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Client::__get()`
-   - :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\\Client::__get()`
+- :phpmethod:`MongoDB\\Database::__construct()`
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index 9eaec154..af229c77 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -69,7 +69,8 @@ array, as was done in the legacy :php:`mongo extension `.
        ]
    );
 
-.. seealso::
+See Also
+--------
 
-   - :php:`MongoDB\\Driver\\Manager::__construct()
-     `
+- :php:`MongoDB\\Driver\\Manager::__construct()
+  `
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
index cf135c25..5c57aae9 100644
--- a/source/reference/method/MongoDBClient__get.txt
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -60,8 +60,9 @@ The following example selects the ``demo`` and ``another-app`` databases:
    $demo = $client->demo;
    $anotherApp = $client->{'another-app'};
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Client::selectDatabase()`
-   - :phpmethod:`MongoDB\\Database::__construct()`
-   - :php:`Property Overloading ` in the PHP Manual
+- :phpmethod:`MongoDB\\Client::selectDatabase()`
+- :phpmethod:`MongoDB\\Database::__construct()`
+- :php:`Property Overloading ` in the PHP Manual
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index 7d694fc9..2dbf0696 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -59,9 +59,10 @@ value will be :php:`Traversable `.
 
 .. todo: add examples
 
-.. seealso::
+See Also
+--------
 
-   - :manual:`aggregate ` command reference in the
-     MongoDB manual
-   - :manual:`Aggregation Pipeline `
-     documentation in the MongoDB Manual
+- :manual:`aggregate ` command reference in the
+  MongoDB manual
+- :manual:`Aggregation Pipeline ` documentation in
+  the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index 550b36b4..eb4c66c9 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -37,13 +37,14 @@ Definition
 
 .. todo: add output and examples
 
-.. seealso::
-
-   - :phpmethod:`MongoDB\\Collection::deleteMany()`
-   - :phpmethod:`MongoDB\\Collection::deleteOne()`
-   - :phpmethod:`MongoDB\\Collection::insertMany()`
-   - :phpmethod:`MongoDB\\Collection::insertOne()`
-   - :phpmethod:`MongoDB\\Collection::replaceOne()`
-   - :phpmethod:`MongoDB\\Collection::updateMany()`
-   - :phpmethod:`MongoDB\\Collection::updateOne()`
-   - :doc:`/tutorial/crud`
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::deleteMany()`
+- :phpmethod:`MongoDB\\Collection::deleteOne()`
+- :phpmethod:`MongoDB\\Collection::insertMany()`
+- :phpmethod:`MongoDB\\Collection::insertOne()`
+- :phpmethod:`MongoDB\\Collection::replaceOne()`
+- :phpmethod:`MongoDB\\Collection::updateMany()`
+- :phpmethod:`MongoDB\\Collection::updateOne()`
+- :doc:`/tutorial/crud`
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 98aac470..76baad15 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -35,7 +35,8 @@ Definition
 
 .. todo: add output and examples
 
-.. seealso::
+See Also
+--------
 
-   - :manual:`count ` command reference in the MongoDB
-     manual
+- :manual:`count ` command reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index e783b5ff..7732813f 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -91,10 +91,11 @@ The output would then resemble::
 
    string(9) "borough_1"
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::createIndexes()`
-   - :doc:`/tutorial/indexes`
-   - :manual:`createIndexes ` command
-     reference in the MongoDB manual
-   - :manual:`Index ` documentation in the MongoDB Manual
+- :phpmethod:`MongoDB\\Collection::createIndexes()`
+- :doc:`/tutorial/indexes`
+- :manual:`createIndexes ` command reference
+  in the MongoDB manual
+- :manual:`Index ` documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index 46521748..82b3631f 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -82,10 +82,11 @@ The output would then resemble::
      string(9) "geo_index"
    }
 
-.. seealso::
-
-   - :phpmethod:`MongoDB\\Collection::createIndex()`
-   - :doc:`/tutorial/indexes`
-   - :manual:`createIndexes ` command
-     reference in the MongoDB manual
-   - :manual:`Index ` documentation in the MongoDB Manual
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :doc:`/tutorial/indexes`
+- :manual:`createIndexes ` command reference
+  in the MongoDB manual
+- :manual:`Index ` documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index 31c54cff..5087b906 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -58,10 +58,11 @@ The output would then resemble::
 
    Deleted 2 document(s)
 
-.. seealso::
-
-   - :phpmethod:`MongoDB\\Collection::deleteOne()`
-   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
-   - :doc:`/tutorial/crud`
-   - :manual:`delete ` command reference in the
-     MongoDB manual
+- :manual:`distinct ` command reference in the
+  MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index a551ab8b..254db2e8 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -65,8 +65,9 @@ The output would then resemble::
      }
    }
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Database::dropCollection()`
-   - :manual:`drop ` command reference in the MongoDB
-     manual
+- :phpmethod:`MongoDB\\Database::dropCollection()`
+- :manual:`drop ` command reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index 516ef286..025f6124 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -63,10 +63,11 @@ The output would then resemble::
      }
    }
 
-.. seealso::
-
-   - :phpmethod:`MongoDB\\Collection::dropIndexes()`
-   - :doc:`/tutorial/indexes`
-   - :manual:`dropIndexes ` command reference
-     in the MongoDB manual
-   - :manual:`Index documentation ` in the MongoDB manual
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::dropIndexes()`
+- :doc:`/tutorial/indexes`
+- :manual:`dropIndexes ` command reference in
+  the MongoDB manual
+- :manual:`Index documentation ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index 7276cc44..c8dec7ab 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -66,10 +66,11 @@ The output would then resemble::
      }
    }
 
-.. seealso::
-
-   - :phpmethod:`MongoDB\\Collection::dropIndex()`
-   - :doc:`/tutorial/indexes`
-   - :manual:`dropIndexes ` command reference
-     in the MongoDB manual
-   - :manual:`Index documentation ` in the MongoDB manual
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::dropIndex()`
+- :doc:`/tutorial/indexes`
+- :manual:`dropIndexes ` command reference in
+  the MongoDB manual
+- :manual:`Index documentation ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index e44a7af9..a5f477de 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -147,8 +147,9 @@ The output would then resemble::
      }
    }
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::findOne()`
-   - :manual:`find ` command reference in the MongoDB
-     manual
+- :phpmethod:`MongoDB\\Collection::findOne()`
+- :manual:`find ` command reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index e30ae8a9..8481b3d6 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -82,8 +82,9 @@ The output would then resemble::
      }
    }
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::find()`
-   - :manual:`find ` command reference in the MongoDB
-     manual
+- :phpmethod:`MongoDB\\Collection::find()`
+- :manual:`find ` command reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index 55b4dcbf..b5d3958e 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -77,9 +77,10 @@ The output would then resemble::
      string(8) "40375376"
    }
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
-   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
-   - :manual:`findAndModify ` command
-     reference in the MongoDB manual
+- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+- :manual:`findAndModify ` command reference
+  in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index ae24d622..5ca7b312 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -124,9 +124,10 @@ The output would then resemble::
      string(9) "999999999"
    }
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
-   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
-   - :manual:`findAndModify ` command
-     reference in the MongoDB manual
+- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+- :manual:`findAndModify ` command reference
+  in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index bb18defb..fe71d2a3 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -88,9 +88,10 @@ The output would then resemble::
      }
    }
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
-   - :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
-   - :manual:`findAndModify ` command
-     reference in the MongoDB manual
+- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+- :manual:`findAndModify ` command reference
+  in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-getCollectionName.txt b/source/reference/method/MongoDBCollection-getCollectionName.txt
index 1ed9d5c1..481c4bd5 100644
--- a/source/reference/method/MongoDBCollection-getCollectionName.txt
+++ b/source/reference/method/MongoDBCollection-getCollectionName.txt
@@ -43,7 +43,8 @@ The output would then resemble::
 
    zips
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::getDatabaseName()`
-   - :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\\Collection::getNamespace()`
diff --git a/source/reference/method/MongoDBCollection-getDatabaseName.txt b/source/reference/method/MongoDBCollection-getDatabaseName.txt
index 221d2a80..70e9daef 100644
--- a/source/reference/method/MongoDBCollection-getDatabaseName.txt
+++ b/source/reference/method/MongoDBCollection-getDatabaseName.txt
@@ -43,8 +43,9 @@ The output would then resemble::
 
    demo
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::getCollectionName()`
-   - :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\\Collection::getNamespace()`
 
diff --git a/source/reference/method/MongoDBCollection-getManager.txt b/source/reference/method/MongoDBCollection-getManager.txt
index 9783df64..aeaf71b3 100644
--- a/source/reference/method/MongoDBCollection-getManager.txt
+++ b/source/reference/method/MongoDBCollection-getManager.txt
@@ -27,7 +27,8 @@ Definition
 
       A :php:`MongoDB\\Driver\\Manager ` object.
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Client::getManager()`
-   - :phpmethod:`MongoDB\\Database::getManager()`
+- :phpmethod:`MongoDB\\Client::getManager()`
+- :phpmethod:`MongoDB\\Database::getManager()`
diff --git a/source/reference/method/MongoDBCollection-getNamespace.txt b/source/reference/method/MongoDBCollection-getNamespace.txt
index cfa323ce..a369cd2e 100644
--- a/source/reference/method/MongoDBCollection-getNamespace.txt
+++ b/source/reference/method/MongoDBCollection-getNamespace.txt
@@ -44,7 +44,8 @@ The output would then resemble::
 
    demo.zips
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::getCollectionName()`
-   - :phpmethod:`MongoDB\\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 26a9ff84..59e8f253 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -84,10 +84,11 @@ The output would then resemble::
 
 .. end-crud-include
 
-.. seealso::
-
-   - :phpmethod:`MongoDB\\Collection::insertOne()`
-   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
-   - :doc:`/tutorial/crud`
-   - :manual:`insert ` command reference in the
-     MongoDB manual
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::insertOne()`
+- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :doc:`/tutorial/crud`
+- :manual:`insert ` command reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index 582291d5..59ee6457 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -69,10 +69,11 @@ The output would then resemble::
 
 .. end-crud-include
 
-.. seealso::
-
-   - :phpmethod:`MongoDB\\Collection::insertMany()`
-   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
-   - :doc:`/tutorial/crud`
-   - :manual:`insert ` command reference in the
-     MongoDB manual
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::insertMany()`
+- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :doc:`/tutorial/crud`
+- :manual:`insert ` command reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index de616b5e..5a7c4970 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -93,12 +93,13 @@ The output would then resemble::
      string(19) "example.restaurants"
    }
 
-.. seealso::
-
-   - :doc:`/tutorial/indexes`
-   - :manual:`listIndexes ` command reference in
-     the MongoDB manual
-   - :manual:`Index documentation ` in the MongoDB manual
-   - `Enumerating Collections
-     `_
-     specification
+See Also
+--------
+
+- :doc:`/tutorial/indexes`
+- :manual:`listIndexes ` command reference in
+  the MongoDB manual
+- :manual:`Index documentation ` in the MongoDB manual
+- `Enumerating Collections
+  `_
+  specification
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index b78ea911..a0e958dc 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -68,11 +68,12 @@ The output would then resemble::
    Matched 1 document(s)
    Modified 1 document(s)
 
-.. seealso::
-
-   - :phpmethod:`MongoDB\\Collection::updateMany()`
-   - :phpmethod:`MongoDB\\Collection::updateOne()`
-   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
-   - :doc:`/tutorial/crud`
-   - :manual:`update ` command reference in the
-     MongoDB manual
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::updateMany()`
+- :phpmethod:`MongoDB\\Collection::updateOne()`
+- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :doc:`/tutorial/crud`
+- :manual:`update ` command reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 0f9974f0..9c0738ab 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -58,11 +58,12 @@ The output would then resemble::
    Matched 5656 document(s)
    Modified 5656 document(s)
 
-.. seealso::
-
-   - :phpmethod:`MongoDB\\Collection::replaceOne()`
-   - :phpmethod:`MongoDB\\Collection::updateOne()`
-   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
-   - :doc:`/tutorial/crud`
-   - :manual:`update ` command reference in the
-     MongoDB manual
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::replaceOne()`
+- :phpmethod:`MongoDB\\Collection::updateOne()`
+- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :doc:`/tutorial/crud`
+- :manual:`update ` command reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index b9baed53..cf1ed819 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -60,11 +60,12 @@ The output would then resemble::
    Matched 1 document(s)
    Modified 1 document(s)
 
-.. seealso::
-
-   - :phpmethod:`MongoDB\\Collection::replaceOne()`
-   - :phpmethod:`MongoDB\\Collection::updateMany()`
-   - :phpmethod:`MongoDB\\Collection::bulkWrite()`
-   - :doc:`/tutorial/crud`
-   - :manual:`update ` command reference in the
-     MongoDB manual
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::replaceOne()`
+- :phpmethod:`MongoDB\\Collection::updateMany()`
+- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :doc:`/tutorial/crud`
+- :manual:`update ` command reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index a9625c60..2e938938 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -49,6 +49,7 @@ preference:
        'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
    ]);
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::__construct()`
+- :phpmethod:`MongoDB\\Collection::__construct()`
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
index 3f16e356..0688726f 100644
--- a/source/reference/method/MongoDBCollection__construct.txt
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -40,9 +40,10 @@ options from that object.
 
 .. todo: add an example
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::withOptions()`
-   - :phpmethod:`MongoDB\\Client::selectCollection()`
-   - :phpmethod:`MongoDB\\Database::selectCollection()`
-   - :phpmethod:`MongoDB\\Database::__get()`
+- :phpmethod:`MongoDB\\Collection::withOptions()`
+- :phpmethod:`MongoDB\\Client::selectCollection()`
+- :phpmethod:`MongoDB\\Database::selectCollection()`
+- :phpmethod:`MongoDB\\Database::__get()`
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index 599ef23c..5a16cb89 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -138,11 +138,11 @@ The output would resemble::
      }
    }
 
-.. seealso::
-
-   - :doc:`/tutorial/commands`
-   - :manual:`Database Commands ` in the
-     MongoDB manual
-   - :php:`MongoDB\\Driver\\Cursor `
-   - :php:`MongoDB\\Driver\\Manager::executeCommand()
-     `
+See Also
+--------
+
+- :doc:`/tutorial/commands`
+- :manual:`Database Commands ` in the MongoDB manual
+- :php:`MongoDB\\Driver\\Cursor `
+- :php:`MongoDB\\Driver\\Manager::executeCommand()
+  `
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 90588484..995337e4 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -83,8 +83,9 @@ The output would then resemble::
      }
    }
 
-.. seealso::
+See Also
+--------
 
-   - :manual:`create ` command reference in the MongoDB
-     manual
-   - :manual:`db.createCollection() `
+- :manual:`create ` command reference in the MongoDB
+  manual
+- :manual:`db.createCollection() `
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index daa1c7a5..256b3e65 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -62,8 +62,9 @@ The output would then resemble::
      }
    }
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Client::dropDatabase()`
-   - :manual:`dropDatabase ` command reference
-     in the MongoDB manual
+- :phpmethod:`MongoDB\\Client::dropDatabase()`
+- :manual:`dropDatabase ` command reference in
+  the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 2666ccad..4f182367 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -64,8 +64,9 @@ The output would then resemble::
      }
    }
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::drop()`
-   - :manual:`drop ` command reference in the MongoDB
-     manual
+- :phpmethod:`MongoDB\\Collection::drop()`
+- :manual:`drop ` command reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBDatabase-getManager.txt b/source/reference/method/MongoDBDatabase-getManager.txt
index a2ccc61e..117edda8 100644
--- a/source/reference/method/MongoDBDatabase-getManager.txt
+++ b/source/reference/method/MongoDBDatabase-getManager.txt
@@ -27,7 +27,8 @@ Definition
 
       A :php:`MongoDB\\Driver\\Manager ` object.
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Client::getManager()`
-   - :phpmethod:`MongoDB\\Collection::getManager()`
+- :phpmethod:`MongoDB\\Client::getManager()`
+- :phpmethod:`MongoDB\\Collection::getManager()`
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index 5463847d..4a71248b 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -110,10 +110,11 @@ The output would then resemble::
      }
    }
 
-.. seealso::
-
-   - :manual:`listCollections `_
-     specification
+See Also
+--------
+
+- :manual:`listCollections `_
+  specification
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index e447d70c..aff7ea62 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -69,8 +69,9 @@ database with a custom read preference:
        ]
    );
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Database::__get()`
-   - :phpmethod:`MongoDB\\Client::selectCollection()`
-   - :phpmethod:`MongoDB\\Collection::__construct()`
+- :phpmethod:`MongoDB\\Database::__get()`
+- :phpmethod:`MongoDB\\Client::selectCollection()`
+- :phpmethod:`MongoDB\\Collection::__construct()`
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index f071697c..bcb523b8 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -68,6 +68,7 @@ database with a custom read preference:
        'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
    ]);
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index 9661ac88..6c5c84df 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -49,6 +49,7 @@ preference:
        'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
    ]);
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\\Database::__construct()`
diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt
index 0a836175..0b593688 100644
--- a/source/reference/method/MongoDBDatabase__construct.txt
+++ b/source/reference/method/MongoDBDatabase__construct.txt
@@ -37,8 +37,9 @@ the :php:`MongoDB\\Driver\\Manager ` object. If
 you select the Database from a :phpclass:`Client ` object, the
 Database inherits its options from that object.
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Database::withOptions()`
-   - :phpmethod:`MongoDB\\Client::selectDatabase()`
-   - :phpmethod:`MongoDB\\Client::__get()`
+- :phpmethod:`MongoDB\\Database::withOptions()`
+- :phpmethod:`MongoDB\\Client::selectDatabase()`
+- :phpmethod:`MongoDB\\Client::__get()`
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index 9ed4b196..dedacf3b 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -60,8 +60,9 @@ collections from the ``demo`` database:
    $users = $db->users;
    $systemProfile = $db->{'system.profile'};
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Database::selectCollection()`
-   - :phpmethod:`MongoDB\\Client::selectCollection()`
-   - :php:`Property Overloading ` in the PHP Manual
+- :phpmethod:`MongoDB\\Database::selectCollection()`
+- :phpmethod:`MongoDB\\Client::selectCollection()`
+- :php:`Property Overloading ` in the PHP Manual
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
index b7b154fc..2cc91f61 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
@@ -28,8 +28,9 @@ Definition
 
 .. todo: add examples
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index 064be31d..92602db8 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -32,8 +32,9 @@ Definition
 
 .. todo: add examples
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index 8a65c1b2..d438a739 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -35,6 +35,7 @@ Definition
 
 .. todo: add examples
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Collection::find()`
+- :phpmethod:`MongoDB\\Collection::find()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index ff0f63fc..d7784ffb 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -31,6 +31,7 @@ Definition
 
 .. todo: add examples
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index 3c650999..5a9e02e0 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -32,6 +32,7 @@ Definition
 
 .. todo: add examples
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
index 6e7f2e9c..164d82fc 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -31,8 +31,9 @@ Definition
 
 .. todo: add examples
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
index 5dfcf821..bbff5996 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -35,8 +35,9 @@ Definition
 
 .. todo: add examples
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 6eb61c23..00ad60a0 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -41,6 +41,7 @@ metadata document will be created when the writable stream is closed.
 
 .. todo: add examples
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index f2913c37..078fda50 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -38,6 +38,7 @@ Definition
 
 .. todo: add examples
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index ebe1562f..6553c255 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -39,6 +39,7 @@ the Bucket inherits its options from that object.
 
 .. todo: add an example
 
-.. seealso::
+See Also
+--------
 
-   - :phpmethod:`MongoDB\\Database::selectGridFSBucket()`
+- :phpmethod:`MongoDB\\Database::selectGridFSBucket()`

From 0707f2cfcb7b834824c3fd7cd981aa7d90e69cd8 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 14 Nov 2016 23:24:40 -0500
Subject: [PATCH 049/321] PHPLIB-234: Use "Return Values" section headings

---
 .../reference/method/MongoDBClient-dropDatabase.txt   |  9 +++++----
 source/reference/method/MongoDBClient-getManager.txt  |  5 +++--
 .../reference/method/MongoDBClient-listDatabases.txt  |  9 +++++----
 .../method/MongoDBClient-selectCollection.txt         |  5 +++--
 .../reference/method/MongoDBClient-selectDatabase.txt |  5 +++--
 source/reference/method/MongoDBClient__get.txt        |  5 +++--
 .../reference/method/MongoDBCollection-aggregate.txt  |  9 +++++----
 .../reference/method/MongoDBCollection-bulkWrite.txt  |  8 ++++----
 source/reference/method/MongoDBCollection-count.txt   |  5 +++--
 .../method/MongoDBCollection-createIndex.txt          |  5 +++--
 .../method/MongoDBCollection-createIndexes.txt        |  5 +++--
 .../reference/method/MongoDBCollection-deleteMany.txt |  8 ++++----
 .../reference/method/MongoDBCollection-deleteOne.txt  |  8 ++++----
 .../reference/method/MongoDBCollection-distinct.txt   |  5 +++--
 source/reference/method/MongoDBCollection-drop.txt    |  9 +++++----
 .../reference/method/MongoDBCollection-dropIndex.txt  |  9 +++++----
 .../method/MongoDBCollection-dropIndexes.txt          |  9 +++++----
 source/reference/method/MongoDBCollection-find.txt    |  5 +++--
 source/reference/method/MongoDBCollection-findOne.txt |  9 +++++----
 .../method/MongoDBCollection-findOneAndDelete.txt     |  7 ++++---
 .../method/MongoDBCollection-findOneAndReplace.txt    | 10 +++++-----
 .../method/MongoDBCollection-findOneAndUpdate.txt     | 10 +++++-----
 .../method/MongoDBCollection-getCollectionName.txt    |  5 +++--
 .../method/MongoDBCollection-getDatabaseName.txt      |  5 +++--
 .../reference/method/MongoDBCollection-getManager.txt |  5 +++--
 .../method/MongoDBCollection-getNamespace.txt         |  5 +++--
 .../reference/method/MongoDBCollection-insertMany.txt |  8 ++++----
 .../reference/method/MongoDBCollection-insertOne.txt  |  8 ++++----
 .../method/MongoDBCollection-listIndexes.txt          |  8 ++++----
 .../reference/method/MongoDBCollection-replaceOne.txt |  8 ++++----
 .../reference/method/MongoDBCollection-updateMany.txt |  8 ++++----
 .../reference/method/MongoDBCollection-updateOne.txt  |  8 ++++----
 .../method/MongoDBCollection-withOptions.txt          |  5 +++--
 source/reference/method/MongoDBDatabase-command.txt   |  5 +++--
 .../method/MongoDBDatabase-createCollection.txt       |  7 ++++---
 source/reference/method/MongoDBDatabase-drop.txt      |  9 +++++----
 .../method/MongoDBDatabase-dropCollection.txt         |  9 +++++----
 .../method/MongoDBDatabase-getDatabaseName.txt        |  5 +++--
 .../reference/method/MongoDBDatabase-getManager.txt   |  5 +++--
 .../method/MongoDBDatabase-listCollections.txt        |  9 +++++----
 .../method/MongoDBDatabase-selectCollection.txt       |  5 +++--
 .../method/MongoDBDatabase-selectGridFSBucket.txt     |  5 +++--
 .../reference/method/MongoDBDatabase-withOptions.txt  |  5 +++--
 source/reference/method/MongoDBDatabase__get.txt      |  5 +++--
 source/reference/method/MongoDBGridFSBucket-find.txt  |  5 +++--
 .../method/MongoDBGridFSBucket-getBucketName.txt      |  5 +++--
 .../method/MongoDBGridFSBucket-getDatabaseName.txt    |  5 +++--
 .../MongoDBGridFSBucket-getFileDocumentForStream.txt  |  5 +++--
 .../method/MongoDBGridFSBucket-getFileIdForStream.txt |  7 ++++---
 .../method/MongoDBGridFSBucket-openDownloadStream.txt |  5 +++--
 .../MongoDBGridFSBucket-openDownloadStreamByName.txt  |  5 +++--
 .../method/MongoDBGridFSBucket-openUploadStream.txt   |  5 +++--
 .../method/MongoDBGridFSBucket-uploadFromStream.txt   | 11 ++++++-----
 53 files changed, 198 insertions(+), 156 deletions(-)

diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index e80fb8e5..e72c407e 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -29,11 +29,12 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      An array or object with the result document of the :manual:`dropDatabase
-      ` command. The return type will depend on
-      the ``typeMap`` option.
+An array or object with the result document of the :manual:`dropDatabase
+` command. The return type will depend on the
+``typeMap`` option.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBClient-getManager.txt b/source/reference/method/MongoDBClient-getManager.txt
index 84f07ffb..c320595d 100644
--- a/source/reference/method/MongoDBClient-getManager.txt
+++ b/source/reference/method/MongoDBClient-getManager.txt
@@ -23,9 +23,10 @@ Definition
 
       function getManager(): MongoDB\Manager
 
-   :returns:
+Return Values
+-------------
 
-      A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\\Driver\\Manager ` object.
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index 6af8a61b..59d7d326 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -29,11 +29,12 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A traversable :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`, which
-      contains an :phpclass:`MongoDB\\Model\\DatabaseInfo` object for each
-      database on the server.
+A traversable :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`, which contains
+a :phpclass:`MongoDB\\Model\\DatabaseInfo` object for each database on the
+server.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 33ec540d..cc49aede 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\\Collection` object.
 
 Behavior
 --------
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index f6c76f7b..b891b43a 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\\Database` object.
 
 Behavior
 --------
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
index 5c57aae9..7e0ee299 100644
--- a/source/reference/method/MongoDBClient__get.txt
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -27,9 +27,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBClient-method-get-param.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\\Database` object.
 
 Behavior
 --------
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index 2dbf0696..cd670b98 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -30,11 +30,12 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :php:`MongoDB\\Driver\\Cursor ` or
-      :php:`ArrayIterator ` object. In both cases, the return
-      value will be :php:`Traversable `.
+A :php:`MongoDB\\Driver\\Cursor ` or
+:php:`ArrayIterator ` object. In both cases, the return value
+will be :php:`Traversable `.
 
 .. _php-agg-method-behavior:
 
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index eb4c66c9..5c7c2149 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -29,11 +29,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\BulkWriteResult` object, which encapsulates a
-      :php:`MongoDB\\Driver\\WriteResult `
-      object.
+A :phpclass:`MongoDB\\BulkWriteResult` object, which encapsulates a
+:php:`MongoDB\\Driver\\WriteResult ` object.
 
 .. todo: add output and examples
 
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 76baad15..247bfa62 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-count-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      The number of documents matching the filter criteria.
+The number of documents matching the filter criteria.
 
 .. todo: add output and examples
 
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index 7732813f..6ba4ac00 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -34,9 +34,10 @@ Definition
    :manual:`createIndexes ` command reference
    in the MongoDB manual.
 
-   :returns:
+Return Values
+-------------
 
-      The name of the created index as a string.
+The name of the created index as a string.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index 82b3631f..433a31ca 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      The names of the created indexes as an array of strings.
+The names of the created indexes as an array of strings.
 
 ``$indexes`` parameter
 ----------------------
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index 5087b906..9fe9ed6e 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -29,11 +29,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
-      :php:`MongoDB\\Driver\\WriteResult `
-      object.
+A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
+:php:`MongoDB\\Driver\\WriteResult ` object.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index e25e79ec..3f3bfdbc 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -31,11 +31,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
-      :php:`MongoDB\\Driver\\WriteResult `
-      object.
+A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
+:php:`MongoDB\\Driver\\WriteResult ` object.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index 42a387d8..c7f6e643 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-distinct-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      An array of the distinct values.
+An array of the distinct values.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index 254db2e8..fa2410df 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -29,11 +29,12 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-drop-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      An array or object with the result document of the :manual:`drop
-      ` command. The return type will depend on the
-      ``typeMap`` option.
+An array or object with the result document of the :manual:`drop
+` command. The return type will depend on the
+``typeMap`` option.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index 025f6124..75bc81cb 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -29,11 +29,12 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      An array or object with the result document of the :manual:`dropIndexes
-      ` command. The return type will depend on
-      the ``typeMap`` option.
+An array or object with the result document of the :manual:`dropIndexes
+` command. The return type will depend on the
+``typeMap`` option.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index c8dec7ab..8274445e 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -30,11 +30,12 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      An array or object with the result document of the :manual:`dropIndexes
-      ` command. The return type will depend on
-      the ``typeMap`` option.
+An array or object with the result document of the :manual:`dropIndexes
+` command. The return type will depend on the
+``typeMap`` option.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index a5f477de..1b336e77 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-find-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\\Driver\\Cursor ` object.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index 8481b3d6..34716fdf 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -29,11 +29,12 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-findOne-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      An array or object for the :term:`first document ` document
-      that matched the query, or ``null`` if no document matched the query. The
-      return type will depend on the ``typeMap`` option.
+An array or object for the :term:`first document ` document that
+matched the query, or ``null`` if no document matched the query. The return type
+will depend on the ``typeMap`` option.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index b5d3958e..4536bf37 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -31,10 +31,11 @@ Definition
 
    .. include:: /includes/extracts/bson-deserialization-findOneAndDelete.rst
 
-   :returns:
+Return Values
+-------------
 
-      An object for the document that was deleted, or ``null`` if no document
-      matched the query.
+An object for the document that was deleted, or ``null`` if no document matched
+the query.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 5ca7b312..92ffa9b4 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -31,12 +31,12 @@ Definition
 
    .. include:: /includes/extracts/bson-deserialization-findOneAndReplace.rst
 
-   :returns:
+Return Values
+-------------
 
-      An object for either the original or the replaced document, depending on
-      the specified value of the ``returnDocument`` option. By default, the
-      original document is returned. If no document matched the query, ``null``
-      is returned.
+An object for either the original or the replaced document, depending on the
+specified value of the ``returnDocument`` option. By default, the original
+document is returned. If no document matched the query, ``null`` is returned.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index fe71d2a3..71c85c75 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -31,12 +31,12 @@ Definition
 
    .. include:: /includes/extracts/bson-deserialization-findOneAndUpdate.rst
 
-   :returns:
+Return Values
+-------------
 
-      An object for either the original or the updated document, depending on
-      the specified value of the ``returnDocument`` option. By default, the
-      original document is returned. If no document matched the query, ``null``
-      is returned.
+An object for either the original or the updated document, depending on the
+specified value of the ``returnDocument`` option. By default, the original
+document is returned. If no document matched the query, ``null`` is returned.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBCollection-getCollectionName.txt b/source/reference/method/MongoDBCollection-getCollectionName.txt
index 481c4bd5..b126c7f4 100644
--- a/source/reference/method/MongoDBCollection-getCollectionName.txt
+++ b/source/reference/method/MongoDBCollection-getCollectionName.txt
@@ -21,9 +21,10 @@ Definition
 
       function getCollectionName(): string
 
-   :returns:
+Return Values
+-------------
 
-      The name of this collection as a string.
+The name of this collection as a string.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-getDatabaseName.txt b/source/reference/method/MongoDBCollection-getDatabaseName.txt
index 70e9daef..10ea2672 100644
--- a/source/reference/method/MongoDBCollection-getDatabaseName.txt
+++ b/source/reference/method/MongoDBCollection-getDatabaseName.txt
@@ -21,9 +21,10 @@ Definition
 
       function getDatabaseName(): string
 
-   :returns:
+Return Values
+-------------
 
-      The name of the database containing this collection as a string.
+The name of the database containing this collection as a string.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-getManager.txt b/source/reference/method/MongoDBCollection-getManager.txt
index aeaf71b3..e0bbea08 100644
--- a/source/reference/method/MongoDBCollection-getManager.txt
+++ b/source/reference/method/MongoDBCollection-getManager.txt
@@ -23,9 +23,10 @@ Definition
 
       function getManager(): MongoDB\Manager
 
-   :returns:
+Return Values
+-------------
 
-      A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\\Driver\\Manager ` object.
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBCollection-getNamespace.txt b/source/reference/method/MongoDBCollection-getNamespace.txt
index a369cd2e..256a7cfa 100644
--- a/source/reference/method/MongoDBCollection-getNamespace.txt
+++ b/source/reference/method/MongoDBCollection-getNamespace.txt
@@ -22,9 +22,10 @@ Definition
 
       function getNamespace(): string
 
-   :returns:
+Return Values
+-------------
 
-      The namespace of this collection as a string.
+The namespace of this collection as a string.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 59e8f253..9430d9af 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -29,11 +29,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\InsertManyResult` object, which encapsulates a
-      :php:`MongoDB\\Driver\\WriteResult `
-      object.
+A :phpclass:`MongoDB\\InsertManyResult` object, which encapsulates a
+:php:`MongoDB\\Driver\\WriteResult ` object.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index 59ee6457..6de1e4ff 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -29,11 +29,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\InsertOneResult` object, which encapsulates a
-      :php:`MongoDB\\Driver\\WriteResult `
-      object.
+A :phpclass:`MongoDB\\InsertOneResult` object, which encapsulates a
+:php:`MongoDB\\Driver\\WriteResult ` object.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index 5a7c4970..8d1ffeb4 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -29,11 +29,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A traversable :phpclass:`MongoDB\\Model\\IndexInfoIterator`, which
-      contains an :phpclass:`MongoDB\\Model\\IndexInfo` object for each index
-      for the collection.
+A traversable :phpclass:`MongoDB\\Model\\IndexInfoIterator`, which contains a
+:phpclass:`MongoDB\\Model\\IndexInfo` object for each index for the collection.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index a0e958dc..c05edccc 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -31,11 +31,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-      :php:`MongoDB\\Driver\\WriteResult `
-      object.
+A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
+:php:`MongoDB\\Driver\\WriteResult ` object.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 9c0738ab..9af9853f 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -29,11 +29,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-      :php:`MongoDB\\Driver\\WriteResult `
-      object.
+A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
+:php:`MongoDB\\Driver\\WriteResult ` object.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index cf1ed819..23cc2835 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -31,11 +31,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-      :php:`MongoDB\\Driver\\WriteResult `
-      object.
+A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
+:php:`MongoDB\\Driver\\WriteResult ` object.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index 2e938938..3c5910ff 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\\Collection` object.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index 5a16cb89..ad06820c 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-command-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\\Driver\\Cursor ` object.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 995337e4..92cb676f 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -47,10 +47,11 @@ Definition
    :manual:`create ` command reference in the MongoDB
    manual for compatibility considerations.
 
-   :returns:
+Return Values
+-------------
 
-      An array or object with the result document of the :manual:`create
-      ` command.
+An array or object with the result document of the :manual:`create
+` command.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index 256b3e65..6dbafbea 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -29,11 +29,12 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-drop-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      An array or object with the result document of the :manual:`dropDatabase
-      ` command. The return type will depend on
-      the ``typeMap`` option.
+An array or object with the result document of the :manual:`dropDatabase
+` command. The return type will depend on the
+``typeMap`` option.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 4f182367..52f3d40c 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -29,11 +29,12 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      An array or object with the result document of the :manual:`drop
-      ` command. The return type will depend on
-      the ``typeMap`` option.
+An array or object with the result document of the :manual:`drop
+` command. The return type will depend on the
+``typeMap`` option.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBDatabase-getDatabaseName.txt b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
index 4371997c..b4ce912b 100644
--- a/source/reference/method/MongoDBDatabase-getDatabaseName.txt
+++ b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
@@ -21,9 +21,10 @@ Definition
 
       function getDatabaseName(): string
 
-   :returns:
+Return Values
+-------------
 
-      The name of this database as a string.
+The name of this database as a string.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBDatabase-getManager.txt b/source/reference/method/MongoDBDatabase-getManager.txt
index 117edda8..72a2b057 100644
--- a/source/reference/method/MongoDBDatabase-getManager.txt
+++ b/source/reference/method/MongoDBDatabase-getManager.txt
@@ -23,9 +23,10 @@ Definition
 
       function getManager(): MongoDB\Manager
 
-   :returns:
+Return Values
+-------------
 
-      A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\\Driver\\Manager ` object.
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index 4a71248b..caca2c8f 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -29,11 +29,12 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A traversable :phpclass:`MongoDB\\Model\\CollectionInfoIterator`, which
-      contains an :phpclass:`MongoDB\\Model\\CollectionInfo` object for each
-      collection in the database.
+A traversable :phpclass:`MongoDB\\Model\\CollectionInfoIterator`, which contains
+a :phpclass:`MongoDB\\Model\\CollectionInfo` object for each collection in the
+database.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index aff7ea62..f6d930c2 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\\Collection` object.
 
 Behavior
 --------
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index bcb523b8..b8390a74 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\GridFS\\Bucket` object.
+A :phpclass:`MongoDB\\GridFS\\Bucket` object.
 
 Behavior
 --------
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index 6c5c84df..ec9765d7 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\\Database` object.
 
 Example
 -------
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index dedacf3b..c0f4256d 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -25,9 +25,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-get-param.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\\Collection` object.
 
 Behavior
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index d438a739..82a6828f 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-find-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\\Driver\\Cursor ` object.
 
 .. todo: add examples
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
index 0cd59884..1fafde12 100644
--- a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
@@ -21,8 +21,9 @@ Definition
 
       function getBucketName(): string
 
-   :returns:
+Return Values
+-------------
 
-      The name of this bucket as a string.
+The name of this bucket as a string.
 
 .. todo: add examples
diff --git a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
index 09238171..dc3ceeaa 100644
--- a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
@@ -21,8 +21,9 @@ Definition
 
       function getDatabaseName(): string
 
-   :returns:
+Return Values
+-------------
 
-      The name of the database containing this bucket as a string.
+The name of the database containing this bucket as a string.
 
 .. todo: add examples
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index d7784ffb..f74002e8 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -25,9 +25,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileDocumentForStream-param.rst
 
-   :returns:
+Return Values
+-------------
 
-      The metadata document associated with the GridFS stream.
+The metadata document associated with the GridFS stream.
 
 .. todo: add examples
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index 5a9e02e0..ca852887 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -25,10 +25,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileIdForStream-param.rst
 
-   :returns:
+Return Values
+-------------
 
-      The ``_id`` field of the metadata document associated with the GridFS
-      stream.
+The ``_id`` field of the metadata document associated with the GridFS
+stream.
 
 .. todo: add examples
 
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
index 164d82fc..aca4416a 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -25,9 +25,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStream-param.rst
 
-   :returns:
+Return Values
+-------------
 
-      A readable stream resource.
+A readable stream resource.
 
 .. todo: add examples
 
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
index bbff5996..9712e7d3 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A readable stream resource.
+A readable stream resource.
 
 .. todo: add examples
 
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 00ad60a0..2ad11c4a 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -29,9 +29,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      A writable stream resource.
+A writable stream resource.
 
 Behavior
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index 078fda50..46f63f6d 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -29,12 +29,13 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-option.rst
 
-   :returns:
+Return Values
+-------------
 
-      The ``_id`` field of the metadata document associated with the newly
-      created GridFS file. If the ``_id`` option is not specified, a new
-      :php:`MongoDB\\BSON\\ObjectID ` object will
-      be used by default.
+The ``_id`` field of the metadata document associated with the newly created
+GridFS file. If the ``_id`` option is not specified, a new
+:php:`MongoDB\\BSON\\ObjectID ` object will be used
+by default.
 
 .. todo: add examples
 

From 1649be4cd1b90f178fb02d3e4e2209000da9b013 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 15 Nov 2016 11:17:44 -0500
Subject: [PATCH 050/321] PHPLIB-234: Document exceptions for API methods

---
 source/includes/extracts-error.yaml           | 27 +++++++++++++++++++
 .../method/MongoDBClient-dropDatabase.txt     |  7 +++++
 .../method/MongoDBClient-listDatabases.txt    |  7 +++++
 .../method/MongoDBClient-selectCollection.txt |  5 ++++
 .../method/MongoDBClient-selectDatabase.txt   |  5 ++++
 .../method/MongoDBClient__construct.txt       |  7 +++++
 .../method/MongoDBCollection-aggregate.txt    |  8 ++++++
 .../method/MongoDBCollection-bulkWrite.txt    |  7 +++++
 .../method/MongoDBCollection-count.txt        |  8 ++++++
 .../method/MongoDBCollection-createIndex.txt  |  7 +++++
 .../MongoDBCollection-createIndexes.txt       |  7 +++++
 .../method/MongoDBCollection-deleteMany.txt   |  7 +++++
 .../method/MongoDBCollection-deleteOne.txt    |  7 +++++
 .../method/MongoDBCollection-distinct.txt     |  8 ++++++
 .../method/MongoDBCollection-drop.txt         |  7 +++++
 .../method/MongoDBCollection-dropIndex.txt    |  7 +++++
 .../method/MongoDBCollection-dropIndexes.txt  |  7 +++++
 .../method/MongoDBCollection-find.txt         |  7 +++++
 .../method/MongoDBCollection-findOne.txt      |  7 +++++
 .../MongoDBCollection-findOneAndDelete.txt    |  8 ++++++
 .../MongoDBCollection-findOneAndReplace.txt   |  8 ++++++
 .../MongoDBCollection-findOneAndUpdate.txt    |  8 ++++++
 .../method/MongoDBCollection-insertMany.txt   |  6 +++++
 .../method/MongoDBCollection-insertOne.txt    |  6 +++++
 .../method/MongoDBCollection-listIndexes.txt  |  6 +++++
 .../method/MongoDBCollection-replaceOne.txt   |  7 +++++
 .../method/MongoDBCollection-updateMany.txt   |  7 +++++
 .../method/MongoDBCollection-updateOne.txt    |  7 +++++
 .../method/MongoDBCollection-withOptions.txt  |  5 ++++
 .../method/MongoDBCollection__construct.txt   |  5 ++++
 .../method/MongoDBDatabase-command.txt        |  6 +++++
 .../MongoDBDatabase-createCollection.txt      |  7 +++++
 .../reference/method/MongoDBDatabase-drop.txt |  7 +++++
 .../method/MongoDBDatabase-dropCollection.txt |  7 +++++
 .../MongoDBDatabase-selectCollection.txt      |  5 ++++
 .../MongoDBDatabase-selectGridFSBucket.txt    |  5 ++++
 .../method/MongoDBDatabase-withOptions.txt    |  5 ++++
 .../method/MongoDBDatabase__construct.txt     |  5 ++++
 38 files changed, 272 insertions(+)
 create mode 100644 source/includes/extracts-error.yaml

diff --git a/source/includes/extracts-error.yaml b/source/includes/extracts-error.yaml
new file mode 100644
index 00000000..f50e4140
--- /dev/null
+++ b/source/includes/extracts-error.yaml
@@ -0,0 +1,27 @@
+ref: error-driver-invalidargumentexception
+content: |
+  :php:`MongoDB\\Driver\\Exception\\InvalidArgumentException
+  ` for errors related to the
+  parsing of parameters or options at the driver level.
+---
+ref: error-driver-runtimeexception
+content: |
+  :php:`MongoDB\\Driver\\Exception\\RuntimeException
+  ` for other errors at the driver
+  level (e.g. connection errors).
+---
+ref: error-invalidargumentexception
+content: |
+  :phpclass:`MongoDB\\Exception\\InvalidArgumentException` for errors related to
+  the parsing of parameters or options.
+---
+ref: error-unexpectedvalueexception
+content: |
+  :phpclass:`MongoDB\\Exception\\UnexpectedValueException` if the command
+  response from the server was malformed.
+---
+ref: error-unsupportedexception
+content: |
+  :phpclass:`MongoDB\\Exception\\UnsupportedException` if options are used and
+  not supported by the selected server (e.g. ``collation``, ``writeConcern``).
+...
diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index e72c407e..e97ddddf 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -36,6 +36,13 @@ An array or object with the result document of the :manual:`dropDatabase
 ` command. The return type will depend on the
 ``typeMap`` option.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index 59d7d326..876a3f0e 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -36,6 +36,13 @@ A traversable :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`, which contains
 a :phpclass:`MongoDB\\Model\\DatabaseInfo` object for each database on the
 server.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index cc49aede..48044047 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -34,6 +34,11 @@ Return Values
 
 A :phpclass:`MongoDB\\Collection` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
 Behavior
 --------
 
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index b891b43a..77a4a6f6 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -34,6 +34,11 @@ Return Values
 
 A :phpclass:`MongoDB\\Database` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
 Behavior
 --------
 
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index af229c77..d481e27a 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -29,6 +29,13 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBClient-method-construct-driverOptions.rst
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index cd670b98..9a927ef7 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -37,6 +37,14 @@ A :php:`MongoDB\\Driver\\Cursor ` or
 :php:`ArrayIterator ` object. In both cases, the return value
 will be :php:`Traversable `.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. _php-agg-method-behavior:
 
 Behavior
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index 5c7c2149..772428ff 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -35,6 +35,13 @@ Return Values
 A :phpclass:`MongoDB\\BulkWriteResult` object, which encapsulates a
 :php:`MongoDB\\Driver\\WriteResult ` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. todo: add output and examples
 
 See Also
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 247bfa62..ddc1fb1f 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -34,6 +34,14 @@ Return Values
 
 The number of documents matching the filter criteria.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. todo: add output and examples
 
 See Also
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index 6ba4ac00..162f44bc 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -39,6 +39,13 @@ Return Values
 
 The name of the created index as a string.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index 433a31ca..8ec9ffbb 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -34,6 +34,13 @@ Return Values
 
 The names of the created indexes as an array of strings.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 ``$indexes`` parameter
 ----------------------
 
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index 9fe9ed6e..a961d91a 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -35,6 +35,13 @@ Return Values
 A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
 :php:`MongoDB\\Driver\\WriteResult ` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index 3f3bfdbc..d2db9596 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -37,6 +37,13 @@ Return Values
 A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
 :php:`MongoDB\\Driver\\WriteResult ` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index c7f6e643..e7af2ee6 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -34,6 +34,14 @@ Return Values
 
 An array of the distinct values.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index fa2410df..4fdd1695 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -36,6 +36,13 @@ An array or object with the result document of the :manual:`drop
 ` command. The return type will depend on the
 ``typeMap`` option.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index 75bc81cb..489886b3 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -36,6 +36,13 @@ An array or object with the result document of the :manual:`dropIndexes
 ` command. The return type will depend on the
 ``typeMap`` option.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index 8274445e..d1139a07 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -37,6 +37,13 @@ An array or object with the result document of the :manual:`dropIndexes
 ` command. The return type will depend on the
 ``typeMap`` option.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 1b336e77..c59f1729 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -34,6 +34,13 @@ Return Values
 
 A :php:`MongoDB\\Driver\\Cursor ` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index 34716fdf..6819141b 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -36,6 +36,13 @@ An array or object for the :term:`first document ` document that
 matched the query, or ``null`` if no document matched the query. The return type
 will depend on the ``typeMap`` option.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index 4536bf37..86dda4c1 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -37,6 +37,14 @@ Return Values
 An object for the document that was deleted, or ``null`` if no document matched
 the query.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 92ffa9b4..abe44ed3 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -38,6 +38,14 @@ An object for either the original or the replaced document, depending on the
 specified value of the ``returnDocument`` option. By default, the original
 document is returned. If no document matched the query, ``null`` is returned.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index 71c85c75..6a89c1a8 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -38,6 +38,14 @@ An object for either the original or the updated document, depending on the
 specified value of the ``returnDocument`` option. By default, the original
 document is returned. If no document matched the query, ``null`` is returned.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 9430d9af..f9d708f5 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -35,6 +35,12 @@ Return Values
 A :phpclass:`MongoDB\\InsertManyResult` object, which encapsulates a
 :php:`MongoDB\\Driver\\WriteResult ` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index 6de1e4ff..f4ead380 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -35,6 +35,12 @@ Return Values
 A :phpclass:`MongoDB\\InsertOneResult` object, which encapsulates a
 :php:`MongoDB\\Driver\\WriteResult ` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index 8d1ffeb4..a0b0237d 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -35,6 +35,12 @@ Return Values
 A traversable :phpclass:`MongoDB\\Model\\IndexInfoIterator`, which contains a
 :phpclass:`MongoDB\\Model\\IndexInfo` object for each index for the collection.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index c05edccc..b013ad17 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -37,6 +37,13 @@ Return Values
 A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
 :php:`MongoDB\\Driver\\WriteResult ` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 9af9853f..c4f277bb 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -35,6 +35,13 @@ Return Values
 A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
 :php:`MongoDB\\Driver\\WriteResult ` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index 23cc2835..7cf1d0fe 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -37,6 +37,13 @@ Return Values
 A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
 :php:`MongoDB\\Driver\\WriteResult ` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index 3c5910ff..f3e68dff 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -34,6 +34,11 @@ Return Values
 
 A :phpclass:`MongoDB\\Collection` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
index 0688726f..c3ef0c6b 100644
--- a/source/reference/method/MongoDBCollection__construct.txt
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -29,6 +29,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-construct-option.rst
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
 Behavior
 --------
 
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index ad06820c..46776a80 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -34,6 +34,12 @@ Return Values
 
 A :php:`MongoDB\\Driver\\Cursor ` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 92cb676f..632c06c0 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -53,6 +53,13 @@ Return Values
 An array or object with the result document of the :manual:`create
 ` command.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index 6dbafbea..3fe566f2 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -36,6 +36,13 @@ An array or object with the result document of the :manual:`dropDatabase
 ` command. The return type will depend on the
 ``typeMap`` option.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 52f3d40c..d6158d45 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -36,6 +36,13 @@ An array or object with the result document of the :manual:`drop
 ` command. The return type will depend on the
 ``typeMap`` option.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index f6d930c2..173fdadd 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -34,6 +34,11 @@ Return Values
 
 A :phpclass:`MongoDB\\Collection` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
 Behavior
 --------
 
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index b8390a74..188e24e2 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -34,6 +34,11 @@ Return Values
 
 A :phpclass:`MongoDB\\GridFS\\Bucket` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
 Behavior
 --------
 
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index ec9765d7..4c6f0925 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -34,6 +34,11 @@ Return Values
 
 A :phpclass:`MongoDB\\Database` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt
index 0b593688..2d3e7f57 100644
--- a/source/reference/method/MongoDBDatabase__construct.txt
+++ b/source/reference/method/MongoDBDatabase__construct.txt
@@ -29,6 +29,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBDatabase-method-construct-option.rst
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
 Behavior
 --------
 

From 4debeedc9e2baf55f7fd239fd7c3638ce9de249b Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 15 Nov 2016 19:49:15 -0500
Subject: [PATCH 051/321] Fix spacing in Database class docs

---
 source/reference/class/MongoDBDatabase.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index bb709273..bb489a2a 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -10,8 +10,6 @@ MongoDB\\Database Class
    :depth: 1
    :class: singlecol
 
-
-
 Definition
 ----------
 

From 84415fd466a34d7c7fd121856bb0f91b3bd17324 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 15 Nov 2016 19:49:34 -0500
Subject: [PATCH 052/321] PHPLIB-235: Document exception classes and interfaces

---
 source/reference.txt                   |   3 +-
 source/reference/exception-classes.txt | 110 +++++++++++++++++++++++++
 2 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 source/reference/exception-classes.txt

diff --git a/source/reference.txt b/source/reference.txt
index f986dcf2..53cfa7d9 100644
--- a/source/reference.txt
+++ b/source/reference.txt
@@ -6,9 +6,10 @@ Reference
 
 .. toctree::
    :titlesonly:
-   
+
    /reference/bson
    /reference/class/MongoDBClient
    /reference/class/MongoDBDatabase
    /reference/class/MongoDBCollection
    /reference/class/MongoDBGridFSBucket
+   /reference/exception-classes
diff --git a/source/reference/exception-classes.txt b/source/reference/exception-classes.txt
new file mode 100644
index 00000000..364c2ac5
--- /dev/null
+++ b/source/reference/exception-classes.txt
@@ -0,0 +1,110 @@
+=================
+Exception Classes
+=================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+MongoDB\\Exception\\BadMethodCallException
+------------------------------------------
+
+.. phpclass:: MongoDB\\Exception\\BadMethodCallException
+
+   This exception is thrown when an unsupported method is invoked on an object.
+
+   For example, using an unacknowledged write concern with
+   :phpmethod:`MongoDB\\Collection::insertMany()` will return a
+   :phpclass:`MongoDB\\InsertManyResult` object. It is a logical error to call
+   :phpmethod:`MongoDB\\InsertManyResult::getInsertedCount()`, since the number
+   of inserted documents can only be determined from the response of an
+   acknowledged write operation.
+
+   This class extends PHP's :php:`BadMethodCallException
+   ` class and implements the library's
+   :phpclass:`Exception ` interface.
+
+----
+
+MongoDB\\Exception\\InvalidArgumentException
+--------------------------------------------
+
+.. phpclass:: MongoDB\\Exception\\InvalidArgumentException
+
+   Thrown for errors related to the parsing of parameters or options within the
+   library.
+
+   This class extends the driver's :php:`InvalidArgumentException
+   ` class and implements the
+   library's :phpclass:`Exception ` interface.
+
+----
+
+MongoDB\\Exception\\UnexpectedValueException
+--------------------------------------------
+
+.. phpclass:: MongoDB\\Exception\\UnexpectedValueException
+
+   This exception is thrown when a command response from the server is
+   malformed or not what the library expected. This exception means that an
+   assertion in some operation, which abstracts a database command, has failed.
+   It may indicate a corrupted BSON response or bug in the server, driver, or
+   library.
+
+   This class extends the driver's :php:`UnexpectedValueException
+   ` class and implements the
+   library's :phpclass:`Exception ` interface.
+
+----
+
+MongoDB\\Exception\\UnsupportedException
+----------------------------------------
+
+.. phpclass:: MongoDB\\Exception\\UnsupportedException
+
+   This exception is thrown if an option is used and not supported by the
+   selected server. It is used sparingly in cases where silently ignoring the
+   unsupported option might otherwise lead to unexpected behavior.
+
+   For example, the ``collation`` option for
+   :phpmethod:`MongoDB\\Collection::deleteOne()` is only supported by
+   MongoDB 3.4+. Since collation determines how a document is matched, silently
+   ignoring the option for an older server version could result in an
+   unintended document being deleted.
+
+   This class extends the library's :phpclass:`RuntimeException
+   ` class and implements the
+   library's :phpclass:`Exception ` interface.
+
+   .. note::
+
+      Unlike :phpclass:`InvalidArgumentException
+      `, which may be thrown when
+      an operation's parameters and options are parsed during construction, the
+      selected server is not known until an operation is executed.
+
+----
+
+MongoDB\\Exception\\Exception
+-----------------------------
+
+.. phpclass:: MongoDB\\Exception\\Exception
+
+   This interface extends the driver's :php:`Exception
+   ` interface and is implemented by all
+   exception classes within the library.
+
+----
+
+MongoDB\\Exception\\RuntimeException
+------------------------------------
+
+.. phpclass:: MongoDB\\Exception\\RuntimeException
+
+   This class extends the driver's :php:`RuntimeException
+   ` class, which in turn extends
+   PHP's :php:`RuntimeException ` class.

From 0fc3a62acf7f102b28f374210bebfd2994dbf42c Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 15 Nov 2016 20:37:14 -0500
Subject: [PATCH 053/321] Revise BSON documentation and fix references

---
 source/reference/bson.txt | 122 +++++++++++++++++++-------------------
 1 file changed, 62 insertions(+), 60 deletions(-)

diff --git a/source/reference/bson.txt b/source/reference/bson.txt
index 30bf3f20..300ee5e6 100644
--- a/source/reference/bson.txt
+++ b/source/reference/bson.txt
@@ -13,27 +13,28 @@ BSON
 Overview
 --------
 
-MongoDB stores data records as BSON documents. BSON is a binary
-representation of :term:`JSON` documents, though it contains more data
-types than JSON. For the BSON spec, see `bsonspec.org `_.
+MongoDB stores data records as BSON documents. BSON is a binary representation
+of :term:`JSON` documents, though it contains more data types than JSON. For the
+BSON spec, see `bsonspec.org `_.
 
 By default, the |php-library| returns BSON documents as
-``MongoDB\Model\BSONDocument`` objects and BSON arrays as
-``MongoDB\Model\BSONArray`` objects. ``MongoDB\Model\BSONDocument`` and 
-``MongoDB\Model\BSONArray`` extend PHP's
-:php:`ArrayObject ` class and implement the MongoDB PHP
-driver's :php:`MongoDB\\BSON\\Serializable `
-and :php:`MongoDB\\BSON\\Unserializable `
-interfaces.
+:phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as
+:phpclass:`MongoDB\\Model\\BSONArray` objects.
+:phpclass:`BSONDocument ` and
+:phpclass:`BSONArray ` extend PHP's
+:php:`ArrayObject ` class and implement the driver's
+:php:`MongoDB\\BSON\\Serializable ` and
+:php:`MongoDB\\BSON\\Unserializable ` interfaces.
 
 Type Maps
 ---------
 
-Most methods that read data from MongoDB support a ``typeMap`` option,
-which allows control over how BSON is converted to PHP. Additionally,
+Most methods that read data from MongoDB support a ``typeMap`` option, which
+allows control over how BSON is converted to PHP. Additionally,
 the :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
-:phpclass:`MongoDB\\Collection` classes accept a ``typeMap`` option,
-which applies to any supporting methods and selected classes by default.
+:phpclass:`MongoDB\\Collection` classes accept a ``typeMap`` option, which can
+be used to specify a default type map to apply to any supporting methods and
+selected classes (e.g. :phpmethod:`MongoDB\\Client::selectDatabase()`).
 
 The :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
 :phpclass:`MongoDB\\Collection` classes use the following type map by
@@ -47,20 +48,28 @@ default:
        'root' => 'MongoDB\Model\BSONDocument',
    ]
 
-Serialization and deserialization of PHP variables into MongoDB
----------------------------------------------------------------
-
 ``Persistable`` Classes
-~~~~~~~~~~~~~~~~~~~~~~~
+-----------------------
+
+The driver's :php:`persistence specification ` outlines how
+classes implementing its :php:`MongoDB\\BSON\\Persistable
+` interface are serialized to and deserialized from
+BSON. The :php:`Persistable ` interface is analogous
+to PHP's :php:`Serializable interface `.
+
+The driver automatically handles serialization and deserialization for classes
+implementing the :php:`Persistable ` interface without
+requiring the use of the ``typeMap`` option. This is done by encoding the name
+of the PHP class in a special property within the BSON document.
 
-The PHP driver's :php:`persistence ` specification
-specifies how classes implementing :php:`MongoDB\\BSON\\Persistable
-` are serialized and deserialized, and is
-analogous to PHP's :php:`Serializable interface `.
+.. note::
 
-The PHP :php:`driver ` automatically handles serialization and
-deserialization for classes implementing ``MongoDB\BSON\Persistable``
-without requiring the use of the ``typeMap`` option.
+   When deserializing a PHP variable from BSON, the encoded class name of a
+   :php:`Persistable ` object will override any class
+   specified in the type map, but it will not override ``"array"`` and
+   ``"stdClass"`` or ``"object"``. This is discussed in the 
+   :php:`persistence specification ` but it bears
+   repeating.
 
 Consider the following class definition:
 
@@ -78,12 +87,9 @@ Consider the following class definition:
        {
            $this->id = new MongoDB\BSON\ObjectID;
            $this->name = (string) $name;
-       
-           // Get current time in milliseconds since the epoch
-           $msec = floor(microtime(true) * 1000);
-           $this->createdAt = new MongoDB\BSON\UTCDateTime($msec);
+           $this->createdAt = new MongoDB\BSON\UTCDateTime;
        }
-       
+
        function bsonSerialize()
        {
            return [
@@ -92,7 +98,7 @@ Consider the following class definition:
                'createdAt' => $this->createdAt,
            ];
        }
-       
+
        function bsonUnserialize(array $data)
        {
            $this->id = $data['_id'];
@@ -101,7 +107,7 @@ Consider the following class definition:
        }
    }
 
-The following constructs a ``Person`` object, inserts it into the
+The following example constructs a ``Person`` object, inserts it into the
 database, and reads it back as an object of the same type:
 
 .. code-block:: php
@@ -149,51 +155,47 @@ The same document in the MongoDB shell might display as:
 .. note::
 
    :php:`MongoDB\\BSON\\Persistable ` may only be used
-   for root and embedded BSON documents. BSON arrays are not supported.
+   for root and embedded BSON documents. It may not be used for BSON arrays.
 
 Emulating the Legacy Driver
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
+---------------------------
 
-The legacy :php:`mongo extension ` returned both BSON
-documents and arrays as PHP arrays. While PHP arrays are convenient to
-work with, this behavior was problematic:
+The legacy :php:`mongo extension ` returned both BSON documents and
+arrays as PHP arrays. While PHP arrays are convenient to work with, this
+behavior was problematic:
 
--  Different BSON types could deserialize to the same PHP value (e.g.
-   ``{"0": "foo"}`` and ``["foo"]``), which made it impossible to infer
-   the original BSON type.
+- Different BSON types could deserialize to the same PHP value (e.g.
+  ``{"0": "foo"}`` and ``["foo"]``), which made it impossible to infer the
+  original BSON type.
 
--  Numerically-indexed PHP arrays would be serialized as BSON documents
-   if there was a gap in their key sequence. Such gaps were easily 
-   caused by unsetting a key to remove an element and
-   forgetting to reindex the array.
+- Numerically-indexed PHP arrays would be serialized as BSON documents if there
+  was a gap in their key sequence. Such gaps were easily caused by unsetting a
+  key to remove an element and forgetting to numerically reindex the array.
 
-The |php-library|'s ``MongoDB\Model\BSONDocument`` and ``MongoDB\Model\BSONArray``
-classes address these
-concerns by preserving the BSON type information during serialization
-and deserialization; however, some users may still prefer the legacy
-behavior. If desired, you can use the ``typeMap`` option to have
-the library return everything as a PHP array:
+The |php-library|'s :phpclass:`BSONDocument ` and
+:phpclass:`BSONArray ` classes address these concerns
+by preserving the BSON type information during serialization and
+deserialization; however, some users may still prefer the legacy behavior. If
+desired, you can use the ``typeMap`` option to have the library return
+everything as a PHP array:
 
 .. code-block:: php
 
     [
-           'root' => 'array', 'document' => 'array', 'array' => 'array'
+       [
+           'typeMap' => [
+               'array' => 'array',
+               'document' => 'array',
+               'root' => 'array',
            ],
        ]
    );
 
-   $document = $client->demo->zips->findOne(
-       ['_id' => '94301'],
-       ['typeMap' => [
-            'root' => 'array', 'document' => 'array', 'array' => 'array'
-            ],
-       ]
-   );
+   $document = $client->demo->zips->findOne(['_id' => '94301']);
 
    var_dump($document);
 

From 4468bce607bf5155813b993732aa274a457ba683 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 15 Nov 2016 20:37:43 -0500
Subject: [PATCH 054/321] Revise class documentation and fix references

---
 source/reference/class/MongoDBClient.txt      | 12 ++++-----
 source/reference/class/MongoDBCollection.txt  | 27 ++++++++++---------
 source/reference/class/MongoDBDatabase.txt    | 21 ++++++++-------
 .../reference/class/MongoDBGridFSBucket.txt   | 10 +++----
 4 files changed, 37 insertions(+), 33 deletions(-)

diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
index e6159d91..d5490701 100644
--- a/source/reference/class/MongoDBClient.txt
+++ b/source/reference/class/MongoDBClient.txt
@@ -15,12 +15,12 @@ Definition
 
 .. phpclass:: MongoDB\\Client
 
-   Serves as an entry point for the |php-library|. ``MongoDB\Client``
-   is the preferred class for connecting to a MongoDB server or cluster
-   of servers and serves as a gateway for accessing individual
-   databases and collections. ``MongoDB\Client`` is analogous to the
-   driver's :php:`MongoDB\\Driver\\Manager `
-   class, which it composes.
+   This class serves as an entry point for the |php-library|. It is the
+   preferred class for connecting to a MongoDB server or cluster of servers and
+   acts as a gateway for accessing individual databases and collections.
+   :phpclass:`MongoDB\\Client` is analogous to the driver's
+   :php:`MongoDB\\Driver\\Manager ` class, which it
+   `composes `_.
 
 Methods
 -------
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index d0d5dd41..109fa1ba 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -18,24 +18,28 @@ Definition
    Provides methods for common operations on collections and documents,
    including CRUD operations and index management.
 
-   You can construct collections directly using the PHP extension's
-   :php:`MongoDB\\Driver\\Manager ` class, select
-   a collection from the |php-library|'s :phpclass:`MongoDB\\Client` or
-   :phpclass:`MongoDB\\Database` classes, or create a collection from an
-   existing collection using the
-   :phpmethod:`withOptions() ` clone method.
+   You can construct collections directly using the driver's
+   :php:`MongoDB\\Driver\\Manager ` class or
+   select a collection from the library's :phpclass:`MongoDB\\Client` or
+   :phpclass:`MongoDB\\Database` classes. A collection may also be cloned from
+   an existing :phpclass:`MongoDB\\Collection` object via the
+   :phpmethod:`withOptions() ` method.
 
    :phpclass:`MongoDB\\Collection` supports the :php:`readConcern
    `, :php:`readPreference
    `, :php:`typeMap
    `,
-   and :php:`writeConcern ` options.
-   If you omit an option, the collection inherits the value from the
-   Manager constructor argument or the Database object used to select
-   the collection.
+   and :php:`writeConcern ` options. If you omit an
+   option, the collection inherits the value from the :php:`Manager
+   ` constructor argument or the :phpclass:`Client
+   ` or :phpclass:`Database ` object used to
+   select the collection.
 
    Operations within the :phpclass:`MongoDB\\Collection` class inherit the
-   Collection's options.
+   collection's options.
+
+Type Map Limitations
+--------------------
 
    The :manual:`aggregate ` (when not using a
    cursor), :manual:`distinct `, and
@@ -49,7 +53,6 @@ Definition
    methods return BSON documents as `stdClass` objects and BSON arrays as
    arrays.
 
-
 Methods
 -------
 
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index bb489a2a..4489f21e 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -15,27 +15,28 @@ Definition
 
 .. phpclass:: MongoDB\\Database
 
-   Provides methods for common operations on a database,
-   such as executing database commands and managing collections.
+   Provides methods for common operations on a database, such as executing
+   database commands and managing collections.
 
-   You can construct a database directly using the PHP extension's
+   You can construct a database directly using the driver's
    :php:`MongoDB\\Driver\\Manager ` class or
-   select a database from the |php-library|'s :phpclass:`MongoDB\\Client` class.
+   select a database from the library's :phpclass:`MongoDB\\Client` class. A
+   database may also be cloned from an existing :phpclass:`MongoDB\\Database`
+   object via the :phpmethod:`withOptions() `
+   method.
 
    :phpclass:`MongoDB\\Database` supports the :php:`readConcern
    `, :php:`readPreference
    `, :php:`typeMap
    `,
-   and :php:`writeConcern ` options.
-   If you omit an option, the database inherits the value from the
-   Manager constructor argument or the Client object used to select
-   the database.
+   and :php:`writeConcern ` options. If you omit an
+   option, the database inherits the value from the :php:`Manager
+   ` constructor argument or the :phpclass:`Client
+   ` object used to select the database.
 
    Operations within the :phpclass:`MongoDB\\Database` class inherit the
    Database's options.
 
-.. _database-methods:
-
 Methods
 -------
 
diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 6f889cba..4a7147ce 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -22,11 +22,11 @@ Definition
    class provides an interface around these collections for working with the
    files as PHP :php:`Streams `.
 
-   You can construct a GridFS bucket using the PHP extension's
-   :php:`MongoDB\\Driver\\Manager ` class, or
-   select a bucket from the |php-library|'s :phpclass:`MongoDB\\Database` class
-   via the :phpmethod:`selectGridFSBucket()
-   ` method.
+   You can construct a GridFS bucket using the driver's
+   :php:`Manager ` class, or select a bucket from
+   the library's :phpclass:`MongoDB\\Database` class via the
+   :phpmethod:`selectGridFSBucket() `
+   method.
 
 Methods
 -------

From 10f779a9d39a1f353c2f81b129a528838b404aeb Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 15 Nov 2016 20:38:05 -0500
Subject: [PATCH 055/321] Fix method refs in Upgrade article

---
 source/upgrade.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/source/upgrade.txt b/source/upgrade.txt
index 900db39b..a9c8629b 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -254,12 +254,12 @@ userland. As such, it is no longer done in the new driver and library.
 IDs of inserted documents (whether generated or not) may be accessed
 through the result objects returned by the write methods:
 
--  ``MongoDB\InsertOneResult::getInsertedId()`` for
-   :phpmethod:`MongoDB\\Collection::insertOne`
--  ``MongoDB\InsertManyResult::getInsertedIds()`` for
-   :phpmethod:`MongoDB\\Collection::insertMany`
--  ``MongoDB\BulkWriteResult::getInsertedIds()`` for
-   :phpmethod:`MongoDB\\Collection::bulkWrite`
+- :phpmethod:`MongoDB\\InsertOneResult::getInsertedId()` for
+  :phpmethod:`MongoDB\\Collection::insertOne()`
+- :phpmethod:`MongoDB\\InsertManyResult::getInsertedIds()` for
+  :phpmethod:`MongoDB\\Collection::insertMany()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedIds()` for
+  :phpmethod:`MongoDB\\Collection::bulkWrite()`
 
 ``MongoWriteBatch``
 ~~~~~~~~~~~~~~~~~~~

From b1f81287fe2434028457cb697aca0f53d477e34f Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 16 Nov 2016 12:20:44 -0500
Subject: [PATCH 056/321] PHPLIB-235: Document write result classes

---
 source/includes/extracts-error.yaml           |   6 +
 source/reference.txt                          |   1 +
 ...MongoDBBulkWriteResult-getDeletedCount.txt |  42 +++++
 ...ongoDBBulkWriteResult-getInsertedCount.txt |  42 +++++
 .../MongoDBBulkWriteResult-getInsertedIds.txt |  38 +++++
 ...MongoDBBulkWriteResult-getMatchedCount.txt |  51 +++++++
 ...ongoDBBulkWriteResult-getModifiedCount.txt |  54 +++++++
 ...ongoDBBulkWriteResult-getUpsertedCount.txt |  42 +++++
 .../MongoDBBulkWriteResult-getUpsertedIds.txt |  46 ++++++
 .../MongoDBBulkWriteResult-isAcknowledged.txt |  34 +++++
 .../MongoDBDeleteResult-getDeletedCount.txt   |  40 +++++
 .../MongoDBDeleteResult-isAcknowledged.txt    |  34 +++++
 ...ngoDBInsertManyResult-getInsertedCount.txt |  40 +++++
 ...MongoDBInsertManyResult-getInsertedIds.txt |  36 +++++
 ...MongoDBInsertManyResult-isAcknowledged.txt |  34 +++++
 ...ongoDBInsertOneResult-getInsertedCount.txt |  41 +++++
 .../MongoDBInsertOneResult-getInsertedId.txt  |  35 +++++
 .../MongoDBInsertOneResult-isAcknowledged.txt |  34 +++++
 .../MongoDBUpdateResult-getMatchedCount.txt   |  49 ++++++
 .../MongoDBUpdateResult-getModifiedCount.txt  |  52 +++++++
 .../MongoDBUpdateResult-getUpsertedCount.txt  |  42 +++++
 .../MongoDBUpdateResult-getUpsertedId.txt     |  44 ++++++
 .../MongoDBUpdateResult-isAcknowledged.txt    |  34 +++++
 source/reference/write-result-classes.txt     | 143 ++++++++++++++++++
 24 files changed, 1014 insertions(+)
 create mode 100644 source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
 create mode 100644 source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
 create mode 100644 source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
 create mode 100644 source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
 create mode 100644 source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
 create mode 100644 source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
 create mode 100644 source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
 create mode 100644 source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
 create mode 100644 source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
 create mode 100644 source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
 create mode 100644 source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
 create mode 100644 source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
 create mode 100644 source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
 create mode 100644 source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
 create mode 100644 source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
 create mode 100644 source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
 create mode 100644 source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
 create mode 100644 source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
 create mode 100644 source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
 create mode 100644 source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
 create mode 100644 source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
 create mode 100644 source/reference/write-result-classes.txt

diff --git a/source/includes/extracts-error.yaml b/source/includes/extracts-error.yaml
index f50e4140..9bf6fedf 100644
--- a/source/includes/extracts-error.yaml
+++ b/source/includes/extracts-error.yaml
@@ -10,6 +10,12 @@ content: |
   ` for other errors at the driver
   level (e.g. connection errors).
 ---
+ref: error-badmethodcallexception-write-result
+content: |
+  :phpclass:`MongoDB\\Exception\\BadMethodCallException` if this method is
+  called and the write operation used an unacknowledged :manual:`write concern
+  `.
+---
 ref: error-invalidargumentexception
 content: |
   :phpclass:`MongoDB\\Exception\\InvalidArgumentException` for errors related to
diff --git a/source/reference.txt b/source/reference.txt
index 53cfa7d9..a77f06f4 100644
--- a/source/reference.txt
+++ b/source/reference.txt
@@ -12,4 +12,5 @@ Reference
    /reference/class/MongoDBDatabase
    /reference/class/MongoDBCollection
    /reference/class/MongoDBGridFSBucket
+   /reference/write-result-classes
    /reference/exception-classes
diff --git a/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
new file mode 100644
index 00000000..d0501d3f
--- /dev/null
+++ b/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
@@ -0,0 +1,42 @@
+===========================================
+MongoDB\\BulkWriteResult::getDeletedCount()
+===========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\BulkWriteResult::getDeletedCount()
+
+   Return the total number of documents that were deleted by all delete
+   operations in the bulk write.
+
+   .. code-block:: php
+
+      function getDeletedCount(): integer
+
+   This method should only be called if the write was acknowledged.
+
+Return Values
+-------------
+
+The total number of documents that were deleted by all delete operations in the
+bulk write.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::getDeletedCount()
+  `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
new file mode 100644
index 00000000..6eb1b5de
--- /dev/null
+++ b/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
@@ -0,0 +1,42 @@
+============================================
+MongoDB\\BulkWriteResult::getInsertedCount()
+============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\BulkWriteResult::getInsertedCount()
+
+   Return the total number of documents that were inserted by all insert
+   operations in the bulk write.
+
+   .. code-block:: php
+
+      function getInsertedCount(): integer
+
+   This method should only be called if the write was acknowledged.
+
+Return Values
+-------------
+
+The total number of documents that were inserted by all insert operations in the
+bulk write.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+  `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt b/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
new file mode 100644
index 00000000..679c9400
--- /dev/null
+++ b/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
@@ -0,0 +1,38 @@
+==========================================
+MongoDB\\BulkWriteResult::getInsertedIds()
+==========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\BulkWriteResult::getInsertedIds()
+
+   Return a map of IDs (i.e. ``_id`` field values) for documents that were
+   inserted by all insert operations in the bulk write.
+
+   .. code-block:: php
+
+      function getInsertedIds(): array
+
+   Since IDs are created by the driver, this method may be called irrespective
+   of whether the write was acknowledged.
+
+Return Values
+-------------
+
+A map of IDs (i.e. ``_id`` field values) for documents that were inserted by all
+insert operations in the bulk write.
+
+The index of each ID in the map corresponds to each document's position in the
+bulk operation. If a document had an ID prior to inserting (i.e. the driver did
+not generate an ID), the index will contain its ``_id`` field value. Any
+driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectID
+` instance.
diff --git a/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
new file mode 100644
index 00000000..af1ad98f
--- /dev/null
+++ b/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
@@ -0,0 +1,51 @@
+===========================================
+MongoDB\\BulkWriteResult::getMatchedCount()
+===========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\BulkWriteResult::getMatchedCount()
+
+   Return the total number of documents that were matched by all update and
+   replace operations in the bulk write.
+
+   .. code-block:: php
+
+      function getMatchedCount(): integer
+
+   This method should only be called if the write was acknowledged.
+
+   .. note::
+
+      If an update/replace operation results in no change to the document
+      (e.g. setting the value of a field to its current value), the matched
+      count may be greater than the value returned by
+      :phpmethod:`getModifiedCount()
+      `.
+
+Return Values
+-------------
+
+The total number of documents that were matched by all update and replace
+operations in the bulk write.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\BulkWriteResult::getModifiedCount()`
+- :php:`MongoDB\\Driver\\WriteResult::getMatchedCount()
+  `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
new file mode 100644
index 00000000..674a03cf
--- /dev/null
+++ b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
@@ -0,0 +1,54 @@
+============================================
+MongoDB\\BulkWriteResult::getModifiedCount()
+============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\BulkWriteResult::getModifiedCount()
+
+   Return the total number of documents that were modified by all update and
+   replace operations in the bulk write.
+
+   .. code-block:: php
+
+      function getModifiedCount(): integer|null
+
+   This method should only be called if the write was acknowledged.
+
+   .. note::
+
+      If an update/replace operation results in no change to the document
+      (e.g. setting the value of a field to its current value), the modified
+      count may be less than the value returned by :phpmethod:`getMatchedCount()
+      `.
+
+Return Values
+-------------
+
+The total number of documents that were modified by all update and replace
+operations in the bulk write.
+
+The modified count is not available on versions of MongoDB before 2.6, which
+used the legacy wire protocol version (i.e. ``OP_UPDATE``). If this is the case,
+the modified count will be ``null``.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\BulkWriteResult::getMatchedCount()`
+- :php:`MongoDB\\Driver\\WriteResult::getModifiedCount()
+  `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
new file mode 100644
index 00000000..1f0dff2b
--- /dev/null
+++ b/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
@@ -0,0 +1,42 @@
+============================================
+MongoDB\\BulkWriteResult::getUpsertedCount()
+============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\BulkWriteResult::getUpsertedCount()
+
+   Return the total number of documents that were upserted by all update and
+   replace operations in the bulk write.
+
+   .. code-block:: php
+
+      function getUpsertedCount(): integer
+
+   This method should only be called if the write was acknowledged.
+
+Return Values
+-------------
+
+The total number of documents that were upserted by all update and replace
+operations in the bulk write.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::getUpsertedCount()
+  `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt b/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
new file mode 100644
index 00000000..fb2232a1
--- /dev/null
+++ b/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
@@ -0,0 +1,46 @@
+==========================================
+MongoDB\\BulkWriteResult::getUpsertedIds()
+==========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\BulkWriteResult::getUpsertedIds()
+
+   Return a map of IDs (i.e. ``_id`` field values) for documents that were
+   upserted by all update and replace operations in the bulk write.
+
+   .. code-block:: php
+
+      function getUpsertedIds(): array
+
+Return Values
+-------------
+
+A map of IDs (i.e. ``_id`` field values) for documents that were upserted by all
+update and replace operations in the bulk write.
+
+The index of each ID in the map corresponds to each document's position in the
+bulk operation. If a document had an ID prior to upserting (i.e. the server did
+not generate an ID), the index will contain its ``_id`` field value. Any
+server-generated ID will be a :php:`MongoDB\\BSON\\ObjectID
+` instance.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::getUpsertedIds()
+  `
diff --git a/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt b/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
new file mode 100644
index 00000000..1a857caa
--- /dev/null
+++ b/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
@@ -0,0 +1,34 @@
+==========================================
+MongoDB\\BulkWriteResult::isAcknowledged()
+==========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\BulkWriteResult::isAcknowledged()
+
+   Return whether the write was acknowledged.
+
+   .. code-block:: php
+
+      function isAcknowledged(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the write was acknowledged.
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+  `
+- :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt b/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
new file mode 100644
index 00000000..dcda2574
--- /dev/null
+++ b/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
@@ -0,0 +1,40 @@
+========================================
+MongoDB\\DeleteResult::getDeletedCount()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\DeleteResult::getDeletedCount()
+
+   Return the number of documents that were deleted.
+
+   .. code-block:: php
+
+      function getDeletedCount(): integer
+
+   This method should only be called if the write was acknowledged.
+
+Return Values
+-------------
+
+The number of documents that were deleted.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::getDeletedCount()
+  `
diff --git a/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt b/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
new file mode 100644
index 00000000..a82fa523
--- /dev/null
+++ b/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
@@ -0,0 +1,34 @@
+=======================================
+MongoDB\\DeleteResult::isAcknowledged()
+=======================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\DeleteResult::isAcknowledged()
+
+   Return whether the write was acknowledged.
+
+   .. code-block:: php
+
+      function isAcknowledged(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the write was acknowledged.
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+  `
+- :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt b/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
new file mode 100644
index 00000000..9297008b
--- /dev/null
+++ b/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
@@ -0,0 +1,40 @@
+=============================================
+MongoDB\\InsertManyResult::getInsertedCount()
+=============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\InsertManyResult::getInsertedCount()
+
+   Return the number of documents that were inserted.
+
+   .. code-block:: php
+
+      function getInsertedCount(): integer
+
+   This method should only be called if the write was acknowledged.
+
+Return Values
+-------------
+
+The number of documents that were inserted.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+  `
diff --git a/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt b/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
new file mode 100644
index 00000000..88e76fe4
--- /dev/null
+++ b/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
@@ -0,0 +1,36 @@
+===========================================
+MongoDB\\InsertManyResult::getInsertedIds()
+===========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\InsertManyResult::getInsertedIds()
+
+   Return a map of IDs (i.e. ``_id`` field values) for the inserted documents.
+
+   .. code-block:: php
+
+      function getInsertedIds(): array
+
+   Since IDs are created by the driver, this method may be called irrespective
+   of whether the write was acknowledged.
+
+Return Values
+-------------
+
+A map of IDs (i.e. ``_id`` field values) for the inserted documents.
+
+The index of each ID in the map corresponds to each document's position in the
+bulk operation. If a document had an ID prior to inserting (i.e. the driver did
+not generate an ID), the index will contain its ``_id`` field value. Any
+driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectID
+` instance.
diff --git a/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt b/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
new file mode 100644
index 00000000..db376e5f
--- /dev/null
+++ b/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
@@ -0,0 +1,34 @@
+===========================================
+MongoDB\\InsertManyResult::isAcknowledged()
+===========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\InsertManyResult::isAcknowledged()
+
+   Return whether the write was acknowledged.
+
+   .. code-block:: php
+
+      function isAcknowledged(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the write was acknowledged.
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+  `
+- :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt b/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
new file mode 100644
index 00000000..35508015
--- /dev/null
+++ b/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
@@ -0,0 +1,41 @@
+============================================
+MongoDB\\InsertOneResult::getInsertedCount()
+============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\InsertOneResult::getInsertedCount()
+
+   Return the number of documents that were inserted.
+
+   .. code-block:: php
+
+      function getInsertedCount(): integer
+
+   This method should only be called if the write was acknowledged.
+
+Return Values
+-------------
+
+The number of documents that were inserted. This should be ``1`` for an
+acknowledged insert operation.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+  `
diff --git a/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt b/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
new file mode 100644
index 00000000..7d7a3d67
--- /dev/null
+++ b/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
@@ -0,0 +1,35 @@
+=========================================
+MongoDB\\InsertOneResult::getInsertedId()
+=========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\InsertOneResult::getInsertedId()
+
+   Return the ID (i.e. ``_id`` field value) for the inserted document.
+
+   .. code-block:: php
+
+      function getInsertedId(): mixed
+
+   Since IDs are created by the driver, this method may be called irrespective
+   of whether the write was acknowledged.
+
+Return Values
+-------------
+
+The ID (i.e. ``_id`` field value) of the inserted document.
+
+If the document had an ID prior to inserting (i.e. the driver did not need to
+generate an ID), this will contain its ``_id`` field value. Any driver-generated
+ID will be a :php:`MongoDB\\BSON\\ObjectID `
+instance.
diff --git a/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt b/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
new file mode 100644
index 00000000..921e3a61
--- /dev/null
+++ b/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
@@ -0,0 +1,34 @@
+==========================================
+MongoDB\\InsertOneResult::isAcknowledged()
+==========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\InsertOneResult::isAcknowledged()
+
+   Return whether the write was acknowledged.
+
+   .. code-block:: php
+
+      function isAcknowledged(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the write was acknowledged.
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+  `
+- :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt b/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
new file mode 100644
index 00000000..f347a8cf
--- /dev/null
+++ b/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
@@ -0,0 +1,49 @@
+========================================
+MongoDB\\UpdateResult::getMatchedCount()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\UpdateResult::getMatchedCount()
+
+   Return the number of documents that were matched.
+
+   .. code-block:: php
+
+      function getMatchedCount(): integer
+
+   This method should only be called if the write was acknowledged.
+
+   .. note::
+
+      If an update/replace operation results in no change to the document
+      (e.g. setting the value of a field to its current value), the matched
+      count may be greater than the value returned by
+      :phpmethod:`getModifiedCount()
+      `.
+
+Return Values
+-------------
+
+The number of documents that were matched.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\UpdateResult::getModifiedCount()`
+- :php:`MongoDB\\Driver\\WriteResult::getMatchedCount()
+  `
diff --git a/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt b/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
new file mode 100644
index 00000000..0bd708a0
--- /dev/null
+++ b/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
@@ -0,0 +1,52 @@
+=========================================
+MongoDB\\UpdateResult::getModifiedCount()
+=========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\UpdateResult::getModifiedCount()
+
+   Return the number of documents that were modified.
+
+   .. code-block:: php
+
+      function getModifiedCount(): integer|null
+
+   This method should only be called if the write was acknowledged.
+
+   .. note::
+
+      If an update/replace operation results in no change to the document
+      (e.g. setting the value of a field to its current value), the modified
+      count may be less than the value returned by :phpmethod:`getMatchedCount()
+      `.
+
+Return Values
+-------------
+
+The number of documents that were modified.
+
+The modified count is not available on versions of MongoDB before 2.6, which
+used the legacy wire protocol version (i.e. ``OP_UPDATE``). If this is the case,
+the modified count will be ``null``.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\UpdateResult::getMatchedCount()`
+- :php:`MongoDB\\Driver\\WriteResult::getModifiedCount()
+  `
diff --git a/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt b/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
new file mode 100644
index 00000000..0bbb39fb
--- /dev/null
+++ b/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
@@ -0,0 +1,42 @@
+=========================================
+MongoDB\\UpdateResult::getUpsertedCount()
+=========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\UpdateResult::getUpsertedCount()
+
+   Return the number of documents that were upserted.
+
+   .. code-block:: php
+
+      function getUpsertedCount(): integer
+
+   This method should only be called if the write was acknowledged.
+
+Return Values
+-------------
+
+The total number of documents that were upserted. This should be either ``0`` or
+``1`` for an acknowledged update or replace operation, depending on whether an
+upsert occurred.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::getUpsertedCount()
+  `
diff --git a/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt b/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
new file mode 100644
index 00000000..ed948c0d
--- /dev/null
+++ b/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
@@ -0,0 +1,44 @@
+======================================
+MongoDB\\UpdateResult::getUpsertedId()
+======================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\UpdateResult::getUpsertedId()
+
+   Return the ID (i.e. ``_id`` field value) of the upserted document.
+
+   .. code-block:: php
+
+      function getUpsertedId(): mixed|null
+
+Return Values
+-------------
+
+The ID (i.e. ``_id`` field value) of the upserted document. If no document was
+upserted, ``null`` will be returned.
+
+If the document had an ID prior to upserting (i.e. the server did not need to
+generate an ID), this will contain its ``_id`` field value. Any server-generated
+ID will be a :php:`MongoDB\\BSON\\ObjectID `
+instance.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-badmethodcallexception-write-result.rst
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::getUpsertedIds()
+  `
diff --git a/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt b/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
new file mode 100644
index 00000000..af15d1f1
--- /dev/null
+++ b/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
@@ -0,0 +1,34 @@
+=======================================
+MongoDB\\UpdateResult::isAcknowledged()
+=======================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\UpdateResult::isAcknowledged()
+
+   Return whether the write was acknowledged.
+
+   .. code-block:: php
+
+      function isAcknowledged(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the write was acknowledged.
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+  `
+- :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/write-result-classes.txt b/source/reference/write-result-classes.txt
new file mode 100644
index 00000000..f410c083
--- /dev/null
+++ b/source/reference/write-result-classes.txt
@@ -0,0 +1,143 @@
+====================
+Write Result Classes
+====================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+MongoDB\\BulkWriteResult
+------------------------
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\BulkWriteResult
+
+   This class contains information about an executed bulk write operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::bulkWrite()`.
+
+Methods
+~~~~~~~
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBBulkWriteResult-getDeletedCount
+   /reference/method/MongoDBBulkWriteResult-getInsertedCount
+   /reference/method/MongoDBBulkWriteResult-getInsertedIds
+   /reference/method/MongoDBBulkWriteResult-getMatchedCount
+   /reference/method/MongoDBBulkWriteResult-getModifiedCount
+   /reference/method/MongoDBBulkWriteResult-getUpsertedCount
+   /reference/method/MongoDBBulkWriteResult-getUpsertedIds
+   /reference/method/MongoDBBulkWriteResult-isAcknowledged
+
+----
+
+MongoDB\\DeleteResult
+---------------------
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\DeleteResult
+
+   This class contains information about an executed delete operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::deleteMany()` or
+   :phpmethod:`MongoDB\\Collection::deleteOne()`.
+
+Methods
+~~~~~~~
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBDeleteResult-getDeletedCount
+   /reference/method/MongoDBDeleteResult-isAcknowledged
+
+----
+
+MongoDB\\InsertManyResult
+-------------------------
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\InsertManyResult
+
+   This class contains information about an executed bulk insert operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::insertMany()`.
+
+Methods
+~~~~~~~
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBInsertManyResult-getInsertedCount
+   /reference/method/MongoDBInsertManyResult-getInsertedIds
+   /reference/method/MongoDBInsertManyResult-isAcknowledged
+
+----
+
+MongoDB\\InsertOneResult
+------------------------
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\InsertOneResult
+
+   This class contains information about an executed insert operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::insertOne()`.
+
+Methods
+~~~~~~~
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBInsertOneResult-getInsertedCount
+   /reference/method/MongoDBInsertOneResult-getInsertedId
+   /reference/method/MongoDBInsertOneResult-isAcknowledged
+
+----
+
+MongoDB\\UpdateResult
+---------------------
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\UpdateResult
+
+   This class contains information about an executed update or replace
+   operation. It encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::replaceOne()`,
+   :phpmethod:`MongoDB\\Collection::updateMany()`, or
+   :phpmethod:`MongoDB\\Collection::updateOne()`.
+
+Methods
+~~~~~~~
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBUpdateResult-getMatchedCount
+   /reference/method/MongoDBUpdateResult-getModifiedCount
+   /reference/method/MongoDBUpdateResult-getUpsertedCount
+   /reference/method/MongoDBUpdateResult-getUpsertedId
+   /reference/method/MongoDBUpdateResult-isAcknowledged

From 8e04e567bf34dadc85615d461f5fe35c8bf3b0d6 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 16 Nov 2016 16:45:15 -0500
Subject: [PATCH 057/321] PHPLIB-235: Document BSON model classes

---
 source/reference/bson.txt | 36 ++++++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/source/reference/bson.txt b/source/reference/bson.txt
index 300ee5e6..789bcbce 100644
--- a/source/reference/bson.txt
+++ b/source/reference/bson.txt
@@ -19,12 +19,36 @@ BSON spec, see `bsonspec.org `_.
 
 By default, the |php-library| returns BSON documents as
 :phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as
-:phpclass:`MongoDB\\Model\\BSONArray` objects.
-:phpclass:`BSONDocument ` and
-:phpclass:`BSONArray ` extend PHP's
-:php:`ArrayObject ` class and implement the driver's
-:php:`MongoDB\\BSON\\Serializable ` and
-:php:`MongoDB\\BSON\\Unserializable ` interfaces.
+:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively.
+
+BSON Classes
+------------
+
+.. phpclass:: MongoDB\\Model\\BSONArray
+
+   This class extends PHP's :php:`ArrayObject ` class. It also
+   implements PHP's :php:`JsonSerializable ` interface and the
+   driver's :php:`MongoDB\\BSON\\Serializable ` and
+   :php:`MongoDB\\BSON\\Unserializable `
+   interfaces.
+
+   By default, the library will deserialize BSON arrays as instances of this
+   class. During BSON and JSON serialization, instances of this class will
+   serialize as an array type (:php:`array_values() ` is used
+   internally to numerically reindex the array).
+
+.. phpclass:: MongoDB\\Model\\BSONDocument
+
+   This class extends PHP's :php:`ArrayObject ` class. It also
+   implements PHP's :php:`JsonSerializable ` interface and the
+   driver's :php:`MongoDB\\BSON\\Serializable ` and
+   :php:`MongoDB\\BSON\\Unserializable `
+   interfaces.
+
+   By default, the library will deserialize BSON documents as instances of this
+   class. During BSON and JSON serialization, instances of this class will
+   serialize as a document type (:php:`object casting
+   ` is used internally).
 
 Type Maps
 ---------

From f48b452906425bcd7feffafd735b545047d1ef97 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 16 Nov 2016 16:45:57 -0500
Subject: [PATCH 058/321] PHPLIB-235: Document enumeration model classes

---
 source/reference.txt                          |   1 +
 source/reference/enumeration-classes.txt      | 161 ++++++++++++++++++
 ...ongoDBModelCollectionInfo-getCappedMax.txt |  39 +++++
 ...ngoDBModelCollectionInfo-getCappedSize.txt |  40 +++++
 .../MongoDBModelCollectionInfo-getName.txt    |  34 ++++
 .../MongoDBModelCollectionInfo-getOptions.txt |  36 ++++
 .../MongoDBModelCollectionInfo-isCapped.txt   |  37 ++++
 .../MongoDBModelDatabaseInfo-getName.txt      |  34 ++++
 ...MongoDBModelDatabaseInfo-getSizeOnDisk.txt |  33 ++++
 .../MongoDBModelDatabaseInfo-isEmpty.txt      |  33 ++++
 .../method/MongoDBModelIndexInfo-getKey.txt   |  36 ++++
 .../method/MongoDBModelIndexInfo-getName.txt  |  37 ++++
 .../MongoDBModelIndexInfo-getNamespace.txt    |  36 ++++
 .../MongoDBModelIndexInfo-getVersion.txt      |  34 ++++
 .../method/MongoDBModelIndexInfo-isSparse.txt |  37 ++++
 .../method/MongoDBModelIndexInfo-isTtl.txt    |  37 ++++
 .../method/MongoDBModelIndexInfo-isUnique.txt |  37 ++++
 17 files changed, 702 insertions(+)
 create mode 100644 source/reference/enumeration-classes.txt
 create mode 100644 source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
 create mode 100644 source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
 create mode 100644 source/reference/method/MongoDBModelCollectionInfo-getName.txt
 create mode 100644 source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
 create mode 100644 source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
 create mode 100644 source/reference/method/MongoDBModelDatabaseInfo-getName.txt
 create mode 100644 source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
 create mode 100644 source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
 create mode 100644 source/reference/method/MongoDBModelIndexInfo-getKey.txt
 create mode 100644 source/reference/method/MongoDBModelIndexInfo-getName.txt
 create mode 100644 source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
 create mode 100644 source/reference/method/MongoDBModelIndexInfo-getVersion.txt
 create mode 100644 source/reference/method/MongoDBModelIndexInfo-isSparse.txt
 create mode 100644 source/reference/method/MongoDBModelIndexInfo-isTtl.txt
 create mode 100644 source/reference/method/MongoDBModelIndexInfo-isUnique.txt

diff --git a/source/reference.txt b/source/reference.txt
index a77f06f4..b0606bd8 100644
--- a/source/reference.txt
+++ b/source/reference.txt
@@ -13,4 +13,5 @@ Reference
    /reference/class/MongoDBCollection
    /reference/class/MongoDBGridFSBucket
    /reference/write-result-classes
+   /reference/enumeration-classes
    /reference/exception-classes
diff --git a/source/reference/enumeration-classes.txt b/source/reference/enumeration-classes.txt
new file mode 100644
index 00000000..045091ac
--- /dev/null
+++ b/source/reference/enumeration-classes.txt
@@ -0,0 +1,161 @@
+===================
+Enumeration Classes
+===================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+MongoDB\\Model\\CollectionInfo
+------------------------------
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\Model\\CollectionInfo
+
+   This class models information about a collection. Instances of this class are
+   returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\\Database::listCollections()`.
+
+Methods
+~~~~~~~
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBModelCollectionInfo-getCappedMax
+   /reference/method/MongoDBModelCollectionInfo-getCappedSize
+   /reference/method/MongoDBModelCollectionInfo-getName
+   /reference/method/MongoDBModelCollectionInfo-getOptions
+   /reference/method/MongoDBModelCollectionInfo-isCapped
+
+----
+
+MongoDB\\Model\\CollectionInfoIterator
+--------------------------------------
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\Model\\CollectionInfoIterator
+
+   This interface extends PHP's :php:`Iterator `
+   interface. An instance of this interface is returned by
+   :phpmethod:`MongoDB\\Database::listCollections()`.
+
+Methods
+~~~~~~~
+
+This interface adds no new methods to :php:`Iterator
+`, but specifies that :php:`current()
+` will return an instance of
+:phpclass:`MongoDB\\Model\\CollectionInfo`.
+
+----
+
+MongoDB\\Model\\DatabaseInfo
+----------------------------
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\Model\\DatabaseInfo
+
+   This class models information about a database. Instances of this class are
+   returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`.
+
+Methods
+~~~~~~~
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBModelDatabaseInfo-getName
+   /reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk
+   /reference/method/MongoDBModelDatabaseInfo-isEmpty
+
+----
+
+MongoDB\\Model\\DatabaseInfoIterator
+------------------------------------
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\Model\\DatabaseInfoIterator
+
+   This interface extends PHP's :php:`Iterator `
+   interface. An instance of this interface is returned by
+   :phpmethod:`MongoDB\\Client::listDatabases()`.
+
+Methods
+~~~~~~~
+
+This interface adds no new methods to :php:`Iterator
+`, but specifies that :php:`current()
+` will return an instance of
+:phpclass:`MongoDB\\Model\\DatabaseInfo`.
+
+----
+
+MongoDB\\Model\\IndexInfo
+-------------------------
+
+.. phpclass:: MongoDB\\Model\\IndexInfo
+
+   This class models information about an index. Instances of this class are
+   returned by traversing a :phpclass:`MongoDB\\Model\\IndexInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\\Collection::listIndexes()`.
+
+   This class implements PHP's :php:`ArrayAccess ` interface. This
+   provides a mechanism for accessing index fields for which there exists no
+   helper method. :php`isset() ` may be used to check for the existence
+   of a field before accessing it with ``[]``.
+
+   .. note::
+
+      The :phpclass:`MongoDB\\Model\\IndexInfo` class is immutable. Attempting
+      to modify it via the :php:`ArrayAccess ` interface will
+      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+
+Methods
+~~~~~~~
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBModelIndexInfo-getKey
+   /reference/method/MongoDBModelIndexInfo-getName
+   /reference/method/MongoDBModelIndexInfo-getNamespace
+   /reference/method/MongoDBModelIndexInfo-getVersion
+   /reference/method/MongoDBModelIndexInfo-isSparse
+   /reference/method/MongoDBModelIndexInfo-isTtl
+   /reference/method/MongoDBModelIndexInfo-isUnique
+
+----
+
+MongoDB\\Model\\IndexInfoIterator
+---------------------------------
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\Model\\IndexInfoIterator
+
+   This interface extends PHP's :php:`Iterator `
+   interface. An instance of this interface is returned by
+   :phpmethod:`MongoDB\\Collection::listIndexes()`.
+
+Methods
+~~~~~~~
+
+This interface adds no new methods to :php:`Iterator
+`, but specifies that :php:`current()
+` will return an instance of
+:phpclass:`MongoDB\\Model\\IndexInfo`.
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
new file mode 100644
index 00000000..693350f0
--- /dev/null
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
@@ -0,0 +1,39 @@
+==============================================
+MongoDB\\Model\\CollectionInfo::getCappedMax()
+==============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedMax()
+
+   Return the document limit for the capped collection. This correlates with the
+   ``max`` option for :phpmethod:`MongoDB\\Database::createCollection()`.
+
+   .. code-block:: php
+
+      function getCappedMax(): integer|null
+
+Return Values
+-------------
+
+The document limit for the capped collection. If the collection is not capped,
+``null`` will be returned.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
+- :phpmethod:`MongoDB\\Database::createCollection()`
+- :manual:`Capped Collections ` in the MongoDB manual
+- :manual:`listCollections ` command
+  reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
new file mode 100644
index 00000000..cc0bd769
--- /dev/null
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
@@ -0,0 +1,40 @@
+===============================================
+MongoDB\\Model\\CollectionInfo::getCappedSize()
+===============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedSize()
+
+   Return the size limit for the capped collection in bytes. This correlates
+   with the ``size`` option for
+   :phpmethod:`MongoDB\\Database::createCollection()`.
+
+   .. code-block:: php
+
+      function getCappedSize(): integer|null
+
+Return Values
+-------------
+
+The size limit for the capped collection in bytes. If the collection is not
+capped, ``null`` will be returned.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
+- :phpmethod:`MongoDB\\Database::createCollection()`
+- :manual:`Capped Collections ` in the MongoDB manual
+- :manual:`listCollections ` command
+  reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getName.txt b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
new file mode 100644
index 00000000..cd04ffac
--- /dev/null
+++ b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
@@ -0,0 +1,34 @@
+=========================================
+MongoDB\\Model\\CollectionInfo::getName()
+=========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\CollectionInfo::getName()
+
+   Return the collection name.
+
+   .. code-block:: php
+
+      function getName(): string
+
+Return Values
+-------------
+
+The collection name.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::getCollectionName()`
+- :manual:`listCollections ` command
+  reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
new file mode 100644
index 00000000..e360522b
--- /dev/null
+++ b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
@@ -0,0 +1,36 @@
+============================================
+MongoDB\\Model\\CollectionInfo::getOptions()
+============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\CollectionInfo::getOptions()
+
+   Return the collection options. This correlates with the options for
+   :phpmethod:`MongoDB\\Database::createCollection()`, but may include
+   additional fields set by the server.
+
+   .. code-block:: php
+
+      function getOptions(): array
+
+Return Values
+-------------
+
+The collection options.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Database::createCollection()`
+- :manual:`listCollections ` command
+  reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
new file mode 100644
index 00000000..abfc387d
--- /dev/null
+++ b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
@@ -0,0 +1,37 @@
+==========================================
+MongoDB\\Model\\CollectionInfo::isCapped()
+==========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\CollectionInfo::isCapped()
+
+   Return whether the collection is a :manual:`capped collection
+   `.
+
+   .. code-block:: php
+
+      function isCapped(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the collection is a capped collection.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
+- :manual:`Capped Collections ` in the MongoDB manual
+- :manual:`listCollections ` command
+  reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
new file mode 100644
index 00000000..47991f1a
--- /dev/null
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
@@ -0,0 +1,34 @@
+=======================================
+MongoDB\\Model\\DatabaseInfo::getName()
+=======================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getName()
+
+   Return the database name.
+
+   .. code-block:: php
+
+      function getName(): string
+
+Return Values
+-------------
+
+The database name.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Database::getDatabaseName()`
+- :manual:`listDatabases ` command reference
+  in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
new file mode 100644
index 00000000..2a8fe5ad
--- /dev/null
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
@@ -0,0 +1,33 @@
+=============================================
+MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()
+=============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()
+
+   Return the total size of the database file on disk in bytes.
+
+   .. code-block:: php
+
+      function getSizeOnDisk(): integer
+
+Return Values
+-------------
+
+The total size of the database file on disk in bytes.
+
+See Also
+--------
+
+- :manual:`listDatabases ` command reference
+  in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
new file mode 100644
index 00000000..878844d0
--- /dev/null
+++ b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
@@ -0,0 +1,33 @@
+=======================================
+MongoDB\\Model\\DatabaseInfo::isEmpty()
+=======================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\DatabaseInfo::isEmpty()
+
+   Return whether the database has any data.
+
+   .. code-block:: php
+
+      function isEmpty(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the database has any data.
+
+See Also
+--------
+
+- :manual:`listDatabases ` command reference
+  in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getKey.txt b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
new file mode 100644
index 00000000..6ad0712e
--- /dev/null
+++ b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
@@ -0,0 +1,36 @@
+===================================
+MongoDB\\Model\\IndexInfo::getKey()
+===================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\IndexInfo::getKey()
+
+   Return the index specification (i.e. indexed field(s) and order). This
+   correlates with the ``$key`` parameter for
+   :phpmethod:`MongoDB\\Collection::createIndex()`.
+
+   .. code-block:: php
+
+      function getKey(): array
+
+Return Values
+-------------
+
+The index specification as an associative array.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :manual:`listIndexes ` command reference in
+  the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getName.txt b/source/reference/method/MongoDBModelIndexInfo-getName.txt
new file mode 100644
index 00000000..26983790
--- /dev/null
+++ b/source/reference/method/MongoDBModelIndexInfo-getName.txt
@@ -0,0 +1,37 @@
+====================================
+MongoDB\\Model\\IndexInfo::getName()
+====================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\IndexInfo::getName()
+
+   Return the index name. This correlates with the return value of
+   :phpmethod:`MongoDB\\Collection::createIndex()`. An index name may be derived
+   from the ``$key`` parameter or or explicitly specified via the ``name``
+   option.
+
+   .. code-block:: php
+
+      function getName(): string
+
+Return Values
+-------------
+
+The index name.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :manual:`listIndexes ` command reference in
+  the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
new file mode 100644
index 00000000..987c8bec
--- /dev/null
+++ b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
@@ -0,0 +1,36 @@
+=========================================
+MongoDB\\Model\\IndexInfo::getNamespace()
+=========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\IndexInfo::getNamespace()
+
+   Return the index namespace, which is the namespace of the collection
+   containing the index.
+
+   .. code-block:: php
+
+      function getNamespace(): string
+
+Return Values
+-------------
+
+The index namespace.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :manual:`listIndexes ` command reference in
+  the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
new file mode 100644
index 00000000..e2480df0
--- /dev/null
+++ b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
@@ -0,0 +1,34 @@
+=======================================
+MongoDB\\Model\\IndexInfo::getVersion()
+=======================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\IndexInfo::getVersion()
+
+   Return the index version.
+
+   .. code-block:: php
+
+      function getVersion(): integer
+
+Return Values
+-------------
+
+The index version.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :manual:`listIndexes ` command reference in
+  the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
new file mode 100644
index 00000000..580e2f60
--- /dev/null
+++ b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
@@ -0,0 +1,37 @@
+=====================================
+MongoDB\\Model\\IndexInfo::isSparse()
+=====================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\IndexInfo::isSparse()
+
+   Return whether the index is a :manual:`sparse index `.
+   This correlates with the ``sparse`` option for
+   :phpmethod:`MongoDB\\Collection::createIndex()`.
+
+   .. code-block:: php
+
+      function isSparse(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the index is a sparse index.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :manual:`listIndexes ` command reference in
+  the MongoDB manual
+- :manual:`Sparse Indexes ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
new file mode 100644
index 00000000..f2f16e02
--- /dev/null
+++ b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
@@ -0,0 +1,37 @@
+==================================
+MongoDB\\Model\\IndexInfo::isTtl()
+==================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\IndexInfo::isTtl()
+
+   Return whether the index is a :manual:`TTL index `. This
+   correlates with the ``expireAfterSeconds`` option for
+   :phpmethod:`MongoDB\\Collection::createIndex()`.
+
+   .. code-block:: php
+
+      function isTtl(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the index is a TTL index.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :manual:`listIndexes ` command reference in
+  the MongoDB manual
+- :manual:`TTL Indexes ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
new file mode 100644
index 00000000..5fbfa765
--- /dev/null
+++ b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
@@ -0,0 +1,37 @@
+=====================================
+MongoDB\\Model\\IndexInfo::isUnique()
+=====================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\IndexInfo::isUnique()
+
+   Return whether the index is a :manual:`unique index `.
+   This correlates with the ``unique`` option for
+   :phpmethod:`MongoDB\\Collection::createIndex()`.
+
+   .. code-block:: php
+
+      function isUnique(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the index is a unique index.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :manual:`listIndexes ` command reference in
+  the MongoDB manual
+- :manual:`Unique Indexes ` in the MongoDB manual

From 335da7ecd238da5a02405f5b988a7331cb6af86e Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 16 Nov 2016 17:27:00 -0500
Subject: [PATCH 059/321] Add example data to tutorial

---
 source/tutorial.txt              |  1 +
 source/tutorial/example-data.md  | 45 --------------------------------
 source/tutorial/example-data.txt | 42 +++++++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 45 deletions(-)
 delete mode 100644 source/tutorial/example-data.md
 create mode 100644 source/tutorial/example-data.txt

diff --git a/source/tutorial.txt b/source/tutorial.txt
index b5ae43c6..a1a6f8a6 100644
--- a/source/tutorial.txt
+++ b/source/tutorial.txt
@@ -9,3 +9,4 @@ Tutorials
    /tutorial/commands
    /tutorial/gridfs
    /tutorial/indexes
+   /tutorial/example-data
diff --git a/source/tutorial/example-data.md b/source/tutorial/example-data.md
deleted file mode 100644
index 9b2be0f4..00000000
--- a/source/tutorial/example-data.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# Example Data
-
-Some examples in this documentation use example data fixtures from
-[zips.json][zips]. This is a dataset comprised of United States postal codes,
-populations, and geographic locations.
-
-Importing the dataset into MongoDB can be done in several ways. The following
-example uses [mongodb extension][ext-mongodb]:
-
-[zips]: http://media.mongodb.org/zips.json
-[ext-mongodb]: http://php.net/mongodb
-
-```
-insert($document);
-}
-
-$manager = new MongoDB\Driver\Manager('mongodb://localhost');
-
-$result = $manager->executeBulkWrite('demo.zips', $bulk);
-printf("Inserted %d documents\n", $result->getInsertedCount());
-```
-
-Executing this script should yield the following output:
-
-```
-Inserted 29353 documents
-```
-
-You may also import the dataset using the [mongoimport][mongoimport] command,
-which is included with MongoDB:
-
-[mongoimport]: http://docs.mongodb.org/manual/reference/program/mongoimport/
-
-```bash
-$ mongoimport --db demo --collection zips --file zips.json --drop
-```
diff --git a/source/tutorial/example-data.txt b/source/tutorial/example-data.txt
new file mode 100644
index 00000000..9d4bba92
--- /dev/null
+++ b/source/tutorial/example-data.txt
@@ -0,0 +1,42 @@
+============
+Example Data
+============
+
+.. default-domain:: mongodb
+
+Some examples in this documentation use example data fixtures from
+`zips.json `_. This is a dataset comprised
+of United States postal codes, populations, and geographic locations.
+
+Importing the dataset into MongoDB can be done in several ways. The following
+example uses the :php:`driver ` directly:
+
+.. code-block:: php
+
+   insert($document);
+   }
+
+   $manager = new MongoDB\Driver\Manager('mongodb://127.0.0.1/');
+
+   $result = $manager->executeBulkWrite('demo.zips', $bulk);
+   printf("Inserted %d documents\n", $result->getInsertedCount());
+
+The output would then resemble::
+
+   Inserted 29353 documents
+
+You may also import the dataset using :manual:`mongoimport
+`, which is included with MongoDB:
+
+.. code-block:: none
+
+   $ mongoimport --db demo --collection zips --file zips.json --drop

From f471445784b32d15be4dbba6783887e2031ad614 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 16 Nov 2016 17:27:57 -0500
Subject: [PATCH 060/321] Revise index and upgrade pages in documentation

---
 source/index.txt   |  52 +++++------
 source/upgrade.txt | 227 +++++++++++++++++++++------------------------
 2 files changed, 130 insertions(+), 149 deletions(-)

diff --git a/source/index.txt b/source/index.txt
index 0c1fb363..e4b61328 100644
--- a/source/index.txt
+++ b/source/index.txt
@@ -4,28 +4,25 @@ MongoDB PHP Library
 
 .. default-domain:: mongodb
 
-The |php-library| provides a high-level abstraction
-around the lower-level `PHP Driver `_, also
-known as the ``mongodb`` extension.
-
-While the ``mongodb`` extension provides a limited API for executing
-commands, queries, and write operations, the |php-library|
-implements an API similar to that of the `legacy PHP driver
-`_. The library contains
-abstractions for client, database, and collection objects, and provides
-methods for CRUD operations and common commands such as index and
+The |php-library| provides a high-level abstraction around the lower-level
+`PHP Driver `_, also known as the ``mongodb``
+extension.
+
+While the ``mongodb`` extension provides a limited API for executing commands,
+queries, and write operations, the |php-library| implements an API similar to
+that of the `legacy PHP driver `_. The
+library contains abstractions for client, database, and collection objects, and
+provides methods for CRUD operations and common commands such as index and
 collection management.
 
-If you are developing a PHP application with MongoDB, you should consider
-using this library, or another high-level abstraction, instead of the
-extension alone.
+If you are developing a PHP application with MongoDB, you should consider using
+this library, or another high-level abstraction, instead of the extension alone.
 
-For additional information about the MongoDB PHP Library and the
-``mongodb`` extension, see the `Architecture Overview
-`_ article in the
-extension documentation. `Derick Rethans `_
-has also written a series of blog posts entitled *New MongoDB Drivers
-for PHP and HHVM*:
+For additional information about the MongoDB PHP Library and the ``mongodb``
+extension, see the `Architecture Overview
+`_ article in the extension
+documentation. `Derick Rethans `_ has also written a
+series of blog posts entitled *New MongoDB Drivers for PHP and HHVM*:
 
 - `Part One: History `_
 
@@ -42,26 +39,23 @@ If you are a new MongoDB user, these links should help you become more familiar
 with MongoDB and introduce some of the concepts and terms you will encounter in
 this documentation:
 
-- `Introduction to CRUD operations in MongoDB
-  `_
+- :manual:`Introduction to CRUD operations in MongoDB `
 
-- `What is a MongoDB document?
-  `_
+- :manual:`What is a MongoDB document? `
 
-- `MongoDB's *dot notation* for accessing document properties
-  `_
+- :manual:`Dot notation for accessing document properties
+  `
 
-- `ObjectId: MongoDB's document identifier
-  `_
+- :manual:`ObjectId: MongoDB's document identifier `
 
 .. class:: hidden
 
    .. toctree::
       :titlesonly:
-      
+
       Installation 
       /tutorial
       /upgrade
       /reference
 
-.. /getting-started
\ No newline at end of file
+.. /getting-started
diff --git a/source/upgrade.txt b/source/upgrade.txt
index a9c8629b..693b1e52 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -10,95 +10,94 @@ Upgrade Guide
    :depth: 1
    :class: singlecol
 
-The MongoDB PHP Library and underlying :php:`mongodb
-extension ` have notable API differences from
-the legacy :php:`mongo extension `. This page will
-summarize those differences for the benefit of those
-upgrading from the legacy driver.
-
-Additionally, a community-developed
-`mongo-php-adapter `__
-library exists, which implements the `mongo
-extension `__ API using this library and the new
-driver. While this adapter library is not officially supported by
+Overview
+--------
+
+The |php-library| and underlying :php:`mongodb extension ` have notable
+API differences from the legacy :php:`mongo extension `. This page will
+summarize those differences for the benefit of those upgrading from the legacy
+driver.
+
+Additionally, a community-developed `mongo-php-adapter
+`_ library exists, which
+implements the `mongo extension `_ API using this library
+and the new driver. While this adapter library is not officially supported by
 MongoDB, it does bear mentioning.
 
 Collection API
-~~~~~~~~~~~~~~
-
-This library's :phpclass:`MongoDB\\Collection` class
-implements MongoDB's cross-driver
-`CRUD `__
-and `Index
-Management `__
-specifications. Although some method names have changed in accordance
-with the new specifications, the new class provides the same
-functionality as the legacy driver's
-`MongoCollection `__ class with some
-notable exceptions.
+--------------
+
+This library's :phpclass:`MongoDB\\Collection` class implements MongoDB's
+cross-driver `CRUD
+`_
+and `Index Management
+`_
+specifications. Although some method names have changed in accordance with the
+new specifications, the new class provides the same functionality as the legacy
+driver's :php:`MongoCollection ` class with some notable
+exceptions.
 
 Old and New Methods
 ~~~~~~~~~~~~~~~~~~~
 
 .. list-table::
    :header-rows: 1
-   
-   * - :php:`MongoCollection `
+
+   * - :php:`MongoCollection `
      - :phpclass:`MongoDB\\Collection`
 
    * - :php:`MongoCollection::aggregate() `
-     - :phpmethod:`MongoDB\\Collection::aggregate`
+     - :phpmethod:`MongoDB\\Collection::aggregate()`
 
    * - :php:`MongoCollection::aggregateCursor() `
-     - :phpmethod:`MongoDB\\Collection::aggregate`
+     - :phpmethod:`MongoDB\\Collection::aggregate()`
 
    * - :php:`MongoCollection::batchInsert() `
-     - :phpmethod:`MongoDB\\Collection::insertMany`
+     - :phpmethod:`MongoDB\\Collection::insertMany()`
 
    * - :php:`MongoCollection::count() `
-     - :phpmethod:`MongoDB\\Collection::count`
+     - :phpmethod:`MongoDB\\Collection::count()`
 
    * - :php:`MongoCollection::createDBRef() `
-     - Not yet implemented. See :issue:`PHPLIB-24`
+     - Not yet implemented. See :issue:`PHPLIB-24`.
 
    * - :php:`MongoCollection::createIndex() `
-     - :phpmethod:`MongoDB\\Collection::createIndex`
+     - :phpmethod:`MongoDB\\Collection::createIndex()`
 
    * - :php:`MongoCollection::deleteIndex() `
-     - :phpmethod:`MongoDB\\Collection::dropIndex`
+     - :phpmethod:`MongoDB\\Collection::dropIndex()`
 
    * - :php:`MongoCollection::deleteIndexes() `
-     - :phpmethod:`MongoDB\\Collection::dropIndexes`
+     - :phpmethod:`MongoDB\\Collection::dropIndexes()`
 
    * - :php:`MongoCollection::drop() `
-     - :phpmethod:`MongoDB\\Collection::drop`
+     - :phpmethod:`MongoDB\\Collection::drop()`
 
    * - :php:`MongoCollection::distinct() `
-     - :phpmethod:`MongoDB\\Collection::distinct`
+     - :phpmethod:`MongoDB\\Collection::distinct()`
 
    * - :php:`MongoCollection::ensureIndex() `
-     - :phpmethod:`MongoDB\\Collection::createIndex`
+     - :phpmethod:`MongoDB\\Collection::createIndex()`
 
    * - :php:`MongoCollection::find() `
-     - :phpmethod:`MongoDB\\Collection::find`
+     - :phpmethod:`MongoDB\\Collection::find()`
 
    * - :php:`MongoCollection::findAndModify() `
-   
-     - :phpmethod:`MongoDB\\Collection::findOneAndDelete`,
-       :phpmethod:`MongoDB\\Collection::findOneAndReplace`, and
+     - :phpmethod:`MongoDB\\Collection::findOneAndDelete()`,
+       :phpmethod:`MongoDB\\Collection::findOneAndReplace()`, and
        :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
 
    * - :php:`MongoCollection::findOne() `
-     - :phpmethod:`MongoDB\\Collection::findOne`
+     - :phpmethod:`MongoDB\\Collection::findOne()`
 
    * - :php:`MongoCollection::getDBRef() `
-     - Not implemented. See :issue:`PHPLIB-24`
+     - Not implemented. See :issue:`PHPLIB-24`.
 
    * - :php:`MongoCollection::getIndexInfo() `
-     - :phpmethod:`MongoDB\\Collection::listIndexes`
+     - :phpmethod:`MongoDB\\Collection::listIndexes()`
 
    * - :php:`MongoCollection::getName() `
-     - :phpmethod:`MongoDB\\Collection::getCollectionName`
+     - :phpmethod:`MongoDB\\Collection::getCollectionName()`
 
    * - :php:`MongoCollection::getReadPreference() `
      - Not implemented.
@@ -111,21 +110,21 @@ Old and New Methods
 
    * - :php:`MongoCollection::group() `
      - Not yet implemented. See :issue:`PHPLIB-177`. 
-       Use :phpmethod:`MongoDB\\Database::command`.
+       Use :phpmethod:`MongoDB\\Database::command()`.
 
    * - :php:`MongoCollection::insert() `
-     - :phpmethod:`MongoDB\\Collection::insertOne`
+     - :phpmethod:`MongoDB\\Collection::insertOne()`
 
    * - :php:`MongoCollection::parallelCollectionScan() `
      - Not implemented.
 
    * - :php:`MongoCollection::remove() `
-     - :phpmethod:`MongoDB\\Collection::deleteMany` and
-       :phpmethod:`MongoDB\\Collection::deleteOne`
+     - :phpmethod:`MongoDB\\Collection::deleteMany()` and
+       :phpmethod:`MongoDB\\Collection::deleteOne()`
 
    * - :php:`MongoCollection::save() `
-     - :phpmethod:`MongoDB\\Collection::insertOne` or
-       :phpmethod:`MongoDB\\Collection::replaceOne` with the ``upsert``
+     - :phpmethod:`MongoDB\\Collection::insertOne()` or
+       :phpmethod:`MongoDB\\Collection::replaceOne()` with the ``upsert``
        option.
 
    * - :php:`MongoCollection::setReadPreference() `
@@ -135,33 +134,32 @@ Old and New Methods
      - Not implemented.
 
    * - :php:`MongoCollection::setWriteConcern() `
-     - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions`
+     - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`
 
-   * - :php:`MongoCollection::update() `   
-     - :phpmethod:`MongoDB\\Collection::replaceOne`,
-       :phpmethod:`MongoDB\\Collection::updateMany`, and
-       :phpmethod:`MongoDB\\Collection::updateOne`.
+   * - :php:`MongoCollection::update() `
+     - :phpmethod:`MongoDB\\Collection::replaceOne()`,
+       :phpmethod:`MongoDB\\Collection::updateMany()`, and
+       :phpmethod:`MongoDB\\Collection::updateOne()`.
 
    * - :php:`MongoCollection::validate() `
      - Not implemented.
 
-A guiding principle in designing the new APIs was that explicit method
-names are preferable to overloaded terms found in the old API. For
-instance, :php:`MongoCollection::save() ` and
+A guiding principle in designing the new APIs was that explicit method names are
+preferable to overloaded terms found in the old API. For instance,
+:php:`MongoCollection::save() ` and
 :php:`MongoCollection::findAndModify() `
-have different modes of operation, depending on their arguments.
-Methods were also split to distinguish between :manual:`updating
-specific fields ` and :manual:`full-document
-replacement `.
+have different modes of operation, depending on their arguments. Methods were
+also split to distinguish between :manual:`updating specific fields
+` and :manual:`full-document replacement
+`.
 
 Group Command Helper
-~~~~~~~~~~~~~~~~~~~~
+--------------------
 
-:phpclass:`MongoDB\\Collection` does not
-yet have a helper method for the :manual:`group
-` command; however, it is planned in
-:issue:`PHPLIB-177`. The following example demonstrates how to execute
-a group command using the :phpmethod:`MongoDB\\Database::command()` method:
+:phpclass:`MongoDB\\Collection` does not yet have a helper method for the
+:manual:`group ` command; however, it is planned in
+:issue:`PHPLIB-177`. The following example demonstrates how to execute a group
+command using the :phpmethod:`MongoDB\\Database::command()` method:
 
 .. code-block:: php
 
@@ -180,13 +178,12 @@ a group command using the :phpmethod:`MongoDB\\Database::command()` method:
    $resultDocument = $cursor->toArray()[0];
 
 MapReduce Command Helper
-~~~~~~~~~~~~~~~~~~~~~~~~
+------------------------
 
-:phpclass:`MongoDB\\Collection` does not yet have a helper method for
-the :manual:`mapReduce ` command;
-however, that is planned in :issue:`PHPLIB-53`. The following example
-demonstrates how to execute a mapReduce command using the
-:phpmethod:`MongoDB\\Database::command()` method:
+:phpclass:`MongoDB\\Collection` does not yet have a helper method for the
+:manual:`mapReduce ` command; however, that is
+planned in :issue:`PHPLIB-53`. The following example demonstrates how to execute
+a mapReduce command using the :phpmethod:`MongoDB\\Database::command()` method:
 
 .. code-block:: php
 
@@ -201,58 +198,50 @@ demonstrates how to execute a mapReduce command using the
    ]);
    
    $resultDocument = $cursor->toArray()[0];
-   
-   ?>
 
 DBRef Helpers
-~~~~~~~~~~~~~
+-------------
 
-:phpclass:`MongoDB\\Collection` does not yet
-have helper methods for working with
-:manual:`DBRef `
-objects; however, that is planned in
-:issue:`PHPLIB-24`.
+:phpclass:`MongoDB\\Collection` does not yet have helper methods for working
+with :manual:`DBRef ` objects; however, that is
+planned in :issue:`PHPLIB-24`.
 
 MongoCollection::save() Removed
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-------------------------------
 
-:php:`MongoCollection::save() `,
-which was syntactic sugar for an insert or upsert operation, has been
-removed in favor of explicitly using
+:php:`MongoCollection::save() `, which was syntactic sugar
+for an insert or upsert operation, has been removed in favor of explicitly using
 :phpmethod:`MongoDB\\Collection::insertOne` or
-:phpmethod:`MongoDB\\Collection::replaceOne` with the ``upsert``
-option).
+:phpmethod:`MongoDB\\Collection::replaceOne` (with the ``upsert`` option).
 
-.. .. figure:: img/save-flowchart.png
+.. .. figure:: /images/save-flowchart.png
 ..    :alt: save() flowchart
 
-While the ``save``
-method does have its uses for interactive environments, such as the
-mongo shell, it was intentionally excluded from the
-`CRUD `_
-specification for language drivers. Generally, application code should
-know if the document has an identifier and be able to explicitly insert
-or replace the document and handle the returned InsertResult or
-UpdateResult, respectively. This also helps avoid inadvertent and
-potentially dangerous :manual:`full-document
-replacements `.
+While the ``save`` method does have its uses for interactive environments, such
+as the mongo shell, it was intentionally excluded from the `CRUD specification
+`_
+for language drivers. Generally, application code should know if the document
+has an identifier and be able to explicitly insert or replace the document and
+handle the returned :phpclass:`MongoDB\\InsertOneResult` or
+:phpclass:`MongoDB\\UpdateResult`, respectively. This also helps avoid
+inadvertent and potentially dangerous :manual:`full-document replacements
+`.
 
 Accessing IDs of Inserted Documents
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-In the legacy driver, :php:`MongoCollection::insert()
-`, :php:`MongoCollection::batchInsert()
-` (when inserting) would modify their input
-argument by injecting an ``_id`` key containing the generated ObjectId
-(i.e. :php:`MongoId ` object). This behavior was a bit
-of a hack, as it did not rely on the argument being :php:`passed by
-reference `; instead, it directly modified
-memory through the extension API and could not be implemented in PHP
-userland. As such, it is no longer done in the new driver and library.
+In the legacy driver, :php:`MongoCollection::insert() `,
+:php:`MongoCollection::batchInsert() ` (when inserting) would
+modify their input argument by injecting an ``_id`` key with a generated
+ObjectId (i.e. :php:`MongoId ` object). This behavior was a bit
+of a hack, as it did not rely on the argument being :php:`passed by reference
+`; instead, it directly modified memory through the
+extension API and could not be implemented in PHP userland. As such, it is no
+longer done in the new driver and library.
 
-IDs of inserted documents (whether generated or not) may be accessed
-through the result objects returned by the write methods:
+IDs of inserted documents (whether generated or not) may be accessed through the
+following methods on the write result objects:
 
 - :phpmethod:`MongoDB\\InsertOneResult::getInsertedId()` for
   :phpmethod:`MongoDB\\Collection::insertOne()`
@@ -261,13 +250,11 @@ through the result objects returned by the write methods:
 - :phpmethod:`MongoDB\\BulkWriteResult::getInsertedIds()` for
   :phpmethod:`MongoDB\\Collection::bulkWrite()`
 
-``MongoWriteBatch``
-~~~~~~~~~~~~~~~~~~~
+Bulk Write Operations
+---------------------
 
-The legacy driver's
-:php:`MongoWriteBatch `
-classes have been replaced with a general-purpose
-:phpmethod:`MongoDB\\Collection::bulkWrite` method. Whereas the
-legacy driver only allowed bulk operations of the same type, the new
-method allows operations to be mixed (e.g. inserts, updates, and
-deletes).
+The legacy driver's :php:`MongoWriteBatch ` classes have
+been replaced with a general-purpose
+:phpmethod:`MongoDB\\Collection::bulkWrite()` method. Whereas the legacy driver
+only allowed bulk operations of the same type, the new method allows operations
+to be mixed (e.g. inserts, updates, and deletes).

From 9267e8e464fd1f5f5402bc8268ea683137f96780 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 16 Nov 2016 17:28:23 -0500
Subject: [PATCH 061/321] Remove trailing slash from manual links

---
 source/reference/class/MongoDBGridFSBucket.txt       | 12 ++++++------
 .../reference/method/MongoDBCollection-aggregate.txt |  2 +-
 .../method/MongoDBDatabase-createCollection.txt      |  4 ++--
 source/tutorial/commands.txt                         |  6 +++---
 source/tutorial/gridfs.txt                           |  2 +-
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 4a7147ce..db9c85f1 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -15,12 +15,12 @@ Definition
 
 .. phpclass:: MongoDB\\GridFS\\Bucket
 
-   :manual:`GridFS ` is a specification for storing and
-   retrieving files in MongoDB. GridFS uses two collections to store files. One
-   collection stores the file chunks (e.g. ``fs.chunks``), and the other stores
-   file metadata (e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket`
-   class provides an interface around these collections for working with the
-   files as PHP :php:`Streams `.
+   :manual:`GridFS ` is a specification for storing and retrieving
+   files in MongoDB. GridFS uses two collections to store files. One collection
+   stores the file chunks (e.g. ``fs.chunks``), and the other stores file
+   metadata (e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket` class
+   provides an interface around these collections for working with the files as
+   PHP :php:`Streams `.
 
    You can construct a GridFS bucket using the driver's
    :php:`Manager ` class, or select a bucket from
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index 9a927ef7..a2fca721 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -16,7 +16,7 @@ Definition
 .. phpmethod:: MongoDB\\Collection::aggregate()
 
    Executes an :manual:`aggregation framework pipeline
-   ` operation on the collection.
+   ` operation on the collection.
 
    .. code-block:: php
 
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 632c06c0..e66c8c6a 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -25,7 +25,7 @@ Definition
    collection in a command, such as when inserting a document into a new
    collection. You may also explicitly create a collection with specific options
    using the :phpmethod:`MongoDB\\Database::createCollection()` method, or using
-   :manual:`db.createCollection() ` in
+   :manual:`db.createCollection() ` in
    the :program:`mongo` shell.
 
    Explicitly creating collections enables you to create
@@ -96,4 +96,4 @@ See Also
 
 - :manual:`create ` command reference in the MongoDB
   manual
-- :manual:`db.createCollection() `
+- :manual:`db.createCollection() `
diff --git a/source/tutorial/commands.txt b/source/tutorial/commands.txt
index f4d55d80..4b90501f 100644
--- a/source/tutorial/commands.txt
+++ b/source/tutorial/commands.txt
@@ -206,8 +206,8 @@ The output would then resemble::
 Commands with Custom Read Preference
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Some commands, such as :manual:`createUser `,
-may only be executed on a :term:`primary` replica set member or a
+Some commands, such as :manual:`createUser `, may
+only be executed on a :term:`primary` replica set member or a
 :term:`standalone`.
 
 The command helper methods in the |php-library|, such as
@@ -287,7 +287,7 @@ Iterate Results from a Cursor
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 Some commands, such as :manual:`listCollections
-`, return their results via an iterable
+`, return their results via an iterable
 cursor. To view the results, iterate through the cursor.
 
 The following example lists the collections in the ``demo`` database by
diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt
index a1f3a4ee..61070d86 100644
--- a/source/tutorial/gridfs.txt
+++ b/source/tutorial/gridfs.txt
@@ -10,7 +10,7 @@ GridFS
    :depth: 1
    :class: singlecol
 
-:manual:`GridFS ` is a specification for storing and retrieving
+:manual:`GridFS ` is a specification for storing and retrieving
 files in MongoDB. GridFS uses two collections to store files. One collection
 stores the file chunks (e.g. ``fs.chunks``), and the other stores file metadata
 (e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket` class provides an

From 18db1fe37a05aea9b800bb4906042475125977c4 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 16 Nov 2016 17:49:54 -0500
Subject: [PATCH 062/321] Note that $uriOptions need not be encoded

---
 .../includes/apiargs-MongoDBClient-method-construct-param.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
index 8bd8bee6..9947cadb 100644
--- a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
@@ -25,7 +25,8 @@ type: array
 description: |
   Specifies additional URI options, such as authentication credentials or query
   string parameters. The options specified in ``$uriOptions`` take precedence
-  over any analogous options present in the ``$uri`` string.
+  over any analogous options present in the ``$uri`` string and do not need to
+  be encoded according to `RFC 3986 `_.
 
   Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
   ` extension reference and :manual:`MongoDB

From 9f6104489885100ddd195f7b58c8919edef043dc Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 16 Nov 2016 17:50:30 -0500
Subject: [PATCH 063/321] DOCS-8719: MongoDB\Client example for SSL and auth

---
 .../method/MongoDBClient__construct.txt       | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index d481e27a..50c1fc91 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -39,6 +39,9 @@ Errors/Exceptions
 Examples
 --------
 
+Connecting to a Replica Set
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 If you do not specify a ``$uri`` value, the driver connects to a standalone
 :program:`mongod` on ``127.0.0.1`` via port ``27017``. The following example
 demonstrates how to connect to a replica set with a custom read preference:
@@ -54,6 +57,48 @@ demonstrates how to connect to a replica set with a custom read preference:
        ]
    );
 
+Connecting with SSL and Authentication
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following example demonstrates how to connect to a MongoDB replica set with
+SSL and authentication, as is used for `MongoDB Atlas
+`_:
+
+.. code-block:: php
+
+    'myUsername',
+           'password' => 'myPassword',
+           'ssl' => true,
+           'replicaSet' => 'myReplicaSet',
+           'authSource' => 'admin',
+       ],
+   );
+
+The driver supports additional :php:`SSL options
+`,
+which may be specified in the constructor's ``$driverOptions`` parameter. Those
+options are covered in the :php:`MongoDB\\Driver\\Manager::__construct()
+` documentation.
+
+Specifying a Custom Type Map
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 By default, the |php-library| deserializes BSON documents and arrays
 as :phpclass:`MongoDB\\Model\\BSONDocument` and
 :phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The following

From c27a2e0f948ac4cad12b663afd818a93a4b8f0c9 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 17 Nov 2016 12:00:44 -0500
Subject: [PATCH 064/321] Refer to connection string manual page in Client
 constructor

---
 .../apiargs-MongoDBClient-method-construct-param.yaml         | 4 ++--
 source/reference/method/MongoDBClient__construct.txt          | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
index 9947cadb..4b6ff420 100644
--- a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
@@ -3,8 +3,8 @@ name: $uri
 type: string
 description: |
   The URI of the standalone, replica set, or sharded cluster to which to
-  connect. Refer to the :manual:`MongoDB connection string reference
-  ` for formatting.
+  connect. Refer to :manual:`Connection String URI Format
+  ` in the MongoDB manual for more information.
 
   Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified.
 
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index 50c1fc91..ed80cde6 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -126,3 +126,5 @@ See Also
 
 - :php:`MongoDB\\Driver\\Manager::__construct()
   `
+- :manual:`Connection String URI Format ` in the
+  MongoDB manual

From 8398bf25ccd98193c8ef60fe68a784149e939ebe Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 30 Nov 2016 19:13:00 +0100
Subject: [PATCH 065/321] PHPLIB-232: Support typeMap option on GridFS Bucket

---
 ...gs-MongoDBDatabase-method-selectGridFSBucket-option.yaml | 6 ++++++
 ...apiargs-MongoDBGridFSBucket-method-construct-option.yaml | 4 ++++
 .../reference/method/MongoDBDatabase-selectGridFSBucket.txt | 4 ++--
 .../method/MongoDBGridFSBucket-getFileDocumentForStream.txt | 5 +++--
 .../method/MongoDBGridFSBucket-getFileIdForStream.txt       | 4 ++--
 5 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
index 999b2c1f..294bf6b6 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
@@ -31,6 +31,12 @@ replacement:
   resource: "bucket"
   parent: "database"
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: typeMap
+replacement:
+  parent: "database"
+---
 source:
   file: apiargs-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
index 999b2c1f..30be1b5d 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
@@ -31,6 +31,10 @@ replacement:
   resource: "bucket"
   parent: "database"
 ---
+source:
+  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
+  ref: typeMap
+---
 source:
   file: apiargs-common-option.yaml
   ref: writeConcern
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index 188e24e2..e3b3dfb8 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -42,8 +42,8 @@ Errors/Exceptions
 Behavior
 --------
 
-The selected bucket inherits options such as read preference and write concern
-from the :phpclass:`Database ` object. Options may be
+The selected bucket inherits options such as read preference and type
+mapping from the :phpclass:`Database ` object. Options may be
 overridden via the ``$options`` parameter.
 
 Example
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index f74002e8..0eb45461 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function getFileDocumentForStream($stream): object
+      function getFileDocumentForStream($stream): array|object
 
    This method has the following parameters:
 
@@ -28,7 +28,8 @@ Definition
 Return Values
 -------------
 
-The metadata document associated with the GridFS stream.
+The metadata document associated with the GridFS stream. The return type will
+depend on the bucket's ``typeMap`` option.
 
 .. todo: add examples
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index ca852887..e49b29e9 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -28,8 +28,8 @@ Definition
 Return Values
 -------------
 
-The ``_id`` field of the metadata document associated with the GridFS
-stream.
+The ``_id`` field of the metadata document associated with the GridFS stream.
+The return type will depend on the bucket's ``typeMap`` option.
 
 .. todo: add examples
 

From 7bac0a5e50ebce6d27afc348398f006f3fef7749 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 30 Nov 2016 19:46:11 +0100
Subject: [PATCH 066/321] PHPLIB-238: Implement Bucket::findOne() method

---
 ...oDBGridFSBucket-method-findOne-option.yaml | 42 +++++++++++++++++
 .../reference/class/MongoDBGridFSBucket.txt   |  1 +
 .../method/MongoDBGridFSBucket-find.txt       |  1 +
 .../method/MongoDBGridFSBucket-findOne.txt    | 46 +++++++++++++++++++
 4 files changed, 90 insertions(+)
 create mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
 create mode 100644 source/reference/method/MongoDBGridFSBucket-findOne.txt

diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
new file mode 100644
index 00000000..25a9dc1d
--- /dev/null
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
@@ -0,0 +1,42 @@
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: projection
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: sort
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: skip
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: comment
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: maxTimeMS
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: readConcern
+---
+source:
+  file: apiargs-MongoDBGridFSBucket-method-find-option.yaml
+  ref: readPreference
+---
+source:
+  file: apiargs-MongoDBGridFSBucket-method-find-option.yaml
+  ref: typeMap
+post: |
+  This will be used for the returned result document.
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: modifiers
+...
diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index db9c85f1..1f797018 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -40,6 +40,7 @@ Methods
    /reference/method/MongoDBGridFSBucket-downloadToStreamByName
    /reference/method/MongoDBGridFSBucket-drop
    /reference/method/MongoDBGridFSBucket-find
+   /reference/method/MongoDBGridFSBucket-findOne
    /reference/method/MongoDBGridFSBucket-getBucketName
    /reference/method/MongoDBGridFSBucket-getDatabaseName
    /reference/method/MongoDBGridFSBucket-getFileDocumentForStream
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index 82a6828f..eb1ac158 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -40,3 +40,4 @@ See Also
 --------
 
 - :phpmethod:`MongoDB\\Collection::find()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::findOne()`
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
new file mode 100644
index 00000000..ee849756
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -0,0 +1,46 @@
+==================================
+MongoDB\\GridFS\\Bucket::findOne()
+==================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::findOne()
+
+   Finds a single document from the GridFS bucket's files collection matching
+   the query.
+
+   .. code-block:: php
+
+      function findOne($filter = [], array $options = []): array|object|null
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-findOne-option.rst
+
+Return Values
+-------------
+
+An array or object for the :term:`first document ` that matched
+the query, or ``null`` if no document matched the query. The return type will
+depend on the ``typeMap`` option.
+
+.. todo: add examples
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::findOne()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::find()`

From f6dce8c76e34782797f930c3b231c81b48d7bf27 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 30 Nov 2016 19:46:31 +0100
Subject: [PATCH 067/321] Remove duplicate word from Collection::findOne() docs

---
 source/reference/method/MongoDBCollection-findOne.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index 6819141b..ea6379ec 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -32,9 +32,9 @@ Definition
 Return Values
 -------------
 
-An array or object for the :term:`first document ` document that
-matched the query, or ``null`` if no document matched the query. The return type
-will depend on the ``typeMap`` option.
+An array or object for the :term:`first document ` that matched
+the query, or ``null`` if no document matched the query. The return type will
+depend on the ``typeMap`` option.
 
 Errors/Exceptions
 -----------------

From f39cebaa3aa835d9df6ab8b54e6732dede391416 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 1 Dec 2016 13:57:37 +0100
Subject: [PATCH 068/321] PHPLIB-240: FindAndModify should throw for
 unsupported write concern

This reverts the logic in 21b7d92aef4def00abade10911bae41f1b5ea378, which was to ignore an unsupported write concern for the duration of 1.x. Since the Collection helper methods do not supply a default write concern option if it is not supported, this change will only affect users that were explicitly passing a write concern and relying on the library to ignore it.

While a minor BC break, this changes makes findAndModify consistent with other write commands.
---
 ...args-MongoDBCollection-method-findOneAndDelete-option.yaml | 4 ++--
 ...rgs-MongoDBCollection-method-findOneAndReplace-option.yaml | 4 ++--
 ...args-MongoDBCollection-method-findOneAndUpdate-option.yaml | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
index 066a4714..319022d2 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
@@ -18,6 +18,6 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
 post: |
-  This is not supported for server versions prior to 3.2 and will be ignored if
-  used.
+  This is not supported for server versions prior to 3.2 and will result in an
+  exception at execution time if used.
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
index 8dd5745a..e0b02de8 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
@@ -39,6 +39,6 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
 post: |
-  This is not supported for server versions prior to 3.2 and will be ignored if
-  used.
+  This is not supported for server versions prior to 3.2 and will result in an
+  exception at execution time if used.
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
index 4da7703f..e5f89dc1 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
@@ -39,6 +39,6 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
 post: |
-  This is not supported for server versions prior to 3.2 and will be ignored if
-  used.
+  This is not supported for server versions prior to 3.2 and will result in an
+  exception at execution time if used.
 ...

From 9c79c38c2013301e64245fb6c684ee7e13a814ad Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 1 Dec 2016 16:29:26 +0100
Subject: [PATCH 069/321] PHPLIB-229: Operations should not accept unsupported
 read concern options

---
 source/includes/apiargs-MongoDBCollection-common-option.yaml | 3 +++
 source/includes/extracts-error.yaml                          | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
index 559c138b..4763a3d9 100644
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-common-option.yaml
@@ -36,6 +36,9 @@ type: :php:`MongoDB\\Driver\\ReadConcern `
 description: |
    :manual:`Read concern ` to use for the operation.
    Defaults to the collection's read concern.
+
+   This is not supported for server versions prior to 3.2 and will result in an
+   exception at execution time if used.
 interface: phpmethod
 operation: ~
 optional: true
diff --git a/source/includes/extracts-error.yaml b/source/includes/extracts-error.yaml
index 9bf6fedf..cf69f2a4 100644
--- a/source/includes/extracts-error.yaml
+++ b/source/includes/extracts-error.yaml
@@ -29,5 +29,6 @@ content: |
 ref: error-unsupportedexception
 content: |
   :phpclass:`MongoDB\\Exception\\UnsupportedException` if options are used and
-  not supported by the selected server (e.g. ``collation``, ``writeConcern``).
+  not supported by the selected server (e.g. ``collation``, ``readConcern``,
+  ``writeConcern``).
 ...

From e0bd5368dbacc7e6ee5e9a7f305d18ad41cf2c84 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 1 Dec 2016 17:22:28 +0100
Subject: [PATCH 070/321] PHPLIB-221: Document GridFS exceptions

---
 source/includes/extracts-error.yaml           | 10 ++++++
 source/reference/exception-classes.txt        | 31 +++++++++++++++++++
 .../method/MongoDBGridFSBucket-delete.txt     |  6 ++++
 .../MongoDBGridFSBucket-downloadToStream.txt  |  7 +++++
 ...oDBGridFSBucket-downloadToStreamByName.txt |  7 +++++
 .../method/MongoDBGridFSBucket-drop.txt       |  5 +++
 .../method/MongoDBGridFSBucket-find.txt       |  7 +++++
 .../method/MongoDBGridFSBucket-findOne.txt    |  7 +++++
 ...BGridFSBucket-getFileDocumentForStream.txt |  6 ++++
 ...MongoDBGridFSBucket-getFileIdForStream.txt |  7 +++++
 ...MongoDBGridFSBucket-openDownloadStream.txt |  6 ++++
 ...BGridFSBucket-openDownloadStreamByName.txt |  6 ++++
 .../method/MongoDBGridFSBucket-rename.txt     |  6 ++++
 .../MongoDBGridFSBucket-uploadFromStream.txt  |  6 ++++
 .../method/MongoDBGridFSBucket__construct.txt |  5 +++
 15 files changed, 122 insertions(+)

diff --git a/source/includes/extracts-error.yaml b/source/includes/extracts-error.yaml
index cf69f2a4..a0877389 100644
--- a/source/includes/extracts-error.yaml
+++ b/source/includes/extracts-error.yaml
@@ -31,4 +31,14 @@ content: |
   :phpclass:`MongoDB\\Exception\\UnsupportedException` if options are used and
   not supported by the selected server (e.g. ``collation``, ``readConcern``,
   ``writeConcern``).
+---
+ref: error-gridfs-filenotfoundexception
+content: |
+  :phpclass:`MongoDB\\GridFS\\Exception\\FileNotFoundException` if no file was
+  found for the selection criteria.
+---
+ref: error-gridfs-corruptfileexception
+content: |
+  :phpclass:`MongoDB\\GridFS\\Exception\\CorruptFileException` if the file's
+  metadata or chunk documents contain unexpected or invalid data.
 ...
diff --git a/source/reference/exception-classes.txt b/source/reference/exception-classes.txt
index 364c2ac5..decbf84a 100644
--- a/source/reference/exception-classes.txt
+++ b/source/reference/exception-classes.txt
@@ -89,6 +89,37 @@ MongoDB\\Exception\\UnsupportedException
 
 ----
 
+MongoDB\\GridFS\\Exception\\CorruptFileException
+----------------------------------------
+
+.. phpclass:: MongoDB\\GridFS\\Exception\\CorruptFileException
+
+   This exception is thrown if a GridFS file's metadata or chunk documents
+   contain unexpected or invalid data.
+
+   When selecting a GridFS file, this may be thrown if a metadata field has an
+   incorrect type or its value is out of range (e.g. negative ``length``). When
+   reading a GridFS file, this may be thrown if a chunk's index is out of
+   sequence or its binary data's length out of range.
+
+   This class extends the library's :phpclass:`RuntimeException
+   ` class.
+
+----
+
+MongoDB\\GridFS\\Exception\\FileNotFoundException
+----------------------------------------
+
+.. phpclass:: MongoDB\\GridFS\\Exception\\FileNotFoundException
+
+   This exception is thrown if no GridFS file was found for the selection
+   criteria (e.g. ``id``, ``filename``).
+
+   This class extends the library's :phpclass:`RuntimeException
+   ` class.
+
+----
+
 MongoDB\\Exception\\Exception
 -----------------------------
 
diff --git a/source/reference/method/MongoDBGridFSBucket-delete.txt b/source/reference/method/MongoDBGridFSBucket-delete.txt
index 5f3cde2b..6e4eeac5 100644
--- a/source/reference/method/MongoDBGridFSBucket-delete.txt
+++ b/source/reference/method/MongoDBGridFSBucket-delete.txt
@@ -25,6 +25,12 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-delete-param.rst
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 Behavior
 --------
 
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
index 2cc91f61..62009501 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
@@ -28,6 +28,13 @@ Definition
 
 .. todo: add examples
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index 92602db8..0fd2c8f2 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -32,6 +32,13 @@ Definition
 
 .. todo: add examples
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBGridFSBucket-drop.txt b/source/reference/method/MongoDBGridFSBucket-drop.txt
index 6ec90561..a6730fc8 100644
--- a/source/reference/method/MongoDBGridFSBucket-drop.txt
+++ b/source/reference/method/MongoDBGridFSBucket-drop.txt
@@ -21,4 +21,9 @@ Definition
 
       function drop(): void
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. todo: add examples
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index eb1ac158..da46ecc1 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -34,6 +34,13 @@ Return Values
 
 A :php:`MongoDB\\Driver\\Cursor ` object.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. todo: add examples
 
 See Also
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
index ee849756..0eafeac2 100644
--- a/source/reference/method/MongoDBGridFSBucket-findOne.txt
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -37,6 +37,13 @@ An array or object for the :term:`first document ` that matched
 the query, or ``null`` if no document matched the query. The return type will
 depend on the ``typeMap`` option.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. todo: add examples
 
 See Also
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index 0eb45461..faa58913 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -31,6 +31,12 @@ Return Values
 The metadata document associated with the GridFS stream. The return type will
 depend on the bucket's ``typeMap`` option.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. todo: add examples
 
 See Also
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index e49b29e9..b7ef9964 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -31,6 +31,13 @@ Return Values
 The ``_id`` field of the metadata document associated with the GridFS stream.
 The return type will depend on the bucket's ``typeMap`` option.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-gridfs-corruptfileexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. todo: add examples
 
 See Also
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
index aca4416a..69f6d54f 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -30,6 +30,12 @@ Return Values
 
 A readable stream resource.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. todo: add examples
 
 See Also
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
index 9712e7d3..b4976852 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -34,6 +34,12 @@ Return Values
 
 A readable stream resource.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. todo: add examples
 
 See Also
diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt
index 3815ee0c..77fd899e 100644
--- a/source/reference/method/MongoDBGridFSBucket-rename.txt
+++ b/source/reference/method/MongoDBGridFSBucket-rename.txt
@@ -25,4 +25,10 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-rename-param.rst
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. todo: add examples
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index 46f63f6d..f1c47f12 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -37,6 +37,12 @@ GridFS file. If the ``_id`` option is not specified, a new
 :php:`MongoDB\\BSON\\ObjectID ` object will be used
 by default.
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
 .. todo: add examples
 
 See Also
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index 6553c255..d6c29373 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -29,6 +29,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-option.rst
 
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
 Behavior
 --------
 

From ac79d00f461ce7988897ee980e4888754f0e1f74 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 1 Dec 2016 17:24:26 +0100
Subject: [PATCH 071/321] UnsupportedException already implements Exception via
 RuntimeException

---
 source/reference/exception-classes.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/source/reference/exception-classes.txt b/source/reference/exception-classes.txt
index decbf84a..4a315ae2 100644
--- a/source/reference/exception-classes.txt
+++ b/source/reference/exception-classes.txt
@@ -77,8 +77,7 @@ MongoDB\\Exception\\UnsupportedException
    unintended document being deleted.
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class and implements the
-   library's :phpclass:`Exception ` interface.
+   ` class.
 
    .. note::
 

From b863ddce53a61f49ab14a190dd67753d01628def Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 1 Dec 2016 17:52:33 +0100
Subject: [PATCH 072/321] Fix underline lengths in documentation headers

---
 source/reference/exception-classes.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/reference/exception-classes.txt b/source/reference/exception-classes.txt
index 4a315ae2..289e4ffa 100644
--- a/source/reference/exception-classes.txt
+++ b/source/reference/exception-classes.txt
@@ -89,7 +89,7 @@ MongoDB\\Exception\\UnsupportedException
 ----
 
 MongoDB\\GridFS\\Exception\\CorruptFileException
-----------------------------------------
+------------------------------------------------
 
 .. phpclass:: MongoDB\\GridFS\\Exception\\CorruptFileException
 
@@ -107,7 +107,7 @@ MongoDB\\GridFS\\Exception\\CorruptFileException
 ----
 
 MongoDB\\GridFS\\Exception\\FileNotFoundException
-----------------------------------------
+-------------------------------------------------
 
 .. phpclass:: MongoDB\\GridFS\\Exception\\FileNotFoundException
 

From 3b9c272ceb08d980ec1d2c40d7fb9187bc428aba Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 5 Dec 2016 08:28:58 -0500
Subject: [PATCH 073/321] PHPLIB-112: Support typeMap option for findAndModify
 operations

---
 ...ection-method-findOneAndDelete-option.yaml |  6 ++++++
 ...ction-method-findOneAndReplace-option.yaml |  6 ++++++
 ...ection-method-findOneAndUpdate-option.yaml |  6 ++++++
 .../extracts-bson-deserialization-base.yaml   | 12 -----------
 .../extracts-bson-deserialization.yaml        | 21 -------------------
 .../MongoDBCollection-findOneAndDelete.txt    |  6 ++----
 .../MongoDBCollection-findOneAndReplace.txt   |  7 +++----
 .../MongoDBCollection-findOneAndUpdate.txt    |  7 +++----
 8 files changed, 26 insertions(+), 45 deletions(-)
 delete mode 100644 source/includes/extracts-bson-deserialization-base.yaml
 delete mode 100644 source/includes/extracts-bson-deserialization.yaml

diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
index 319022d2..b7d4deaf 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
@@ -14,6 +14,12 @@ source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
 ---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: typeMap
+post: |
+  This will be used for the returned result document.
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
index e0b02de8..24743d29 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
@@ -31,6 +31,12 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: typeMap
+post: |
+  This will be used for the returned result document.
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: upsert
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
index e5f89dc1..dcec8aa9 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
@@ -31,6 +31,12 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: typeMap
+post: |
+  This will be used for the returned result document.
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: upsert
diff --git a/source/includes/extracts-bson-deserialization-base.yaml b/source/includes/extracts-bson-deserialization-base.yaml
deleted file mode 100644
index 26712a37..00000000
--- a/source/includes/extracts-bson-deserialization-base.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-ref: _bson-deserialization
-content: |
-  .. note::
-
-      {{method}} does not yet support a ``typeMap`` option for BSON
-      deserialization of the returned document.
-
-      Classes implementing
-      :php:`MongoDB\\BSON\\Persistable `
-      are deserialized according to the :php:`persistance
-      ` specification.
-...
diff --git a/source/includes/extracts-bson-deserialization.yaml b/source/includes/extracts-bson-deserialization.yaml
deleted file mode 100644
index 6b665352..00000000
--- a/source/includes/extracts-bson-deserialization.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-ref: bson-deserialization-findOneAndDelete
-source:
-  file: extracts-bson-deserialization-base.yaml
-  ref: _bson-deserialization
-replacement:
-  method: ":phpmethod:`MongoDB\\Collection::findOneAndDelete()`"
----
-ref: bson-deserialization-findOneAndReplace
-source:
-  file: extracts-bson-deserialization-base.yaml
-  ref: _bson-deserialization
-replacement:
-  method: ":phpmethod:`MongoDB\\Collection::findOneAndReplace()`"
----
-ref: bson-deserialization-findOneAndUpdate
-source:
-  file: extracts-bson-deserialization-base.yaml
-  ref: _bson-deserialization
-replacement:
-  method: ":phpmethod:`MongoDB\\Collection::findOneAndUpdate()`"
-...
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index 86dda4c1..7bd8e712 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -29,13 +29,11 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-option.rst
 
-   .. include:: /includes/extracts/bson-deserialization-findOneAndDelete.rst
-
 Return Values
 -------------
 
-An object for the document that was deleted, or ``null`` if no document matched
-the query.
+An array or object for the document that was deleted, or ``null`` if no document
+matched the query. The return type will depend on the ``typeMap`` option.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index abe44ed3..0e0b7a33 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -29,14 +29,13 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-option.rst
 
-   .. include:: /includes/extracts/bson-deserialization-findOneAndReplace.rst
-
 Return Values
 -------------
 
-An object for either the original or the replaced document, depending on the
-specified value of the ``returnDocument`` option. By default, the original
+An array object for either the original or the replaced document, depending on
+the specified value of the ``returnDocument`` option. By default, the original
 document is returned. If no document matched the query, ``null`` is returned.
+The return type will depend on the ``typeMap`` option.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index 6a89c1a8..5d5979a1 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -29,14 +29,13 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-option.rst
 
-   .. include:: /includes/extracts/bson-deserialization-findOneAndUpdate.rst
-
 Return Values
 -------------
 
-An object for either the original or the updated document, depending on the
-specified value of the ``returnDocument`` option. By default, the original
+An array or object for either the original or the updated document, depending on
+the specified value of the ``returnDocument`` option. By default, the original
 document is returned. If no document matched the query, ``null`` is returned.
+The return type will depend on the ``typeMap`` option.
 
 Errors/Exceptions
 -----------------

From 5518dc9bf338cf0b27aa4fcfaac14a1c7830d128 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 5 Dec 2016 12:28:42 -0500
Subject: [PATCH 074/321] PHPLIB-112: Support typeMap option for non-cursor
 aggregate operations

---
 ...apiargs-MongoDBCollection-method-aggregate-option.yaml | 5 -----
 source/reference/method/MongoDBCollection-aggregate.txt   | 8 --------
 2 files changed, 13 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 9779a9eb..4d353bfd 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -49,11 +49,6 @@ source:
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
-post: |
-  .. note::
-
-     This is not supported for inline aggregation results (i.e. ``useCursor``
-     option is ``false`` or the server version is < 2.6).
 ---
 arg_name: option
 name: useCursor
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index a2fca721..6d092181 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -58,14 +58,6 @@ MongoDB server version and whether the ``useCursor`` option is specified. If
 ``result`` array from the command response document. In both cases, the return
 value will be :php:`Traversable `.
 
-.. note::
-
-   BSON deserialization of inline aggregation results (i.e. not using a command
-   cursor) does not yet support a ``typeMap`` option. Classes implementing
-   :php:`MongoDB\\BSON\\Persistable ` will still be
-   deserialized according to the
-   :php:`Persistence ` specification.
-
 .. todo: add examples
 
 See Also

From a4817365a876f279ac2625b4929a3f76f118cc06 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 19 Dec 2016 15:01:54 -0500
Subject: [PATCH 075/321] Remove library version from Composer install examples

By default, Composer installs the most recent stable version and declares a requirement with the caret operator (allowing any newer versions up to but not including the next major version).
---
 source/tutorial/install-php-library.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/tutorial/install-php-library.txt b/source/tutorial/install-php-library.txt
index 39f57246..74cf0e46 100644
--- a/source/tutorial/install-php-library.txt
+++ b/source/tutorial/install-php-library.txt
@@ -33,7 +33,7 @@ root:
 
 .. code-block:: sh
 
-   composer require "mongodb/mongodb=^1.0.0"
+   composer require mongodb/mongodb
 
 While not recommended, you may also manually install the package via
 the source tarballs attached to the `GitHub releases

From a07972bbc39f2f351d99b9c271841de2b094ffa5 Mon Sep 17 00:00:00 2001
From: Allison Moore 
Date: Tue, 17 Jan 2017 13:51:21 -0500
Subject: [PATCH 076/321] DOCS-9174: direct users to PHP.net for extension
 installation

---
 source/tutorial/install-php-library.txt | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/source/tutorial/install-php-library.txt b/source/tutorial/install-php-library.txt
index 74cf0e46..0c4098a0 100644
--- a/source/tutorial/install-php-library.txt
+++ b/source/tutorial/install-php-library.txt
@@ -7,19 +7,13 @@ Install the |php-library|
 Prerequisites
 -------------
 
-The MongoDB PHP Library is a high-level abstraction for the
-MongoDB PHP driver. As such, you must install the `mongodb`
-extension to use the |php-library|:
+The |php-library| is a high-level abstraction for the MongoDB PHP driver. As
+such, you must install the `mongodb` extension to use the library.
 
-.. code-block:: sh
-
-   pecl install mongodb
-   echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
-
-Instructions for installing the `mongodb` extension on HHVM may be
-found in the :php:`Installation with HHVM
-` article
-in the driver documentation.
+:php:`Installing the MongoDB PHP Driver `
+describes how to install the `mongodb` extension for PHP. Instructions for
+installing the driver for HHVM may be found in the :php:`Installation with HHVM
+` article.
 
 Procedure
 ---------

From f90750831bf2206211d87cabae81e6823c68c081 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 17 Jan 2017 14:58:40 -0500
Subject: [PATCH 077/321] Use lowercase when referring to library and driver

---
 source/index.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/source/index.txt b/source/index.txt
index e4b61328..6c3a9740 100644
--- a/source/index.txt
+++ b/source/index.txt
@@ -5,7 +5,7 @@ MongoDB PHP Library
 .. default-domain:: mongodb
 
 The |php-library| provides a high-level abstraction around the lower-level
-`PHP Driver `_, also known as the ``mongodb``
+`PHP driver `_, also known as the ``mongodb``
 extension.
 
 While the ``mongodb`` extension provides a limited API for executing commands,
@@ -18,11 +18,11 @@ collection management.
 If you are developing a PHP application with MongoDB, you should consider using
 this library, or another high-level abstraction, instead of the extension alone.
 
-For additional information about the MongoDB PHP Library and the ``mongodb``
-extension, see the `Architecture Overview
-`_ article in the extension
-documentation. `Derick Rethans `_ has also written a
-series of blog posts entitled *New MongoDB Drivers for PHP and HHVM*:
+For additional information about this library and the ``mongodb`` extension, see
+the `Architecture Overview `_
+article in the extension documentation. `Derick Rethans
+`_ has also written a series of blog posts entitled
+*New MongoDB Drivers for PHP and HHVM*:
 
 - `Part One: History `_
 

From 64c1532f3b8cf492f7503ed64a8dd97a9c8d1f8d Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 25 Jan 2017 15:43:10 -0500
Subject: [PATCH 078/321] Fix manual link in collation option snippet

---
 source/includes/apiargs-MongoDBCollection-common-option.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
index 4763a3d9..28844672 100644
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-common-option.yaml
@@ -17,7 +17,7 @@ description: |
    and accent marks. When specifying collation, the ``locale`` field is
    mandatory; all other collation fields are optional. For descriptions of the
    fields, see :manual:`Collation Document
-   `.
+   `.
 
    If the collation is unspecified but the collection has a default collation,
    the operation uses the collation specified for the collection. If no

From a1b98d9dccd3b2ba7946e7a159b5bf11a1ef09cc Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 25 Jan 2017 15:58:08 -0500
Subject: [PATCH 079/321] PHPLIB-208: Remind users about BSON comparison
 behavior

---
 source/includes/extracts-note.yaml                   | 12 ++++++++++++
 source/reference/method/MongoDBCollection-count.txt  |  5 +++++
 .../method/MongoDBCollection-deleteMany.txt          |  5 +++++
 .../reference/method/MongoDBCollection-deleteOne.txt |  5 +++++
 .../reference/method/MongoDBCollection-distinct.txt  |  5 +++++
 source/reference/method/MongoDBCollection-find.txt   |  5 +++++
 .../reference/method/MongoDBCollection-findOne.txt   |  5 +++++
 .../method/MongoDBCollection-findOneAndDelete.txt    |  5 +++++
 .../method/MongoDBCollection-findOneAndReplace.txt   |  5 +++++
 .../method/MongoDBCollection-findOneAndUpdate.txt    |  5 +++++
 .../method/MongoDBCollection-replaceOne.txt          |  5 +++++
 .../method/MongoDBCollection-updateMany.txt          |  5 +++++
 .../reference/method/MongoDBCollection-updateOne.txt |  5 +++++
 source/reference/method/MongoDBGridFSBucket-find.txt |  5 +++++
 .../reference/method/MongoDBGridFSBucket-findOne.txt |  5 +++++
 source/tutorial/crud.txt                             | 12 ++++++++++++
 16 files changed, 94 insertions(+)
 create mode 100644 source/includes/extracts-note.yaml

diff --git a/source/includes/extracts-note.yaml b/source/includes/extracts-note.yaml
new file mode 100644
index 00000000..05caf35e
--- /dev/null
+++ b/source/includes/extracts-note.yaml
@@ -0,0 +1,12 @@
+ref: note-bson-comparison
+content: |
+  When evaluating query criteria, MongoDB compares types and values according to
+  its own :manual:`comparison rules for BSON types
+  `, which differs from PHP's
+  :php:`comparison ` and :php:`type juggling
+  ` rules. When matching a special
+  BSON type the query criteria should use the respective :php:`BSON class
+  ` in the driver (e.g. use
+  :php:`MongoDB\\BSON\\ObjectID ` to match an
+  :manual:`ObjectId `).
+...
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index ddc1fb1f..396ba25f 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -42,6 +42,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 .. todo: add output and examples
 
 See Also
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index a961d91a..5980b644 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -42,6 +42,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index d2db9596..2da2ccbd 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -44,6 +44,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index e7af2ee6..b35343ee 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -42,6 +42,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index c59f1729..6b1bc2c4 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -41,6 +41,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index ea6379ec..07da2d09 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -43,6 +43,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index 7bd8e712..dddde0ea 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -43,6 +43,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 0e0b7a33..b48417c2 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -45,6 +45,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index 5d5979a1..b3c58327 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -45,6 +45,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index b013ad17..807ac32f 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -44,6 +44,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index c4f277bb..d0b04302 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -42,6 +42,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index 7cf1d0fe..929fc770 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -44,6 +44,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index da46ecc1..8f40253e 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -41,6 +41,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 .. todo: add examples
 
 See Also
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
index 0eafeac2..f07a6134 100644
--- a/source/reference/method/MongoDBGridFSBucket-findOne.txt
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -44,6 +44,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 .. todo: add examples
 
 See Also
diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index cc026dd6..68bb670f 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -92,6 +92,8 @@ The |php-library| provides the :phpmethod:`MongoDB\\Collection::findOne()` and
 :phpmethod:`MongoDB\\Collection::aggregate()` method for performing
 :manual:`aggregation operations `.
 
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 Find One Document
 ~~~~~~~~~~~~~~~~~
 
@@ -137,6 +139,16 @@ The output would then resemble::
      }
    }
 
+.. note::
+
+   The criteria in this example matched an ``_id`` with a string value of
+   ``"94301"``. The same criteria would not have matched a document with an
+   integer value of ``94301`` due to MongoDB's :manual:`comparison rules for
+   BSON types `. Similarly, users should
+   use a :php:`MongoDB\\BSON\\ObjectID ` object
+   when matching an ``_id`` with an :manual:`ObjectId `
+   value, as strings and ObjectIds are not directly comparable.
+
 .. seealso:: :phpmethod:`MongoDB\\Collection::findOne()`
 
 Find Many Documents

From 2d1cbc7ac7e6f6d3fefb95454ab82babd78c718d Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 26 Jan 2017 14:08:39 -0500
Subject: [PATCH 080/321] PHPLIB-218: Tutorial for Decimal128

---
 source/tutorial.txt            |   1 +
 source/tutorial/decimal128.txt | 124 +++++++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+)
 create mode 100644 source/tutorial/decimal128.txt

diff --git a/source/tutorial.txt b/source/tutorial.txt
index a1a6f8a6..bb77bf59 100644
--- a/source/tutorial.txt
+++ b/source/tutorial.txt
@@ -7,6 +7,7 @@ Tutorials
 
    /tutorial/crud
    /tutorial/commands
+   /tutorial/decimal128
    /tutorial/gridfs
    /tutorial/indexes
    /tutorial/example-data
diff --git a/source/tutorial/decimal128.txt b/source/tutorial/decimal128.txt
new file mode 100644
index 00000000..03272a8c
--- /dev/null
+++ b/source/tutorial/decimal128.txt
@@ -0,0 +1,124 @@
+==========
+Decimal128
+==========
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 2
+   :class: singlecol
+
+Overview
+--------
+
+MongoDB 3.4 introduced support for a :manual:`Decimal128 BSON type
+`, which is a 128-bit decimal-based
+floating-point value capable of emulating decimal rounding with exact precision.
+This functionality is intended for applications that handle :manual:`monetary
+data `, such as financial and tax computations.
+
+The :php:`MongoDB\BSON\Decimal128 ` class, which was
+introduced in :php:`PHP driver ` 1.2.0, may be used to work with this
+type in PHP.
+
+Working with Decimal128 Values
+------------------------------
+
+Inserting a Decimal128
+~~~~~~~~~~~~~~~~~~~~~~
+
+The following example inserts a value of type ``Decimal128`` into the ``price``
+field of a collection named ``inventory``:
+
+.. code-block:: php
+
+   demo->inventory;
+
+   $collection->insertOne([
+       '_id' => 1,
+       'item' => '26-inch monitor',
+       'price' => new MongoDB\BSON\Decimal128('428.79'),
+   ]);
+
+   $item = $collection->findOne(['_id' => 1]);
+
+   var_dump($item);
+
+The output would then resemble::
+
+   object(MongoDB\Model\BSONDocument)#9 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(3) {
+       ["_id"]=>
+       int(1)
+       ["item"]=>
+       string(15) "26-inch monitor"
+       ["price"]=>
+       object(MongoDB\BSON\Decimal128)#13 (1) {
+         ["dec"]=>
+         string(6) "428.79"
+       }
+     }
+   }
+
+Mathematical Operations with BCMath
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The :php:`PHP driver ` does not provide any functionality for working
+with ``Decimal128`` values; however, the string representation of a
+:php:`MongoDB\BSON\Decimal128 ` object may be used
+with PHP's :php:`BCMath ` extension.
+
+The following example adds two ``Decimal128`` values and creates a new
+``Decimal128`` value with the result from :php:`bcadd() `:
+
+.. code-block:: php
+
+   
+     string(1) "6"
+   }
+
+This does not match the expected result of "6.912". Each operation in the BCMath
+API uses a scale to determine the number of decimal digits in the result. The
+default scale is zero, which is why the above example produces a result with no
+decimal precision.
+
+In the following example, we use a scale of three for :php:`bcadd() ` to
+obtain the expected result:
+
+.. code-block:: php
+
+   
+     string(5) "6.912"
+   }
+
+In lieu of specifying a scale for each operation, a default scale may be set via
+:php:`bcscale() ` or the :php:`bcmath.scale INI setting
+`. The ``Decimal128`` type
+supports up to 34 decimal digits (i.e. significant digits).

From 68e64555c2a514c0a5a10d6f24b352f49fc6a931 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 26 Jan 2017 15:12:40 -0500
Subject: [PATCH 081/321] PHPLIB-212: Tutorial for collation

---
 source/tutorial.txt           |   1 +
 source/tutorial/collation.txt | 373 ++++++++++++++++++++++++++++++++++
 2 files changed, 374 insertions(+)
 create mode 100644 source/tutorial/collation.txt

diff --git a/source/tutorial.txt b/source/tutorial.txt
index bb77bf59..27f36375 100644
--- a/source/tutorial.txt
+++ b/source/tutorial.txt
@@ -6,6 +6,7 @@ Tutorials
 .. toctree::
 
    /tutorial/crud
+   /tutorial/collation
    /tutorial/commands
    /tutorial/decimal128
    /tutorial/gridfs
diff --git a/source/tutorial/collation.txt b/source/tutorial/collation.txt
new file mode 100644
index 00000000..71b28a87
--- /dev/null
+++ b/source/tutorial/collation.txt
@@ -0,0 +1,373 @@
+=========
+Collation
+=========
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 2
+   :class: singlecol
+
+.. versionadded:: 1.1
+
+Overview
+--------
+
+MongoDB 3.4 introduced support for :manual:`collations
+`, which provide a set of rules to comply with the
+conventions of a particular language when comparing strings.
+
+For example, in Canadian French, the last accent in a given word determines the
+sorting order. Consider the following French words:
+
+.. code-block:: none
+
+   cote < coté < côte < côté
+
+The sort order using the Canadian French collation would result in the
+following:
+
+.. code-block:: none
+
+   cote < côte < coté < côté
+
+If collation is unspecified, MongoDB uses simple binary comparison for strings.
+As such, the sort order of the words would be:
+
+.. code-block:: none
+
+    cote < coté < côte < côté
+
+Usage
+-----
+
+You can specify a default collation for collections and indexes when they are
+created, or specify a collation for CRUD operations and aggregations. For
+operations that support collation, MongoDB uses the collection's default
+collation unless the operation specifies a different collation.
+
+Collation Parameters
+~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: php
+
+   'collation' => [
+       'locale' => ,
+       'caseLevel' => ,
+       'caseFirst' => ,
+       'strength' => ,
+       'numericOrdering' => ,
+       'alternate' => ,
+       'maxVariable' => ,
+       'normalization' => ,
+       'backwards' => ,
+   ]
+
+The only required parameter is ``locale``, which the server parses as an `ICU
+format locale ID `_. For example, set
+``locale`` to ``en_US`` to represent US English or ``fr_CA`` to represent
+Canadian French.
+
+For a complete description of the available parameters, see :manual:`Collation
+Document ` in the MongoDB manual.
+
+Assign a Default Collation to a Collection
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following example creates a new collection called ``contacts`` on the
+``test`` database and assigns a default collation with the ``fr_CA`` locale.
+Specifying a collation when you create the collection ensures that all
+operations involving a query that are run against the ``contacts`` collection
+use the ``fr_CA`` collation, unless the query specifies another collation. Any
+indexes on the new collection also inherit the default collation, unless the
+creation command specifies another collation.
+
+.. code-block:: php
+
+   test;
+
+   $database->createCollection('contacts', [
+       'collation' => ['locale' => 'fr_CA'],
+   ]);
+
+Assign a Collation to an Index
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To specify a collation for an index, use the ``collation`` option when you
+create the index.
+
+The following example creates an index on the ``name`` field of the
+``address_book`` collection, with the ``unique`` parameter enabled and a default
+collation with ``locale`` set to ``en_US``.
+
+.. code-block:: php
+
+   test->address_book;
+
+   $collection->createIndex(
+       ['first_name' => 1],
+       [
+           'collation' => ['locale' => 'en_US'],
+           'unique' => true,
+       ]
+   );
+
+To use this index, make sure your queries also specify the same collation. The
+following query uses the above index:
+
+.. code-block:: php
+
+   test->address_book;
+
+   $cursor = $collection->find(
+       ['first_name' => 'Adam'],
+       [
+           'collation' => ['locale' => 'en_US'],
+       ]
+   );
+
+The following queries do **NOT** use the index. The first query uses no
+collation, and the second uses a collation with a different ``strength`` value
+than the collation on the index.
+
+.. code-block:: php
+
+   test->address_book;
+
+   $cursor1 = $collection->find(['first_name' => 'Adam']);
+
+   $cursor2 = $collection->find(
+       ['first_name' => 'Adam'],
+       [
+           'collation' => [
+               'locale' => 'en_US',
+               'strength' => 2,
+           ],
+       ]
+   );
+
+Operations that Support Collation
+---------------------------------
+
+All reading, updating, and deleting methods support collation. Some examples are
+listed below.
+
+``find()`` with ``sort``
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Individual queries can specify a collation to use when matching and sorting
+results. The following query and sort operation uses a German collation with the
+``locale`` parameter set to ``de``.
+
+.. code-block:: php
+
+   test->contacts;
+
+   $cursor = $collection->find(
+       ['city' => 'New York'],
+       [
+           'collation' => ['locale' => 'de'],
+           'sort' => ['name' => 1],
+       ]
+   );
+
+``findOneAndUpdate()``
+~~~~~~~~~~~~~~~~~~~~~~
+
+A collection called ``names`` contains the following documents:
+
+.. code-block:: javascript
+
+   { "_id" : 1, "first_name" : "Hans" }
+   { "_id" : 2, "first_name" : "Gunter" }
+   { "_id" : 3, "first_name" : "Günter" }
+   { "_id" : 4, "first_name" : "Jürgen" }
+
+The following :phpmethod:`findOneAndUpdate()
+` operation on the collection does not
+specify a collation.
+
+.. code-block:: php
+
+   test->names;
+
+   $document = $collection->findOneAndUpdate(
+       ['first_name' => ['$lt' =-> 'Gunter']],
+       ['$set' => ['verified' => true]]
+   );
+
+Because ``Gunter`` is lexically first in the collection, the above operation
+returns no results and updates no documents.
+
+Consider the same :phpmethod:`findOneAndUpdate()
+` operation but with a collation
+specified, which uses the locale ``de@collation=phonebook``.
+
+.. note::
+
+   Some locales have a ``collation=phonebook`` option available for use with
+   languages which sort proper nouns differently from other words. According to
+   the ``de@collation=phonebook`` collation, characters with umlauts come before
+   the same characters without umlauts.
+
+.. code-block:: php
+
+   test->names;
+
+   $document = $collection->findOneAndUpdate(
+       ['first_name' => ['$lt' =-> 'Gunter']],
+       ['$set' => ['verified' => true]],
+       [
+           'collation' => ['locale' => 'de@collation=phonebook'],
+           'returnDocument' => MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER,
+       ]
+   );
+
+The operation returns the following updated document:
+
+.. code-block:: javascript
+
+   { "_id" => 3, "first_name" => "Günter", "verified" => true }
+
+``findOneAndDelete()``
+~~~~~~~~~~~~~~~~~~~~~~
+
+Set the ``numericOrdering`` collation parameter to ``true`` to compare numeric
+strings by their numeric values.
+
+The collection ``numbers`` contains the following documents:
+
+.. code-block:: javascript
+
+   { "_id" : 1, "a" : "16" }
+   { "_id" : 2, "a" : "84" }
+   { "_id" : 3, "a" : "179" }
+
+The following example matches the first document in which field ``a`` has a
+numeric value greater than 100 and deletes it.
+
+.. code-block:: php
+
+   test->numbers;
+
+   $document = $collection->findOneAndDelete(
+       ['a' => ['$gt' =-> '100']],
+       [
+           'collation' => [
+               'locale' => 'en',
+               'numericOrdering' => true,
+           ],
+       ]
+   );
+
+After the above operation, the following documents remain in the collection:
+
+.. code-block:: javascript
+
+   { "_id" : 1, "a" : "16" }
+   { "_id" : 2, "a" : "84" }
+
+If you perform the same operation without collation, the server deletes the
+first document it finds in which the lexical value of ``a`` is greater than
+``"100"``.
+
+.. code-block:: php
+
+   test->numbers;
+
+   $document = $collection->findOneAndDelete(['a' => ['$gt' =-> '100']]);
+
+After the above operation is executed, the document in which ``a`` was equal to
+``"16"`` has been deleted, and the following documents remain in the collection:
+
+.. code-block:: javascript
+
+   { "_id" : 2, "a" : "84" }
+   { "_id" : 3, "a" : "179" }
+
+``deleteMany()``
+~~~~~~~~~~~~~~~~
+
+You can use collations with all the various CRUD operations which exist in the
+|php-library|.
+
+The collection ``recipes`` contains the following documents:
+
+.. code-block:: javascript
+
+   { "_id" : 1, "dish" : "veggie empanadas", "cuisine" : "Spanish" }
+   { "_id" : 2, "dish" : "beef bourgignon", "cuisine" : "French" }
+   { "_id" : 3, "dish" : "chicken molé", "cuisine" : "Mexican" }
+   { "_id" : 4, "dish" : "chicken paillard", "cuisine" : "french" }
+   { "_id" : 5, "dish" : "pozole verde", "cuisine" : "Mexican" }
+
+Setting the ``strength`` parameter of the collation document to ``1`` or ``2``
+causes the server to disregard case in the query filter. The following example
+uses a case-insensitive query filter to delete all records in which the
+``cuisine`` field matches ``French``.
+
+.. code-block:: php
+
+   test->recipes;
+
+   $collection->deleteMany(
+       ['cuisine' => 'French'],
+       [
+           'collation' => [
+               'locale' => 'en_US',
+               'strength' => 1,
+           ],
+       ]
+   );
+
+After the above operation runs, the documents with ``_id`` values of ``2`` and
+``4`` are deleted from the collection.
+
+Aggregation
+~~~~~~~~~~~
+
+To use collation with an :phpmethod:`aggregate()
+` operation, specify a collation in the
+aggregation options.
+
+The following aggregation example uses a collection called ``names`` and groups
+the ``first_name`` field together, counts the total number of results in each
+group, and sorts the results by German phonebook order.
+
+.. code-block:: php
+
+   test->recipes;
+
+   $cursor = $collection->aggregate(
+       [
+           ['$group' => ['_id' => '$first_name', 'name_count' => ['$sum' => 1]]],
+           ['$sort' => ['_id' => 1]],
+       ],
+       [
+           'collation' => ['locale' => 'de@collation=phonebook'],
+       ]
+   );

From 3a13a998e01c5393902b66476c695f8b07c86826 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 26 Jan 2017 15:17:16 -0500
Subject: [PATCH 082/321] Add trailing comma after array element

---
 source/reference/method/MongoDBCollection-findOneAndUpdate.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index b3c58327..4401164b 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -68,7 +68,7 @@ setting its building number to ``"761"``:
        [ '$set' => [ 'address.building' => '761' ]],
        [
            'projection' => [ 'address' => 1 ],
-           'returnDocument' => MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER
+           'returnDocument' => MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER,
        ]
    );
 

From 3a403f9889dd5e2ae096e421d8ba5bf6290d829c Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 26 Jan 2017 15:58:14 -0500
Subject: [PATCH 083/321] PHPLIB-246: Document BulkWriteException thrown by
 write operations

Clarify how the "ordered" option may impact bulk write operations. Also advise users to inspect the BulkWriteException's WriteResult to determine the nature of the error.
---
 ...oDBCollection-method-bulkWrite-option.yaml |  6 +++---
 .../includes/extracts-bulkwriteexception.yaml | 21 +++++++++++++++++++
 source/includes/extracts-error.yaml           |  8 +++++++
 .../method/MongoDBCollection-bulkWrite.txt    |  7 +++++++
 .../method/MongoDBCollection-deleteMany.txt   |  2 ++
 .../method/MongoDBCollection-deleteOne.txt    |  2 ++
 .../method/MongoDBCollection-insertMany.txt   |  7 +++++++
 .../method/MongoDBCollection-insertOne.txt    |  6 ++++++
 .../method/MongoDBCollection-replaceOne.txt   |  2 ++
 .../method/MongoDBCollection-updateMany.txt   |  2 ++
 .../method/MongoDBCollection-updateOne.txt    |  2 ++
 11 files changed, 62 insertions(+), 3 deletions(-)
 create mode 100644 source/includes/extracts-bulkwriteexception.yaml

diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
index 680769cf..bb663bf3 100644
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
@@ -6,11 +6,11 @@ arg_name: option
 name: ordered
 type: boolean
 description: |
-  If ``true``: when a single write fails, the operation returns without
-  performing the remaining writes.
+  If ``true``: when a single write fails, the operation will stop without
+  performing the remaining writes and throw an exception.
 
   If ``false``: when a single write fails, the operation will continue with the
-  remaining writes, if any.
+  remaining writes, if any, and throw an exception.
 
   The default is ``true``.
 interface: phpmethod
diff --git a/source/includes/extracts-bulkwriteexception.yaml b/source/includes/extracts-bulkwriteexception.yaml
new file mode 100644
index 00000000..f002063f
--- /dev/null
+++ b/source/includes/extracts-bulkwriteexception.yaml
@@ -0,0 +1,21 @@
+ref: bulkwriteexception-result
+content: |
+  If a :php:`MongoDB\\Driver\\Exception\\BulkWriteException
+  ` is thrown, users should call
+  :php:`getWriteResult() ` and
+  inspect the returned :php:`MongoDB\\Driver\\WriteResult
+  ` object to determine the nature of the error.
+
+  For example, a write operation may have been successfully applied to the
+  primary server but failed to satisfy the write concern (e.g. replication took
+  too long). Alternatively, a write operation may have failed outright (e.g.
+  unique key violation).
+---
+ref: bulkwriteexception-ordered
+content: |
+  In the case of a bulk write, the result may indicate multiple successful write
+  operations and/or errors. If the ``ordered`` option is ``true``, some
+  operations may have succeeded before the first error was encountered and the
+  exception thrown. If the ``ordered`` option is ``false``, multiple errors may
+  have been encountered.
+...
diff --git a/source/includes/extracts-error.yaml b/source/includes/extracts-error.yaml
index a0877389..cfada049 100644
--- a/source/includes/extracts-error.yaml
+++ b/source/includes/extracts-error.yaml
@@ -1,3 +1,11 @@
+ref: error-driver-bulkwriteexception
+content: |
+  :php:`MongoDB\\Driver\\Exception\\BulkWriteException
+  ` for errors related to the write
+  operation. Users should inspect the value returned by :php:`getWriteResult()
+  ` to determine the nature of the
+  error.
+---
 ref: error-driver-invalidargumentexception
 content: |
   :php:`MongoDB\\Driver\\Exception\\InvalidArgumentException
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index 772428ff..e58688cb 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -40,8 +40,15 @@ Errors/Exceptions
 
 .. include:: /includes/extracts/error-unsupportedexception.rst
 .. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-bulkwriteexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/bulkwriteexception-result.rst
+.. include:: /includes/extracts/bulkwriteexception-ordered.rst
+
 .. todo: add output and examples
 
 See Also
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index 5980b644..b3f965ed 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -40,12 +40,14 @@ Errors/Exceptions
 
 .. include:: /includes/extracts/error-unsupportedexception.rst
 .. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-bulkwriteexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
 Behavior
 --------
 
 .. include:: /includes/extracts/note-bson-comparison.rst
+.. include:: /includes/extracts/bulkwriteexception-result.rst
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index 2da2ccbd..bb824dc8 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -42,12 +42,14 @@ Errors/Exceptions
 
 .. include:: /includes/extracts/error-unsupportedexception.rst
 .. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-bulkwriteexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
 Behavior
 --------
 
 .. include:: /includes/extracts/note-bson-comparison.rst
+.. include:: /includes/extracts/bulkwriteexception-result.rst
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index f9d708f5..5ba27048 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -39,8 +39,15 @@ Errors/Exceptions
 -----------------
 
 .. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-bulkwriteexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/bulkwriteexception-result.rst
+.. include:: /includes/extracts/bulkwriteexception-ordered.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index f4ead380..83535593 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -39,8 +39,14 @@ Errors/Exceptions
 -----------------
 
 .. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-bulkwriteexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/bulkwriteexception-result.rst
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index 807ac32f..6186d575 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -42,12 +42,14 @@ Errors/Exceptions
 
 .. include:: /includes/extracts/error-unsupportedexception.rst
 .. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-bulkwriteexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
 Behavior
 --------
 
 .. include:: /includes/extracts/note-bson-comparison.rst
+.. include:: /includes/extracts/bulkwriteexception-result.rst
 
 Example
 -------
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index d0b04302..271fa756 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -40,12 +40,14 @@ Errors/Exceptions
 
 .. include:: /includes/extracts/error-unsupportedexception.rst
 .. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-bulkwriteexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
 Behavior
 --------
 
 .. include:: /includes/extracts/note-bson-comparison.rst
+.. include:: /includes/extracts/bulkwriteexception-result.rst
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index 929fc770..88e9c0ba 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -42,12 +42,14 @@ Errors/Exceptions
 
 .. include:: /includes/extracts/error-unsupportedexception.rst
 .. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-bulkwriteexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
 Behavior
 --------
 
 .. include:: /includes/extracts/note-bson-comparison.rst
+.. include:: /includes/extracts/bulkwriteexception-result.rst
 
 Examples
 --------

From 154d751e0f86e92519c0a2d6a27c3aadd476e8fd Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 26 Jan 2017 16:39:40 -0500
Subject: [PATCH 084/321] PHPLIB-243: Add regex query examples to CRUD tutorial

---
 source/tutorial/crud.txt | 42 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index 68bb670f..efc82fc6 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -331,6 +331,48 @@ The output would then resemble::
    10025: NEW YORK, NY
    90201: BELL GARDENS, CA
 
+Regular Expressions
+~~~~~~~~~~~~~~~~~~~
+
+Filter criteria may include regular expressions, either by using the
+:php:`MongoDB\\BSON\\Regex ` class directory or the
+:query:`$regex` operator.
+
+The following example lists documents in the ``zips`` collection where the city
+name starts with "garden" and the state is Texas:
+
+.. code-block:: php
+
+   demo->zips;
+
+   $cursor = $collection->find([
+       'city' => new MongoDB\BSON\Regex('^garden', 'i'),
+       'state' => 'TX',
+   ]);
+
+   foreach ($cursor as $document) {
+      printf("%s: %s, %s\n", $document['_id'], $document['city'], $document['state']);
+   }
+
+The output would then resemble::
+
+   78266: GARDEN RIDGE, TX
+   79739: GARDEN CITY, TX
+   79758: GARDENDALE, TX
+
+An equivalent filter could be constructed using the :query:`$regex` operator:
+
+.. code-block:: php
+
+   [
+       'city' => ['$regex' => '^garden', '$options' => 'i'],
+       'state' => 'TX',
+   ]
+
+.. seealso:: :manual:`$regex ` in the MongoDB manual
+
 Complex Queries with Aggregation
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

From f10eb7663489ca0eb70fba3f0d01769df8a11fa5 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 27 Jan 2017 14:00:12 -0500
Subject: [PATCH 085/321] PHPLIB-257: Document that connections are initialized
 lazily

---
 .../reference/method/MongoDBClient__construct.txt   | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index ed80cde6..ad864d18 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -36,6 +36,16 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-driver-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+A :php:`MongoDB\\Driver\\Manager ` is constructed
+internally. Per the `Server Discovery and Monitoring
+`_
+specification, :php:`MongoDB\\Driver\\Manager::__construct()
+` performs no I/O. Connections will be
+initialized on demand, when the first operation is executed.
+
 Examples
 --------
 
@@ -128,3 +138,6 @@ See Also
   `
 - :manual:`Connection String URI Format ` in the
   MongoDB manual
+- `Server Discovery and Monitoring
+  `_
+  specification

From 48196a285c4a65e09b1d5337ebf50a49de3d69db Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 1 Feb 2017 10:53:09 -0500
Subject: [PATCH 086/321] Fix GridFS tutorial examples to read a stream's
 contents

---
 source/tutorial/gridfs.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt
index 61070d86..b2f052bd 100644
--- a/source/tutorial/gridfs.txt
+++ b/source/tutorial/gridfs.txt
@@ -87,7 +87,7 @@ To open a download stream and read from it:
    $bucket = (new MongoDB\Client)->example->selectGridFSBucket();
 
    $stream = $bucket->openDownloadStream($fileId);
-   $contents = file_get_contents($stream);
+   $contents = stream_get_contents($stream);
 
 To download the file all at once and write it to an writable stream:
 
@@ -136,7 +136,7 @@ particular file:
    $bucket = (new MongoDB\Client)->example->selectGridFSBucket();
 
    $stream = $bucket->openDownloadStreamByName('my-file.txt', ['revision' => 0]);
-   $contents = file_get_contents($stream);
+   $contents = stream_get_contents($stream);
 
 Deleting Files
 --------------

From 53de84a7299a8cd46493afac265776d46fd7dde5 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 1 Feb 2017 10:53:39 -0500
Subject: [PATCH 087/321] Fix typo in GridFS tutorial

---
 source/tutorial/gridfs.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt
index b2f052bd..d302fcbf 100644
--- a/source/tutorial/gridfs.txt
+++ b/source/tutorial/gridfs.txt
@@ -89,7 +89,7 @@ To open a download stream and read from it:
    $stream = $bucket->openDownloadStream($fileId);
    $contents = stream_get_contents($stream);
 
-To download the file all at once and write it to an writable stream:
+To download the file all at once and write it to a writable stream:
 
 .. code-block:: php
 

From fbfaf0223618a5627ea611464a78f2648fbd5a49 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 16 Mar 2017 13:18:46 -0400
Subject: [PATCH 088/321] Revise docs for Find modifiers option

---
 .../apiargs-MongoDBCollection-method-find-option.yaml       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index b5ffe9c9..c43a0a8d 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -137,9 +137,9 @@ arg_name: option
 name: modifiers
 type: array|object
 description: |
-  Meta-operators that modify the output or behavior of a query. :manual:`Cursor
-  Methods  describes the query modification
-  methods available in MongoDB.
+  :manual:`Meta operators ` that modify the
+  output or behavior of a query. Use of these operators is deprecated in favor
+  of named options.
 interface: phpmethod
 operation: ~
 optional: true

From 00a33857574dc29dc0b17af4678a6ca99a540083 Mon Sep 17 00:00:00 2001
From: jonathan 
Date: Tue, 18 Apr 2017 11:15:53 -0400
Subject: [PATCH 089/321] DOCSP-574 - Added ref tags for cross linking with
 manual's CRUD pages.

---
 source/tutorial/crud.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index efc82fc6..9b2d92c7 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -151,6 +151,8 @@ The output would then resemble::
 
 .. seealso:: :phpmethod:`MongoDB\\Collection::findOne()`
 
+.. _php-find-many-documents:
+
 Find Many Documents
 ~~~~~~~~~~~~~~~~~~~
 
@@ -373,6 +375,8 @@ An equivalent filter could be constructed using the :query:`$regex` operator:
 
 .. seealso:: :manual:`$regex ` in the MongoDB manual
 
+.. _php-aggregation:
+
 Complex Queries with Aggregation
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

From 66347c1abb7598c93c053bbfb162c00460685c4d Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 8 May 2017 09:27:45 -0400
Subject: [PATCH 090/321] Fix RST link syntax

---
 source/upgrade.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/upgrade.txt b/source/upgrade.txt
index 693b1e52..6805d630 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -231,7 +231,7 @@ Accessing IDs of Inserted Documents
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 In the legacy driver, :php:`MongoCollection::insert() `,
-:php:`MongoCollection::batchInsert() `, and
 :php:`MongoCollection::save() ` (when inserting) would
 modify their input argument by injecting an ``_id`` key with a generated
 ObjectId (i.e. :php:`MongoId ` object). This behavior was a bit

From 2c3aa71d818a44cb48b98eb33fc4c1a21480d432 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 25 May 2017 10:12:18 -0400
Subject: [PATCH 091/321] DOCS-10307: Fix title in
 Bucket::downloadToStreamByName() docs

---
 .../method/MongoDBGridFSBucket-downloadToStreamByName.txt   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index 0fd2c8f2..ca294bc3 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -1,6 +1,6 @@
-===========================================
-MongoDB\\GridFS\\Bucket::downloadToStream()
-===========================================
+=================================================
+MongoDB\\GridFS\\Bucket::downloadToStreamByName()
+=================================================
 
 .. default-domain:: mongodb
 

From 73262d1cc310769f7822e785e677831c8c20f513 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 23 Jun 2017 14:26:17 -0400
Subject: [PATCH 092/321] Add restaurants.json to example data documentation

---
 source/tutorial/example-data.txt | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/source/tutorial/example-data.txt b/source/tutorial/example-data.txt
index 9d4bba92..6b29e19d 100644
--- a/source/tutorial/example-data.txt
+++ b/source/tutorial/example-data.txt
@@ -5,23 +5,25 @@ Example Data
 .. default-domain:: mongodb
 
 Some examples in this documentation use example data fixtures from
-`zips.json `_. This is a dataset comprised
-of United States postal codes, populations, and geographic locations.
+`zips.json `_ and
+`primer-dataset.json `_.
 
 Importing the dataset into MongoDB can be done in several ways. The following
-example uses the :php:`driver ` directly:
+example imports the `zips.json` file into a `demo.zips` collection:
+:php:`driver ` directly:
 
 .. code-block:: php
 
    insert($document);
    }
 
@@ -34,9 +36,10 @@ The output would then resemble::
 
    Inserted 29353 documents
 
-You may also import the dataset using :manual:`mongoimport
+You may also import the datasets using :manual:`mongoimport
 `, which is included with MongoDB:
 
 .. code-block:: none
 
    $ mongoimport --db demo --collection zips --file zips.json --drop
+   $ mongoimport --db demo --collection restaurants --file primer-dataset.json --drop

From ffe4df4f44bf5cf7f6016638156cc69d134171ad Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 23 Jun 2017 15:09:03 -0400
Subject: [PATCH 093/321] Use "test" database instead of "demo" or "example" in
 docs

---
 source/reference/bson.txt                     |  4 +--
 .../method/MongoDBClient-dropDatabase.txt     |  6 ++--
 .../method/MongoDBClient-selectCollection.txt |  8 ++---
 .../method/MongoDBClient-selectDatabase.txt   |  8 ++---
 .../reference/method/MongoDBClient__get.txt   |  4 +--
 .../method/MongoDBCollection-createIndex.txt  |  8 ++---
 .../MongoDBCollection-createIndexes.txt       |  4 +--
 .../method/MongoDBCollection-deleteMany.txt   |  2 +-
 .../method/MongoDBCollection-deleteOne.txt    |  2 +-
 .../method/MongoDBCollection-distinct.txt     | 10 +++---
 .../method/MongoDBCollection-drop.txt         |  6 ++--
 .../method/MongoDBCollection-dropIndex.txt    |  4 +--
 .../method/MongoDBCollection-dropIndexes.txt  |  4 +--
 .../method/MongoDBCollection-find.txt         |  2 +-
 .../method/MongoDBCollection-findOne.txt      |  2 +-
 .../MongoDBCollection-findOneAndDelete.txt    |  4 +--
 .../MongoDBCollection-findOneAndReplace.txt   |  4 +--
 .../MongoDBCollection-findOneAndUpdate.txt    |  4 +--
 .../MongoDBCollection-getCollectionName.txt   |  4 +--
 .../MongoDBCollection-getDatabaseName.txt     |  6 ++--
 .../method/MongoDBCollection-getNamespace.txt |  6 ++--
 .../method/MongoDBCollection-insertMany.txt   |  4 +--
 .../method/MongoDBCollection-insertOne.txt    |  4 +--
 .../method/MongoDBCollection-listIndexes.txt  | 10 +++---
 .../method/MongoDBCollection-replaceOne.txt   |  4 +--
 .../method/MongoDBCollection-updateMany.txt   |  2 +-
 .../method/MongoDBCollection-updateOne.txt    |  2 +-
 .../method/MongoDBCollection-withOptions.txt  |  2 +-
 .../method/MongoDBDatabase-command.txt        |  4 +--
 .../MongoDBDatabase-createCollection.txt      |  4 +--
 .../reference/method/MongoDBDatabase-drop.txt |  6 ++--
 .../method/MongoDBDatabase-dropCollection.txt |  6 ++--
 .../MongoDBDatabase-getDatabaseName.txt       |  4 +--
 .../MongoDBDatabase-listCollections.txt       |  8 ++---
 .../MongoDBDatabase-selectCollection.txt      | 10 +++---
 .../MongoDBDatabase-selectGridFSBucket.txt    |  8 ++---
 .../method/MongoDBDatabase-withOptions.txt    |  2 +-
 .../reference/method/MongoDBDatabase__get.txt |  4 +--
 source/tutorial/commands.txt                  | 14 ++++----
 source/tutorial/crud.txt                      | 36 +++++++++----------
 source/tutorial/decimal128.txt                |  2 +-
 source/tutorial/example-data.txt              |  8 ++---
 source/tutorial/gridfs.txt                    | 18 +++++-----
 source/tutorial/indexes.txt                   | 12 +++----
 44 files changed, 138 insertions(+), 138 deletions(-)

diff --git a/source/reference/bson.txt b/source/reference/bson.txt
index 789bcbce..b7a16e5f 100644
--- a/source/reference/bson.txt
+++ b/source/reference/bson.txt
@@ -138,7 +138,7 @@ database, and reads it back as an object of the same type:
 
    demo->persons;
+   $collection = (new MongoDB\Client)->test->persons;
 
    $result = $collection->insertOne(new Person('Bob'));
 
@@ -219,7 +219,7 @@ everything as a PHP array:
        ]
    );
 
-   $document = $client->demo->zips->findOne(['_id' => '94301']);
+   $document = $client->test->zips->findOne(['_id' => '94301']);
 
    var_dump($document);
 
diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index e97ddddf..ccb303ff 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -46,7 +46,7 @@ Errors/Exceptions
 Example
 -------
 
-The following example drops the ``demo`` database:
+The following example drops the ``test`` database:
 
 .. code-block:: php
 
@@ -54,7 +54,7 @@ The following example drops the ``demo`` database:
 
    $client = new MongoDB\Client;
 
-   $result = $client->dropDatabase('demo');
+   $result = $client->dropDatabase('test');
 
    var_dump($result);
 
@@ -64,7 +64,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(2) {
        ["dropped"]=>
-       string(4) "demo"
+       string(4) "test"
        ["ok"]=>
        float(1)
      }
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 48044047..6ce12df7 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -49,7 +49,7 @@ overridden via the ``$options`` parameter.
 Example
 -------
 
-The following example selects the ``users`` collection in the ``demo`` database:
+The following example selects the ``users`` collection in the ``test`` database:
 
 .. code-block:: php
 
@@ -57,9 +57,9 @@ The following example selects the ``users`` collection in the ``demo`` database:
 
    $client = new MongoDB\Client;
 
-   $collection = $client->selectCollection('demo', 'users');
+   $collection = $client->selectCollection('test', 'users');
 
-The following example selects the ``users`` collection in the ``demo`` database
+The following example selects the ``users`` collection in the ``test`` database
 with a custom read preference:
 
 .. code-block:: php
@@ -69,7 +69,7 @@ with a custom read preference:
    $client = new MongoDB\Client;
 
    $collection = $client->selectCollection(
-       'demo',
+       'test',
        'users',
        [
            'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index 77a4a6f6..10dc4d8a 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -49,7 +49,7 @@ via the ``$options`` parameter.
 Example
 -------
 
-The following example selects the ``demo`` database:
+The following example selects the ``test`` database:
 
 .. code-block:: php
 
@@ -57,9 +57,9 @@ The following example selects the ``demo`` database:
 
    $client = new MongoDB\Client;
 
-   $db = $client->selectDatabase('demo');
+   $db = $client->selectDatabase('test');
 
-The following examples selects the ``demo`` database with a custom read
+The following examples selects the ``test`` database with a custom read
 preference:
 
 .. code-block:: php
@@ -69,7 +69,7 @@ preference:
    $client = new MongoDB\Client;
 
    $db = $client->selectDatabase(
-       'demo',
+       'test',
        [
            'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
        ]
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
index 7e0ee299..c0824578 100644
--- a/source/reference/method/MongoDBClient__get.txt
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -50,7 +50,7 @@ any options, use the :phpmethod:`MongoDB\\Client::selectDatabase` method.
 Examples
 --------
 
-The following example selects the ``demo`` and ``another-app`` databases:
+The following example selects the ``test`` and ``another-app`` databases:
 
 .. code-block:: php
 
@@ -58,7 +58,7 @@ The following example selects the ``demo`` and ``another-app`` databases:
 
    $client = new MongoDB\Client;
 
-   $demo = $client->demo;
+   $test = $client->test;
    $anotherApp = $client->{'another-app'};
 
 See Also
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index 162f44bc..da7629da 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -54,13 +54,13 @@ Create a Compound Index
 
 The following example creates a :manual:`compound index `
 on the ``borough`` and ``cuisine`` fields in the ``restaurants`` collection in
-the ``example`` database.
+the ``test`` database.
 
 .. code-block:: php
 
    selectCollection('example', 'restaurants');
+   $collection = (new MongoDB\Client)->selectCollection('test', 'restaurants');
 
    $indexName = $collection->createIndex(['borough' => 1, 'cuisine' => 1]);
 
@@ -74,7 +74,7 @@ Create a Partial Index
 ~~~~~~~~~~~~~~~~~~~~~~
 
 The following example adds a :manual:`partial index ` on
-the ``borough`` field in the ``restaurants`` collection in the ``example``
+the ``borough`` field in the ``restaurants`` collection in the ``test``
 database. The partial index indexes only documents where the ``borough`` field
 exists.
 
@@ -82,7 +82,7 @@ exists.
 
    selectCollection('example, 'restaurants');
+   $collection = (new MongoDB\Client)->selectCollection('test, 'restaurants');
 
    $indexName = $collection->createIndex(
       ['borough' => 1],
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index 8ec9ffbb..b2fc994b 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -64,7 +64,7 @@ Example
 -------
 
 The following example creates two indexes on the ``restaurants`` collection in
-the ``example`` database. One index is a compound index on the ``borough`` and
+the ``test`` database. One index is a compound index on the ``borough`` and
 ``cuisine`` fields and the other is 2dsphere index on the ``loc`` field with a
 custom name.
 
@@ -72,7 +72,7 @@ custom name.
 
    selectCollection('example', 'restaurants');
+   $collection = (new MongoDB\Client)->selectCollection('test', 'restaurants');
 
    $indexNames = $collection->createIndexes([
        [ 'key' => [ 'borough' => 1, 'cuisine' => 1] ],
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index b3f965ed..fb84bd99 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -59,7 +59,7 @@ that have ``"ny"`` as the value for the ``state`` field:
 
    demo->users;
+   $collection = (new MongoDB\Client)->test->users;
    $collection->drop();
 
    $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index bb824dc8..27ba5a7c 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -61,7 +61,7 @@ has ``"ny"`` as the value for the ``state`` field:
 
    demo->users;
+   $collection = (new MongoDB\Client)->test->users;
    $collection->drop();
 
    $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index b35343ee..bf7ffb4c 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -54,13 +54,13 @@ Return Distinct Values for a Field
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 The following example identifies the distinct values for the ``borough`` field
-in the ``restaurants`` collection in the ``example`` database.
+in the ``restaurants`` collection in the ``test`` database.
 
 .. code-block:: php
 
    example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $distinct = $collection->distinct('borough');
 
@@ -87,14 +87,14 @@ Return Distinct Values Using a Filter
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 The following example identifies the distinct values for the ``cuisine`` field
-in the ``restaurants`` collection in the ``example`` database for documents
-where the ``borough`` is ``Queens``:
+in the ``restaurants`` collection in the ``test`` database for documents where
+the ``borough`` is ``Queens``:
 
 .. code-block:: php
 
    example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $distinct = $collection->distinct('cuisine', ['borough' => 'Queens']);
 
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index 4fdd1695..c1762871 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -46,14 +46,14 @@ Errors/Exceptions
 Example
 -------
 
-The following operation drops the ``restaurants`` collection in the ``example``
+The following operation drops the ``restaurants`` collection in the ``test``
 database:
 
 .. code-block:: php
 
    example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $result = $collection->drop();
 
@@ -65,7 +65,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(3) {
        ["ns"]=>
-       string(19) "example.restaurants"
+       string(16) "test.restaurants"
        ["nIndexesWas"]=>
        int(3)
        ["ok"]=>
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index 489886b3..880349bd 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -47,13 +47,13 @@ Example
 -------
 
 The following drops an indexes with name ``borough_1`` from the ``restaurants``
-collection in the ``example`` database:
+collection in the ``test`` database:
 
 .. code-block:: php
 
    example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $result = $collection->dropIndex('borough_1');
 
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index d1139a07..8cdf9e43 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -48,13 +48,13 @@ Example
 -------
 
 The following drops all indexes from the ``restaurants`` collection in the
-``example`` database:
+``test`` database:
 
 .. code-block:: php
 
    example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $result = $collection->dropIndexes();
 
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 6b1bc2c4..0849338e 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -56,7 +56,7 @@ returned. It also limits the results to 5 documents.
 
 .. code-block:: php
 
-   $collection = (new MongoDB\Client)->example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $cursor = $collection->find(
        [
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index 07da2d09..ab155b0d 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -58,7 +58,7 @@ returned.
 
 .. code-block:: php
 
-   $collection = (new MongoDB\Client)->example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $restaurant = $collection->findOne(
        [
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index dddde0ea..ccb28c1f 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -52,13 +52,13 @@ Examples
 --------
 
 The following example finds and deletes the document with ``restaurant_id`` of
-``"40375376"`` from the ``restaurants`` collection in the ``example`` database:
+``"40375376"`` from the ``restaurants`` collection in the ``test`` database:
 
 .. code-block:: php
 
    example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $deletedRestaurant = $collection->findOneAndDelete(
        [ 'restaurant_id' => '40375376' ],
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index b48417c2..0b522d2c 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -54,7 +54,7 @@ Examples
 --------
 
 Consider the following document in the ``restaurants`` collection in the
-``example`` database:
+``test`` database:
 
 .. code-block:: javascript
 
@@ -99,7 +99,7 @@ The following operation replaces the document with ``restaurant_id`` of
 
    example->restaurants;
+   $collection = (new MongoDB\Client)->teset->restaurants;
 
    $replacedRestaurant = $collection->findOneAndReplace(
        [ 'restaurant_id' => '41220906' ],
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index 4401164b..69eb4aa9 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -54,14 +54,14 @@ Examples
 --------
 
 The following operation updates the restaurant with ``restaurant_id`` of
-``"40361708"`` in the ``restaurants`` collection in the ``example`` database by
+``"40361708"`` in the ``restaurants`` collection in the ``test`` database by
 setting its building number to ``"761"``:
 
 .. code-block:: php
 
    example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $updatedRestaurant = $collection->findOneAndUpdate(
        [ 'restaurant_id' => '40361708' ],
diff --git a/source/reference/method/MongoDBCollection-getCollectionName.txt b/source/reference/method/MongoDBCollection-getCollectionName.txt
index b126c7f4..86fe3e5e 100644
--- a/source/reference/method/MongoDBCollection-getCollectionName.txt
+++ b/source/reference/method/MongoDBCollection-getCollectionName.txt
@@ -30,13 +30,13 @@ Example
 -------
 
 The following returns the collection name for the ``zips`` collection in the
-``demo`` database.
+``test`` database.
 
 .. code-block:: php
 
    demo->zips;
+   $collection = (new MongoDB\Client)->test->zips;
 
    echo $collection->getCollectionName();
 
diff --git a/source/reference/method/MongoDBCollection-getDatabaseName.txt b/source/reference/method/MongoDBCollection-getDatabaseName.txt
index 10ea2672..93500c80 100644
--- a/source/reference/method/MongoDBCollection-getDatabaseName.txt
+++ b/source/reference/method/MongoDBCollection-getDatabaseName.txt
@@ -30,19 +30,19 @@ Example
 -------
 
 The following returns the database name for the ``zips`` collection in the
-``demo`` database.
+``test`` database.
 
 .. code-block:: php
 
    demo->zips;
+   $collection = (new MongoDB\Client)->test->zips;
 
    echo $collection->getDatabaseName();
 
 The output would then resemble::
 
-   demo
+   test
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBCollection-getNamespace.txt b/source/reference/method/MongoDBCollection-getNamespace.txt
index 256a7cfa..74f1b022 100644
--- a/source/reference/method/MongoDBCollection-getNamespace.txt
+++ b/source/reference/method/MongoDBCollection-getNamespace.txt
@@ -30,20 +30,20 @@ The namespace of this collection as a string.
 Example
 -------
 
-The following returns the namespace of the ``zips`` collection in the ``demo``
+The following returns the namespace of the ``zips`` collection in the ``test``
 database.
 
 .. code-block:: php
 
    demo->zips;
+   $collection = (new MongoDB\Client)->test->zips;
 
    echo $collection->getNamespace();
 
 The output would then resemble::
 
-   demo.zips
+   test.zips
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 5ba27048..a56db3de 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -54,13 +54,13 @@ Example
 .. start-crud-include
 
 The following operation inserts two documents into the ``users`` collection
-in the ``example`` database:
+in the ``test`` database:
 
 .. code-block:: php
 
    example->users;
+   $collection = (new MongoDB\Client)->test->users;
 
    $insertManyResult = $collection->insertMany([
        [
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index 83535593..c5ff2dc1 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -53,13 +53,13 @@ Example
 .. start-crud-include
 
 The following operation inserts a document into the ``users`` collection in the
-``example`` database:
+``test`` database:
 
 .. code-block:: php
 
    example->users;
+   $collection = (new MongoDB\Client)->test->users;
 
    $insertOneResult = $collection->insertOne([
        'username' => 'admin',
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index a0b0237d..e39a9bbb 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -45,13 +45,13 @@ Example
 -------
 
 The following example lists all of the indexes for the ``restaurants``
-collection in the ``example`` database:
+collection in the ``test`` database:
 
 .. code-block:: php
 
    example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    foreach ($collection->listIndexes() as $index) {
       var_dump($index);
@@ -70,7 +70,7 @@ The output would then resemble::
      ["name"]=>
      string(4) "_id_"
      ["ns"]=>
-     string(19) "example.restaurants"
+     string(16) "test.restaurants"
    }
    object(MongoDB\Model\IndexInfo)#12 (4) {
      ["v"]=>
@@ -83,7 +83,7 @@ The output would then resemble::
      ["name"]=>
      string(10) "cuisine_-1"
      ["ns"]=>
-     string(19) "example.restaurants"
+     string(16) "test.restaurants"
    }
    object(MongoDB\Model\IndexInfo)#8 (4) {
      ["v"]=>
@@ -96,7 +96,7 @@ The output would then resemble::
      ["name"]=>
      string(9) "borough_1"
      ["ns"]=>
-     string(19) "example.restaurants"
+     string(16) "test.restaurants"
    }
 
 See Also
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index 6186d575..ba43452b 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -55,13 +55,13 @@ Example
 -------
 
 The following example replaces the document with ``restaurant_id`` of
-``"40356068"`` in the ``restaurants`` collection in the ``example`` database:
+``"40356068"`` in the ``restaurants`` collection in the ``test`` database:
 
 .. code-block:: php
 
    example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $updateResult = $collection->replaceOne(
        [ 'restaurant_id' => '40356068' ],
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 271fa756..bd72fdf9 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -57,7 +57,7 @@ The following example updates all of the documents with the ``borough`` of
 
 .. code-block:: php
 
-   $collection = (new MongoDB\Client)->example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $updateResult = $collection->updateMany(
        [ 'borough' => 'Queens' ],
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index 88e9c0ba..bed657f9 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -59,7 +59,7 @@ The following example updates one document with the ``restaurant_id`` of
 
 .. code-block:: php
 
-   $collection = (new MongoDB\Client)->example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $updateResult = $collection->updateOne(
        [ 'restaurant_id' => '40356151' ],
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index f3e68dff..24e84ab8 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -49,7 +49,7 @@ preference:
 
    selectCollect('demo', 'restaurants');
+   $collection = (new MongoDB\Client)->selectCollect('test', 'restaurants');
 
    $newCollection = $sourceCollection->withOptions([
        'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index 46776a80..46b28fbe 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -51,7 +51,7 @@ result document:
 
    example;
+   $database = (new MongoDB\Client)->test;
 
    $cursor = $database->command(['isMaster' => 1]);
 
@@ -92,7 +92,7 @@ multiple result documents:
 
    example;
+   $database = (new MongoDB\Client)->test;
 
    $cursor = $database->command(['isMaster' => 1]);
 
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index e66c8c6a..8db6696c 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -63,14 +63,14 @@ Errors/Exceptions
 Example
 -------
 
-The following example creates a ``users`` collection in the ``demo``
+The following example creates a ``users`` collection in the ``test``
 database with document validation criteria:
 
 .. code-block:: php
 
    demo;
+   $db = (new MongoDB\Client)->test;
 
    $result = $db->createCollection('users', [
        'validator' => [
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index 3fe566f2..bcf6ca88 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -46,13 +46,13 @@ Errors/Exceptions
 Example
 -------
 
-The following example drops the ``demo`` database:
+The following example drops the ``test`` database:
 
 .. code-block:: php
 
    demo;
+   $db = (new MongoDB\Client)->test;
 
    $result = $db->drop();
 
@@ -64,7 +64,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(2) {
        ["dropped"]=>
-       string(4) "demo"
+       string(4) "test"
        ["ok"]=>
        float(1)
      }
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index d6158d45..fbc005b8 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -46,13 +46,13 @@ Errors/Exceptions
 Example
 -------
 
-The following example drops the ``users`` collection in the ``demo`` database:
+The following example drops the ``users`` collection in the ``test`` database:
 
 .. code-block:: php
 
    demo;
+   $db = (new MongoDB\Client)->test;
 
    $result = $db->dropCollection('users');
 
@@ -64,7 +64,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(3) {
        ["ns"]=>
-       string(10) "demo.users"
+       string(10) "test.users"
        ["nIndexesWas"]=>
        int(1)
        ["ok"]=>
diff --git a/source/reference/method/MongoDBDatabase-getDatabaseName.txt b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
index b4ce912b..6ff9dcb9 100644
--- a/source/reference/method/MongoDBDatabase-getDatabaseName.txt
+++ b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
@@ -35,10 +35,10 @@ The following example prints the name of a database object:
 
    demo;
+   $db = (new MongoDB\Client)->test;
 
    echo $db->getDatabaseName();
 
 The output would then resemble::
 
-   demo
+   test
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index caca2c8f..99fd69f5 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -39,13 +39,13 @@ database.
 Example
 -------
 
-The following example lists all of the collections in the ``example`` database:
+The following example lists all of the collections in the ``test`` database:
 
 .. code-block:: php
 
    example;
+   $database = (new MongoDB\Client)->test;
 
    foreach ($database->listCollections() as $collectionInfo) {
        var_dump($collectionInfo);
@@ -76,13 +76,13 @@ The output would then resemble::
    }
 
 The following example lists all collections whose name starts with ``"rest"``
-in the ``example`` database:
+in the ``test`` database:
 
 .. code-block:: php
 
    example;
+   $database = (new MongoDB\Client)->test;
 
    $collections = $database->listCollections([
        'filter' => [
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 173fdadd..8a5a42b2 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -49,24 +49,24 @@ overridden via the ``$options`` parameter.
 Example
 -------
 
-The following example selects the ``users`` collection in the ``demo`` database:
+The following example selects the ``users`` collection in the ``test`` database:
 
 .. code-block:: php
 
    demo;
+   $db = (new MongoDB\Client)->test;
 
-   $collection = $db->selectCollection('demo', 'users');
+   $collection = $db->selectCollection('test', 'users');
 
-The following example selects the ``users`` collection in the ``demo``
+The following example selects the ``users`` collection in the ``test``
 database with a custom read preference:
 
 .. code-block:: php
 
    demo;
+   $db = (new MongoDB\Client)->test;
 
    $users = $db->selectCollection(
        'users',
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index e3b3dfb8..9c63fdf7 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -49,25 +49,25 @@ overridden via the ``$options`` parameter.
 Example
 -------
 
-The following example selects the default ``fs.files`` bucket in the ``demo``
+The following example selects the default ``fs.files`` bucket in the ``test``
 database:
 
 .. code-block:: php
 
    demo;
+   $db = (new MongoDB\Client)->test;
 
    $bucket = $db->selectGridFSBucket();
 
-The following example selects the custom ``images.files`` bucket in the ``demo``
+The following example selects the custom ``images.files`` bucket in the ``test``
 database with a custom read preference:
 
 .. code-block:: php
 
    demo;
+   $db = (new MongoDB\Client)->test;
 
    $imagesBucket = $db->selectGridFSBucket([
        'bucketName' => 'images',
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index 4c6f0925..9bc0a82e 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -49,7 +49,7 @@ preference:
 
    demo;
+   $db = (new MongoDB\Client)->test;
 
    $newDb = $db->withOptions([
        'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index c0f4256d..c41e3981 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -50,13 +50,13 @@ Examples
 --------
 
 The following example selects the ``users`` and ``system.profile``
-collections from the ``demo`` database:
+collections from the ``test`` database:
 
 .. code-block:: php
 
    demo;
+   $db = (new MongoDB\Client)->test;
 
    $users = $db->users;
    $systemProfile = $db->{'system.profile'};
diff --git a/source/tutorial/commands.txt b/source/tutorial/commands.txt
index 4b90501f..6cb6fca3 100644
--- a/source/tutorial/commands.txt
+++ b/source/tutorial/commands.txt
@@ -30,13 +30,13 @@ To execute a command on a :program:`mongod` instance, use the
 :phpmethod:`MongoDB\\Database::command()` method. For instance, the following
 operation uses the :manual:`geoNear ` command to
 search for the three closest documents to longitude ``-74`` and latitude ``40``
-in the ``restos`` collection in the ``example`` database:
+in the ``restos`` collection in the ``test`` database:
 
 .. code-block:: php
 
    example;
+   $database = (new MongoDB\Client)->test;
 
    $cursor = $database->command([
        'geoNear' => 'restos',
@@ -218,14 +218,14 @@ object on which it is invoked. To execute commands that require a specific read
 preference, specify the read preference in the ``$options`` parameter of the
 method.
 
-The following example adds a user to the ``demo`` database and specifies a
+The following example adds a user to the ``test`` database and specifies a
 custom read preference:
 
 .. code-block:: php
 
    demo;
+   $db = (new MongoDB\Client)->test;
 
    $cursor = $db->command(
        [
@@ -267,7 +267,7 @@ document, or access the first result in the array, as in the following:
 
    demo;
+   $database = (new MongoDB\Client)->test;
 
    $cursor = $database->command(['ping' => 1]);
 
@@ -290,7 +290,7 @@ Some commands, such as :manual:`listCollections
 `, return their results via an iterable
 cursor. To view the results, iterate through the cursor.
 
-The following example lists the collections in the ``demo`` database by
+The following example lists the collections in the ``test`` database by
 iterating through the cursor returned by the ``listCollections`` command using a
 ``foreach`` loop:
 
@@ -298,7 +298,7 @@ iterating through the cursor returned by the ``listCollections`` command using a
 
    demo;
+   $database = (new MongoDB\Client)->test;
 
    $cursor = $database->command(['listCollections' => 1]);
 
diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index 9b2d92c7..ed76c2ae 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -53,7 +53,7 @@ The following example inserts a document while specifying the value for the
 
    demo->users;
+   $collection = (new MongoDB\Client)->test->users;
 
    $insertOneResult = $collection->insertOne(['_id' => 1, 'name' => 'Alice']);
 
@@ -107,7 +107,7 @@ The following example searches for the document with ``_id`` of ``"94301"``:
 
    demo->zips;
+   $collection = (new MongoDB\Client)->test->zips;
 
    $document = $collection->findOne(['_id' => '94301']);
 
@@ -167,7 +167,7 @@ specified city and state values:
 
    demo->zips;
+   $collection = (new MongoDB\Client)->test->zips;
 
    $cursor = $collection->find(['city' => 'JERSEY CITY', 'state' => 'NJ']);
 
@@ -210,7 +210,7 @@ returned. It also limits the results to 5 documents.
 
    example->restaurants;
+   $collection = (new MongoDB\Client)->test->restaurants;
 
    $cursor = $collection->find(
        [
@@ -311,7 +311,7 @@ five most populous zip codes in the United States:
 
    demo->zips;
+   $collection = (new MongoDB\Client)->test->zips;
 
    $cursor = $collection->find(
        [],
@@ -347,7 +347,7 @@ name starts with "garden" and the state is Texas:
 
    demo->zips;
+   $collection = (new MongoDB\Client)->test->zips;
 
    $cursor = $collection->find([
        'city' => new MongoDB\BSON\Regex('^garden', 'i'),
@@ -395,7 +395,7 @@ with them:
 
    demo->zips;
+   $collection = (new MongoDB\Client)->test->zips;
 
    $cursor = $collection->aggregate([
        ['$group' => ['_id' => '$state', 'count' => ['$sum' => 1]]],
@@ -434,7 +434,7 @@ updates to perform. The :phpmethod:`MongoDB\\Collection::updateOne()` reference
 describes each parameter in detail.
 
 The following example inserts two documents into an empty ``users`` collection
-in the ``demo`` database using the :phpmethod:`MongoDB\\Collection::insertOne()`
+in the ``test`` database using the :phpmethod:`MongoDB\\Collection::insertOne()`
 method, and then updates the documents where the value for the ``state`` field
 is ``"ny"`` to include a ``country`` field set to ``"us"``:
 
@@ -442,7 +442,7 @@ is ``"ny"`` to include a ``country`` field set to ``"us"``:
 
    demo->users;
+   $collection = (new MongoDB\Client)->test->users;
    $collection->drop();
 
    $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
@@ -470,7 +470,7 @@ value, as in this example:
 
    demo->users;
+   $collection = (new MongoDB\Client)->test->users;
    $collection->drop();
 
    $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
@@ -506,7 +506,7 @@ updates to perform. The :phpmethod:`MongoDB\\Collection::updateMany()` reference
 describes each parameter in detail.
 
 The following example inserts three documents into an empty ``users`` collection
-in the ``demo`` database and then uses the :query:`$set` operator to update the
+in the ``test`` database and then uses the :query:`$set` operator to update the
 documents matching the filter criteria to include the ``country`` field with
 value ``"us"``:
 
@@ -514,7 +514,7 @@ value ``"us"``:
 
    demo->users;
+   $collection = (new MongoDB\Client)->test->users;
    $collection->drop();
 
    $collection->insertOne(['name' => 'Bob', 'state' => 'ny', 'country' => 'us']);
@@ -567,13 +567,13 @@ parameter in detail.
    fields in a document rather than replacing the entire document.
 
 The following example inserts one document into an empty ``users`` collection in
-the ``demo`` database, and then replaces that document with a new one:
+the ``test`` database, and then replaces that document with a new one:
 
 .. code-block:: php
 
    demo->users;
+   $collection = (new MongoDB\Client)->test->users;
    $collection->drop();
 
    $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
@@ -609,13 +609,13 @@ When a document is upserted, the ID is accessible via
 
 The following example uses :phpmethod:`MongoDB\\Collection::updateOne()` with
 the ``upsert`` option set to ``true`` and an empty ``users`` collection in the
-``demo`` database, therefore inserting the document into the database:
+``test`` database, therefore inserting the document into the database:
 
 .. code-block:: php
 
    demo->users;
+   $collection = (new MongoDB\Client)->test->users;
    $collection->drop();
 
    $updateResult = $collection->updateOne(
@@ -681,7 +681,7 @@ value is ``"ny"``:
 
    demo->users;
+   $collection = (new MongoDB\Client)->test->users;
    $collection->drop();
 
    $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
@@ -715,7 +715,7 @@ value is ``"ny"``:
 
    demo->users;
+   $collection = (new MongoDB\Client)->test->users;
    $collection->drop();
 
    $collection->insertOne(['name' => 'Bob', 'state' => 'ny']);
diff --git a/source/tutorial/decimal128.txt b/source/tutorial/decimal128.txt
index 03272a8c..a94d0ea5 100644
--- a/source/tutorial/decimal128.txt
+++ b/source/tutorial/decimal128.txt
@@ -36,7 +36,7 @@ field of a collection named ``inventory``:
 
    demo->inventory;
+   $collection = (new MongoDB\Client)->test->inventory;
 
    $collection->insertOne([
        '_id' => 1,
diff --git a/source/tutorial/example-data.txt b/source/tutorial/example-data.txt
index 6b29e19d..e9370f2b 100644
--- a/source/tutorial/example-data.txt
+++ b/source/tutorial/example-data.txt
@@ -9,7 +9,7 @@ Some examples in this documentation use example data fixtures from
 `primer-dataset.json `_.
 
 Importing the dataset into MongoDB can be done in several ways. The following
-example imports the `zips.json` file into a `demo.zips` collection:
+example imports the `zips.json` file into a `test.zips` collection:
 :php:`driver ` directly:
 
 .. code-block:: php
@@ -29,7 +29,7 @@ example imports the `zips.json` file into a `demo.zips` collection:
 
    $manager = new MongoDB\Driver\Manager('mongodb://127.0.0.1/');
 
-   $result = $manager->executeBulkWrite('demo.zips', $bulk);
+   $result = $manager->executeBulkWrite('test.zips', $bulk);
    printf("Inserted %d documents\n", $result->getInsertedCount());
 
 The output would then resemble::
@@ -41,5 +41,5 @@ You may also import the datasets using :manual:`mongoimport
 
 .. code-block:: none
 
-   $ mongoimport --db demo --collection zips --file zips.json --drop
-   $ mongoimport --db demo --collection restaurants --file primer-dataset.json --drop
+   $ mongoimport --db test --collection zips --file zips.json --drop
+   $ mongoimport --db test --collection restaurants --file primer-dataset.json --drop
diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt
index d302fcbf..33c7f6be 100644
--- a/source/tutorial/gridfs.txt
+++ b/source/tutorial/gridfs.txt
@@ -50,7 +50,7 @@ To open an upload stream and write to it:
 
    example->selectGridFSBucket();
+   $bucket = (new MongoDB\Client)->test->selectGridFSBucket();
 
    $stream = $bucket->openUploadStream('my-file.txt');
 
@@ -64,7 +64,7 @@ To upload the entire contents of a readable stream in one call:
 
    example->selectGridFSBucket();
+   $bucket = (new MongoDB\Client)->test->selectGridFSBucket();
 
    $file = fopen('/path/to/my-file.txt', 'rb');
    $bucket->uploadFromStream('my-file.txt', $file);
@@ -84,7 +84,7 @@ To open a download stream and read from it:
    // In practice, $fileId denotes the _id of an existing file in GridFS
    $fileId = new MongoDB\BSON\ObjectId;
 
-   $bucket = (new MongoDB\Client)->example->selectGridFSBucket();
+   $bucket = (new MongoDB\Client)->test->selectGridFSBucket();
 
    $stream = $bucket->openDownloadStream($fileId);
    $contents = stream_get_contents($stream);
@@ -98,7 +98,7 @@ To download the file all at once and write it to a writable stream:
    // In practice, $fileId denotes the _id of an existing file in GridFS
    $fileId = new MongoDB\BSON\ObjectId;
 
-   $bucket = (new MongoDB\Client)->example->selectGridFSBucket();
+   $bucket = (new MongoDB\Client)->test->selectGridFSBucket();
 
    $file = fopen('/path/to/my-output-file.txt', 'wb');
 
@@ -133,7 +133,7 @@ particular file:
 
    example->selectGridFSBucket();
+   $bucket = (new MongoDB\Client)->test->selectGridFSBucket();
 
    $stream = $bucket->openDownloadStreamByName('my-file.txt', ['revision' => 0]);
    $contents = stream_get_contents($stream);
@@ -150,7 +150,7 @@ You can delete a GridFS file by its ``_id``.
    // In practice, $fileId denotes the _id of an existing file in GridFS
    $fileId = new MongoDB\BSON\ObjectId;
 
-   $bucket = (new MongoDB\Client)->example->selectGridFSBucket();
+   $bucket = (new MongoDB\Client)->test->selectGridFSBucket();
 
    $bucket->delete($fileId);
 
@@ -165,7 +165,7 @@ about the GridFS files.
 
    example->selectGridFSBucket();
+   $bucket = (new MongoDB\Client)->test->selectGridFSBucket();
 
    $cursor = $bucket->find(['filename' => 'my-file.txt']);
 
@@ -183,7 +183,7 @@ the file document for an existing readable or writable GridFS stream.
    // In practice, $fileId denotes the _id of an existing file in GridFS
    $fileId = new MongoDB\BSON\ObjectId;
 
-   $bucket = (new MongoDB\Client)->example->selectGridFSBucket();
+   $bucket = (new MongoDB\Client)->test->selectGridFSBucket();
 
    $stream = $bucket->openDownloadStream($fileId);
    $metadata = $bucket->getFileDocumentForStream($stream);
@@ -208,7 +208,7 @@ convenience for accessing the ``_id`` property of the object returned by
 
    example->selectGridFSBucket();
+   $bucket = (new MongoDB\Client)->test->selectGridFSBucket();
 
    $stream = $bucket->openDownloadStreamByName('my-file.txt');
    $fileId = $bucket->getFileIdForStream($stream);
diff --git a/source/tutorial/indexes.txt b/source/tutorial/indexes.txt
index 733bfb43..0ffe7bdb 100644
--- a/source/tutorial/indexes.txt
+++ b/source/tutorial/indexes.txt
@@ -37,7 +37,7 @@ the :phpmethod:`createIndex() ` method:
 
    demo->zips;
+   $collection = (new MongoDB\Client)->test->zips;
 
    $result = $collection->createIndex(['state' => 1]);
 
@@ -59,13 +59,13 @@ about the indexes in a collection. The
 information about each index. Refer to the method reference for more details.
 
 The following example lists all indexes in the ``zips`` collection in the
-``demo`` database:
+``test`` database:
 
 .. code-block:: php
 
    demo->zips;
+   $collection = (new MongoDB\Client)->test->zips;
 
    foreach ($collection->listIndexes() as $indexInfo) {
        var_dump($indexInfo);
@@ -84,7 +84,7 @@ The output would resemble::
      ["name"]=>
      string(4) "_id_"
      ["ns"]=>
-     string(9) "demo.zips"
+     string(9) "test.zips"
    }
    object(MongoDB\Model\IndexInfo)#13 (4) {
      ["v"]=>
@@ -97,7 +97,7 @@ The output would resemble::
      ["name"]=>
      string(7) "state_1"
      ["ns"]=>
-     string(9) "demo.zips"
+     string(9) "test.zips"
    }
 
 Drop Indexes
@@ -114,7 +114,7 @@ The following example drops a single index by its name, ``state_1``:
 
    demo->zips;
+   $collection = (new MongoDB\Client)->test->zips;
 
    $result = $collection->dropIndex('state_1');
 

From 600854cc78b855113b1d2d6450893db898625688 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 23 Jun 2017 15:09:49 -0400
Subject: [PATCH 094/321] Fix typo

---
 source/reference/method/MongoDBCollection-withOptions.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index 24e84ab8..92e09f6e 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -49,7 +49,7 @@ preference:
 
    selectCollect('test', 'restaurants');
+   $collection = (new MongoDB\Client)->selectCollection('test', 'restaurants');
 
    $newCollection = $sourceCollection->withOptions([
        'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),

From d45d8ceb071c24272e87630f0c749a114ed08e94 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 23 Jun 2017 15:10:09 -0400
Subject: [PATCH 095/321] Add example for querying with BSON classes in
 findOne() docs

---
 .../method/MongoDBCollection-findOne.txt      | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index ab155b0d..b687456f 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -51,6 +51,28 @@ Behavior
 Examples
 --------
 
+Matching BSON Types in Query Criteria
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In the following example, documents in the ``restaurants`` collection use an
+:manual:`ObjectId ` for their identifier (the default)
+and documents in the ``zips`` collection use a string. Since ObjectID is a
+special BSON type, the query criteria for selecting a restaurant must use the
+:php:`MongoDB\\BSON\\ObjectID ` class.
+
+.. code-block:: php
+
+   $database = (new MongoDB\Client)->test;
+
+   $zip = $database->zips->findOne(['_id' => '10036']);
+
+   $restaurant = $database->restaurants->findOne([
+       '_id' => new MongoDB\BSON\ObjectID('594d5ef280a846852a4b3f70'),
+   ])
+
+Projecting Fields
+~~~~~~~~~~~~~~~~~
+
 The following example finds a restaurant based on the ``cuisine`` and
 ``borough`` fields and uses a :manual:`projection
 ` to limit the fields that are

From 07ef3f3e80ee6c3f956e663713aa05a442c55437 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 23 Jun 2017 15:20:49 -0400
Subject: [PATCH 096/321] Update expected output for findAndModify examples

---
 .../MongoDBCollection-findOneAndDelete.txt    | 25 +++++-----
 .../MongoDBCollection-findOneAndReplace.txt   | 38 ++++++++------
 .../MongoDBCollection-findOneAndUpdate.txt    | 49 +++++++++++--------
 3 files changed, 65 insertions(+), 47 deletions(-)

diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index ccb28c1f..b6a88f0f 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -75,18 +75,21 @@ The following example finds and deletes the document with ``restaurant_id`` of
 
 The output would then resemble::
 
-   object(stdClass)#14 (4) {
-     ["_id"]=>
-     object(MongoDB\BSON\ObjectID)#11 (1) {
-       ["oid"]=>
-       string(24) "576023c6b02fa9281da3fad9"
+   object(MongoDB\Model\BSONDocument)#17 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#11 (1) {
+         ["oid"]=>
+         string(24) "594d5ef280a846852a4b3f70"
+       }
+       ["borough"]=>
+       string(9) "Manhattan"
+       ["name"]=>
+       string(15) "Agra Restaurant"
+       ["restaurant_id"]=>
+       string(8) "40375376"
      }
-     ["borough"]=>
-     string(9) "Manhattan"
-     ["name"]=>
-     string(15) "Agra Restaurant"
-     ["restaurant_id"]=>
-     string(8) "40375376"
    }
 
 See Also
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 0b522d2c..631158ec 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -117,23 +117,29 @@ The following operation replaces the document with ``restaurant_id`` of
 
 The output would then resemble::
 
-   object(stdClass)#14 (6) {
-     ["_id"]=>
-     object(MongoDB\BSON\ObjectID)#11 (1) {
-       ["oid"]=>
-       string(24) "576023c7b02fa9281da4139e"
-     }
-     ["borough"]=>
-     string(13) "Staten Island"
-     ["cuisine"]=>
-     string(7) "Italian"
-     ["grades"]=>
-     array(0) {
+   object(MongoDB\Model\BSONDocument)#18 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(6) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#11 (1) {
+         ["oid"]=>
+         string(24) "594d5ef380a846852a4b5837"
+       }
+       ["Borough"]=>
+       string(13) "Staten Island"
+       ["cuisine"]=>
+       string(7) "Italian"
+       ["grades"]=>
+       object(MongoDB\Model\BSONArray)#17 (1) {
+         ["storage":"ArrayObject":private]=>
+         array(0) {
+         }
+       }
+       ["name"]=>
+       string(22) "Staten Island Pastaria"
+       ["restaurant_id"]=>
+       string(9) "999999999"
      }
-     ["name"]=>
-     string(22) "Staten Island Pastaria"
-     ["restaurant_id"]=>
-     string(9) "999999999"
    }
 
 See Also
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index 69eb4aa9..42e877b4 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -76,27 +76,36 @@ setting its building number to ``"761"``:
 
 The output would then resemble::
 
-   object(stdClass)#16 (2) {
-     ["_id"]=>
-     object(MongoDB\BSON\ObjectID)#10 (1) {
-       ["oid"]=>
-       string(24) "5813a08d29032c6e72d566a7"
-     }
-     ["address"]=>
-     object(stdClass)#15 (4) {
-       ["building"]=>
-       string(3) "761"
-       ["coord"]=>
-       array(2) {
-         [0]=>
-         float(-73.9925306)
-         [1]=>
-         float(40.7309346)
+   object(MongoDB\Model\BSONDocument)#20 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(2) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectID)#12 (1) {
+         ["oid"]=>
+         string(24) "594d5ef280a846852a4b3dee"
+       }
+       ["address"]=>
+       object(MongoDB\Model\BSONDocument)#19 (1) {
+         ["storage":"ArrayObject":private]=>
+         array(4) {
+           ["building"]=>
+           string(3) "761"
+           ["coord"]=>
+           object(MongoDB\Model\BSONArray)#18 (1) {
+             ["storage":"ArrayObject":private]=>
+             array(2) {
+               [0]=>
+               float(-73.9925306)
+               [1]=>
+               float(40.7309346)
+             }
+           }
+           ["street"]=>
+           string(8) "Broadway"
+           ["zipcode"]=>
+           string(5) "10003"
+         }
        }
-       ["street"]=>
-       string(8) "Broadway"
-       ["zipcode"]=>
-       string(5) "10003"
      }
    }
 

From 98556ee2a862c1ee23f83894b311ec5f7d96d027 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 23 Jun 2017 15:21:01 -0400
Subject: [PATCH 097/321] Add missing semicolons

---
 source/reference/method/MongoDBCollection-findOne.txt           | 2 +-
 source/reference/method/MongoDBCollection-findOneAndReplace.txt | 2 +-
 source/reference/method/MongoDBCollection-findOneAndUpdate.txt  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index b687456f..b6a0316b 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -68,7 +68,7 @@ special BSON type, the query criteria for selecting a restaurant must use the
 
    $restaurant = $database->restaurants->findOne([
        '_id' => new MongoDB\BSON\ObjectID('594d5ef280a846852a4b3f70'),
-   ])
+   ]);
 
 Projecting Fields
 ~~~~~~~~~~~~~~~~~
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 631158ec..773f72d4 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -113,7 +113,7 @@ The following operation replaces the document with ``restaurant_id`` of
        [ 'returnDocument' => MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER ]
    );
 
-   var_dump($replacedRestaurant)
+   var_dump($replacedRestaurant);
 
 The output would then resemble::
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index 42e877b4..c05b5ed1 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -72,7 +72,7 @@ setting its building number to ``"761"``:
        ]
    );
 
-   var_dump($updatedRestaurant)
+   var_dump($updatedRestaurant);
 
 The output would then resemble::
 

From 356f619ac76db97b42ff6ff011ecce8e414afbd1 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 6 Jul 2017 09:38:02 -0400
Subject: [PATCH 098/321] Fix title for MongoDB\GridFS\Bucket docs

---
 source/reference/class/MongoDBGridFSBucket.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 1f797018..76ee5654 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -1,6 +1,6 @@
-============================
-MongoDB\\GridFS\Bucket Class
-============================
+=============================
+MongoDB\\GridFS\\Bucket Class
+=============================
 
 .. default-domain:: mongodb
 

From 9f710260eeb2b3641fd0d5624c87bb194c2f19b9 Mon Sep 17 00:00:00 2001
From: Maciej Malarz 
Date: Sat, 29 Jul 2017 13:19:31 +0200
Subject: [PATCH 099/321] Fix typo in GridFS tutorial

---
 source/tutorial/gridfs.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt
index 33c7f6be..ba9b8368 100644
--- a/source/tutorial/gridfs.txt
+++ b/source/tutorial/gridfs.txt
@@ -28,7 +28,7 @@ method.
 
 The bucket can be constructed with various options:
 
- - ``bucketName`` determines the prefix for the buckey's metadata and chunk
+ - ``bucketName`` determines the prefix for the bucket's metadata and chunk
    collections. The default value is ``"fs"``.
  - ``chunkSizeBytes`` determines the size of each chunk. GridFS divides the
    file into chunks of this length, except for the last, which is only as large

From c67c4fb9e2a14902a7b9ad0fef6c917fa589c7a8 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 7 Aug 2017 18:26:40 -0400
Subject: [PATCH 100/321] Revise docs for bypassDocumentValidation option

---
 source/includes/apiargs-MongoDBCollection-common-option.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
index 28844672..eaf8e421 100644
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-common-option.yaml
@@ -4,6 +4,9 @@ type: boolean
 description: |
    If ``true``, allows the write operation to circumvent document level
    validation. Defaults to ``false``.
+
+   This option is available in MongoDB 3.2+ and is ignored for older server
+   versions, which do not support document level validation.
 interface: phpmethod
 operation: ~
 optional: true

From bf8013a52ab83c9c743a71ab21ea9faae3de2bab Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 16 Aug 2017 19:39:31 -0400
Subject: [PATCH 101/321] PHPLIB-265: Add regex example with character escaping

---
 source/tutorial/crud.txt | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index ed76c2ae..f009d187 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -375,6 +375,21 @@ An equivalent filter could be constructed using the :query:`$regex` operator:
 
 .. seealso:: :manual:`$regex ` in the MongoDB manual
 
+Although MongoDB's regular expression syntax is not exactly the same as PHP's
+:php:`PCRE ` syntax, :php:`preg_quote() `
+may be used to escape special characters that should be matched as-is. The
+following example finds restaurants whose name starts with "(Library)":
+
+.. code-block:: php
+
+   test->restaurants;
+
+   $cursor = $collection->find([
+       'name' => new MongoDB\BSON\Regex('^' . preg_quote('(Library)')),
+   ]);
+
 .. _php-aggregation:
 
 Complex Queries with Aggregation

From cafcd27d2aed26418bdd01cfe2d71f86d16b8831 Mon Sep 17 00:00:00 2001
From: Petr Buchin 
Date: Fri, 7 Jul 2017 03:52:46 +0300
Subject: [PATCH 102/321] PHPLIB-271: Implement accessors for options on core
 classes

---
 source/reference/class/MongoDBClient.txt      |  4 ++
 source/reference/class/MongoDBCollection.txt  |  4 ++
 source/reference/class/MongoDBDatabase.txt    |  4 ++
 .../reference/class/MongoDBGridFSBucket.txt   |  4 ++
 .../method/MongoDBClient-getReadConcern.txt   | 52 ++++++++++++++++
 .../MongoDBClient-getReadPreference.txt       | 59 +++++++++++++++++++
 .../method/MongoDBClient-getTypeMap.txt       | 56 ++++++++++++++++++
 .../method/MongoDBClient-getWriteConcern.txt  | 50 ++++++++++++++++
 .../MongoDBCollection-getReadConcern.txt      | 50 ++++++++++++++++
 .../MongoDBCollection-getReadPreference.txt   | 53 +++++++++++++++++
 .../method/MongoDBCollection-getTypeMap.txt   | 58 ++++++++++++++++++
 .../MongoDBCollection-getWriteConcern.txt     | 50 ++++++++++++++++
 .../method/MongoDBDatabase-getReadConcern.txt | 50 ++++++++++++++++
 .../MongoDBDatabase-getReadPreference.txt     | 53 +++++++++++++++++
 .../method/MongoDBDatabase-getTypeMap.txt     | 58 ++++++++++++++++++
 .../MongoDBDatabase-getWriteConcern.txt       | 50 ++++++++++++++++
 .../MongoDBGridFSBucket-getReadConcern.txt    | 50 ++++++++++++++++
 .../MongoDBGridFSBucket-getReadPreference.txt | 50 ++++++++++++++++
 .../method/MongoDBGridFSBucket-getTypeMap.txt | 58 ++++++++++++++++++
 .../MongoDBGridFSBucket-getWriteConcern.txt   | 50 ++++++++++++++++
 20 files changed, 863 insertions(+)
 create mode 100644 source/reference/method/MongoDBClient-getReadConcern.txt
 create mode 100644 source/reference/method/MongoDBClient-getReadPreference.txt
 create mode 100644 source/reference/method/MongoDBClient-getTypeMap.txt
 create mode 100644 source/reference/method/MongoDBClient-getWriteConcern.txt
 create mode 100644 source/reference/method/MongoDBCollection-getReadConcern.txt
 create mode 100644 source/reference/method/MongoDBCollection-getReadPreference.txt
 create mode 100644 source/reference/method/MongoDBCollection-getTypeMap.txt
 create mode 100644 source/reference/method/MongoDBCollection-getWriteConcern.txt
 create mode 100644 source/reference/method/MongoDBDatabase-getReadConcern.txt
 create mode 100644 source/reference/method/MongoDBDatabase-getReadPreference.txt
 create mode 100644 source/reference/method/MongoDBDatabase-getTypeMap.txt
 create mode 100644 source/reference/method/MongoDBDatabase-getWriteConcern.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt

diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
index d5490701..2bf05682 100644
--- a/source/reference/class/MongoDBClient.txt
+++ b/source/reference/class/MongoDBClient.txt
@@ -32,6 +32,10 @@ Methods
    /reference/method/MongoDBClient__get
    /reference/method/MongoDBClient-dropDatabase
    /reference/method/MongoDBClient-getManager
+   /reference/method/MongoDBClient-getReadConcern
+   /reference/method/MongoDBClient-getReadPreference
+   /reference/method/MongoDBClient-getTypeMap
+   /reference/method/MongoDBClient-getWriteConcern
    /reference/method/MongoDBClient-listDatabases
    /reference/method/MongoDBClient-selectCollection
    /reference/method/MongoDBClient-selectDatabase
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index 109fa1ba..873f37f0 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -80,6 +80,10 @@ Methods
    /reference/method/MongoDBCollection-getDatabaseName
    /reference/method/MongoDBCollection-getManager
    /reference/method/MongoDBCollection-getNamespace
+   /reference/method/MongoDBCollection-getReadConcern
+   /reference/method/MongoDBCollection-getReadPreference
+   /reference/method/MongoDBCollection-getTypeMap
+   /reference/method/MongoDBCollection-getWriteConcern
    /reference/method/MongoDBCollection-insertMany
    /reference/method/MongoDBCollection-insertOne
    /reference/method/MongoDBCollection-listIndexes
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index 4489f21e..1cc6f858 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -51,6 +51,10 @@ Methods
    /reference/method/MongoDBDatabase-dropCollection
    /reference/method/MongoDBDatabase-getDatabaseName
    /reference/method/MongoDBDatabase-getManager
+   /reference/method/MongoDBDatabase-getReadConcern
+   /reference/method/MongoDBDatabase-getReadPreference
+   /reference/method/MongoDBDatabase-getTypeMap
+   /reference/method/MongoDBDatabase-getWriteConcern
    /reference/method/MongoDBDatabase-listCollections
    /reference/method/MongoDBDatabase-selectCollection
    /reference/method/MongoDBDatabase-selectGridFSBucket
diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 76ee5654..0a3ad0a4 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -45,6 +45,10 @@ Methods
    /reference/method/MongoDBGridFSBucket-getDatabaseName
    /reference/method/MongoDBGridFSBucket-getFileDocumentForStream
    /reference/method/MongoDBGridFSBucket-getFileIdForStream
+   /reference/method/MongoDBGridFSBucket-getReadConcern
+   /reference/method/MongoDBGridFSBucket-getReadPreference
+   /reference/method/MongoDBGridFSBucket-getTypeMap
+   /reference/method/MongoDBGridFSBucket-getWriteConcern
    /reference/method/MongoDBGridFSBucket-openDownloadStream
    /reference/method/MongoDBGridFSBucket-openDownloadStreamByName
    /reference/method/MongoDBGridFSBucket-openUploadStream
diff --git a/source/reference/method/MongoDBClient-getReadConcern.txt b/source/reference/method/MongoDBClient-getReadConcern.txt
new file mode 100644
index 00000000..c3d31318
--- /dev/null
+++ b/source/reference/method/MongoDBClient-getReadConcern.txt
@@ -0,0 +1,52 @@
+========================================
+MongoDB\\Client::getReadConcern()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::getReadConcern()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\ReadConcern ` used by this
+   :phpclass:`Client `.
+
+   Returns the default read concern of this client.
+
+   .. code-block:: php
+
+      function getReadConcern(): MongoDB\Driver\ReadConcern
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\ReadConcern ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+    MongoDB\Driver\ReadConcern::MAJORITY]
+   );
+
+   MongoDB\Driver\ReadConcern::MAJORITY === $client->getReadConcern()->getLevel(); // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\\Database::getReadConcern()`
diff --git a/source/reference/method/MongoDBClient-getReadPreference.txt b/source/reference/method/MongoDBClient-getReadPreference.txt
new file mode 100644
index 00000000..da8ae039
--- /dev/null
+++ b/source/reference/method/MongoDBClient-getReadPreference.txt
@@ -0,0 +1,59 @@
+========================================
+MongoDB\\Client::getReadPreference()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::getReadPreference()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\ReadPreference ` used by this
+   :phpclass:`Client `.
+
+   Returns the default read preference of this client.
+
+   .. code-block:: php
+
+      function getReadPreference(): MongoDB\Driver\ReadPreference
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\ReadPreference ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+    MongoDB\Driver\ReadPreference::RP_PRIMARY,
+           'readPreferenceTags' => ['foo' => 'bar', 'spam' => 'egg'],
+           'maxStalenessSeconds' => 150,
+       ]
+   );
+
+   $readPreference = $client->getReadPreference();
+
+   MongoDB\Driver\ReadPreference::RP_PRIMARY === $readPreference->getMode(); // true
+   ['foo' => 'bar', 'spam' => 'egg'] === $readPreference->getTags(); // true
+   150 = $readPreference->getMaxStalenessSeconds(); // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\\Database::getReadPreference()`
diff --git a/source/reference/method/MongoDBClient-getTypeMap.txt b/source/reference/method/MongoDBClient-getTypeMap.txt
new file mode 100644
index 00000000..97be3de2
--- /dev/null
+++ b/source/reference/method/MongoDBClient-getTypeMap.txt
@@ -0,0 +1,56 @@
+========================================
+MongoDB\\Client::getTypeMap()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::getTypeMap()
+
+   Accessor for the type map used by this :phpclass:`Client `.
+
+   .. code-block:: php
+
+      function getTypeMap(): array
+
+Return Values
+-------------
+
+A type map array.
+
+Example
+-------
+
+.. code-block:: php
+
+    'array', 'document' => 'array', 'array' => 'array'];
+   $client = new MongoDB\Client('mongodb://127.0.0.1/', [], ['typeMap' => $typeMap]);
+   $client->getTypeMap() === $typeMap; //true
+   var_dump($client->getTypeMap());
+
+The output will be as follows:
+
+   array(3) {
+     ["root"]=>
+     string(5) "array"
+     ["document"]=>
+     string(5) "array"
+     ["array"]=>
+     string(5) "array"
+   }
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\\Database::getTypeMap()`
diff --git a/source/reference/method/MongoDBClient-getWriteConcern.txt b/source/reference/method/MongoDBClient-getWriteConcern.txt
new file mode 100644
index 00000000..cbe1777b
--- /dev/null
+++ b/source/reference/method/MongoDBClient-getWriteConcern.txt
@@ -0,0 +1,50 @@
+========================================
+MongoDB\\Client::getWriteConcern()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::getWriteConcern()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\WriteConcern ` used by this
+   :phpclass:`Client `.
+
+   Returns the default write concern of this client.
+
+   .. code-block:: php
+
+      function getWriteConcern(): MongoDB\Driver\WriteConcern
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\WriteConcern ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+    1, 'wTimeoutMS' => 100, 'journal' => true]);
+   $writeConcern = $client->getWriteConcern();
+   1 === $writeConcern->getW(); // true
+   100 === $writeConcern->getWtimeout(); // true
+   $writeConcern->getJournal(); // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\\Database::getWriteConcern()`
diff --git a/source/reference/method/MongoDBCollection-getReadConcern.txt b/source/reference/method/MongoDBCollection-getReadConcern.txt
new file mode 100644
index 00000000..c3062fa0
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-getReadConcern.txt
@@ -0,0 +1,50 @@
+========================================
+MongoDB\\Collection::getReadConcern()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::getReadConcern()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\ReadConcern ` used by this
+   :phpclass:`Collection `.
+
+   Returns the default read concern of this collection.
+
+   .. code-block:: php
+
+      function getReadConcern(): MongoDB\Driver\ReadConcern
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\ReadConcern ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+   test->selectCollection('test', ['readConcern' => $readConcern]);
+
+   $collection->getReadConcern() === $readConcern; // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getReadConcern()`
+- :phpmethod:`MongoDB\\Database::getReadConcern()`
+- :phpmethod:`MongoDB\\GridFS\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBCollection-getReadPreference.txt b/source/reference/method/MongoDBCollection-getReadPreference.txt
new file mode 100644
index 00000000..3a6acb5d
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-getReadPreference.txt
@@ -0,0 +1,53 @@
+========================================
+MongoDB\\Collection::getReadPreference()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::getReadPreference()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\ReadPreference ` used by this
+   :phpclass:`Collection `.
+
+   Returns the default read preference of this collection.
+
+   .. code-block:: php
+
+      function getReadPreference(): MongoDB\Driver\ReadPreference
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\ReadPreference ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+   test->selectCollection(
+       'test',
+       ['readPreference' => $readPreference]
+   );
+
+   $collection->getReadPreference() === $readPreference; // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getReadPreference()`
+- :phpmethod:`MongoDB\\Database::getReadPreference()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBCollection-getTypeMap.txt b/source/reference/method/MongoDBCollection-getTypeMap.txt
new file mode 100644
index 00000000..20544b30
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-getTypeMap.txt
@@ -0,0 +1,58 @@
+========================================
+MongoDB\\Collection::getTypeMap()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::getTypeMap()
+
+   Accessor for the type map used by this :phpclass:`Collection `.
+
+   .. code-block:: php
+
+      function getTypeMap(): array
+
+Return Values
+-------------
+
+A type map array.
+
+Example
+-------
+
+.. code-block:: php
+
+    'array', 'document' => 'array', 'array' => 'array'];
+   $collection = (new MongoDB\Client)->test->selectCollection('test', ['typeMap' => $typeMap]);
+
+   $collection->getTypeMap() === $typeMap; //true
+   var_dump($collection->getTypeMap());
+
+The output will be as follows:
+
+   array(3) {
+     ["root"]=>
+     string(5) "array"
+     ["document"]=>
+     string(5) "array"
+     ["array"]=>
+     string(5) "array"
+   }
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getTypeMap()`
+- :phpmethod:`MongoDB\\Database::getTypeMap()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBCollection-getWriteConcern.txt b/source/reference/method/MongoDBCollection-getWriteConcern.txt
new file mode 100644
index 00000000..6ac0a91f
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-getWriteConcern.txt
@@ -0,0 +1,50 @@
+========================================
+MongoDB\\Collection::getWriteConcern()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::getWriteConcern()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\WriteConcern ` used by this
+   :phpclass:`Collection `.
+
+   Returns the default write concern of this collection.
+
+   .. code-block:: php
+
+      function getWriteConcern(): MongoDB\Driver\WriteConcern
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\WriteConcern ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+   test->selectCollection('test', ['writeConcern' => $writeConcern]);
+
+   $collection->getWriteConcern() === $writeConcern; // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBDatabase-getReadConcern.txt b/source/reference/method/MongoDBDatabase-getReadConcern.txt
new file mode 100644
index 00000000..334813b3
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-getReadConcern.txt
@@ -0,0 +1,50 @@
+========================================
+MongoDB\\Database::getReadConcern()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::getReadConcern()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\ReadConcern ` used by this
+   :phpclass:`Database `.
+
+   Returns the default read concern of this database.
+
+   .. code-block:: php
+
+      function getReadConcern(): MongoDB\Driver\ReadConcern
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\ReadConcern ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+   selectDatabase('test', ['readConcern' => $readConcern]);
+
+   $database->getReadConcern() === $readConcern; // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getReadConcern()`
+- :phpmethod:`MongoDB\\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\\GridFS\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBDatabase-getReadPreference.txt b/source/reference/method/MongoDBDatabase-getReadPreference.txt
new file mode 100644
index 00000000..5ee66c9a
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-getReadPreference.txt
@@ -0,0 +1,53 @@
+========================================
+MongoDB\\Database::getReadPreference()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::getReadPreference()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\ReadPreference ` used by this
+   :phpclass:`Database `.
+
+   Returns the default read preference of this database.
+
+   .. code-block:: php
+
+      function getReadPreference(): MongoDB\Driver\ReadPreference
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\ReadPreference ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+   selectDatabase(
+       'test',
+       ['readPreference' => $readPreference]
+   );
+
+   $database->getReadPreference() === $readPreference; // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getReadPreference()`
+- :phpmethod:`MongoDB\\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBDatabase-getTypeMap.txt b/source/reference/method/MongoDBDatabase-getTypeMap.txt
new file mode 100644
index 00000000..fe44ab79
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-getTypeMap.txt
@@ -0,0 +1,58 @@
+========================================
+MongoDB\\Database::getTypeMap()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::getTypeMap()
+
+   Accessor for the type map used by this :phpclass:`Database `.
+
+   .. code-block:: php
+
+      function getTypeMap(): array
+
+Return Values
+-------------
+
+A type map array.
+
+Example
+-------
+
+.. code-block:: php
+
+    'array', 'document' => 'array', 'array' => 'array'];
+   $database = (new MongoDB\Client)->selectDatabase('test', ['typeMap' => $typeMap]);
+
+   $database->getTypeMap() === $typeMap; //true
+   var_dump($database->getTypeMap());
+
+The output will be as follows:
+
+   array(3) {
+     ["root"]=>
+     string(5) "array"
+     ["document"]=>
+     string(5) "array"
+     ["array"]=>
+     string(5) "array"
+   }
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getTypeMap()`
+- :phpmethod:`MongoDB\\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBDatabase-getWriteConcern.txt b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
new file mode 100644
index 00000000..73095026
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
@@ -0,0 +1,50 @@
+========================================
+MongoDB\\Database::getWriteConcern()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::getWriteConcern()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\WriteConcern ` used by this
+   :phpclass:`Database `.
+
+   Returns the default write concern of this database.
+
+   .. code-block:: php
+
+      function getWriteConcern(): MongoDB\Driver\WriteConcern
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\WriteConcern ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+   selectDatabase('test', ['writeConcern' => $writeConcern]);
+
+   $database->getWriteConcern() === $writeConcern; // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
new file mode 100644
index 00000000..b52abf05
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
@@ -0,0 +1,50 @@
+========================================
+MongoDB\\GridFS\Bucket::getReadConcern()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\Bucket::getReadConcern()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\ReadConcern ` used by this
+   :phpclass:`Bucket `.
+
+   Returns the default read concern of this bucket.
+
+   .. code-block:: php
+
+      function getReadConcern(): MongoDB\Driver\ReadConcern
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\ReadConcern ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+   test->selectGridFSBucket(['readConcern' => $readConcern]);
+
+   $bucket->getReadConcern() === $readConcern; // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getReadConcern()`
+- :phpmethod:`MongoDB\\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\\Database::getReadConcern()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
new file mode 100644
index 00000000..7db2c209
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
@@ -0,0 +1,50 @@
+========================================
+MongoDB\\GridFS\Bucket::getReadPreference()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\Bucket::getReadPreference()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\ReadPreference ` used by this
+   :phpclass:`Bucket `.
+
+   Returns the default read preference of this bucket.
+
+   .. code-block:: php
+
+      function getReadPreference(): MongoDB\Driver\ReadPreference
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\ReadPreference ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+   test->selectGridFSBucket(['readPreference' => $readPreference]);
+
+   $bucket->getReadPreference() === $readPreference; // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getReadPreference()`
+- :phpmethod:`MongoDB\\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\\Database::getReadPreference()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
new file mode 100644
index 00000000..b73d1178
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
@@ -0,0 +1,58 @@
+========================================
+MongoDB\\GridFS\Bucket::getTypeMap()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\Bucket::getTypeMap()
+
+   Accessor for the type map used by this :phpclass:`Bucket `.
+
+   .. code-block:: php
+
+      function getTypeMap(): array
+
+Return Values
+-------------
+
+A type map array.
+
+Example
+-------
+
+.. code-block:: php
+
+    'array', 'document' => 'array', 'array' => 'array'];
+   $bucket = (new MongoDB\Client)->test->selectGridFSBucket(['typeMap' => $typeMap]);
+
+   $bucket->getTypeMap() === $typeMap; //true
+   var_dump($bucket->getTypeMap());
+
+The output will be as follows:
+
+   array(3) {
+     ["root"]=>
+     string(5) "array"
+     ["document"]=>
+     string(5) "array"
+     ["array"]=>
+     string(5) "array"
+   }
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getTypeMap()`
+- :phpmethod:`MongoDB\\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\\Database::getTypeMap()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
new file mode 100644
index 00000000..dff8e7e9
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
@@ -0,0 +1,50 @@
+========================================
+MongoDB\\GridFS\Bucket::getWriteConcern()
+========================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\Bucket::getWriteConcern()
+
+   Accessor for the
+   :php:`MongoDB\\Driver\\WriteConcern ` used by this
+   :phpclass:`Bucket `.
+
+   Returns the default write concern of this bucket.
+
+   .. code-block:: php
+
+      function getWriteConcern(): MongoDB\Driver\WriteConcern
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\WriteConcern ` object.
+
+Example
+-------
+
+.. code-block:: php
+
+   test->selectGridFSBucket(['writeConcern' => $writeConcern]);
+
+   $bucket->getWriteConcern() === $writeConcern; // true
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\\Database::getWriteConcern()`

From a529c70dc87cb1345e132640545d5110cdac4895 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 13 Sep 2017 14:10:51 -0400
Subject: [PATCH 103/321] PHPLIB-271: Revise docs for option accessors

---
 source/reference/bson.txt                     |  2 +
 .../method/MongoDBClient-getReadConcern.txt   | 30 ++++++++-------
 .../MongoDBClient-getReadPreference.txt       | 37 +++++++++----------
 .../method/MongoDBClient-getTypeMap.txt       | 23 ++++++++----
 .../method/MongoDBClient-getWriteConcern.txt  | 33 ++++++++++-------
 .../MongoDBCollection-getReadConcern.txt      | 28 ++++++++------
 .../MongoDBCollection-getReadPreference.txt   | 27 ++++++++------
 .../method/MongoDBCollection-getTypeMap.txt   | 21 +++++++----
 .../MongoDBCollection-getWriteConcern.txt     | 31 ++++++++++------
 .../method/MongoDBDatabase-getReadConcern.txt | 28 ++++++++------
 .../MongoDBDatabase-getReadPreference.txt     | 31 +++++++++-------
 .../method/MongoDBDatabase-getTypeMap.txt     | 21 +++++++----
 .../MongoDBDatabase-getWriteConcern.txt       | 31 ++++++++++------
 .../MongoDBGridFSBucket-getReadConcern.txt    | 31 ++++++++++------
 .../MongoDBGridFSBucket-getReadPreference.txt | 33 ++++++++++-------
 .../method/MongoDBGridFSBucket-getTypeMap.txt | 26 ++++++++-----
 .../MongoDBGridFSBucket-getWriteConcern.txt   | 34 +++++++++++------
 17 files changed, 280 insertions(+), 187 deletions(-)

diff --git a/source/reference/bson.txt b/source/reference/bson.txt
index b7a16e5f..1ddf4422 100644
--- a/source/reference/bson.txt
+++ b/source/reference/bson.txt
@@ -50,6 +50,8 @@ BSON Classes
    serialize as a document type (:php:`object casting
    ` is used internally).
 
+.. _php-type-map:
+
 Type Maps
 ---------
 
diff --git a/source/reference/method/MongoDBClient-getReadConcern.txt b/source/reference/method/MongoDBClient-getReadConcern.txt
index c3d31318..d5ab3c47 100644
--- a/source/reference/method/MongoDBClient-getReadConcern.txt
+++ b/source/reference/method/MongoDBClient-getReadConcern.txt
@@ -1,6 +1,6 @@
-========================================
+=================================
 MongoDB\\Client::getReadConcern()
-========================================
+=================================
 
 .. default-domain:: mongodb
 
@@ -15,11 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Client::getReadConcern()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\ReadConcern ` used by this
-   :phpclass:`Client `.
-
-   Returns the default read concern of this client.
+   Returns the read concern for this client.
 
    .. code-block:: php
 
@@ -37,16 +33,24 @@ Example
 
     MongoDB\Driver\ReadConcern::MAJORITY]
-   );
+   $client = new MongoDB\Client('mongodb://127.0.0.1/', [
+       'readConcernLevel' => 'majority',
+   ]);
+
+   var_dump($client->getReadConcern());
+
+The output would then resemble::
 
-   MongoDB\Driver\ReadConcern::MAJORITY === $client->getReadConcern()->getLevel(); // true
+   object(MongoDB\Driver\ReadConcern)#5 (1) {
+     ["level"]=>
+     string(8) "majority"
+   }
 
 See Also
 --------
 
+- :manual:`Read Concern ` in the MongoDB manual
+- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
 - :phpmethod:`MongoDB\\Collection::getReadConcern()`
 - :phpmethod:`MongoDB\\Database::getReadConcern()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBClient-getReadPreference.txt b/source/reference/method/MongoDBClient-getReadPreference.txt
index da8ae039..46a63d92 100644
--- a/source/reference/method/MongoDBClient-getReadPreference.txt
+++ b/source/reference/method/MongoDBClient-getReadPreference.txt
@@ -1,6 +1,6 @@
-========================================
+====================================
 MongoDB\\Client::getReadPreference()
-========================================
+====================================
 
 .. default-domain:: mongodb
 
@@ -15,11 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Client::getReadPreference()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\ReadPreference ` used by this
-   :phpclass:`Client `.
-
-   Returns the default read preference of this client.
+   Returns the read preference for this client.
 
    .. code-block:: php
 
@@ -28,7 +24,8 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference ` object.
+A :php:`MongoDB\\Driver\\ReadPreference `
+object.
 
 Example
 -------
@@ -37,23 +34,23 @@ Example
 
     MongoDB\Driver\ReadPreference::RP_PRIMARY,
-           'readPreferenceTags' => ['foo' => 'bar', 'spam' => 'egg'],
-           'maxStalenessSeconds' => 150,
-       ]
-   );
+   $client = new MongoDB\Client('mongodb://127.0.0.1/', [
+       'readPreference' => 'primaryPreferred',
+   ]);
+
+   var_dump($client->getReadPreference());
 
-   $readPreference = $client->getReadPreference();
+The output would then resemble::
 
-   MongoDB\Driver\ReadPreference::RP_PRIMARY === $readPreference->getMode(); // true
-   ['foo' => 'bar', 'spam' => 'egg'] === $readPreference->getTags(); // true
-   150 = $readPreference->getMaxStalenessSeconds(); // true
+   object(MongoDB\Driver\ReadPreference)#5 (1) {
+     ["mode"]=>
+     string(16) "primaryPreferred"
+   }
 
 See Also
 --------
 
+- :manual:`Read Preference ` in the MongoDB manual
 - :phpmethod:`MongoDB\\Collection::getReadPreference()`
 - :phpmethod:`MongoDB\\Database::getReadPreference()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBClient-getTypeMap.txt b/source/reference/method/MongoDBClient-getTypeMap.txt
index 97be3de2..090405bc 100644
--- a/source/reference/method/MongoDBClient-getTypeMap.txt
+++ b/source/reference/method/MongoDBClient-getTypeMap.txt
@@ -1,6 +1,6 @@
-========================================
+=============================
 MongoDB\\Client::getTypeMap()
-========================================
+=============================
 
 .. default-domain:: mongodb
 
@@ -15,7 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Client::getTypeMap()
 
-   Accessor for the type map used by this :phpclass:`Client `.
+   Returns the type map for this client.
 
    .. code-block:: php
 
@@ -24,7 +24,7 @@ Definition
 Return Values
 -------------
 
-A type map array.
+A :ref:`type map ` array.
 
 Example
 -------
@@ -33,12 +33,17 @@ Example
 
     'array', 'document' => 'array', 'array' => 'array'];
-   $client = new MongoDB\Client('mongodb://127.0.0.1/', [], ['typeMap' => $typeMap]);
-   $client->getTypeMap() === $typeMap; //true
+   $client = new MongoDB\Client('mongodb://127.0.0.1/', [], [
+       'typeMap' => [
+           'root' => 'array',
+           'document' => 'array',
+           'array' => 'array',
+       ],
+   ]);
+
    var_dump($client->getTypeMap());
 
-The output will be as follows:
+The output would then resemble::
 
    array(3) {
      ["root"]=>
@@ -52,5 +57,7 @@ The output will be as follows:
 See Also
 --------
 
+- :doc:`/reference/bson`
 - :phpmethod:`MongoDB\\Collection::getTypeMap()`
 - :phpmethod:`MongoDB\\Database::getTypeMap()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBClient-getWriteConcern.txt b/source/reference/method/MongoDBClient-getWriteConcern.txt
index cbe1777b..349cb051 100644
--- a/source/reference/method/MongoDBClient-getWriteConcern.txt
+++ b/source/reference/method/MongoDBClient-getWriteConcern.txt
@@ -1,6 +1,6 @@
-========================================
+==================================
 MongoDB\\Client::getWriteConcern()
-========================================
+==================================
 
 .. default-domain:: mongodb
 
@@ -15,11 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Client::getWriteConcern()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\WriteConcern ` used by this
-   :phpclass:`Client `.
-
-   Returns the default write concern of this client.
+   Returns the write concern for this client.
 
    .. code-block:: php
 
@@ -28,7 +24,8 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern ` object.
+A :php:`MongoDB\\Driver\\WriteConcern `
+object.
 
 Example
 -------
@@ -37,14 +34,24 @@ Example
 
     1, 'wTimeoutMS' => 100, 'journal' => true]);
-   $writeConcern = $client->getWriteConcern();
-   1 === $writeConcern->getW(); // true
-   100 === $writeConcern->getWtimeout(); // true
-   $writeConcern->getJournal(); // true
+   $client = new MongoDB\Client('mongodb://127.0.0.1/', [
+       'journal' => true,
+   ]);
+
+   var_dump($client->getWriteConcern());
+
+The output would then resemble::
+
+   object(MongoDB\Driver\WriteConcern)#4 (1) {
+     ["j"]=>
+     bool(true)
+   }
 
 See Also
 --------
 
+- :manual:`Write Concern ` in the MongoDB manual
+- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
 - :phpmethod:`MongoDB\\Collection::getWriteConcern()`
 - :phpmethod:`MongoDB\\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBCollection-getReadConcern.txt b/source/reference/method/MongoDBCollection-getReadConcern.txt
index c3062fa0..5c0fc468 100644
--- a/source/reference/method/MongoDBCollection-getReadConcern.txt
+++ b/source/reference/method/MongoDBCollection-getReadConcern.txt
@@ -1,6 +1,6 @@
-========================================
+=====================================
 MongoDB\\Collection::getReadConcern()
-========================================
+=====================================
 
 .. default-domain:: mongodb
 
@@ -15,11 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Collection::getReadConcern()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\ReadConcern ` used by this
-   :phpclass:`Collection `.
-
-   Returns the default read concern of this collection.
+   Returns the read concern for this collection.
 
    .. code-block:: php
 
@@ -37,14 +33,24 @@ Example
 
    test->selectCollection('test', ['readConcern' => $readConcern]);
+   $collection = (new MongoDB\Client)->selectCollection('test', 'users', [
+      'readConcern' => new MongoDB\Driver\ReadConcern(MongoDB\Driver\ReadConcern::MAJORITY),
+   ]);
+
+   var_dump($collection->getReadConcern());
+
+The output would then resemble::
 
-   $collection->getReadConcern() === $readConcern; // true
+   object(MongoDB\Driver\ReadConcern)#5 (1) {
+     ["level"]=>
+     string(8) "majority"
+   }
 
 See Also
 --------
 
+- :manual:`Read Concern ` in the MongoDB manual
+- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
 - :phpmethod:`MongoDB\\Client::getReadConcern()`
 - :phpmethod:`MongoDB\\Database::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\Bucket::getReadConcern()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBCollection-getReadPreference.txt b/source/reference/method/MongoDBCollection-getReadPreference.txt
index 3a6acb5d..b46bf716 100644
--- a/source/reference/method/MongoDBCollection-getReadPreference.txt
+++ b/source/reference/method/MongoDBCollection-getReadPreference.txt
@@ -15,11 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Collection::getReadPreference()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\ReadPreference ` used by this
-   :phpclass:`Collection `.
-
-   Returns the default read preference of this collection.
+   Returns the read preference for this collection.
 
    .. code-block:: php
 
@@ -28,7 +24,8 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference ` object.
+A :php:`MongoDB\\Driver\\ReadPreference `
+object.
 
 Example
 -------
@@ -37,17 +34,23 @@ Example
 
    test->selectCollection(
-       'test',
-       ['readPreference' => $readPreference]
-   );
+   $collection = (new MongoDB\Client)->selectCollection('test', 'users', [
+       'readPreference' => new MongoDB\Driver\ReadPreference('primaryPreferred'),
+   ]);
+
+   var_dump($collection->getReadPreference());
+
+The output would then resemble::
 
-   $collection->getReadPreference() === $readPreference; // true
+   object(MongoDB\Driver\ReadPreference)#5 (1) {
+     ["mode"]=>
+     string(16) "primaryPreferred"
+   }
 
 See Also
 --------
 
+- :manual:`Read Preference ` in the MongoDB manual
 - :phpmethod:`MongoDB\\Client::getReadPreference()`
 - :phpmethod:`MongoDB\\Database::getReadPreference()`
 - :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBCollection-getTypeMap.txt b/source/reference/method/MongoDBCollection-getTypeMap.txt
index 20544b30..a9e6f606 100644
--- a/source/reference/method/MongoDBCollection-getTypeMap.txt
+++ b/source/reference/method/MongoDBCollection-getTypeMap.txt
@@ -1,6 +1,6 @@
-========================================
+=================================
 MongoDB\\Collection::getTypeMap()
-========================================
+=================================
 
 .. default-domain:: mongodb
 
@@ -15,7 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Collection::getTypeMap()
 
-   Accessor for the type map used by this :phpclass:`Collection `.
+   Returns the type map for this collection.
 
    .. code-block:: php
 
@@ -24,7 +24,7 @@ Definition
 Return Values
 -------------
 
-A type map array.
+A :ref:`type map ` array.
 
 Example
 -------
@@ -33,13 +33,17 @@ Example
 
     'array', 'document' => 'array', 'array' => 'array'];
-   $collection = (new MongoDB\Client)->test->selectCollection('test', ['typeMap' => $typeMap]);
+   $collection = (new MongoDB\Client)->selectCollection('test', 'users', [
+       'typeMap' => [
+           'root' => 'array',
+           'document' => 'array',
+           'array' => 'array',
+       ],
+   ]);
 
-   $collection->getTypeMap() === $typeMap; //true
    var_dump($collection->getTypeMap());
 
-The output will be as follows:
+The output would then resemble::
 
    array(3) {
      ["root"]=>
@@ -53,6 +57,7 @@ The output will be as follows:
 See Also
 --------
 
+- :doc:`/reference/bson`
 - :phpmethod:`MongoDB\\Client::getTypeMap()`
 - :phpmethod:`MongoDB\\Database::getTypeMap()`
 - :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBCollection-getWriteConcern.txt b/source/reference/method/MongoDBCollection-getWriteConcern.txt
index 6ac0a91f..ea283226 100644
--- a/source/reference/method/MongoDBCollection-getWriteConcern.txt
+++ b/source/reference/method/MongoDBCollection-getWriteConcern.txt
@@ -1,6 +1,6 @@
-========================================
+======================================
 MongoDB\\Collection::getWriteConcern()
-========================================
+======================================
 
 .. default-domain:: mongodb
 
@@ -15,11 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Collection::getWriteConcern()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\WriteConcern ` used by this
-   :phpclass:`Collection `.
-
-   Returns the default write concern of this collection.
+   Returns the write concern for this collection.
 
    .. code-block:: php
 
@@ -28,7 +24,8 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern ` object.
+A :php:`MongoDB\\Driver\\WriteConcern `
+object.
 
 Example
 -------
@@ -37,14 +34,26 @@ Example
 
    test->selectCollection('test', ['writeConcern' => $writeConcern]);
+   $collection = (new MongoDB\Client)->selectCollection('test', 'users', [
+      'writeConcern' => new MongoDB\Driver\WriteConcern(1, 0, true),
+   ]);
+
+   var_dump($collection->getWriteConcern());
+
+The output would then resemble::
 
-   $collection->getWriteConcern() === $writeConcern; // true
+   object(MongoDB\Driver\WriteConcern)#5 (2) {
+     ["w"]=>
+     int(1)
+     ["j"]=>
+     bool(true)
+   }
 
 See Also
 --------
 
+- :manual:`Write Concern ` in the MongoDB manual
+- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
 - :phpmethod:`MongoDB\\Client::getWriteConcern()`
 - :phpmethod:`MongoDB\\Database::getWriteConcern()`
 - :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBDatabase-getReadConcern.txt b/source/reference/method/MongoDBDatabase-getReadConcern.txt
index 334813b3..17eca777 100644
--- a/source/reference/method/MongoDBDatabase-getReadConcern.txt
+++ b/source/reference/method/MongoDBDatabase-getReadConcern.txt
@@ -1,6 +1,6 @@
-========================================
+===================================
 MongoDB\\Database::getReadConcern()
-========================================
+===================================
 
 .. default-domain:: mongodb
 
@@ -15,11 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Database::getReadConcern()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\ReadConcern ` used by this
-   :phpclass:`Database `.
-
-   Returns the default read concern of this database.
+   Returns the read concern for this database.
 
    .. code-block:: php
 
@@ -37,14 +33,24 @@ Example
 
    selectDatabase('test', ['readConcern' => $readConcern]);
+   $database = (new MongoDB\Client)->selectDatabase('test', [
+      'readConcern' => new MongoDB\Driver\ReadConcern(MongoDB\Driver\ReadConcern::MAJORITY),
+   ]);
+
+   var_dump($database->getReadConcern());
+
+The output would then resemble::
 
-   $database->getReadConcern() === $readConcern; // true
+   object(MongoDB\Driver\ReadConcern)#5 (1) {
+     ["level"]=>
+     string(8) "majority"
+   }
 
 See Also
 --------
 
+- :manual:`Read Concern ` in the MongoDB manual
+- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
 - :phpmethod:`MongoDB\\Client::getReadConcern()`
 - :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\Bucket::getReadConcern()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBDatabase-getReadPreference.txt b/source/reference/method/MongoDBDatabase-getReadPreference.txt
index 5ee66c9a..364bcc0d 100644
--- a/source/reference/method/MongoDBDatabase-getReadPreference.txt
+++ b/source/reference/method/MongoDBDatabase-getReadPreference.txt
@@ -1,6 +1,6 @@
-========================================
+======================================
 MongoDB\\Database::getReadPreference()
-========================================
+======================================
 
 .. default-domain:: mongodb
 
@@ -15,11 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Database::getReadPreference()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\ReadPreference ` used by this
-   :phpclass:`Database `.
-
-   Returns the default read preference of this database.
+   Returns the read preference for this database.
 
    .. code-block:: php
 
@@ -28,7 +24,8 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference ` object.
+A :php:`MongoDB\\Driver\\ReadPreference `
+object.
 
 Example
 -------
@@ -37,17 +34,23 @@ Example
 
    selectDatabase(
-       'test',
-       ['readPreference' => $readPreference]
-   );
+   $database = (new MongoDB\Client)->selectDatabase('test', [
+       'readPreference' => new MongoDB\Driver\ReadPreference('primaryPreferred'),
+   ]);
+
+   var_dump($database->getReadPreference());
+
+The output would then resemble::
 
-   $database->getReadPreference() === $readPreference; // true
+   object(MongoDB\Driver\ReadPreference)#5 (1) {
+     ["mode"]=>
+     string(16) "primaryPreferred"
+   }
 
 See Also
 --------
 
+- :manual:`Read Preference ` in the MongoDB manual
 - :phpmethod:`MongoDB\\Client::getReadPreference()`
 - :phpmethod:`MongoDB\\Collection::getReadPreference()`
 - :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBDatabase-getTypeMap.txt b/source/reference/method/MongoDBDatabase-getTypeMap.txt
index fe44ab79..b8735c40 100644
--- a/source/reference/method/MongoDBDatabase-getTypeMap.txt
+++ b/source/reference/method/MongoDBDatabase-getTypeMap.txt
@@ -1,6 +1,6 @@
-========================================
+===============================
 MongoDB\\Database::getTypeMap()
-========================================
+===============================
 
 .. default-domain:: mongodb
 
@@ -15,7 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Database::getTypeMap()
 
-   Accessor for the type map used by this :phpclass:`Database `.
+   Returns the type map for this database.
 
    .. code-block:: php
 
@@ -24,7 +24,7 @@ Definition
 Return Values
 -------------
 
-A type map array.
+A :ref:`type map ` array.
 
 Example
 -------
@@ -33,13 +33,17 @@ Example
 
     'array', 'document' => 'array', 'array' => 'array'];
-   $database = (new MongoDB\Client)->selectDatabase('test', ['typeMap' => $typeMap]);
+   $database = (new MongoDB\Client)->selectDatabase('test', [
+       'typeMap' => [
+           'root' => 'array',
+           'document' => 'array',
+           'array' => 'array',
+       ],
+   ]);
 
-   $database->getTypeMap() === $typeMap; //true
    var_dump($database->getTypeMap());
 
-The output will be as follows:
+The output would then resemble::
 
    array(3) {
      ["root"]=>
@@ -53,6 +57,7 @@ The output will be as follows:
 See Also
 --------
 
+- :doc:`/reference/bson`
 - :phpmethod:`MongoDB\\Client::getTypeMap()`
 - :phpmethod:`MongoDB\\Collection::getTypeMap()`
 - :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBDatabase-getWriteConcern.txt b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
index 73095026..2d0c3a36 100644
--- a/source/reference/method/MongoDBDatabase-getWriteConcern.txt
+++ b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
@@ -1,6 +1,6 @@
-========================================
+====================================
 MongoDB\\Database::getWriteConcern()
-========================================
+====================================
 
 .. default-domain:: mongodb
 
@@ -15,11 +15,7 @@ Definition
 
 .. phpmethod:: MongoDB\\Database::getWriteConcern()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\WriteConcern ` used by this
-   :phpclass:`Database `.
-
-   Returns the default write concern of this database.
+   Returns the write concern for this database.
 
    .. code-block:: php
 
@@ -28,7 +24,8 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern ` object.
+A :php:`MongoDB\\Driver\\WriteConcern `
+object.
 
 Example
 -------
@@ -37,14 +34,26 @@ Example
 
    selectDatabase('test', ['writeConcern' => $writeConcern]);
+   $database = (new MongoDB\Client)->selectDatabase('test', [
+      'writeConcern' => new MongoDB\Driver\WriteConcern(1, 0, true),
+   ]);
+
+   var_dump($database->getWriteConcern());
+
+The output would then resemble::
 
-   $database->getWriteConcern() === $writeConcern; // true
+   object(MongoDB\Driver\WriteConcern)#5 (2) {
+     ["w"]=>
+     int(1)
+     ["j"]=>
+     bool(true)
+   }
 
 See Also
 --------
 
+- :manual:`Write Concern ` in the MongoDB manual
+- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
 - :phpmethod:`MongoDB\\Client::getWriteConcern()`
 - :phpmethod:`MongoDB\\Collection::getWriteConcern()`
 - :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
index b52abf05..60a17b57 100644
--- a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
@@ -1,6 +1,6 @@
-========================================
-MongoDB\\GridFS\Bucket::getReadConcern()
-========================================
+=========================================
+MongoDB\\GridFS\\Bucket::getReadConcern()
+=========================================
 
 .. default-domain:: mongodb
 
@@ -13,13 +13,9 @@ MongoDB\\GridFS\Bucket::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\Bucket::getReadConcern()
+.. phpmethod:: MongoDB\\GridFS\\Bucket::getReadConcern()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\ReadConcern ` used by this
-   :phpclass:`Bucket `.
-
-   Returns the default read concern of this bucket.
+   Returns the read concern for this GridFS bucket.
 
    .. code-block:: php
 
@@ -37,14 +33,25 @@ Example
 
    test->selectGridFSBucket(['readConcern' => $readConcern]);
+   $database = (new MongoDB\Client)->selectDatabase('test');
+   $bucket = $database->selectGridFSBucket([
+      'readConcern' => new MongoDB\Driver\ReadConcern(MongoDB\Driver\ReadConcern::MAJORITY),
+   ]);
+
+   var_dump($bucket->getReadConcern());
+
+The output would then resemble::
 
-   $bucket->getReadConcern() === $readConcern; // true
+   object(MongoDB\Driver\ReadConcern)#3 (1) {
+     ["level"]=>
+     string(8) "majority"
+   }
 
 See Also
 --------
 
+- :manual:`Read Concern ` in the MongoDB manual
+- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
 - :phpmethod:`MongoDB\\Client::getReadConcern()`
 - :phpmethod:`MongoDB\\Collection::getReadConcern()`
 - :phpmethod:`MongoDB\\Database::getReadConcern()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
index 7db2c209..cee0479d 100644
--- a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
@@ -1,6 +1,6 @@
-========================================
-MongoDB\\GridFS\Bucket::getReadPreference()
-========================================
+============================================
+MongoDB\\GridFS\\Bucket::getReadPreference()
+============================================
 
 .. default-domain:: mongodb
 
@@ -13,13 +13,9 @@ MongoDB\\GridFS\Bucket::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\Bucket::getReadPreference()
+.. phpmethod:: MongoDB\\GridFS\\Bucket::getReadPreference()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\ReadPreference ` used by this
-   :phpclass:`Bucket `.
-
-   Returns the default read preference of this bucket.
+   Returns the read preference for this GridFS bucket.
 
    .. code-block:: php
 
@@ -28,7 +24,8 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference ` object.
+A :php:`MongoDB\\Driver\\ReadPreference `
+object.
 
 Example
 -------
@@ -37,14 +34,24 @@ Example
 
    test->selectGridFSBucket(['readPreference' => $readPreference]);
+   $database = (new MongoDB\Client)->selectDatabase('test');
+   $bucket = $database->selectGridFSBucket([
+      'readPreference' => new MongoDB\Driver\ReadPreference('primaryPreferred'),
+   ]);
+
+   var_dump($bucket->getReadPreference());
+
+The output would then resemble::
 
-   $bucket->getReadPreference() === $readPreference; // true
+   object(MongoDB\Driver\ReadPreference)#3 (1) {
+     ["mode"]=>
+     string(16) "primaryPreferred"
+   }
 
 See Also
 --------
 
+- :manual:`Read Preference ` in the MongoDB manual
 - :phpmethod:`MongoDB\\Client::getReadPreference()`
 - :phpmethod:`MongoDB\\Collection::getReadPreference()`
 - :phpmethod:`MongoDB\\Database::getReadPreference()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
index b73d1178..25b2c5d3 100644
--- a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
@@ -1,6 +1,6 @@
-========================================
-MongoDB\\GridFS\Bucket::getTypeMap()
-========================================
+=====================================
+MongoDB\\GridFS\\Bucket::getTypeMap()
+=====================================
 
 .. default-domain:: mongodb
 
@@ -13,9 +13,9 @@ MongoDB\\GridFS\Bucket::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\Bucket::getTypeMap()
+.. phpmethod:: MongoDB\\GridFS\\Bucket::getTypeMap()
 
-   Accessor for the type map used by this :phpclass:`Bucket `.
+   Returns the type map for this GridFS bucket.
 
    .. code-block:: php
 
@@ -24,7 +24,7 @@ Definition
 Return Values
 -------------
 
-A type map array.
+A :ref:`type map ` array.
 
 Example
 -------
@@ -33,13 +33,18 @@ Example
 
     'array', 'document' => 'array', 'array' => 'array'];
-   $bucket = (new MongoDB\Client)->test->selectGridFSBucket(['typeMap' => $typeMap]);
+   $database = (new MongoDB\Client)->selectDatabase('test');
+   $bucket = $database->selectGridFSBucket([
+       'typeMap' => [
+           'root' => 'array',
+           'document' => 'array',
+           'array' => 'array',
+       ],
+   ]);
 
-   $bucket->getTypeMap() === $typeMap; //true
    var_dump($bucket->getTypeMap());
 
-The output will be as follows:
+The output would then resemble::
 
    array(3) {
      ["root"]=>
@@ -53,6 +58,7 @@ The output will be as follows:
 See Also
 --------
 
+- :doc:`/reference/bson`
 - :phpmethod:`MongoDB\\Client::getTypeMap()`
 - :phpmethod:`MongoDB\\Collection::getTypeMap()`
 - :phpmethod:`MongoDB\\Database::getTypeMap()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
index dff8e7e9..edf7f5dc 100644
--- a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
@@ -1,6 +1,6 @@
-========================================
+=========================================
 MongoDB\\GridFS\Bucket::getWriteConcern()
-========================================
+=========================================
 
 .. default-domain:: mongodb
 
@@ -13,13 +13,9 @@ MongoDB\\GridFS\Bucket::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\Bucket::getWriteConcern()
+.. phpmethod:: MongoDB\\GridFS\\Bucket::getWriteConcern()
 
-   Accessor for the
-   :php:`MongoDB\\Driver\\WriteConcern ` used by this
-   :phpclass:`Bucket `.
-
-   Returns the default write concern of this bucket.
+   Returns the write concern for this GridFS bucket.
 
    .. code-block:: php
 
@@ -28,7 +24,8 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern ` object.
+A :php:`MongoDB\\Driver\\WriteConcern `
+object.
 
 Example
 -------
@@ -37,14 +34,27 @@ Example
 
    test->selectGridFSBucket(['writeConcern' => $writeConcern]);
+   $database = (new MongoDB\Client)->selectDatabase('test');
+   $bucket = $database->selectGridFSBucket([
+      'writeConcern' => new MongoDB\Driver\WriteConcern(1, 0, true),
+   ]);
+
+   var_dump($bucket->getWriteConcern());
+
+The output would then resemble::
 
-   $bucket->getWriteConcern() === $writeConcern; // true
+   object(MongoDB\Driver\WriteConcern)#3 (2) {
+     ["w"]=>
+     int(1)
+     ["j"]=>
+     bool(true)
+   }
 
 See Also
 --------
 
+- :manual:`Write Concern ` in the MongoDB manual
+- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
 - :phpmethod:`MongoDB\\Client::getWriteConcern()`
 - :phpmethod:`MongoDB\\Collection::getWriteConcern()`
 - :phpmethod:`MongoDB\\Database::getWriteConcern()`

From 50f85a6fa64cf1cacd83d7c24663eb1b0c3d04de Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 13 Sep 2017 14:11:18 -0400
Subject: [PATCH 104/321] Improve description of type map in BSON docs

---
 source/reference/bson.txt | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/source/reference/bson.txt b/source/reference/bson.txt
index 1ddf4422..4f506c7b 100644
--- a/source/reference/bson.txt
+++ b/source/reference/bson.txt
@@ -74,6 +74,19 @@ default:
        'root' => 'MongoDB\Model\BSONDocument',
    ]
 
+The type map above will convert BSON documents and arrays to
+:phpclass:`MongoDB\\Model\\BSONDocument` and
+:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The ``root`` and
+``document`` keys are used to distinguish the top-level BSON document from
+embedded documents, respectively.
+
+A type map may specify any class that implements
+:php:`MongoDB\\BSON\\Unserializable ` as well as
+``"array"``, ``"stdClass``", and ``"object"`` (``"stdClass``" and ``"object"``
+are aliases of one another).
+
+.. seealso:: :php:`Deserialization from BSON ` in the PHP manual
+
 ``Persistable`` Classes
 -----------------------
 

From 2fd60d9a0bf0de538a03b153d1da04f4ecb22c68 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 14 Sep 2017 16:53:06 -0400
Subject: [PATCH 105/321] PHPLIB-280: Rename ObjectID to ObjectId

---
 .../apiargs-MongoDBGridFSBucket-common-option.yaml   |  2 +-
 source/includes/extracts-note.yaml                   |  2 +-
 source/reference/bson.txt                            |  4 ++--
 .../method/MongoDBBulkWriteResult-getInsertedIds.txt |  2 +-
 .../method/MongoDBBulkWriteResult-getUpsertedIds.txt |  2 +-
 source/reference/method/MongoDBCollection-find.txt   | 10 +++++-----
 .../reference/method/MongoDBCollection-findOne.txt   |  8 ++++----
 .../method/MongoDBCollection-findOneAndDelete.txt    |  2 +-
 .../method/MongoDBCollection-findOneAndReplace.txt   |  2 +-
 .../method/MongoDBCollection-findOneAndUpdate.txt    |  2 +-
 .../method/MongoDBCollection-insertMany.txt          |  4 ++--
 .../reference/method/MongoDBCollection-insertOne.txt |  2 +-
 .../method/MongoDBGridFSBucket-uploadFromStream.txt  |  2 +-
 .../MongoDBInsertManyResult-getInsertedIds.txt       |  2 +-
 .../method/MongoDBInsertOneResult-getInsertedId.txt  |  2 +-
 .../method/MongoDBUpdateResult-getUpsertedId.txt     |  2 +-
 source/tutorial/commands.txt                         |  6 +++---
 source/tutorial/crud.txt                             | 12 ++++++------
 18 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
index 8c6470d8..fbfa0dcf 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
@@ -3,7 +3,7 @@ name: _id
 type: mixed
 description: |
   Value to use as the file document identifier. Defaults to a new
-  :php:`MongoDB\\BSON\\ObjectID ` object.
+  :php:`MongoDB\\BSON\\ObjectId ` object.
 interface: phpmethod
 operation: ~
 optional: true
diff --git a/source/includes/extracts-note.yaml b/source/includes/extracts-note.yaml
index 05caf35e..7790f0c3 100644
--- a/source/includes/extracts-note.yaml
+++ b/source/includes/extracts-note.yaml
@@ -7,6 +7,6 @@ content: |
   ` rules. When matching a special
   BSON type the query criteria should use the respective :php:`BSON class
   ` in the driver (e.g. use
-  :php:`MongoDB\\BSON\\ObjectID ` to match an
+  :php:`MongoDB\\BSON\\ObjectId ` to match an
   :manual:`ObjectId `).
 ...
diff --git a/source/reference/bson.txt b/source/reference/bson.txt
index 4f506c7b..c366ea8a 100644
--- a/source/reference/bson.txt
+++ b/source/reference/bson.txt
@@ -124,7 +124,7 @@ Consider the following class definition:
        
        public function __construct($name)
        {
-           $this->id = new MongoDB\BSON\ObjectID;
+           $this->id = new MongoDB\BSON\ObjectId;
            $this->name = (string) $name;
            $this->createdAt = new MongoDB\BSON\UTCDateTime;
        }
@@ -167,7 +167,7 @@ The output would then resemble:
 
    object(Person)#18 (3) {
      ["id":"Person":private]=>
-     object(MongoDB\BSON\ObjectID)#15 (1) {
+     object(MongoDB\BSON\ObjectId)#15 (1) {
        ["oid"]=>
        string(24) "56fad2c36118fd2e9820cfc1"
      }
diff --git a/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt b/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
index 679c9400..bcbcd536 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
@@ -34,5 +34,5 @@ insert operations in the bulk write.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to inserting (i.e. the driver did
 not generate an ID), the index will contain its ``_id`` field value. Any
-driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectID
+driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
 ` instance.
diff --git a/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt b/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
index fb2232a1..6abad98f 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
@@ -31,7 +31,7 @@ update and replace operations in the bulk write.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to upserting (i.e. the server did
 not generate an ID), the index will contain its ``_id`` field value. Any
-server-generated ID will be a :php:`MongoDB\\BSON\\ObjectID
+server-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
 ` instance.
 
 Errors/Exceptions
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 0849338e..34eed99a 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -83,7 +83,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(4) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#8 (1) {
+       object(MongoDB\BSON\ObjectId)#8 (1) {
          ["oid"]=>
          string(24) "576023c6b02fa9281da3f983"
        }
@@ -99,7 +99,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(4) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#12 (1) {
+       object(MongoDB\BSON\ObjectId)#12 (1) {
          ["oid"]=>
          string(24) "576023c6b02fa9281da3f98d"
        }
@@ -115,7 +115,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(4) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#10 (1) {
+       object(MongoDB\BSON\ObjectId)#10 (1) {
          ["oid"]=>
          string(24) "576023c6b02fa9281da3f99b"
        }
@@ -131,7 +131,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(4) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#13 (1) {
+       object(MongoDB\BSON\ObjectId)#13 (1) {
          ["oid"]=>
          string(24) "576023c6b02fa9281da3f9a8"
        }
@@ -147,7 +147,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(4) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#8 (1) {
+       object(MongoDB\BSON\ObjectId)#8 (1) {
          ["oid"]=>
          string(24) "576023c6b02fa9281da3f9b4"
        }
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index b6a0316b..0bf95f64 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -56,9 +56,9 @@ Matching BSON Types in Query Criteria
 
 In the following example, documents in the ``restaurants`` collection use an
 :manual:`ObjectId ` for their identifier (the default)
-and documents in the ``zips`` collection use a string. Since ObjectID is a
+and documents in the ``zips`` collection use a string. Since ObjectId is a
 special BSON type, the query criteria for selecting a restaurant must use the
-:php:`MongoDB\\BSON\\ObjectID ` class.
+:php:`MongoDB\\BSON\\ObjectId ` class.
 
 .. code-block:: php
 
@@ -67,7 +67,7 @@ special BSON type, the query criteria for selecting a restaurant must use the
    $zip = $database->zips->findOne(['_id' => '10036']);
 
    $restaurant = $database->restaurants->findOne([
-       '_id' => new MongoDB\BSON\ObjectID('594d5ef280a846852a4b3f70'),
+       '_id' => new MongoDB\BSON\ObjectId('594d5ef280a846852a4b3f70'),
    ]);
 
 Projecting Fields
@@ -104,7 +104,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(4) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#8 (1) {
+       object(MongoDB\BSON\ObjectId)#8 (1) {
          ["oid"]=>
          string(24) "576023c6b02fa9281da3f983"
        }
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index b6a88f0f..1253bad4 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -79,7 +79,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(4) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#11 (1) {
+       object(MongoDB\BSON\ObjectId)#11 (1) {
          ["oid"]=>
          string(24) "594d5ef280a846852a4b3f70"
        }
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 773f72d4..6a96a30b 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -121,7 +121,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(6) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#11 (1) {
+       object(MongoDB\BSON\ObjectId)#11 (1) {
          ["oid"]=>
          string(24) "594d5ef380a846852a4b5837"
        }
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index c05b5ed1..377d255e 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -80,7 +80,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(2) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#12 (1) {
+       object(MongoDB\BSON\ObjectId)#12 (1) {
          ["oid"]=>
          string(24) "594d5ef280a846852a4b3dee"
        }
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index a56db3de..8b7eb53b 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -84,12 +84,12 @@ The output would then resemble::
    Inserted 2 document(s)
    array(2) {
      [0]=>
-     object(MongoDB\BSON\ObjectID)#11 (1) {
+     object(MongoDB\BSON\ObjectId)#11 (1) {
        ["oid"]=>
        string(24) "579a25921f417dd1e5518141"
      }
      [1]=>
-     object(MongoDB\BSON\ObjectID)#12 (1) {
+     object(MongoDB\BSON\ObjectId)#12 (1) {
        ["oid"]=>
        string(24) "579a25921f417dd1e5518142"
      }
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index c5ff2dc1..0d25f6d5 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -74,7 +74,7 @@ The following operation inserts a document into the ``users`` collection in the
 The output would then resemble::
 
    Inserted 1 document(s)
-   object(MongoDB\BSON\ObjectID)#11 (1) {
+   object(MongoDB\BSON\ObjectId)#11 (1) {
      ["oid"]=>
      string(24) "579a25921f417dd1e5518141"
    }
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index f1c47f12..fa26bacc 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -34,7 +34,7 @@ Return Values
 
 The ``_id`` field of the metadata document associated with the newly created
 GridFS file. If the ``_id`` option is not specified, a new
-:php:`MongoDB\\BSON\\ObjectID ` object will be used
+:php:`MongoDB\\BSON\\ObjectId ` object will be used
 by default.
 
 Errors/Exceptions
diff --git a/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt b/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
index 88e76fe4..75c63870 100644
--- a/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
+++ b/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
@@ -32,5 +32,5 @@ A map of IDs (i.e. ``_id`` field values) for the inserted documents.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to inserting (i.e. the driver did
 not generate an ID), the index will contain its ``_id`` field value. Any
-driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectID
+driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
 ` instance.
diff --git a/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt b/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
index 7d7a3d67..8d4a01dd 100644
--- a/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
+++ b/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
@@ -31,5 +31,5 @@ The ID (i.e. ``_id`` field value) of the inserted document.
 
 If the document had an ID prior to inserting (i.e. the driver did not need to
 generate an ID), this will contain its ``_id`` field value. Any driver-generated
-ID will be a :php:`MongoDB\\BSON\\ObjectID `
+ID will be a :php:`MongoDB\\BSON\\ObjectId `
 instance.
diff --git a/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt b/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
index ed948c0d..52498708 100644
--- a/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
+++ b/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
@@ -29,7 +29,7 @@ upserted, ``null`` will be returned.
 
 If the document had an ID prior to upserting (i.e. the server did not need to
 generate an ID), this will contain its ``_id`` field value. Any server-generated
-ID will be a :php:`MongoDB\\BSON\\ObjectID `
+ID will be a :php:`MongoDB\\BSON\\ObjectId `
 instance.
 
 Errors/Exceptions
diff --git a/source/tutorial/commands.txt b/source/tutorial/commands.txt
index 6cb6fca3..88ce5ec9 100644
--- a/source/tutorial/commands.txt
+++ b/source/tutorial/commands.txt
@@ -74,7 +74,7 @@ The output would then resemble::
                  ["storage":"ArrayObject":private]=>
                  array(3) {
                    ["_id"]=>
-                   object(MongoDB\BSON\ObjectID)#3 (1) {
+                   object(MongoDB\BSON\ObjectId)#3 (1) {
                      ["oid"]=>
                      string(24) "55cba2486c522cafdb059bed"
                    }
@@ -113,7 +113,7 @@ The output would then resemble::
                  ["storage":"ArrayObject":private]=>
                  array(3) {
                    ["_id"]=>
-                   object(MongoDB\BSON\ObjectID)#15 (1) {
+                   object(MongoDB\BSON\ObjectId)#15 (1) {
                      ["oid"]=>
                      string(24) "55cba2476c522cafdb0544df"
                    }
@@ -152,7 +152,7 @@ The output would then resemble::
                  ["storage":"ArrayObject":private]=>
                  array(3) {
                    ["_id"]=>
-                   object(MongoDB\BSON\ObjectID)#20 (1) {
+                   object(MongoDB\BSON\ObjectId)#20 (1) {
                      ["oid"]=>
                      string(24) "55cba2476c522cafdb053c92"
                    }
diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index f009d187..28ba3b6c 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -145,7 +145,7 @@ The output would then resemble::
    ``"94301"``. The same criteria would not have matched a document with an
    integer value of ``94301`` due to MongoDB's :manual:`comparison rules for
    BSON types `. Similarly, users should
-   use a :php:`MongoDB\\BSON\\ObjectID ` object
+   use a :php:`MongoDB\\BSON\\ObjectId ` object
    when matching an ``_id`` with an :manual:`ObjectId `
    value, as strings and ObjectIds are not directly comparable.
 
@@ -237,7 +237,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(4) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#8 (1) {
+       object(MongoDB\BSON\ObjectId)#8 (1) {
          ["oid"]=>
          string(24) "576023c6b02fa9281da3f983"
        }
@@ -253,7 +253,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(4) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#12 (1) {
+       object(MongoDB\BSON\ObjectId)#12 (1) {
          ["oid"]=>
          string(24) "576023c6b02fa9281da3f98d"
        }
@@ -269,7 +269,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(4) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#10 (1) {
+       object(MongoDB\BSON\ObjectId)#10 (1) {
          ["oid"]=>
          string(24) "576023c6b02fa9281da3f99b"
        }
@@ -285,7 +285,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(4) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#13 (1) {
+       object(MongoDB\BSON\ObjectId)#13 (1) {
          ["oid"]=>
          string(24) "576023c6b02fa9281da3f9a8"
        }
@@ -658,7 +658,7 @@ The output would then resemble::
      ["storage":"ArrayObject":private]=>
      array(3) {
        ["_id"]=>
-       object(MongoDB\BSON\ObjectID)#15 (1) {
+       object(MongoDB\BSON\ObjectId)#15 (1) {
          ["oid"]=>
          string(24) "57509c4406d7241dad86e7c3"
        }

From c6ec0306e1b088597086afd2f79b1777d4a82883 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 15 Sep 2017 11:44:53 -0400
Subject: [PATCH 106/321] Fix docs title for getBucketName()

---
 .../reference/method/MongoDBGridFSBucket-getBucketName.txt  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
index 1fafde12..d8a43a3c 100644
--- a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
@@ -1,6 +1,6 @@
-===========================================
-MongoDB\\GridFS\\Bucket::downloadToStream()
-===========================================
+========================================
+MongoDB\\GridFS\\Bucket::getBucketName()
+========================================
 
 .. default-domain:: mongodb
 

From 630c810cd535e5ca07a1b181b3eeab69d6744c75 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 15 Sep 2017 11:35:00 -0400
Subject: [PATCH 107/321] PHPLIB-272: Implement chunkSizeBytes accessor for
 Bucket class

---
 .../reference/class/MongoDBGridFSBucket.txt   |  1 +
 .../MongoDBGridFSBucket-getChunkSizeBytes.txt | 29 +++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt

diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 0a3ad0a4..6f38080f 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -42,6 +42,7 @@ Methods
    /reference/method/MongoDBGridFSBucket-find
    /reference/method/MongoDBGridFSBucket-findOne
    /reference/method/MongoDBGridFSBucket-getBucketName
+   /reference/method/MongoDBGridFSBucket-getChunkSizeBytes
    /reference/method/MongoDBGridFSBucket-getDatabaseName
    /reference/method/MongoDBGridFSBucket-getFileDocumentForStream
    /reference/method/MongoDBGridFSBucket-getFileIdForStream
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
new file mode 100644
index 00000000..30ee467f
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
@@ -0,0 +1,29 @@
+============================================
+MongoDB\\GridFS\\Bucket::getChunkSizeBytes()
+============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::getChunkSizeBytes()
+
+   Returns the chunk size of this bucket in bytes.
+
+   .. code-block:: php
+
+      function getChunkSizeBytes(): integer
+
+Return Values
+-------------
+
+The chunk size of this bucket in bytes.
+
+.. todo: add examples

From a1eb7f656b95f4ff4e2b01dcf4c3085ccf0fda49 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 15 Sep 2017 12:05:05 -0400
Subject: [PATCH 108/321] PHPLIB-258: Accessors for GridFS files and chunks
 collections

---
 .../reference/class/MongoDBGridFSBucket.txt   |  2 ++
 ...ongoDBGridFSBucket-getChunksCollection.txt | 29 +++++++++++++++++++
 ...MongoDBGridFSBucket-getFilesCollection.txt | 29 +++++++++++++++++++
 3 files changed, 60 insertions(+)
 create mode 100644 source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
 create mode 100644 source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt

diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 6f38080f..cea877f4 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -42,10 +42,12 @@ Methods
    /reference/method/MongoDBGridFSBucket-find
    /reference/method/MongoDBGridFSBucket-findOne
    /reference/method/MongoDBGridFSBucket-getBucketName
+   /reference/method/MongoDBGridFSBucket-getChunksCollection
    /reference/method/MongoDBGridFSBucket-getChunkSizeBytes
    /reference/method/MongoDBGridFSBucket-getDatabaseName
    /reference/method/MongoDBGridFSBucket-getFileDocumentForStream
    /reference/method/MongoDBGridFSBucket-getFileIdForStream
+   /reference/method/MongoDBGridFSBucket-getFilesCollection
    /reference/method/MongoDBGridFSBucket-getReadConcern
    /reference/method/MongoDBGridFSBucket-getReadPreference
    /reference/method/MongoDBGridFSBucket-getTypeMap
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
new file mode 100644
index 00000000..354fa3e0
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
@@ -0,0 +1,29 @@
+==============================================
+MongoDB\\GridFS\\Bucket::getChunksCollection()
+==============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::getChunksCollection()
+
+   Returns the chunks collection used by the bucket.
+
+   .. code-block:: php
+
+      function getChunksCollection(): MongoDB\Collection
+
+Return Values
+-------------
+
+A :phpclass:`MongoDB\\Collection` object for the chunks collection.
+
+.. todo: add examples
diff --git a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
new file mode 100644
index 00000000..b4059cc8
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
@@ -0,0 +1,29 @@
+=============================================
+MongoDB\\GridFS\\Bucket::getFilesCollection()
+=============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::getFilesCollection()
+
+   Returns the files collection used by the bucket.
+
+   .. code-block:: php
+
+      function getFilesCollection(): MongoDB\Collection
+
+Return Values
+-------------
+
+A :phpclass:`MongoDB\\Collection` object for the files collection.
+
+.. todo: add examples

From 6f845ed3b7f4c4e9c4d50ce840c907147b284d7c Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 15 Sep 2017 14:14:12 -0400
Subject: [PATCH 109/321] PHPLIB-285: Do not convert count's hint document to a
 string

---
 .../apiargs-MongoDBCollection-method-count-option.yaml   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
index a3598c59..4999b78a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
@@ -6,8 +6,13 @@ arg_name: option
 name: hint
 type: string|array|object
 description: |
-  The index to use. If you specify a document, it is interpreted as an index
-  specification from which a name will be derived.
+  The index to use. Specify either the index name as a string or the index key
+  pattern as a document. If specified, then the query system will only consider
+  plans using the hinted index.
+
+  .. versionchanged:: 1.2
+     If a document is provided, it is passed to the command as-is. Previously,
+     the library would convert the key pattern to an index name.
 interface: phpmethod
 operation: ~
 optional: true

From af44af676c9309b8d5b2433f17a8e7615caadcca Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 15 Sep 2017 14:55:29 -0400
Subject: [PATCH 110/321] PHPLIB-286: Support hint option for Find and FindOne

---
 ...piargs-MongoDBCollection-method-find-option.yaml | 13 +++++++++++++
 ...rgs-MongoDBCollection-method-findOne-option.yaml |  4 ++++
 2 files changed, 17 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index c43a0a8d..1ceac458 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -80,6 +80,19 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+arg_name: option
+name: hint
+type: string|array|object
+description: |
+  The index to use. Specify either the index name as a string or the index key
+  pattern as a document. If specified, then the query system will only consider
+  plans using the hinted index.
+
+  .. versionadded:: 1.2
+interface: phpmethod
+operation: ~
+optional: true
+---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
index 4e3793e3..a708742a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
@@ -18,6 +18,10 @@ source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: comment
 ---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: hint
+---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS

From 564bda80ac9757e41bc47289bb68cf7786d061ee Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 15 Sep 2017 15:17:38 -0400
Subject: [PATCH 111/321] PHPLIB-287: Add named modifier options to Find and
 FindOne

Before PHPC 1.2.0, these options could only be specified as query modifiers.
---
 ...-MongoDBCollection-method-find-option.yaml | 68 +++++++++++++++++++
 ...ngoDBCollection-method-findOne-option.yaml | 20 ++++++
 2 files changed, 88 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index 1ceac458..9e8cbdf2 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -106,6 +106,39 @@ source:
   ref: readPreference
 ---
 arg_name: option
+name: max
+type: array|object
+description: |
+  The exclusive upper bound for a specific index.
+
+  .. versionadded:: 1.2
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: maxScan
+type: integer
+description: |
+  Maximum number of documents or index keys to scan when executing the query.
+
+  .. versionadded:: 1.2
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: min
+type: array|object
+description: |
+  The inclusive lower bound for a specific index.
+
+  .. versionadded:: 1.2
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
 name: oplogReplay
 type: boolean
 description: |
@@ -133,6 +166,41 @@ operation: ~
 optional: true
 ---
 arg_name: option
+name: returnKey
+type: boolean
+description: |
+  If true, returns only the index keys in the resulting documents.
+
+  .. versionadded:: 1.2
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: showRecordId
+type: boolean
+description: |
+  Determines whether to return the record identifier for each document. If true,
+  adds a field $recordId to the returned documents.
+
+  .. versionadded:: 1.2
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: snapshot
+type: boolean
+description: |
+  Prevents the cursor from returning a document more than once because of an
+  intervening write operation.
+
+  .. versionadded:: 1.2
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
 name: allowPartialResults
 type: boolean
 description: |
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
index a708742a..a4e20e57 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
@@ -40,6 +40,26 @@ source:
 post: |
   This will be used for the returned result document.
 ---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: max
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: maxScan
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: min
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: returnKey
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: showRecordId
+---
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: modifiers

From 96018df5352527108604e4a602da3c2e3c3daf9b Mon Sep 17 00:00:00 2001
From: kvwalker 
Date: Tue, 17 Oct 2017 14:33:42 -0400
Subject: [PATCH 112/321] PHPLIB-268 Add option maxAwaitTimeMS on getMore
 commands

---
 .../apiargs-MongoDBCollection-method-find-option.yaml |  4 ++++
 source/includes/apiargs-common-option.yaml            | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index 9e8cbdf2..635e923c 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -93,6 +93,10 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: maxAwaitTimeMS
+---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml
index 54d6bd89..5d119a6b 100644
--- a/source/includes/apiargs-common-option.yaml
+++ b/source/includes/apiargs-common-option.yaml
@@ -10,6 +10,17 @@ operation: ~
 optional: true
 ---
 arg_name: option
+name: maxAwaitTimeMS
+type: integer
+description: |
+    Positive integer denoting the time limit in milliseconds for the server to block
+    a getMore operation if no data is available. This option should only be used if
+    cursorType is TAILABLE_AWAIT.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
 name: readConcern
 type: :php:`MongoDB\\Driver\\ReadConcern `
 description: |

From 1d8f082a58768494dc70c10714c4d51200a74d0b Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Tue, 24 Oct 2017 14:22:08 -0400
Subject: [PATCH 113/321] Document how to specify singleBatch option with Find

---
 .../apiargs-MongoDBCollection-method-find-option.yaml      | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index 9e8cbdf2..37f16bf3 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -35,6 +35,13 @@ type: integer
 description: |
   The maximum number of documents to return. If unspecified, then defaults to no
   limit. A limit of ``0`` is equivalent to setting no limit.
+
+  A negative limit is similar to a positive limit but closes the cursor after
+  returning a single batch of results. As such, with a negative limit, if the
+  limited result set does not fit into a single batch, the number of documents
+  received will be less than the specified limit. By passing a negative limit, the
+  client indicates to the server that it will not ask for a subsequent batch via
+  getMore.
 interface: phpmethod
 operation: ~
 optional: true

From 68ed80c8809e314f2087a217ca7d1a61405a8d52 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Wed, 25 Oct 2017 13:23:28 -0400
Subject: [PATCH 114/321] PHPLIB-53 Add documentation for mapReduce (#419)

PHPLIB-53 Add documentation for mapReduce
---
 ...oDBCollection-method-mapReduce-option.yaml |  90 +++++++++++++
 ...goDBCollection-method-mapReduce-param.yaml |  36 +++++
 source/reference/class/MongoDBCollection.txt  |   1 +
 .../method/MongoDBCollection-mapReduce.txt    | 125 ++++++++++++++++++
 4 files changed, 252 insertions(+)
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
 create mode 100644 source/reference/method/MongoDBCollection-mapReduce.txt

diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
new file mode 100644
index 00000000..a2e97d11
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
@@ -0,0 +1,90 @@
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: bypassDocumentValidation
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+---
+arg_name: option
+name: finalize
+type: :php:`MongoDB\\BSON\\Javascript `
+description: |
+  Follows the reduce method and modifies the output.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: jsMode
+type: boolean
+description: |
+  Specifies whether to convert intermediate data into BSON format between the
+  execution of the map and reduce functions. The default is ``false``.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: limit
+type: integer
+description: |
+  Specifies a maximum number of documents for the input into the map function.
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: maxTimeMS
+---
+arg_name: option
+name: query
+type: document
+description: |
+  Specifies the selection criteria using query operators for determining the
+  documents input to the map function.
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: readConcern
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: readPreference
+---
+arg_name: option
+name: scope
+type: document
+description: |
+  Specifies global variables that are accessible in the map, reduce, and finalize
+  functions.
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: sort
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: typeMap
+---
+arg_name: option
+name: verbose
+type: boolean
+description: |
+  Specifies whether to include the timing information in the result information.
+  The default is ``true``.
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: writeConcern
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
new file mode 100644
index 00000000..401d49ed
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
@@ -0,0 +1,36 @@
+arg_name: param
+name: $map
+type: :php:`MongoDB\\BSON\\Javascript `
+description: |
+  A JavaScript function that associates or "maps" a value with a key and emits
+  the key and value pair.
+interface: phpmethod
+operation: ~
+optional: false
+---
+arg_name: param
+name: $reduce
+type: :php:`MongoDB\\BSON\\Javascript `
+description: |
+  A JavaScript function that "reduces" to a single object all the values
+  associated with a particular key.
+interface: phpmethod
+operation: ~
+optional: false
+---
+arg_name: param
+name: $out
+type: string|document
+description: |
+  Specifies where to output the result of the map-reduce operation. You can
+  either output to a collection or return the result inline. On a primary member
+  of a replica set you can output either to a collection or inline, but on a
+  secondary, only inline output is possible.
+interface: phpmethod
+operation: ~
+optional: false
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index 873f37f0..2fe978cd 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -87,6 +87,7 @@ Methods
    /reference/method/MongoDBCollection-insertMany
    /reference/method/MongoDBCollection-insertOne
    /reference/method/MongoDBCollection-listIndexes
+   /reference/method/MongoDBCollection-mapReduce
    /reference/method/MongoDBCollection-replaceOne
    /reference/method/MongoDBCollection-updateMany
    /reference/method/MongoDBCollection-updateOne
diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
new file mode 100644
index 00000000..bed40af6
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -0,0 +1,125 @@
+=================================
+MongoDB\\Collection::mapReduce()
+=================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::mapReduce()
+
+   The :manual:`mapReduce ` command allows you to
+   run map-reduce aggregation operations over a collection.
+
+   .. code-block:: php
+
+      function mapReduce($map, $reduce, $out, array $options = []): MongoDB\MapReduceResult
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-mapReduce-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-mapReduce-option.rst
+
+Return Values
+-------------
+
+A :phpclass:`MongoDB\\MapReduceResult` object, which allows for iteration of
+mapReduce results irrespective of the output method (e.g. inline, collection)
+via the :php:`IteratorAggregate ` interface. It also
+provides access to command statistics.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+Behavior
+--------
+
+In MongoDB, the map-reduce operation can write results to a collection
+or return the results inline. If you write map-reduce output to a
+collection, you can perform subsequent map-reduce operations on the
+same input collection that merge replace, merge, or reduce new results
+with previous results. See :manual:`Map-Reduce ` and
+:manual:`Perform Incremental Map-Reduce `
+for details and examples.
+
+When returning the results of a map-reduce operation *inline*, the
+result documents must be within the :limit:`BSON Document Size` limit,
+which is currently 16 megabytes.
+
+MongoDB supports map-reduce operations on :manual:`sharded collections
+`. Map-reduce operations can also output
+the results to a sharded collection. See
+:manual:`Map-Reduce and Sharded Collections `.
+
+Example
+-------
+
+This example will use city populations to calculate the overall population of
+each state.
+
+.. code-block:: php
+
+   test->zips;
+
+   $map = new MongoDB\BSON\Javascript('function() { emit(this.state, this.pop); }');
+   $reduce = new MongoDB\BSON\Javascript('function(key, values) { return Array.sum(values) }');
+   $out = ['inline' => 1];
+
+   $populations = $collection->mapReduce($map, $reduce, $out);
+
+   foreach ($populations as $pop) {
+      var_dump($pop);
+   };
+
+The output would then resemble::
+
+   object(stdClass)#2293 (2) {
+      ["_id"]=>
+      string(2) "AK"
+      ["value"]=>
+      float(544698)
+   }
+   object(stdClass)#2300 (2) {
+      ["_id"]=>
+      string(2) "AL"
+      ["value"]=>
+      float(4040587)
+   }
+   object(stdClass)#2293 (2) {
+      ["_id"]=>
+      string(2) "AR"
+      ["value"]=>
+      float(2350725)
+   }
+   object(stdClass)#2300 (2) {
+      ["_id"]=>
+      string(2) "AZ"
+      ["value"]=>
+      float(3665228)
+   }
+
+
+See Also
+--------
+
+- :manual:`mapReduce ` command reference in the MongoDB
+  manual
+- :manual:`Map-Reduce ` documentation in the MongoDB manual
+

From 81b2cd5ec75f07e973f8861ca144471ca2c921a9 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Wed, 25 Oct 2017 14:45:20 -0400
Subject: [PATCH 115/321] PHPLIB-284 Highlight API changes in documentation

---
 ...args-MongoDBCollection-method-find-option.yaml | 15 ++++++++++++---
 source/includes/apiargs-common-option.yaml        | 11 -----------
 .../method/MongoDBClient-getReadConcern.txt       |  2 ++
 .../method/MongoDBClient-getReadPreference.txt    |  2 ++
 .../reference/method/MongoDBClient-getTypeMap.txt |  2 ++
 .../method/MongoDBClient-getWriteConcern.txt      |  2 ++
 .../method/MongoDBCollection-getReadConcern.txt   |  2 ++
 .../MongoDBCollection-getReadPreference.txt       |  2 ++
 .../method/MongoDBCollection-getTypeMap.txt       |  2 ++
 .../method/MongoDBCollection-getWriteConcern.txt  |  2 ++
 .../method/MongoDBCollection-mapReduce.txt        |  2 ++
 .../method/MongoDBDatabase-getReadConcern.txt     |  2 ++
 .../method/MongoDBDatabase-getReadPreference.txt  |  2 ++
 .../method/MongoDBDatabase-getTypeMap.txt         |  2 ++
 .../method/MongoDBDatabase-getWriteConcern.txt    |  2 ++
 .../MongoDBGridFSBucket-getChunkSizeBytes.txt     |  2 ++
 .../MongoDBGridFSBucket-getChunksCollection.txt   |  2 ++
 .../MongoDBGridFSBucket-getFilesCollection.txt    |  2 ++
 .../method/MongoDBGridFSBucket-getReadConcern.txt |  2 ++
 .../MongoDBGridFSBucket-getReadPreference.txt     |  2 ++
 .../method/MongoDBGridFSBucket-getTypeMap.txt     |  2 ++
 .../MongoDBGridFSBucket-getWriteConcern.txt       |  2 ++
 22 files changed, 52 insertions(+), 14 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index fcc9a0bb..1827b896 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -100,9 +100,18 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
-source:
-  file: apiargs-common-option.yaml
-  ref: maxAwaitTimeMS
+arg_name: option
+name: maxAwaitTimeMS
+type: integer
+description: |
+  Positive integer denoting the time limit in milliseconds for the server to
+  block a getMore operation if no data is available. This option should only be
+  used if cursorType is TAILABLE_AWAIT.
+
+  .. versionadded:: 1.2
+interface: phpmethod
+operation: ~
+optional: true
 ---
 source:
   file: apiargs-common-option.yaml
diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml
index 5d119a6b..54d6bd89 100644
--- a/source/includes/apiargs-common-option.yaml
+++ b/source/includes/apiargs-common-option.yaml
@@ -10,17 +10,6 @@ operation: ~
 optional: true
 ---
 arg_name: option
-name: maxAwaitTimeMS
-type: integer
-description: |
-    Positive integer denoting the time limit in milliseconds for the server to block
-    a getMore operation if no data is available. This option should only be used if
-    cursorType is TAILABLE_AWAIT.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
 name: readConcern
 type: :php:`MongoDB\\Driver\\ReadConcern `
 description: |
diff --git a/source/reference/method/MongoDBClient-getReadConcern.txt b/source/reference/method/MongoDBClient-getReadConcern.txt
index d5ab3c47..b7c4c60b 100644
--- a/source/reference/method/MongoDBClient-getReadConcern.txt
+++ b/source/reference/method/MongoDBClient-getReadConcern.txt
@@ -2,6 +2,8 @@
 MongoDB\\Client::getReadConcern()
 =================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBClient-getReadPreference.txt b/source/reference/method/MongoDBClient-getReadPreference.txt
index 46a63d92..96d8eec5 100644
--- a/source/reference/method/MongoDBClient-getReadPreference.txt
+++ b/source/reference/method/MongoDBClient-getReadPreference.txt
@@ -2,6 +2,8 @@
 MongoDB\\Client::getReadPreference()
 ====================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBClient-getTypeMap.txt b/source/reference/method/MongoDBClient-getTypeMap.txt
index 090405bc..04697f33 100644
--- a/source/reference/method/MongoDBClient-getTypeMap.txt
+++ b/source/reference/method/MongoDBClient-getTypeMap.txt
@@ -2,6 +2,8 @@
 MongoDB\\Client::getTypeMap()
 =============================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBClient-getWriteConcern.txt b/source/reference/method/MongoDBClient-getWriteConcern.txt
index 349cb051..b779aae9 100644
--- a/source/reference/method/MongoDBClient-getWriteConcern.txt
+++ b/source/reference/method/MongoDBClient-getWriteConcern.txt
@@ -2,6 +2,8 @@
 MongoDB\\Client::getWriteConcern()
 ==================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBCollection-getReadConcern.txt b/source/reference/method/MongoDBCollection-getReadConcern.txt
index 5c0fc468..ff1cfeb0 100644
--- a/source/reference/method/MongoDBCollection-getReadConcern.txt
+++ b/source/reference/method/MongoDBCollection-getReadConcern.txt
@@ -2,6 +2,8 @@
 MongoDB\\Collection::getReadConcern()
 =====================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBCollection-getReadPreference.txt b/source/reference/method/MongoDBCollection-getReadPreference.txt
index b46bf716..4eac30d3 100644
--- a/source/reference/method/MongoDBCollection-getReadPreference.txt
+++ b/source/reference/method/MongoDBCollection-getReadPreference.txt
@@ -2,6 +2,8 @@
 MongoDB\\Collection::getReadPreference()
 ========================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBCollection-getTypeMap.txt b/source/reference/method/MongoDBCollection-getTypeMap.txt
index a9e6f606..11e56426 100644
--- a/source/reference/method/MongoDBCollection-getTypeMap.txt
+++ b/source/reference/method/MongoDBCollection-getTypeMap.txt
@@ -2,6 +2,8 @@
 MongoDB\\Collection::getTypeMap()
 =================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBCollection-getWriteConcern.txt b/source/reference/method/MongoDBCollection-getWriteConcern.txt
index ea283226..4fa26ee1 100644
--- a/source/reference/method/MongoDBCollection-getWriteConcern.txt
+++ b/source/reference/method/MongoDBCollection-getWriteConcern.txt
@@ -2,6 +2,8 @@
 MongoDB\\Collection::getWriteConcern()
 ======================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
index bed40af6..dd413cb5 100644
--- a/source/reference/method/MongoDBCollection-mapReduce.txt
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -2,6 +2,8 @@
 MongoDB\\Collection::mapReduce()
 =================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBDatabase-getReadConcern.txt b/source/reference/method/MongoDBDatabase-getReadConcern.txt
index 17eca777..fa277d88 100644
--- a/source/reference/method/MongoDBDatabase-getReadConcern.txt
+++ b/source/reference/method/MongoDBDatabase-getReadConcern.txt
@@ -2,6 +2,8 @@
 MongoDB\\Database::getReadConcern()
 ===================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBDatabase-getReadPreference.txt b/source/reference/method/MongoDBDatabase-getReadPreference.txt
index 364bcc0d..c70b4026 100644
--- a/source/reference/method/MongoDBDatabase-getReadPreference.txt
+++ b/source/reference/method/MongoDBDatabase-getReadPreference.txt
@@ -2,6 +2,8 @@
 MongoDB\\Database::getReadPreference()
 ======================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBDatabase-getTypeMap.txt b/source/reference/method/MongoDBDatabase-getTypeMap.txt
index b8735c40..bc1688d6 100644
--- a/source/reference/method/MongoDBDatabase-getTypeMap.txt
+++ b/source/reference/method/MongoDBDatabase-getTypeMap.txt
@@ -2,6 +2,8 @@
 MongoDB\\Database::getTypeMap()
 ===============================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBDatabase-getWriteConcern.txt b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
index 2d0c3a36..31b0ded5 100644
--- a/source/reference/method/MongoDBDatabase-getWriteConcern.txt
+++ b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
@@ -2,6 +2,8 @@
 MongoDB\\Database::getWriteConcern()
 ====================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
index 30ee467f..3a97aba7 100644
--- a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
@@ -2,6 +2,8 @@
 MongoDB\\GridFS\\Bucket::getChunkSizeBytes()
 ============================================
 
+.. versionchanged:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
index 354fa3e0..cc98abed 100644
--- a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
@@ -2,6 +2,8 @@
 MongoDB\\GridFS\\Bucket::getChunksCollection()
 ==============================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
index b4059cc8..e989202b 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
@@ -2,6 +2,8 @@
 MongoDB\\GridFS\\Bucket::getFilesCollection()
 =============================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
index 60a17b57..00517d22 100644
--- a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
@@ -2,6 +2,8 @@
 MongoDB\\GridFS\\Bucket::getReadConcern()
 =========================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
index cee0479d..94003eea 100644
--- a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
@@ -2,6 +2,8 @@
 MongoDB\\GridFS\\Bucket::getReadPreference()
 ============================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
index 25b2c5d3..cd9c4a1b 100644
--- a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
@@ -2,6 +2,8 @@
 MongoDB\\GridFS\\Bucket::getTypeMap()
 =====================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
diff --git a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
index edf7f5dc..1b5577e6 100644
--- a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
@@ -2,6 +2,8 @@
 MongoDB\\GridFS\Bucket::getWriteConcern()
 =========================================
 
+.. versionadded:: 1.2
+
 .. default-domain:: mongodb
 
 .. contents:: On this page

From 0a2ffa3bcddf89249fc92e92a132f92008410e92 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Tue, 24 Oct 2017 17:19:57 -0400
Subject: [PATCH 116/321] PHPLIB-266 Support passing index hint to aggregations

---
 .../apiargs-MongoDBCollection-method-aggregate-option.yaml    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 4d353bfd..965684b4 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -34,6 +34,10 @@ post: |
   Document validation requires MongoDB 3.2 or later: if you are using an earlier
   version of MongoDB, this option will be ignored.
 ---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: hint
+---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS

From abc35a29b09e90217a5fd7b1e9757236c85fcef8 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Wed, 25 Oct 2017 10:56:24 -0400
Subject: [PATCH 117/321] Add version to docs and object casting to command
 prep

---
 ...MongoDBCollection-method-aggregate-option.yaml | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 965684b4..97d57bdf 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -34,9 +34,18 @@ post: |
   Document validation requires MongoDB 3.2 or later: if you are using an earlier
   version of MongoDB, this option will be ignored.
 ---
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: hint
+arg_name: option
+name: hint
+type: string|array|object
+description: |
+  The index to use. Specify either the index name as a string or the index key
+  pattern as a document. If specified, then the query system will only consider
+  plans using the hinted index.
+
+  .. versionadded:: 1.3
+interface: phpmethod
+operation: ~
+optional: true
 ---
 source:
   file: apiargs-common-option.yaml

From 018098b7a3e810047bce7244f1ba178e397eb036 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micka=C3=ABl?= 
Date: Sat, 11 Nov 2017 13:45:10 +0100
Subject: [PATCH 118/321] Fix example 1

The call is made following the MongoDB\Client::selectCollection() signature instead of the MongoDB\Database::selectCollection() signature
---
 source/reference/method/MongoDBDatabase-selectCollection.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 8a5a42b2..6294e1a7 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -57,7 +57,7 @@ The following example selects the ``users`` collection in the ``test`` database:
 
    $db = (new MongoDB\Client)->test;
 
-   $collection = $db->selectCollection('test', 'users');
+   $collection = $db->selectCollection('users');
 
 The following example selects the ``users`` collection in the ``test``
 database with a custom read preference:

From a5579b36b1c9cdb3af859560755c40864fc471d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micka=C3=ABl?= 
Date: Sat, 11 Nov 2017 13:45:10 +0100
Subject: [PATCH 119/321] Fix example 1

The call is made following the MongoDB\Client::selectCollection() signature instead of the MongoDB\Database::selectCollection() signature
---
 source/reference/method/MongoDBDatabase-selectCollection.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 8a5a42b2..6294e1a7 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -57,7 +57,7 @@ The following example selects the ``users`` collection in the ``test`` database:
 
    $db = (new MongoDB\Client)->test;
 
-   $collection = $db->selectCollection('test', 'users');
+   $collection = $db->selectCollection('users');
 
 The following example selects the ``users`` collection in the ``test``
 database with a custom read preference:

From 52028fb6a164799bf091fdc10c7deb7c1a4d6981 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micka=C3=ABl?= 
Date: Sat, 11 Nov 2017 13:45:10 +0100
Subject: [PATCH 120/321] Fix example 1

The call is made following the MongoDB\Client::selectCollection() signature instead of the MongoDB\Database::selectCollection() signature
---
 source/reference/method/MongoDBDatabase-selectCollection.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 8a5a42b2..6294e1a7 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -57,7 +57,7 @@ The following example selects the ``users`` collection in the ``test`` database:
 
    $db = (new MongoDB\Client)->test;
 
-   $collection = $db->selectCollection('test', 'users');
+   $collection = $db->selectCollection('users');
 
 The following example selects the ``users`` collection in the ``test``
 database with a custom read preference:

From cfeaa989ea21fe66625366d538b7e93e255d896f Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Tue, 14 Nov 2017 12:17:25 -0500
Subject: [PATCH 121/321] PHPLIB-293 Add support for a comment parameter to the
 aggregate command (#432)

* PHPLIB-293 Add support for a comment parameter to the aggregate command
---
 ...gs-MongoDBCollection-method-aggregate-option.yaml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 97d57bdf..c9196353 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -35,6 +35,18 @@ post: |
   version of MongoDB, this option will be ignored.
 ---
 arg_name: option
+name: comment
+type: string
+description: |
+  Users can specify an arbitrary string to help trace the operation through the
+  database profiler, currentOp, and logs.
+
+  .. versionadded:: 1.3
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
 name: hint
 type: string|array|object
 description: |

From 2fd7e9890b7d5892917add630b346683d258b598 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Tue, 14 Nov 2017 12:30:33 -0500
Subject: [PATCH 122/321] PHPLIB-254 Support maxTimeMS option for CreateIndexes
 operation (#431)

* PHPLIB-254 Support maxTimeMS option for CreateIndexes operation
---
 .../apiargs-MongoDBCollection-method-createIndex-option.yaml  | 4 ++++
 ...apiargs-MongoDBCollection-method-createIndexes-option.yaml | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
index a7364a66..7956edd2 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
@@ -41,6 +41,10 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: maxTimeMS
+---
 arg_name: option
 name: name
 type: string
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
index 2be24cba..9b188dcd 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
@@ -1,3 +1,7 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: maxTimeMS
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern

From 02fdcff6aad57cf0bcdf8a7dc2de639f4d9b4960 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Wed, 15 Nov 2017 16:58:01 -0500
Subject: [PATCH 123/321] PHPLIB-297 Support maxTimeMS option for DropIndexes
 operation (#434)

* PHPLIB-297 Support maxTimeMS option for DropIndexes operation
---
 .../apiargs-MongoDBCollection-method-dropIndex-option.yaml    | 4 ++++
 .../apiargs-MongoDBCollection-method-dropIndexes-option.yaml  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
index 6460329f..886288cc 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
@@ -1,3 +1,7 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: maxTimeMS
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
index 6460329f..886288cc 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
@@ -1,3 +1,7 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: maxTimeMS
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap

From 5c54082807ceef3707a78a368bf901c548cc614f Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Wed, 29 Nov 2017 10:43:57 -0500
Subject: [PATCH 124/321] Add ChangeStream documentation (#439)

* Add ChangeStream documentation
---
 ...MongoDBCollection-method-watch-option.yaml | 49 +++++++++++++++++
 ...-MongoDBCollection-method-watch-param.yaml | 13 +++++
 source/reference/class/MongoDBCollection.txt  |  1 +
 .../method/MongoDBCollection-watch.txt        | 52 +++++++++++++++++++
 4 files changed, 115 insertions(+)
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
 create mode 100644 source/reference/method/MongoDBCollection-watch.txt

diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
new file mode 100644
index 00000000..e5967e2b
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -0,0 +1,49 @@
+source:
+  file: apiargs-MongoDBCollection-method-aggregate-option.yaml
+  ref: batchSize
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+---
+arg_name: option
+name: fullDocument
+type: string
+description: |
+  Allowed values are 'default' and 'updateLookup'. Defaults to 'default'.
+  When set to 'updateLookup', the change notification for partial updates will
+  include both a delta describing the changes to the document, as well as a
+  copy of the entire document that was changed from some time after the change
+  occurred. The following values are supported:
+
+  - ``MongoDB\Operation\ChangeStream::FULL_DOCUMENT_DEFAULT`` (*default*)
+  - ``MongoDB\Operation\ChangeStream::FULL_DOCUMENT_UPDATE_LOOKUP``
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-MongoDBCollection-method-find-option.yaml
+  ref: maxAwaitTimeMS
+---
+arg_name: option
+name: readPreference
+type: :php:`MongoDB\\Driver\\ReadPreference `
+description: |
+  The read preference for the initial change stream aggregation, used for
+  server selection during an automatic resume.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: resumeAfter
+type: array|object
+description: |
+  Specifies the logical starting point for the new change stream.
+
+  Note this is an option of the '$changeStream' pipeline stage.
+interface: phpmethod
+operation: ~
+optional: true
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
new file mode 100644
index 00000000..e0da852c
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
@@ -0,0 +1,13 @@
+arg_name: param
+name: $pipeline
+type: array|object
+description: |
+  The pipeline of stages to append to an initial ``$changeStream`` stage.
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index 2fe978cd..faca9cdf 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -91,4 +91,5 @@ Methods
    /reference/method/MongoDBCollection-replaceOne
    /reference/method/MongoDBCollection-updateMany
    /reference/method/MongoDBCollection-updateOne
+   /reference/method/MongoDBCollection-watch
    /reference/method/MongoDBCollection-withOptions
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
new file mode 100644
index 00000000..34c9935d
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -0,0 +1,52 @@
+================================
+MongoDB\\Collection::watch()
+================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::watch()
+
+   Executes a :manual:`change stream ` operation on the
+   collection.
+
+   .. code-block:: php
+
+      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-watch-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-watch-option.rst
+
+Return Values
+-------------
+
+A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+events in the change stream via the :php:`Iterator ` interface.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+See Also
+--------
+
+- :manual:`Aggregation Pipeline ` documentation in
+  the MongoDB Manual
+- :manual:`Change Streams ` documentation in the MongoDB manual

From 820eaabc899c745a0c8e81eda293e11bdc47652d Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Wed, 29 Nov 2017 13:13:12 -0500
Subject: [PATCH 125/321] Add ReadPreference documentation for Collection
 watch()

---
 ...iargs-MongoDBCollection-method-watch-option.yaml | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index e5967e2b..98bb70fc 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -26,15 +26,12 @@ source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: maxAwaitTimeMS
 ---
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-  The read preference for the initial change stream aggregation, used for
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: readPreference
+post: |
+  This is used for both the initial change stream aggregation and for
   server selection during an automatic resume.
-interface: phpmethod
-operation: ~
-optional: true
 ---
 arg_name: option
 name: resumeAfter

From 80230996640b1672d2e09ba6915ca2712a9840f0 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Mon, 27 Nov 2017 16:53:30 -0500
Subject: [PATCH 126/321] PHPLIB-295: arrayFilters for update and findAndModify

---
 .../apiargs-MongoDBCollection-common-option.yaml     | 12 ++++++++++++
 ...oDBCollection-method-findOneAndUpdate-option.yaml |  4 ++++
 ...s-MongoDBCollection-method-updateMany-option.yaml |  4 ++++
 3 files changed, 20 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
index eaf8e421..249e47a5 100644
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-common-option.yaml
@@ -1,4 +1,16 @@
 arg_name: option
+name: arrayFilters
+type: array
+description: |
+  An array of filter documents that determines which array elements to modify
+  for an update operation on an array field.
+
+  .. versionadded:: 1.3
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
 name: bypassDocumentValidation
 type: boolean
 description: |
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
index dcec8aa9..e5d04b4f 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
@@ -6,6 +6,10 @@ source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: sort
 ---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: arrayFilters
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: collation
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
index 4fec2f05..16e5ec68 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
@@ -2,6 +2,10 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: upsert
 ---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: arrayFilters
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation

From 3b789a76106dcb56e249663830b2f9ca8e7db488 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 2 Jan 2018 10:16:37 -0500
Subject: [PATCH 127/321] Revise group() and mapReduce() info in upgrade guide

---
 source/upgrade.txt | 33 +++++----------------------------
 1 file changed, 5 insertions(+), 28 deletions(-)

diff --git a/source/upgrade.txt b/source/upgrade.txt
index 6805d630..5b0cb919 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -109,8 +109,7 @@ Old and New Methods
      - Not implemented.
 
    * - :php:`MongoCollection::group() `
-     - Not yet implemented. See :issue:`PHPLIB-177`. 
-       Use :phpmethod:`MongoDB\\Database::command()`.
+     - Not implemented. Use :phpmethod:`MongoDB\\Database::command()`.
 
    * - :php:`MongoCollection::insert() `
      - :phpmethod:`MongoDB\\Collection::insertOne()`
@@ -156,10 +155,10 @@ also split to distinguish between :manual:`updating specific fields
 Group Command Helper
 --------------------
 
-:phpclass:`MongoDB\\Collection` does not yet have a helper method for the
-:manual:`group ` command; however, it is planned in
-:issue:`PHPLIB-177`. The following example demonstrates how to execute a group
-command using the :phpmethod:`MongoDB\\Database::command()` method:
+:phpclass:`MongoDB\\Collection` does have a helper method for the
+:manual:`group ` command; The following example
+demonstrates how to execute a group command using the
+:phpmethod:`MongoDB\\Database::command()` method:
 
 .. code-block:: php
 
@@ -177,28 +176,6 @@ command using the :phpmethod:`MongoDB\\Database::command()` method:
 
    $resultDocument = $cursor->toArray()[0];
 
-MapReduce Command Helper
-------------------------
-
-:phpclass:`MongoDB\\Collection` does not yet have a helper method for the
-:manual:`mapReduce ` command; however, that is
-planned in :issue:`PHPLIB-53`. The following example demonstrates how to execute
-a mapReduce command using the :phpmethod:`MongoDB\\Database::command()` method:
-
-.. code-block:: php
-
-   selectDatabase('db_name');
-   $cursor = $database->command([
-       'mapReduce' => 'collection_name',
-       'map' => new MongoDB\BSON\Javascript('...'),
-       'reduce' => new MongoDB\BSON\Javascript('...'),
-       'out' => 'output_collection_name',
-   ]);
-   
-   $resultDocument = $cursor->toArray()[0];
-
 DBRef Helpers
 -------------
 

From 343c74a9b959a4a12eddc6ff2a62ff051aa23d07 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Thu, 30 Nov 2017 13:09:13 -0500
Subject: [PATCH 128/321] PHPLIB-267 Document example of tailable cursor
 iteration

---
 source/tutorial.txt                 |   1 +
 source/tutorial/tailable-cursor.txt | 192 ++++++++++++++++++++++++++++
 2 files changed, 193 insertions(+)
 create mode 100644 source/tutorial/tailable-cursor.txt

diff --git a/source/tutorial.txt b/source/tutorial.txt
index 27f36375..c5037e6d 100644
--- a/source/tutorial.txt
+++ b/source/tutorial.txt
@@ -12,3 +12,4 @@ Tutorials
    /tutorial/gridfs
    /tutorial/indexes
    /tutorial/example-data
+   /tutorial/tailable-cursor
diff --git a/source/tutorial/tailable-cursor.txt b/source/tutorial/tailable-cursor.txt
new file mode 100644
index 00000000..7b6118d9
--- /dev/null
+++ b/source/tutorial/tailable-cursor.txt
@@ -0,0 +1,192 @@
+===============
+Tailable Cursor
+===============
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 2
+   :class: singlecol
+
+Overview
+--------
+
+When the driver executes a query or command (e.g.
+:manual:`aggregate `), results from the operation
+are returned via a :php:`MongoDB\\Driver\\Cursor `
+object. The Cursor class implements PHP's :php:`Traversable `
+interface, which allows it to be iterated with ``foreach`` and interface with
+any PHP functions that work with :php:`iterables `. Similar to
+result objects in other database drivers, cursors in MongoDB only support
+forward iteration, which means they cannot be rewound or used with ``foreach``
+multiple times.
+
+:manual:`Tailable cursors ` are a special type of
+MongoDB cursor that allows the client to read some results and then wait until
+more documents become available. These cursors are primarily used with
+:manual:`Capped Collections ` and
+:manual:`Change Streams `.
+
+While normal cursors can be iterated once with ``foreach``, that approach will
+not work with tailable cursors. When ``foreach`` is used with a tailable cursor,
+the loop will stop upon reaching the end of the initial result set. Attempting
+to continue iteration on the cursor with a second ``foreach`` would throw an
+exception, since PHP attempts to rewind the cursor.
+
+In order to continuously read from a tailable cursor, we will need to wrap the
+Cursor object with an :php:`IteratorIterator `. This will
+allow us to directly control the cursor's iteration (e.g. call ``next()``),
+avoid inadvertently rewinding the cursor, and decide when to wait for new
+results or stop iteration entirely.
+
+Wrapping a Normal Cursor
+------------------------
+
+Before looking at how a tailable cursor can be wrapped with
+:php:`IteratorIterator `, we'll start by examining how the
+class interacts with a normal cursor.
+
+The following example finds five restaurants and uses ``foreach`` to view the
+results:
+
+.. code-block:: php
+
+   test->restaurants;
+
+   $cursor = $collection->find([], ['limit' => 5]);
+
+   foreach ($cursor as $document) {
+      var_dump($document);
+   }
+
+While this example is quite concise, there is actually quite a bit going on. The
+``foreach`` construct begins by rewinding the iterable (``$cursor`` in this
+case). It then checks if the current position is valid. If the position is not
+valid, the loop ends. Otherwise, the current key and value are accessed
+accordingly and the loop body is executed. Assuming a :php:`break ` has
+not occurred, the iterator then advances to the next position, control jumps
+back to the validity check, and the loop continues.
+
+With the inner workings of ``foreach`` under our belt, we can now translate the
+preceding example to use IteratorIterator:
+
+.. code-block:: php
+
+   test->restaurants;
+
+   $cursor = $collection->find([], ['limit' => 5]);
+
+   $iterator = new IteratorIterator($cursor);
+
+   $iterator->rewind();
+
+   while ($iterator->valid()) {
+      $document = $iterator->current();
+      var_dump($document);
+      $iterator->next();
+   }
+
+.. note::
+
+   Calling ``$iterator->next()`` after the ``while`` loop naturally ends would
+   throw an exception, since all results on the cursor have been exhausted.
+
+The purpose of this example is simply to demonstrate the functional equivalence
+between ``foreach`` and manual iteration with PHP's :php:`Iterator `
+API. For normal cursors, there is little reason to use IteratorIterator instead
+of a concise ``foreach`` loop.
+
+Wrapping a Tailable Cursor
+--------------------------
+
+In order to demonstrate a tailable cursor in action, we'll need two scripts: a
+"producer" and a "consumer". The producer script will create a new capped
+collection using :phpmethod:`MongoDB\\Database::createCollection()` and proceed
+to insert a new document into that collection each second.
+
+.. code-block:: php
+
+   test;
+
+   $database->createCollection('capped', [
+       'capped' => true,
+       'size' => 16777216,
+   ]);
+
+   $collection = $database->selectCollection('capped');
+
+   while (true) {
+       $collection->insertOne(['createdAt' => new MongoDB\BSON\UTCDateTime()]);
+       sleep(1);
+   }
+
+With the producer script still running, we will now execute a consumer script to
+read the inserted documents using a tailable cursor, indicated by the
+``cursorType`` option to :phpmethod:`MongoDB\\Collection::find()`. We'll start
+by using ``foreach`` to illustrate its shortcomings:
+
+.. code-block:: php
+
+   test->capped;
+
+   $cursor = $collection->find([], [
+       'cursorType' => MongoDB\Operation\Find::TAILABLE_AWAIT,
+       'maxAwaitTimeMS' => 100,
+   ]);
+
+   foreach ($cursor as $document) {
+       printf("Consumed document created at: %s\n", $document->createdAt);
+   }
+
+If you execute this consumer script, you'll notice that it quickly exhausts all
+results in the capped collection and then terminates. We cannot add a second
+``foreach``, as that would throw an exception when attempting to rewind the
+cursor. This is a ripe use case for directly controlling the iteration process
+using :php:`IteratorIterator `.
+
+.. code-block:: php
+
+   test->capped;
+
+   $cursor = $collection->find([], [
+       'cursorType' => MongoDB\Operation\Find::TAILABLE_AWAIT,
+       'maxAwaitTimeMS' => 100,
+   ]);
+
+   $iterator = new IteratorIterator($cursor);
+
+   $iterator->rewind();
+
+   while (true) {
+      if ($iterator->valid()) {
+         $document = $iterator->current();
+         printf("Consumed document created at: %s\n", $document->createdAt);
+      }
+
+      $iterator->next();
+   }
+}
+
+Much like the ``foreach`` example, this version on the consumer script will
+start by quickly printing all results in the capped collection; however, it will
+not terminate upon reaching the end of the initial result set. Since we're
+working with a tailable cursor, calling ``next()`` will block and wait for
+additional results rather than throw an exception. We will also use ``valid()``
+to check if there is actually data available to read at each step.
+
+Since we've elected to use a ``TAILABLE_AWAIT`` cursor, the server will delay
+its response to the driver for a set amount of time. In this example, we've
+requested that the server block for approximately 100 milliseconds by specifying
+the ``maxAwaitTimeMS`` option to :phpmethod:`MongoDB\\Collection::find()`.

From 5d676d5c84b0a20c285340839b0ad2280428c2b2 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 30 Jan 2018 15:29:33 -0500
Subject: [PATCH 129/321] Clarify when aggregate and mapReduce options may be
 ignored

---
 .../apiargs-MongoDBCollection-method-aggregate-option.yaml    | 2 ++
 .../apiargs-MongoDBCollection-method-mapReduce-option.yaml    | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index c9196353..93cc4642 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -70,6 +70,8 @@ source:
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
+post: |
+  This option will be ignored when using the :ref:`$out ` stage.
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
index a2e97d11..41c363ac 100644
--- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
@@ -1,6 +1,8 @@
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
+post: |
+  This only applies when results are output to a collection.
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
@@ -55,6 +57,8 @@ source:
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
+post: |
+  This option will be ignored when results are output to a collection.
 ---
 arg_name: option
 name: scope

From ffb8193cc9174addc87c92d30edb7c3c099604a6 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Thu, 1 Feb 2018 11:58:38 -0500
Subject: [PATCH 130/321] Improve maxAwaitTimeMS documentation for watch

---
 ...piargs-MongoDBCollection-method-watch-option.yaml | 12 +++++++++---
 source/tutorial/tailable-cursor.txt                  |  1 -
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index 98bb70fc..3b98876d 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -22,9 +22,15 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: maxAwaitTimeMS
+arg_name: option
+name: maxAwaitTimeMS
+type: integer
+description: |
+  Positive integer denoting the time limit in milliseconds for the server to
+  block a getMore operation if no data is available.
+interface: phpmethod
+operation: ~
+optional: true
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/tutorial/tailable-cursor.txt b/source/tutorial/tailable-cursor.txt
index 7b6118d9..4bdb0bd3 100644
--- a/source/tutorial/tailable-cursor.txt
+++ b/source/tutorial/tailable-cursor.txt
@@ -177,7 +177,6 @@ using :php:`IteratorIterator `.
 
       $iterator->next();
    }
-}
 
 Much like the ``foreach`` example, this version on the consumer script will
 start by quickly printing all results in the capped collection; however, it will

From e724acc6006a094e446cdbc907b27051a7ce0a69 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Fri, 2 Feb 2018 14:10:44 -0500
Subject: [PATCH 131/321] PHPLIB-303: Implement MongoDB\Client::startSession()

---
 ...goDBClient-method-startSession-option.yaml | 12 +++
 source/reference/class/MongoDBClient.txt      |  1 +
 .../method/MongoDBClient-startSession.txt     | 82 +++++++++++++++++++
 3 files changed, 95 insertions(+)
 create mode 100644 source/includes/apiargs-MongoDBClient-method-startSession-option.yaml
 create mode 100644 source/reference/method/MongoDBClient-startSession.txt

diff --git a/source/includes/apiargs-MongoDBClient-method-startSession-option.yaml b/source/includes/apiargs-MongoDBClient-method-startSession-option.yaml
new file mode 100644
index 00000000..737303f0
--- /dev/null
+++ b/source/includes/apiargs-MongoDBClient-method-startSession-option.yaml
@@ -0,0 +1,12 @@
+arg_name: option
+name: causalConsistency
+type: boolean
+description: |
+  Enables or disables :ref:`causal consistency ` for the
+  session. If true, each operation in the session will be causally ordered after
+  the previous read or write operation. Set to false to disable causal
+  consistency. Defaults to true.
+interface: phpmethod
+operation: ~
+optional: true
+...
diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
index 2bf05682..90e93467 100644
--- a/source/reference/class/MongoDBClient.txt
+++ b/source/reference/class/MongoDBClient.txt
@@ -39,3 +39,4 @@ Methods
    /reference/method/MongoDBClient-listDatabases
    /reference/method/MongoDBClient-selectCollection
    /reference/method/MongoDBClient-selectDatabase
+   /reference/method/MongoDBClient-startSession
diff --git a/source/reference/method/MongoDBClient-startSession.txt b/source/reference/method/MongoDBClient-startSession.txt
new file mode 100644
index 00000000..11d7847e
--- /dev/null
+++ b/source/reference/method/MongoDBClient-startSession.txt
@@ -0,0 +1,82 @@
+===============================
+MongoDB\\Client::startSession()
+===============================
+
+.. default-domain:: mongodb
+
+.. versionadded:: 1.3
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::startSession()
+
+   Start a new client session for use with this client.
+
+   .. code-block:: php
+
+      function startSession(array $options = []): MongoDB\Driver\Session
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-startSession-option.rst
+
+Return Values
+-------------
+
+A :php:`MongoDB\Driver\Session `
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-driver-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+Example
+-------
+
+The following example starts a new session:
+
+.. code-block:: php
+
+   startSession();
+
+   var_dump($session);
+
+The output would then resemble::
+
+   object(MongoDB\Driver\Session)#2043 (4) {
+     ["logicalSessionId"]=>
+     array(1) {
+       ["id"]=>
+       object(MongoDB\BSON\Binary)#225 (2) {
+         ["data"]=>
+         string(16) "................"
+         ["type"]=>
+         int(4)
+       }
+     }
+     ["clusterTime"]=>
+     NULL
+     ["causalConsistency"]=>
+     bool(true)
+     ["operationTime"]=>
+     NULL
+   }
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\Manager::startSession()
+  `
+- :ref:`Causal Consistency ` in the MongoDB manual

From 78ceaadc83b5f5e249cf14c714f4d7f796cdc969 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Fri, 2 Feb 2018 15:35:11 -0500
Subject: [PATCH 132/321] PHPLIB-282: Drop support for MongoDB 2.4

---
 ...rgs-MongoDBCollection-method-aggregate-option.yaml | 11 -----------
 ...s-MongoDBCollection-method-createIndex-option.yaml |  8 ++------
 .../MongoDBBulkWriteResult-getModifiedCount.txt       |  4 ----
 .../method/MongoDBUpdateResult-getModifiedCount.txt   |  4 ----
 4 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 93cc4642..dfab5b9a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -16,11 +16,6 @@ description: |
   Specifies the initial batch size for the cursor. A batchSize of ``0`` means an
   empty first batch and is useful for quickly returning a cursor or failure
   message without doing significant server-side work.
-
-  .. note::
-
-     This is not supported for inline aggregation results (i.e. ``useCursor``
-     option is ``false`` or the server version is < 2.6).
 interface: phpmethod
 operation: ~
 optional: true
@@ -83,12 +78,6 @@ type: boolean
 description: |
   Indicates whether the command will request that the server provide results
   using a cursor. The default is ``true``.
-
-  For MongoDB version 2.6 or later, ``useCursor`` allows users to turn off
-  cursors if necessary to aid in replica set or shard cluster upgrades.
-
-  ``useCursor`` is ignored for MongoDB versions prior to 2.6 as aggregation
-  cursors are not available.
 interface: phpmethod
 operation: ~
 optional: true
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
index 7956edd2..341ed31a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
@@ -69,12 +69,8 @@ arg_name: option
 name: 2dsphereIndexVersion
 type: integer
 description: |
-  Specifies the :manual:`version of a 2dsphere ` index to
-  create.
-
-  MongoDB 2.6 introduced version 2 of 2dsphere indexes. Version 2 is the default
-  version of 2dsphere indexes created in MongoDB 2.6 and later versions.
-  ``2dsphereIndexVersion`` enables you to override the default version 2.
+  Overrides the server's default version for a :manual:`2dsphere
+  ` index.
 interface: phpmethod
 operation: ~
 optional: true
diff --git a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
index 674a03cf..2e8f708b 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
@@ -37,10 +37,6 @@ Return Values
 The total number of documents that were modified by all update and replace
 operations in the bulk write.
 
-The modified count is not available on versions of MongoDB before 2.6, which
-used the legacy wire protocol version (i.e. ``OP_UPDATE``). If this is the case,
-the modified count will be ``null``.
-
 Errors/Exceptions
 -----------------
 
diff --git a/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt b/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
index 0bd708a0..3e2a7a6e 100644
--- a/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
+++ b/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
@@ -35,10 +35,6 @@ Return Values
 
 The number of documents that were modified.
 
-The modified count is not available on versions of MongoDB before 2.6, which
-used the legacy wire protocol version (i.e. ``OP_UPDATE``). If this is the case,
-the modified count will be ``null``.
-
 Errors/Exceptions
 -----------------
 

From 1aacf7cba5073a466f67a7a377e52c7b5650ac25 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 1 Feb 2018 16:50:55 -0500
Subject: [PATCH 133/321] Format notes for $changeStream pipeline operators

---
 .../apiargs-MongoDBCollection-method-watch-option.yaml    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index 3b98876d..11e6b9c8 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -18,6 +18,10 @@ description: |
 
   - ``MongoDB\Operation\ChangeStream::FULL_DOCUMENT_DEFAULT`` (*default*)
   - ``MongoDB\Operation\ChangeStream::FULL_DOCUMENT_UPDATE_LOOKUP``
+
+  .. note::
+
+     This is an option of the `$changeStream` pipeline stage.
 interface: phpmethod
 operation: ~
 optional: true
@@ -45,7 +49,9 @@ type: array|object
 description: |
   Specifies the logical starting point for the new change stream.
 
-  Note this is an option of the '$changeStream' pipeline stage.
+  .. note::
+
+     This is an option of the `$changeStream` pipeline stage.
 interface: phpmethod
 operation: ~
 optional: true

From 4ba5700f44b7a4402453dbe95ea9b566b8d8e46e Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 1 Feb 2018 16:55:09 -0500
Subject: [PATCH 134/321] Clarify batchSize option for change streams

The batchSize option for change streams is not identical to the aggregate option, so they should not share the same text. That said, the batchSize option likely has no effect on the resulting change stream (see: PHPLIB-321).
---
 ...iargs-MongoDBCollection-method-watch-option.yaml | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index 11e6b9c8..611f4c9d 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -1,6 +1,13 @@
-source:
-  file: apiargs-MongoDBCollection-method-aggregate-option.yaml
-  ref: batchSize
+---
+arg_name: option
+name: batchSize
+type: integer
+description: |
+  Specifies the maximum number of change events to return in each batch of the
+  response from the MongoDB cluster.
+interface: phpmethod
+operation: ~
+optional: true
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml

From 619b370c90eeba9f7165ec483d3e1182381cbf87 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 31 Jan 2018 18:37:09 -0500
Subject: [PATCH 135/321] PHPLIB-302: Support session option for operations

---
 ...args-MongoDBClient-method-dropDatabase-option.yaml |  4 ++++
 ...rgs-MongoDBClient-method-listDatabases-option.yaml |  4 ++++
 ...rgs-MongoDBCollection-method-aggregate-option.yaml |  4 ++++
 ...rgs-MongoDBCollection-method-bulkWrite-option.yaml |  4 ++++
 ...apiargs-MongoDBCollection-method-count-option.yaml |  4 ++++
 ...s-MongoDBCollection-method-createIndex-option.yaml |  4 ++++
 ...MongoDBCollection-method-createIndexes-option.yaml |  4 ++++
 ...gs-MongoDBCollection-method-deleteMany-option.yaml |  4 ++++
 ...rgs-MongoDBCollection-method-deleteOne-option.yaml |  4 ++++
 ...args-MongoDBCollection-method-distinct-option.yaml |  4 ++++
 .../apiargs-MongoDBCollection-method-drop-option.yaml |  4 ++++
 ...rgs-MongoDBCollection-method-dropIndex-option.yaml |  4 ++++
 ...s-MongoDBCollection-method-dropIndexes-option.yaml |  4 ++++
 .../apiargs-MongoDBCollection-method-find-option.yaml |  4 ++++
 ...iargs-MongoDBCollection-method-findOne-option.yaml |  4 ++++
 ...goDBCollection-method-findOneAndDelete-option.yaml |  4 ++++
 ...oDBCollection-method-findOneAndReplace-option.yaml |  4 ++++
 ...goDBCollection-method-findOneAndUpdate-option.yaml |  4 ++++
 ...gs-MongoDBCollection-method-insertMany-option.yaml |  4 ++++
 ...rgs-MongoDBCollection-method-insertOne-option.yaml |  4 ++++
 ...s-MongoDBCollection-method-listIndexes-option.yaml |  4 ++++
 ...rgs-MongoDBCollection-method-mapReduce-option.yaml |  4 ++++
 ...gs-MongoDBCollection-method-replaceOne-option.yaml |  4 ++++
 ...gs-MongoDBCollection-method-updateMany-option.yaml |  4 ++++
 ...rgs-MongoDBCollection-method-updateOne-option.yaml |  4 ++++
 ...apiargs-MongoDBDatabase-method-command-option.yaml |  4 ++++
 ...ongoDBDatabase-method-createCollection-option.yaml |  4 ++++
 .../apiargs-MongoDBDatabase-method-drop-option.yaml   |  4 ++++
 ...-MongoDBDatabase-method-dropCollection-option.yaml |  4 ++++
 ...MongoDBDatabase-method-listCollections-option.yaml |  4 ++++
 source/includes/apiargs-common-option.yaml            | 11 +++++++++++
 31 files changed, 131 insertions(+)

diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
index 22141f1a..2134691a 100644
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
@@ -1,3 +1,7 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
index 4eb407fe..d7e37115 100644
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
@@ -1,4 +1,8 @@
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index dfab5b9a..a1d6b27a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -68,6 +68,10 @@ source:
 post: |
   This option will be ignored when using the :ref:`$out ` stage.
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
index bb663bf3..da0f1be0 100644
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
@@ -17,6 +17,10 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
index 4999b78a..50736af4 100644
--- a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
@@ -38,6 +38,10 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 arg_name: option
 name: skip
 type: integer
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
index 341ed31a..a01f6165 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
@@ -75,6 +75,10 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
index 9b188dcd..7d1acc65 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
@@ -2,6 +2,10 @@ source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
index 8c775dde..5116149c 100644
--- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
@@ -2,6 +2,10 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: collation
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
index 8c775dde..5116149c 100644
--- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
@@ -2,6 +2,10 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: collation
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
index e8608b38..9e40f51c 100644
--- a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
@@ -13,4 +13,8 @@ source:
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
index 6460329f..eefa8dbf 100644
--- a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
@@ -4,6 +4,10 @@ source:
 post: |
   This will be used for the returned command result document.
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
index 886288cc..93305378 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
@@ -2,6 +2,10 @@ source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
index 886288cc..93305378 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
@@ -2,6 +2,10 @@ source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index 1827b896..9738bacf 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -125,6 +125,10 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 arg_name: option
 name: max
 type: array|object
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
index a4e20e57..cc8a1d80 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
@@ -34,6 +34,10 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
index b7d4deaf..d3833fb4 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
@@ -14,6 +14,10 @@ source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
index 24743d29..2f3ca47e 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
@@ -31,6 +31,10 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
index e5d04b4f..a4040e84 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
@@ -35,6 +35,10 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
index 1b32b97a..86ca51d3 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
@@ -6,6 +6,10 @@ source:
   file: apiargs-MongoDBCollection-method-bulkWrite-option.yaml
   ref: ordered
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
index ee47d575..7395bf93 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
@@ -2,6 +2,10 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
index 4eb407fe..d7e37115 100644
--- a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
@@ -1,4 +1,8 @@
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
index 41c363ac..adae215a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
@@ -70,6 +70,10 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
   ref: sort
diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
index 4fec2f05..781badcb 100644
--- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
@@ -10,6 +10,10 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: collation
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
index 16e5ec68..db2a7a6a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
@@ -14,6 +14,10 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: collation
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
index 4fec2f05..781badcb 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
@@ -10,6 +10,10 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: collation
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
index 7dc5b5a0..02a59871 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
@@ -5,6 +5,10 @@ description: |
    :manual:`Read preference ` to use for the
    operation. Defaults to the database's read preference.
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBDatabase-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
index d70a905f..c1d4d2af 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
@@ -93,6 +93,10 @@ source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 arg_name: option
 name: size
 type: integer
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
index 630c1bd1..804fcae0 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
@@ -1,3 +1,7 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBDatabase-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
index 630c1bd1..804fcae0 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
@@ -1,3 +1,7 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
 source:
   file: apiargs-MongoDBDatabase-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
index c8bcc2c5..1c3d1f75 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
@@ -12,4 +12,8 @@ optional: true
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
 ...
diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml
index 54d6bd89..ebe4d509 100644
--- a/source/includes/apiargs-common-option.yaml
+++ b/source/includes/apiargs-common-option.yaml
@@ -36,6 +36,17 @@ replacement:
   parent: "client"
 ---
 arg_name: option
+name: session
+type: :php:`MongoDB\\Driver\\Session `
+description: |
+  Client session to associate with the operation.
+
+  Sessions are not supported for server versions prior to 3.6.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
 name: typeMap
 type: array
 description: |

From 1d2ef0c26a5984a4966a39955017030df9ce2d67 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 5 Feb 2018 13:55:56 -0500
Subject: [PATCH 136/321] Watch processes its own options and relies on
 Aggregate for others

Previously, Watch did not validate the "fullDocument" option and neglected to pass "readConcern" and "readPreference" to Aggregate. This refactors the class so that Watch only processes its own options.

Additionally, Aggregate is now first created from Watch::__construct() instead of Watch::execute(), which allows its options to be validated earlier (akin to FindOne creating Find in its constructor). Aggregate is only recreated if a new resume token is provided during a resume.
---
 .../apiargs-MongoDBCollection-method-watch-option.yaml        | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index 611f4c9d..48c97325 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -43,6 +43,10 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: readConcern
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference

From 151fcdbf7785fd81f9aeeed4119815e43724606e Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 5 Feb 2018 14:02:51 -0500
Subject: [PATCH 137/321] PHPLIB-302: Support session option for change streams

---
 .../apiargs-MongoDBCollection-method-watch-option.yaml        | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index 48c97325..63c43de9 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -66,4 +66,8 @@ description: |
 interface: phpmethod
 operation: ~
 optional: true
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
 ...

From f43e7937a1f60380973b1560a08420f7a97825da Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 5 Feb 2018 14:03:46 -0500
Subject: [PATCH 138/321] PHPLIB-323: Support typeMap option for change streams

---
 .../apiargs-MongoDBCollection-method-watch-option.yaml        | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index 63c43de9..f835e1f0 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -70,4 +70,8 @@ optional: true
 source:
   file: apiargs-common-option.yaml
   ref: session
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: typeMap
 ...

From f26e665fb5bf7dbcd88214cfefc9d5a0bb506c39 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 6 Feb 2018 15:40:15 -0500
Subject: [PATCH 139/321] PHPLIB-283: Support filter option for ListDatabases

---
 ...-MongoDBClient-method-listDatabases-option.yaml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
index d7e37115..390c1809 100644
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
@@ -1,3 +1,17 @@
+arg_name: option
+name: filter
+type: array|object
+description: |
+  A query expression to filter the list of databases.
+
+  You can specify a query expression for database fields (e.g. ``name``,
+  ``sizeOnDisk``, ``empty``).
+
+  .. versionadded:: 1.3
+interface: phpmethod
+operation: ~
+optional: true
+---
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS

From ea060c4e8f9c0a643607c3eb4aacb7ed01c9d377 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 6 Feb 2018 15:49:35 -0500
Subject: [PATCH 140/321] Update docs for ListCollections filter option

---
 ...args-MongoDBDatabase-method-listCollections-option.yaml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
index 1c3d1f75..09f51cfd 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
@@ -4,7 +4,12 @@ type: array|object
 description: |
   A query expression to filter the list of collections.
 
-  You can specify a query expression on the collection ``name`` and ``options``.
+  You can specify a query expression for collection fields (e.g. ``name``,
+  ``options``).
+
+  For server versions < 3.0, the filter can only be used to match the ``name``
+  field with a string value. More complex filters will result in an exception at
+  execution time if used.
 interface: phpmethod
 operation: ~
 optional: true

From 5a525ca2e73d75be54dad8140d93bd5d04fbf071 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 6 Feb 2018 16:15:56 -0500
Subject: [PATCH 141/321] PHPLIB-302: Version info macro for session options

---
 .../apiargs-MongoDBClient-method-dropDatabase-option.yaml       | 2 ++
 .../apiargs-MongoDBClient-method-listDatabases-option.yaml      | 2 ++
 .../apiargs-MongoDBCollection-method-aggregate-option.yaml      | 2 ++
 .../apiargs-MongoDBCollection-method-bulkWrite-option.yaml      | 2 ++
 .../includes/apiargs-MongoDBCollection-method-count-option.yaml | 2 ++
 .../apiargs-MongoDBCollection-method-createIndex-option.yaml    | 2 ++
 .../apiargs-MongoDBCollection-method-createIndexes-option.yaml  | 2 ++
 .../apiargs-MongoDBCollection-method-deleteMany-option.yaml     | 2 ++
 .../apiargs-MongoDBCollection-method-deleteOne-option.yaml      | 2 ++
 .../apiargs-MongoDBCollection-method-distinct-option.yaml       | 2 ++
 .../includes/apiargs-MongoDBCollection-method-drop-option.yaml  | 2 ++
 .../apiargs-MongoDBCollection-method-dropIndex-option.yaml      | 2 ++
 .../apiargs-MongoDBCollection-method-dropIndexes-option.yaml    | 2 ++
 .../includes/apiargs-MongoDBCollection-method-find-option.yaml  | 2 ++
 .../apiargs-MongoDBCollection-method-findOne-option.yaml        | 2 ++
 ...piargs-MongoDBCollection-method-findOneAndDelete-option.yaml | 2 ++
 ...iargs-MongoDBCollection-method-findOneAndReplace-option.yaml | 2 ++
 ...piargs-MongoDBCollection-method-findOneAndUpdate-option.yaml | 2 ++
 .../apiargs-MongoDBCollection-method-insertMany-option.yaml     | 2 ++
 .../apiargs-MongoDBCollection-method-insertOne-option.yaml      | 2 ++
 .../apiargs-MongoDBCollection-method-listIndexes-option.yaml    | 2 ++
 .../apiargs-MongoDBCollection-method-mapReduce-option.yaml      | 2 ++
 .../apiargs-MongoDBCollection-method-replaceOne-option.yaml     | 2 ++
 .../apiargs-MongoDBCollection-method-updateMany-option.yaml     | 2 ++
 .../apiargs-MongoDBCollection-method-updateOne-option.yaml      | 2 ++
 .../includes/apiargs-MongoDBDatabase-method-command-option.yaml | 2 ++
 .../apiargs-MongoDBDatabase-method-createCollection-option.yaml | 2 ++
 source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml | 2 ++
 .../apiargs-MongoDBDatabase-method-dropCollection-option.yaml   | 2 ++
 .../apiargs-MongoDBDatabase-method-listCollections-option.yaml  | 2 ++
 30 files changed, 60 insertions(+)

diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
index 2134691a..01a287e5 100644
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
@@ -1,6 +1,8 @@
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
index 390c1809..95c4a54e 100644
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
@@ -19,4 +19,6 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index a1d6b27a..1d6e24da 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -71,6 +71,8 @@ post: |
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
index da0f1be0..d5d2e5df 100644
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
@@ -20,6 +20,8 @@ optional: true
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
index 50736af4..62227f1c 100644
--- a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
@@ -41,6 +41,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 arg_name: option
 name: skip
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
index a01f6165..fd03eb23 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
@@ -78,6 +78,8 @@ optional: true
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
index 7d1acc65..af6ddc3b 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
@@ -5,6 +5,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
index 5116149c..81e520bb 100644
--- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
@@ -5,6 +5,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
index 5116149c..81e520bb 100644
--- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
@@ -5,6 +5,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
index 9e40f51c..b456d8b6 100644
--- a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
@@ -17,4 +17,6 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
index eefa8dbf..b1f39752 100644
--- a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
@@ -7,6 +7,8 @@ post: |
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
index 93305378..0b1970c3 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
@@ -5,6 +5,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
index 93305378..0b1970c3 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
@@ -5,6 +5,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index 9738bacf..80ebef1f 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -128,6 +128,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 arg_name: option
 name: max
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
index cc8a1d80..7c06a855 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
@@ -37,6 +37,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
index d3833fb4..520b4de1 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
@@ -17,6 +17,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
index 2f3ca47e..caaac953 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
@@ -34,6 +34,8 @@ optional: true
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
index a4040e84..703b60e7 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
@@ -38,6 +38,8 @@ optional: true
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
index 86ca51d3..39193578 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
@@ -9,6 +9,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
index 7395bf93..61d795c7 100644
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
@@ -5,6 +5,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
index d7e37115..cbfb6501 100644
--- a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
@@ -5,4 +5,6 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ...
diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
index adae215a..8d02ffb7 100644
--- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
@@ -73,6 +73,8 @@ optional: true
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-method-find-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
index 781badcb..55eb32a7 100644
--- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
@@ -13,6 +13,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
index db2a7a6a..6fd44cf5 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
@@ -17,6 +17,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
index 781badcb..55eb32a7 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
@@ -13,6 +13,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
index 02a59871..934e325d 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
@@ -8,6 +8,8 @@ description: |
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBDatabase-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
index c1d4d2af..53441bd7 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
@@ -96,6 +96,8 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 arg_name: option
 name: size
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
index 804fcae0..89969685 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
@@ -1,6 +1,8 @@
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBDatabase-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
index 804fcae0..89969685 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
@@ -1,6 +1,8 @@
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBDatabase-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
index 09f51cfd..4329e221 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
@@ -21,4 +21,6 @@ source:
 source:
   file: apiargs-common-option.yaml
   ref: session
+post: |
+  .. versionadded:: 1.3
 ...

From eb9a5f0622555d3caf24d94be61d963141f858af Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 6 Feb 2018 16:16:32 -0500
Subject: [PATCH 142/321] PHPLIB-295: Move version info for arrayFilters out of
 common include

Noting version info on a per-method basis keeps this flexible if another method end up using the option in some later version.
---
 source/includes/apiargs-MongoDBCollection-common-option.yaml    | 2 --
 ...piargs-MongoDBCollection-method-findOneAndUpdate-option.yaml | 2 ++
 .../apiargs-MongoDBCollection-method-updateMany-option.yaml     | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
index 249e47a5..b1a6a290 100644
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-common-option.yaml
@@ -4,8 +4,6 @@ type: array
 description: |
   An array of filter documents that determines which array elements to modify
   for an update operation on an array field.
-
-  .. versionadded:: 1.3
 interface: phpmethod
 operation: ~
 optional: true
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
index 703b60e7..858ddb2a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
@@ -9,6 +9,8 @@ source:
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: arrayFilters
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
index 6fd44cf5..ae27c0d9 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
@@ -5,6 +5,8 @@ source:
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: arrayFilters
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml

From 91739362aee026a890374b5322b73c86a30ab5d2 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 6 Feb 2018 16:18:18 -0500
Subject: [PATCH 143/321] PHPLIB-254: Version info for maxTimeMS
 Create/DropIndexes option

---
 .../apiargs-MongoDBCollection-method-createIndex-option.yaml    | 2 ++
 .../apiargs-MongoDBCollection-method-createIndexes-option.yaml  | 2 ++
 .../apiargs-MongoDBCollection-method-dropIndex-option.yaml      | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
index fd03eb23..456b0f25 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
@@ -44,6 +44,8 @@ optional: true
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
+post: |
+  .. versionadded:: 1.3
 ---
 arg_name: option
 name: name
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
index af6ddc3b..2b67712f 100644
--- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
@@ -1,6 +1,8 @@
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
index 0b1970c3..00db41c6 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
@@ -1,6 +1,8 @@
 source:
   file: apiargs-common-option.yaml
   ref: maxTimeMS
+post: |
+  .. versionadded:: 1.3
 ---
 source:
   file: apiargs-common-option.yaml

From 522bed117eadca558b797b3b53529b1c7fbc325e Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 6 Feb 2018 16:18:59 -0500
Subject: [PATCH 144/321] Version info for Client::startSession() and
 Collection::watch()

This also fixes RST formatting for header lengths.
---
 source/reference/method/MongoDBClient-startSession.txt | 4 ++--
 source/reference/method/MongoDBCollection-watch.txt    | 6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/source/reference/method/MongoDBClient-startSession.txt b/source/reference/method/MongoDBClient-startSession.txt
index 11d7847e..df851d49 100644
--- a/source/reference/method/MongoDBClient-startSession.txt
+++ b/source/reference/method/MongoDBClient-startSession.txt
@@ -2,10 +2,10 @@
 MongoDB\\Client::startSession()
 ===============================
 
-.. default-domain:: mongodb
-
 .. versionadded:: 1.3
 
+.. default-domain:: mongodb
+
 .. contents:: On this page
    :local:
    :backlinks: none
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
index 34c9935d..dee50024 100644
--- a/source/reference/method/MongoDBCollection-watch.txt
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -1,6 +1,8 @@
-================================
+============================
 MongoDB\\Collection::watch()
-================================
+============================
+
+.. versionadded:: 1.3
 
 .. default-domain:: mongodb
 

From 46f7094fb624457abbc0c81472301374f8f0da31 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 7 Feb 2018 13:54:21 -0500
Subject: [PATCH 145/321] Use three-space indent for arrayFilters option
 description

---
 source/includes/apiargs-MongoDBCollection-common-option.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
index b1a6a290..8817090f 100644
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-common-option.yaml
@@ -2,8 +2,8 @@ arg_name: option
 name: arrayFilters
 type: array
 description: |
-  An array of filter documents that determines which array elements to modify
-  for an update operation on an array field.
+   An array of filter documents that determines which array elements to modify
+   for an update operation on an array field.
 interface: phpmethod
 operation: ~
 optional: true

From bcf6b8cbee2312b1f18664703211f7fa495ba576 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 7 Feb 2018 13:55:08 -0500
Subject: [PATCH 146/321] Note that arrayFilters update option requires MongoDB
 3.6

---
 source/includes/apiargs-MongoDBCollection-common-option.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
index 8817090f..0f117d69 100644
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-common-option.yaml
@@ -4,6 +4,9 @@ type: array
 description: |
    An array of filter documents that determines which array elements to modify
    for an update operation on an array field.
+
+   This is not supported for server versions prior to 3.6 and will result in an
+   exception at execution time if used.
 interface: phpmethod
 operation: ~
 optional: true

From 9e99e1292fcd623b0d2d76d3d7997c7f582c0e06 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 8 Feb 2018 10:11:41 -0500
Subject: [PATCH 147/321] Rename and reorder tailable cursor tutorial

---
 source/tutorial.txt                 | 2 +-
 source/tutorial/tailable-cursor.txt | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/source/tutorial.txt b/source/tutorial.txt
index c5037e6d..d94f0682 100644
--- a/source/tutorial.txt
+++ b/source/tutorial.txt
@@ -11,5 +11,5 @@ Tutorials
    /tutorial/decimal128
    /tutorial/gridfs
    /tutorial/indexes
-   /tutorial/example-data
    /tutorial/tailable-cursor
+   /tutorial/example-data
diff --git a/source/tutorial/tailable-cursor.txt b/source/tutorial/tailable-cursor.txt
index 4bdb0bd3..3496ad60 100644
--- a/source/tutorial/tailable-cursor.txt
+++ b/source/tutorial/tailable-cursor.txt
@@ -1,6 +1,6 @@
-===============
-Tailable Cursor
-===============
+=========================
+Tailable Cursor Iteration
+=========================
 
 .. default-domain:: mongodb
 

From 3d699263bd6241bd16486cb750138169a6d201b3 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 12 Feb 2018 15:58:59 -0500
Subject: [PATCH 148/321] PHPLIB-328: Document ChangeStream iterator class

Note: the ChangeStream::key() example reports expected output, despite the current behavior of the library. That should be resolved with PHPLIB-327.
---
 source/reference.txt                          |   1 +
 .../method/MongoDBChangeStream-current.txt    | 104 ++++++++++++++++++
 .../MongoDBChangeStream-getCursorId.txt       |  58 ++++++++++
 .../method/MongoDBChangeStream-key.txt        |  74 +++++++++++++
 .../method/MongoDBChangeStream-next.txt       |  42 +++++++
 .../method/MongoDBChangeStream-rewind.txt     |  52 +++++++++
 .../method/MongoDBChangeStream-valid.txt      |  40 +++++++
 .../method/MongoDBCollection-watch.txt        |  62 +++++++++++
 source/reference/result-classes.txt           |  42 +++++++
 source/tutorial/tailable-cursor.txt           |   2 +
 10 files changed, 477 insertions(+)
 create mode 100644 source/reference/method/MongoDBChangeStream-current.txt
 create mode 100644 source/reference/method/MongoDBChangeStream-getCursorId.txt
 create mode 100644 source/reference/method/MongoDBChangeStream-key.txt
 create mode 100644 source/reference/method/MongoDBChangeStream-next.txt
 create mode 100644 source/reference/method/MongoDBChangeStream-rewind.txt
 create mode 100644 source/reference/method/MongoDBChangeStream-valid.txt
 create mode 100644 source/reference/result-classes.txt

diff --git a/source/reference.txt b/source/reference.txt
index b0606bd8..e75363af 100644
--- a/source/reference.txt
+++ b/source/reference.txt
@@ -13,5 +13,6 @@ Reference
    /reference/class/MongoDBCollection
    /reference/class/MongoDBGridFSBucket
    /reference/write-result-classes
+   /reference/result-classes
    /reference/enumeration-classes
    /reference/exception-classes
diff --git a/source/reference/method/MongoDBChangeStream-current.txt b/source/reference/method/MongoDBChangeStream-current.txt
new file mode 100644
index 00000000..1666fcd8
--- /dev/null
+++ b/source/reference/method/MongoDBChangeStream-current.txt
@@ -0,0 +1,104 @@
+================================
+MongoDB\\ChangeStream::current()
+================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\ChangeStream::current()
+
+   Returns the current event in the change stream.
+
+   .. code-block:: php
+
+      function current(): array|object|null
+
+   The structure of each event document will vary based on the operation type.
+   See :manual:`Change Events ` in the MongoDB manual
+   for more information.
+
+Return Values
+-------------
+
+An array or object for the current event in the change stream, or ``null`` if
+there is no current event (i.e. :phpmethod:`MongoDB\\ChangeStream::valid()`
+returns ``false``). The return type will depend on the ``typeMap`` option for
+:phpmethod:`MongoDB\\Collection::watch()`.
+
+Examples
+--------
+
+This example reports events while iterating a change stream.
+
+.. code-block:: php
+
+   test->inventory;
+
+   $changeStream = $collection->watch();
+
+   for ($changeStream->rewind(); true; $changeStream->next()) {
+       if ( ! $changeStream->valid()) {
+           continue;
+       }
+
+       $event = $changeStream->current();
+
+       $ns = sprintf('%s.%s', $event['ns']['db'], $event['ns']['coll']);
+       $id = json_encode($event['documentKey']['_id']);
+
+       switch ($event['operationType']) {
+           case 'delete':
+               printf("Deleted document in %s with _id: %s\n\n", $ns, $id);
+               break;
+
+           case 'insert':
+               printf("Inserted new document in %s\n", $ns);
+               echo json_encode($event['fullDocument']), "\n\n";
+               break;
+
+           case 'replace':
+               printf("Replaced new document in %s with _id: %s\n", $ns, $id);
+               echo json_encode($event['fullDocument']), "\n\n";
+               break;
+
+           case 'update':
+               printf("Updated document in %s with _id: %s\n", $ns, $id);
+               echo json_encode($event['updateDescription']), "\n\n";
+               break;
+       }
+   }
+
+Assuming that a document was inserted, updated, and deleted while the above
+script was iterating the change stream, the output would then resemble:
+
+.. code-block:: none
+
+   Inserted new document in test.inventory
+   {"_id":{"$oid":"5a81fc0d6118fd1af1790d32"},"name":"Widget","quantity":5}
+
+   Updated document in test.inventory with _id: {"$oid":"5a81fc0d6118fd1af1790d32"}
+   {"updatedFields":{"quantity":4},"removedFields":[]}
+
+   Deleted document in test.inventory with _id: {"$oid":"5a81fc0d6118fd1af1790d32"}
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::watch()`
+- :php:`Iterator::current() `
+- :ref:`Tailable Cursor Iteration `
+- :manual:`Change Streams ` documentation in the MongoDB manual
+- :manual:`Change Events ` documentation in the
+  MongoDB manual
\ No newline at end of file
diff --git a/source/reference/method/MongoDBChangeStream-getCursorId.txt b/source/reference/method/MongoDBChangeStream-getCursorId.txt
new file mode 100644
index 00000000..769e2dca
--- /dev/null
+++ b/source/reference/method/MongoDBChangeStream-getCursorId.txt
@@ -0,0 +1,58 @@
+====================================
+MongoDB\\ChangeStream::getCursorId()
+====================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\ChangeStream::getCursorId()
+
+   Returns the change stream cursor's ID.
+
+   .. code-block:: php
+
+      function getCursorId(): MongoDB\Driver\CursorId
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\CursorId ` object.
+
+Examples
+--------
+
+This example reports the cursor ID for a change stream.
+
+.. code-block:: php
+
+   test->inventory;
+
+   $changeStream = $collection->watch();
+
+   var_dump($changeStream->getCursorId());
+
+The output would then resemble::
+
+   object(MongoDB\Driver\CursorId)#5 (1) {
+     ["id"]=>
+     int(8462642181784669708)
+   }
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::watch()`
+- :php:`MongoDB\\Driver\\CursorId `
+- :php:`MongoDB\\Driver\\Cursor::getId() `
diff --git a/source/reference/method/MongoDBChangeStream-key.txt b/source/reference/method/MongoDBChangeStream-key.txt
new file mode 100644
index 00000000..338961b7
--- /dev/null
+++ b/source/reference/method/MongoDBChangeStream-key.txt
@@ -0,0 +1,74 @@
+============================
+MongoDB\\ChangeStream::key()
+============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\ChangeStream::key()
+
+   Returns the index of the current event in the change stream.
+
+   .. code-block:: php
+
+      function key(): integer|null
+
+   The index of the first event in a change stream starts at zero and will
+   increment by one for each subsequent event.
+
+Return Values
+-------------
+
+The index of the current event in the change stream, or ``null`` if there is no
+current event (i.e. :phpmethod:`MongoDB\\ChangeStream::valid()` returns
+``false``).
+
+Examples
+--------
+
+This example reports the index of events while iterating a change stream.
+
+.. code-block:: php
+
+   test->inventory;
+
+   $changeStream = $collection->watch();
+
+   for ($changeStream->rewind(); true; $changeStream->next()) {
+       if ( ! $changeStream->valid()) {
+           continue;
+       }
+
+       $event = $changeStream->current();
+
+       printf("%d: %s\n", $changeStream->key(), $event['operationType']);
+   }
+
+Assuming that a document was inserted, updated, and deleted while the above
+script was iterating the change stream, the output would then resemble:
+
+.. code-block:: none
+
+   0: insert
+   1: update
+   2: delete
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::watch()`
+- :php:`Iterator::key() `
+- :ref:`Tailable Cursor Iteration `
+- :manual:`Change Streams ` documentation in the MongoDB manual
\ No newline at end of file
diff --git a/source/reference/method/MongoDBChangeStream-next.txt b/source/reference/method/MongoDBChangeStream-next.txt
new file mode 100644
index 00000000..629fd14f
--- /dev/null
+++ b/source/reference/method/MongoDBChangeStream-next.txt
@@ -0,0 +1,42 @@
+=============================
+MongoDB\\ChangeStream::next()
+=============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\ChangeStream::next()
+
+   Advances the change stream and attempts to load the next event.
+
+   .. code-block:: php
+
+      function next(): void
+
+   .. note::
+
+      Advancing the change stream does not guarantee that there will be a
+      current event to access. You should still call
+      :phpmethod:`MongoDB\\ChangeStream::valid()` to check for a current event
+      at each step of iteration.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::watch()`
+- :php:`Iterator::next() `
+- :ref:`Tailable Cursor Iteration `
+- :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-rewind.txt b/source/reference/method/MongoDBChangeStream-rewind.txt
new file mode 100644
index 00000000..dbdeb161
--- /dev/null
+++ b/source/reference/method/MongoDBChangeStream-rewind.txt
@@ -0,0 +1,52 @@
+===============================
+MongoDB\\ChangeStream::rewind()
+===============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\ChangeStream::rewind()
+
+   Rewinds the change stream and attempts to load the first event.
+
+   .. code-block:: php
+
+      function rewind(): void
+
+   This method should be called at the start of change stream iteration.
+
+   .. note::
+
+      Rewinding the change stream does not guarantee that there will be a
+      current event to access. You should still call
+      :phpmethod:`MongoDB\\ChangeStream::valid()` to check for a current event
+      at each step of iteration. After initially rewinding the change stream,
+      :phpmethod:`MongoDB\\ChangeStream::next()` should be used to iterate
+      further.
+
+Errors/Exceptions
+-----------------
+
+:php:`MongoDB\\Driver\\Exception\\LogicException
+` if this method is called after a call
+to :phpmethod:`MongoDB\\ChangeStream::next()` (i.e. the underlying
+:php:`MongoDB\\Driver\\Cursor ` has already been
+advanced).
+
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::watch()`
+- :php:`Iterator::rewind() `
+- :ref:`Tailable Cursor Iteration `
+- :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-valid.txt b/source/reference/method/MongoDBChangeStream-valid.txt
new file mode 100644
index 00000000..d5b0d84c
--- /dev/null
+++ b/source/reference/method/MongoDBChangeStream-valid.txt
@@ -0,0 +1,40 @@
+==============================
+MongoDB\\ChangeStream::valid()
+==============================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\ChangeStream::valid()
+
+   Returns whether there is a current event in the change stream.
+
+   .. code-block:: php
+
+      function valid(): boolean
+
+   When manually iterating the change stream using
+   :php:`Iterator ` methods, this method should
+   be used to determine if :phpmethod:`MongoDB\\ChangeStream::current()` and
+   :phpmethod:`MongoDB\\ChangeStream::key()` can be called.
+
+Return Values
+-------------
+
+A boolean indicating whether there is a current event in the change stream.
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::watch()`
+- :php:`Iterator::valid() `
+- :ref:`Tailable Cursor Iteration `
+- :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
index dee50024..b5688c6b 100644
--- a/source/reference/method/MongoDBCollection-watch.txt
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -46,9 +46,71 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Examples
+--------
+
+This example reports events while iterating a change stream.
+
+.. code-block:: php
+
+   test->inventory;
+
+   $changeStream = $collection->watch();
+
+   for ($changeStream->rewind(); true; $changeStream->next()) {
+       if ( ! $changeStream->valid()) {
+           continue;
+       }
+
+       $event = $changeStream->current();
+
+       $ns = sprintf('%s.%s', $event['ns']['db'], $event['ns']['coll']);
+       $id = json_encode($event['documentKey']['_id']);
+
+       switch ($event['operationType']) {
+           case 'delete':
+               printf("Deleted document in %s with _id: %s\n\n", $ns, $id);
+               break;
+
+           case 'insert':
+               printf("Inserted new document in %s\n", $ns);
+               echo json_encode($event['fullDocument']), "\n\n";
+               break;
+
+           case 'replace':
+               printf("Replaced new document in %s with _id: %s\n", $ns, $id);
+               echo json_encode($event['fullDocument']), "\n\n";
+               break;
+
+           case 'update':
+               printf("Updated document in %s with _id: %s\n", $ns, $id);
+               echo json_encode($event['updateDescription']), "\n\n";
+               break;
+       }
+   }
+
+Assuming that a document was inserted, updated, and deleted while the above
+script was iterating the change stream, the output would then resemble:
+
+.. code-block:: none
+
+   Inserted new document in test.inventory
+   {"_id":{"$oid":"5a81fc0d6118fd1af1790d32"},"name":"Widget","quantity":5}
+
+   Updated document in test.inventory with _id: {"$oid":"5a81fc0d6118fd1af1790d32"}
+   {"updatedFields":{"quantity":4},"removedFields":[]}
+
+   Deleted document in test.inventory with _id: {"$oid":"5a81fc0d6118fd1af1790d32"}
+
 See Also
 --------
 
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
+- :manual:`Change Events ` documentation in the
+  MongoDB manual
diff --git a/source/reference/result-classes.txt b/source/reference/result-classes.txt
new file mode 100644
index 00000000..f751b9a2
--- /dev/null
+++ b/source/reference/result-classes.txt
@@ -0,0 +1,42 @@
+==============
+Result Classes
+==============
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+MongoDB\\ChangeStream
+---------------------
+
+.. versionadded:: 1.3
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\ChangeStream
+
+   This class extends PHP's :php:`Iterator `
+   interface. An instance of this class is returned by
+   :phpmethod:`MongoDB\\Collection::watch()`.
+
+   This class allows for iteration of events in a change stream. It also allows
+   iteration to automatically resume after certain errors, such as a replica set
+   failover.
+
+Methods
+~~~~~~~
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBChangeStream-current
+   /reference/method/MongoDBChangeStream-getCursorId
+   /reference/method/MongoDBChangeStream-key
+   /reference/method/MongoDBChangeStream-next
+   /reference/method/MongoDBChangeStream-rewind
+   /reference/method/MongoDBChangeStream-valid
diff --git a/source/tutorial/tailable-cursor.txt b/source/tutorial/tailable-cursor.txt
index 3496ad60..c4ff3b0e 100644
--- a/source/tutorial/tailable-cursor.txt
+++ b/source/tutorial/tailable-cursor.txt
@@ -1,3 +1,5 @@
+.. _php-tailable-cursor:
+
 =========================
 Tailable Cursor Iteration
 =========================

From 9a7f85e05c42f0b83a46ed27eaf4913033afe086 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 12 Feb 2018 15:59:51 -0500
Subject: [PATCH 149/321] PHPLIB-328: Document MapReduceResult class

---
 .../method/MongoDBCollection-mapReduce.txt    |  3 +-
 .../MongoDBMapReduceResult-getCounts.txt      | 66 +++++++++++++++
 ...goDBMapReduceResult-getExecutionTimeMS.txt | 58 +++++++++++++
 .../MongoDBMapReduceResult-getIterator.txt    | 83 +++++++++++++++++++
 .../MongoDBMapReduceResult-getTiming.txt      | 74 +++++++++++++++++
 source/reference/result-classes.txt           | 31 +++++++
 6 files changed, 313 insertions(+), 2 deletions(-)
 create mode 100644 source/reference/method/MongoDBMapReduceResult-getCounts.txt
 create mode 100644 source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
 create mode 100644 source/reference/method/MongoDBMapReduceResult-getIterator.txt
 create mode 100644 source/reference/method/MongoDBMapReduceResult-getTiming.txt

diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
index dd413cb5..2796e385 100644
--- a/source/reference/method/MongoDBCollection-mapReduce.txt
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -36,7 +36,7 @@ Return Values
 -------------
 
 A :phpclass:`MongoDB\\MapReduceResult` object, which allows for iteration of
-mapReduce results irrespective of the output method (e.g. inline, collection)
+map-reduce results irrespective of the output method (e.g. inline, collection)
 via the :php:`IteratorAggregate ` interface. It also
 provides access to command statistics.
 
@@ -117,7 +117,6 @@ The output would then resemble::
       float(3665228)
    }
 
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBMapReduceResult-getCounts.txt b/source/reference/method/MongoDBMapReduceResult-getCounts.txt
new file mode 100644
index 00000000..c2feab0c
--- /dev/null
+++ b/source/reference/method/MongoDBMapReduceResult-getCounts.txt
@@ -0,0 +1,66 @@
+=====================================
+MongoDB\\MapReduceResult::getCounts()
+=====================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\MapReduceResult::getCounts()
+
+   Returns count statistics for the map-reduce operation.
+
+   .. code-block:: php
+
+      function getCounts(): array
+
+Return Values
+-------------
+
+An array of count statistics for the map-reduce operation.
+
+Examples
+--------
+
+This example reports the count statistics for a map-reduce operation.
+
+.. code-block:: php
+
+   test->zips;
+
+   $map = new MongoDB\BSON\Javascript('function() { emit(this.state, this.pop); }');
+   $reduce = new MongoDB\BSON\Javascript('function(key, values) { return Array.sum(values) }');
+   $out = ['inline' => 1];
+
+   $result = $collection->mapReduce($map, $reduce, $out);
+
+   var_dump($result->getCounts());
+
+The output would then resemble::
+
+   array(4) {
+     ["input"]=>
+     int(29353)
+     ["emit"]=>
+     int(29353)
+     ["reduce"]=>
+     int(180)
+     ["output"]=>
+     int(51)
+   }
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :manual:`mapReduce ` command reference in the
+  MongoDB manual
diff --git a/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt b/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
new file mode 100644
index 00000000..06c5b012
--- /dev/null
+++ b/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
@@ -0,0 +1,58 @@
+==============================================
+MongoDB\\MapReduceResult::getExecutionTimeMS()
+==============================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\MapReduceResult::getExecutionTimeMS()
+
+   Returns the execution time in milliseconds of the map-reduce operation.
+
+   .. code-block:: php
+
+      function getExecutionTimeMS(): integer
+
+Return Values
+-------------
+
+An integer denoting the execution time in milliseconds for the map-reduce
+operation.
+
+Examples
+--------
+
+This example reports the execution time for a map-reduce operation.
+
+.. code-block:: php
+
+   test->zips;
+
+   $map = new MongoDB\BSON\Javascript('function() { emit(this.state, this.pop); }');
+   $reduce = new MongoDB\BSON\Javascript('function(key, values) { return Array.sum(values) }');
+   $out = ['inline' => 1];
+
+   $result = $collection->mapReduce($map, $reduce, $out);
+
+   var_dump($result->getExecutionTimeMS());
+
+The output would then resemble::
+
+   int(244)
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :manual:`mapReduce ` command reference in the
+  MongoDB manual
diff --git a/source/reference/method/MongoDBMapReduceResult-getIterator.txt b/source/reference/method/MongoDBMapReduceResult-getIterator.txt
new file mode 100644
index 00000000..b5804028
--- /dev/null
+++ b/source/reference/method/MongoDBMapReduceResult-getIterator.txt
@@ -0,0 +1,83 @@
+=======================================
+MongoDB\\MapReduceResult::getIterator()
+=======================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\MapReduceResult::getIterator()
+
+   Returns a php:`Traversable `, which may be used to iterate
+   through the results of the map-reduce operation.
+
+   .. code-block:: php
+
+      function getIterator(): Traversable
+
+Return Values
+-------------
+
+A :php:`Traversable `, which may be used to iterate through the
+results of the map-reduce operation.
+
+Example
+-------
+
+This example iterates through the results of a map-reduce operation.
+
+.. code-block:: php
+
+   test->zips;
+
+   $map = new MongoDB\BSON\Javascript('function() { emit(this.state, this.pop); }');
+   $reduce = new MongoDB\BSON\Javascript('function(key, values) { return Array.sum(values) }');
+   $out = ['inline' => 1];
+
+   $result = $collection->mapReduce($map, $reduce, $out);
+
+   foreach ($result as $population) {
+      var_dump($population);
+   };
+
+The output would then resemble::
+
+   object(stdClass)#2293 (2) {
+      ["_id"]=>
+      string(2) "AK"
+      ["value"]=>
+      float(544698)
+   }
+   object(stdClass)#2300 (2) {
+      ["_id"]=>
+      string(2) "AL"
+      ["value"]=>
+      float(4040587)
+   }
+   object(stdClass)#2293 (2) {
+      ["_id"]=>
+      string(2) "AR"
+      ["value"]=>
+      float(2350725)
+   }
+   object(stdClass)#2300 (2) {
+      ["_id"]=>
+      string(2) "AZ"
+      ["value"]=>
+      float(3665228)
+   }
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :php:`IteratorAggregate::getIterator() `
diff --git a/source/reference/method/MongoDBMapReduceResult-getTiming.txt b/source/reference/method/MongoDBMapReduceResult-getTiming.txt
new file mode 100644
index 00000000..75ab5393
--- /dev/null
+++ b/source/reference/method/MongoDBMapReduceResult-getTiming.txt
@@ -0,0 +1,74 @@
+=====================================
+MongoDB\\MapReduceResult::getTiming()
+=====================================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\MapReduceResult::getTiming()
+
+   Returns timing statistics for the map-reduce operation.
+
+   .. code-block:: php
+
+      function getTiming(): array
+
+   Timing statistics will only be available if the ``verbose`` option was
+   specified for :phpmethod:`MongoDB\\Collection::mapReduce()`.
+
+Return Values
+-------------
+
+An array of timing statistics for the map-reduce operation. If no timing
+statistics are available, the array will be empty.
+
+Examples
+--------
+
+This example specifies the ``verbose`` option for
+:phpmethod:`MongoDB\\Collection::mapReduce()` and reports the timing statistics
+for a map-reduce operation.
+
+.. code-block:: php
+
+   test->zips;
+
+   $map = new MongoDB\BSON\Javascript('function() { emit(this.state, this.pop); }');
+   $reduce = new MongoDB\BSON\Javascript('function(key, values) { return Array.sum(values) }');
+   $out = ['inline' => 1];
+
+   $result = $collection->mapReduce($map, $reduce, $out, ['verbose' => true]);
+
+   var_dump($result->getTiming());
+
+The output would then resemble::
+
+   array(5) {
+     ["mapTime"]=>
+     int(163)
+     ["emitLoop"]=>
+     int(233)
+     ["reduceTime"]=>
+     int(9)
+     ["mode"]=>
+     string(5) "mixed"
+     ["total"]=>
+     int(233)
+   }
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :manual:`mapReduce ` command reference in the
+  MongoDB manual
diff --git a/source/reference/result-classes.txt b/source/reference/result-classes.txt
index f751b9a2..cb6860ec 100644
--- a/source/reference/result-classes.txt
+++ b/source/reference/result-classes.txt
@@ -40,3 +40,34 @@ Methods
    /reference/method/MongoDBChangeStream-next
    /reference/method/MongoDBChangeStream-rewind
    /reference/method/MongoDBChangeStream-valid
+
+----
+
+MongoDB\\MapReduceResult
+------------------------
+
+.. versionadded:: 1.2
+
+Definition
+~~~~~~~~~~
+
+.. phpclass:: MongoDB\\MapReduceResult
+
+   This class extends PHP's :php:`IteratorAggregate `
+   interface. An instance of this class is returned by
+   :phpmethod:`MongoDB\\Collection::mapReduce()`.
+
+   This class allows for iteration of map-reduce results irrespective of the
+   output method (e.g. inline, collection). It also provides access to command
+   statistics.
+
+Methods
+~~~~~~~
+
+.. toctree::
+   :titlesonly:
+
+   /reference/method/MongoDBMapReduceResult-getCounts
+   /reference/method/MongoDBMapReduceResult-getExecutionTimeMS
+   /reference/method/MongoDBMapReduceResult-getIterator
+   /reference/method/MongoDBMapReduceResult-getTiming

From 8254a564bad260d86d0c6b55cbb828333f080b0a Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Fri, 23 Feb 2018 12:05:21 -0500
Subject: [PATCH 150/321] PHPLIB-172: Support explain option for aggregate
 command

---
 ...gs-MongoDBCollection-method-aggregate-option.yaml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 1d6e24da..6c7d37bd 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -42,6 +42,18 @@ operation: ~
 optional: true
 ---
 arg_name: option
+name: explain
+type: boolean
+description: |
+  Specifies whether or not to return the information on the processing of the
+  pipeline.
+
+  .. versionadded:: 1.4
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
 name: hint
 type: string|array|object
 description: |

From fefe3824fb1ed8efd2e5485b90c67f94c36a53b8 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 27 Feb 2018 16:22:39 -0500
Subject: [PATCH 151/321] Document arrayFilters option for UpdateOne

---
 .../apiargs-MongoDBCollection-method-updateOne-option.yaml  | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
index 55eb32a7..ae27c0d9 100644
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
@@ -2,6 +2,12 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: upsert
 ---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: arrayFilters
+post: |
+  .. versionadded:: 1.3
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation

From c396108091b6a83ada2915cf8e22e3de3691081b Mon Sep 17 00:00:00 2001
From: maxime alves 
Date: Wed, 7 Mar 2018 11:24:06 +0100
Subject: [PATCH 152/321] removed collectionName attribute in GridFSbucket
 construct signature

---
 source/reference/method/MongoDBGridFSBucket__construct.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index d6c29373..94e601ef 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function __construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = [])
+      function __construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = [])
 
    This constructor has the following parameters:
 

From 42008528b2f9db93edaeb3b418ea72ee3947d9ee Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Mon, 19 Mar 2018 17:09:51 -0400
Subject: [PATCH 153/321] Add modifyCollection documentation

---
 ...tabase-method-modifyCollection-option.yaml | 14 ++++
 ...atabase-method-modifyCollection-param.yaml | 20 +++++
 source/includes/apiargs-common-param.yaml     |  3 +-
 source/reference/class/MongoDBDatabase.txt    |  1 +
 .../MongoDBDatabase-modifyCollection.txt      | 81 +++++++++++++++++++
 5 files changed, 118 insertions(+), 1 deletion(-)
 create mode 100644 source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
 create mode 100644 source/reference/method/MongoDBDatabase-modifyCollection.txt

diff --git a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
new file mode 100644
index 00000000..ca8d6fef
--- /dev/null
+++ b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
@@ -0,0 +1,14 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: typeMap
+post: |
+  This will be used for the returned command result document.
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: writeConcern
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
new file mode 100644
index 00000000..16597b3a
--- /dev/null
+++ b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
@@ -0,0 +1,20 @@
+source:
+  file: apiargs-common-param.yaml
+  ref: $collectionName
+replacement:
+  subject: "collection or view"
+  action: " to modify"
+---
+arg_name: param
+name: $collectionOptions
+type: array
+description: |
+  Collection or view options to assign.
+interface: phpmethod
+operation: ~
+optional: false
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/includes/apiargs-common-param.yaml b/source/includes/apiargs-common-param.yaml
index 0f152c82..a8d79082 100644
--- a/source/includes/apiargs-common-param.yaml
+++ b/source/includes/apiargs-common-param.yaml
@@ -23,11 +23,12 @@ arg_name: param
 name: $collectionName
 type: string
 description: |
-  The name of the collection{{action}}.
+  The name of the {{subject}}{{action}}.
 interface: phpmethod
 operation: ~
 optional: false
 replacement:
+  subject: "collection"
   action: ""
 ---
 arg_name: param
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index 1cc6f858..66aca2c1 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -56,6 +56,7 @@ Methods
    /reference/method/MongoDBDatabase-getTypeMap
    /reference/method/MongoDBDatabase-getWriteConcern
    /reference/method/MongoDBDatabase-listCollections
+   /reference/method/MongoDBDatabase-modifyCollection
    /reference/method/MongoDBDatabase-selectCollection
    /reference/method/MongoDBDatabase-selectGridFSBucket
    /reference/method/MongoDBDatabase-withOptions
diff --git a/source/reference/method/MongoDBDatabase-modifyCollection.txt b/source/reference/method/MongoDBDatabase-modifyCollection.txt
new file mode 100644
index 00000000..43eb2d25
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-modifyCollection.txt
@@ -0,0 +1,81 @@
+=====================================
+MongoDB\\Database::modifyCollection()
+=====================================
+
+.. versionadded:: 1.4
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::modifyCollection()
+
+   Modifies a collection or view according to the specified
+   ``$collectionOptions``.
+
+   .. code-block:: php
+
+      function modifyCollection($collectionName, array $collectionOptions, array $options = []): array|object
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-modifyCollection-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-modifyCollection-option.rst
+
+Return Values
+-------------
+
+An array or object with the result document of the :manual:`collMod
+` command.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+Example
+-------
+
+The following example changes the expiration time of a TTL collection in the
+``test`` database:
+
+.. code-block:: php
+
+   test;
+
+   $result = $db->modifyCollection('users', [
+       'keyPattern' => ['lastAccess' => 1],
+       'expireAfterSeconds' => 1000
+   ]);
+
+   var_dump($result);
+
+The output would then resemble::
+
+   object(stdClass)#2779 {
+     ["expireAfterSeconds_old"]=>
+     int(3)
+     ["expireAfterSeconds_new"]=>
+     int(1000)
+     ["ok"]=>
+     float(1)
+   }
+
+See Also
+--------
+
+- :manual:`collMod ` command reference in the MongoDB
+  manual

From 4e15ad1e55f499406cb5645288f8e3d615cb8359 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Fri, 23 Feb 2018 13:03:01 -0500
Subject: [PATCH 154/321] PHPLIB-332: Create explain helper on Collection class

---
 ...ngoDBCollection-method-explain-option.yaml |  20 ++
 ...ongoDBCollection-method-explain-param.yaml |  13 +
 source/reference/class/MongoDBCollection.txt  |   1 +
 .../method/MongoDBCollection-explain.txt      | 278 ++++++++++++++++++
 4 files changed, 312 insertions(+)
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
 create mode 100644 source/reference/method/MongoDBCollection-explain.txt

diff --git a/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml b/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
new file mode 100644
index 00000000..7c6a4dcd
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
@@ -0,0 +1,20 @@
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: readPreference
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: typeMap
+post: |
+  This will be used for the returned command result document.
+---
+arg_name: option
+name: verbosity
+type: string
+description: |
+  The verbosity level at which to run the command. See the :manual:`explain
+  ` command for more information.
+interface: phpmethod
+operation: ~
+optional: true
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml b/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
new file mode 100644
index 00000000..59f15637
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
@@ -0,0 +1,13 @@
+arg_name: param
+name: $explainable
+type: :phpclass:`MongoDB\\Operation\\Explainable`
+description: |
+  The command to explain.
+interface: phpmethod
+operation: ~
+optional: false
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index faca9cdf..4c393df8 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -71,6 +71,7 @@ Methods
    /reference/method/MongoDBCollection-drop
    /reference/method/MongoDBCollection-dropIndex
    /reference/method/MongoDBCollection-dropIndexes
+   /reference/method/MongoDBCollection-explain
    /reference/method/MongoDBCollection-find
    /reference/method/MongoDBCollection-findOne
    /reference/method/MongoDBCollection-findOneAndDelete
diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt
new file mode 100644
index 00000000..df1c82e7
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-explain.txt
@@ -0,0 +1,278 @@
+==============================
+MongoDB\\Collection::explain()
+==============================
+
+.. versionadded:: 1.4
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::explain()
+
+   Explain the given command.
+
+   .. code-block:: php
+
+      function explain(MongoDB\\Operation\\Explainable $explainable, array $options = []): array|object
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-explain-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-explain-option.rst
+
+Return Values
+-------------
+
+An array or object with the result document of the :manual:`explain
+` command. The return type will depend on the
+``typeMap`` option.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+Explainable Commands
+--------------------
+
+Explainable commands include, but are not limited to:
+
+   - :phpclass:`MongoDB\\Operation\\Count`
+   - :phpclass:`MongoDB\\Operation\\DeleteMany`
+   - :phpclass:`MongoDB\\Operation\\DeleteOne`
+   - :phpclass:`MongoDB\\Operation\\Distinct`
+   - :phpclass:`MongoDB\\Operation\\Find`
+   - :phpclass:`MongoDB\\Operation\\FindOne`
+   - :phpclass:`MongoDB\\Operation\\FindOneAndDelete`
+   - :phpclass:`MongoDB\\Operation\\FindOneAndReplace`
+   - :phpclass:`MongoDB\\Operation\\FindOneAndUpdate`
+   - :phpclass:`MongoDB\\Operation\\UpdateMany`
+   - :phpclass:`MongoDB\\Operation\\UpdateOne`
+
+Examples
+--------
+
+This example explains a count command.
+
+.. code-block:: php
+
+   test->restaurants;
+
+   $count = new MongoDB\Operation\Count(
+       $collection->getDatabaseName(),
+       $collection->getCollectionName(),
+       ['cuisine' => 'Italian']
+   );
+
+   $result = $collection->explain($count);
+
+   var_dump($result);
+
+The output would then resemble::
+
+   object(MongoDB\Model\BSONDocument)#29 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(4) {
+       ["queryPlanner"]=>
+       object(MongoDB\Model\BSONDocument)#21 (1) {
+         ["storage":"ArrayObject":private]=>
+         array(6) {
+           ["plannerVersion"]=>
+           int(1)
+           ["namespace"]=>
+           string(16) "test.restaurants"
+           ["indexFilterSet"]=>
+           bool(false)
+           ["parsedQuery"]=>
+           object(MongoDB\Model\BSONDocument)#15 (1) {
+             ["storage":"ArrayObject":private]=>
+             array(1) {
+               ["cuisine"]=>
+               object(MongoDB\Model\BSONDocument)#14 (1) {
+                 ["storage":"ArrayObject":private]=>
+                 array(1) {
+                   ["$eq"]=>
+                   string(7) "Italian"
+                 }
+               }
+             }
+           }
+           ["winningPlan"]=>
+           object(MongoDB\Model\BSONDocument)#19 (1) {
+             ["storage":"ArrayObject":private]=>
+             array(2) {
+               ["stage"]=>
+               string(5) "COUNT"
+               ["inputStage"]=>
+               object(MongoDB\Model\BSONDocument)#18 (1) {
+                 ["storage":"ArrayObject":private]=>
+                 array(3) {
+                   ["stage"]=>
+                   string(8) "COLLSCAN"
+                   ["filter"]=>
+                   object(MongoDB\Model\BSONDocument)#17 (1) {
+                     ["storage":"ArrayObject":private]=>
+                     array(1) {
+                       ["cuisine"]=>
+                       object(MongoDB\Model\BSONDocument)#16 (1) {
+                         ["storage":"ArrayObject":private]=>
+                         array(1) {
+                           ["$eq"]=>
+                           string(7) "Italian"
+                         }
+                       }
+                     }
+                   }
+                   ["direction"]=>
+                   string(7) "forward"
+                 }
+               }
+             }
+           }
+           ["rejectedPlans"]=>
+           object(MongoDB\Model\BSONArray)#20 (1) {
+             ["storage":"ArrayObject":private]=>
+             array(0) {
+             }
+           }
+         }
+       }
+       ["executionStats"]=>
+       object(MongoDB\Model\BSONDocument)#27 (1) {
+         ["storage":"ArrayObject":private]=>
+         array(7) {
+           ["executionSuccess"]=>
+           bool(true)
+           ["nReturned"]=>
+           int(0)
+           ["executionTimeMillis"]=>
+           int(24)
+           ["totalKeysExamined"]=>
+           int(0)
+           ["totalDocsExamined"]=>
+           int(25359)
+           ["executionStages"]=>
+           object(MongoDB\Model\BSONDocument)#25 (1) {
+             ["storage":"ArrayObject":private]=>
+             array(14) {
+               ["stage"]=>
+               string(5) "COUNT"
+               ["nReturned"]=>
+               int(0)
+               ["executionTimeMillisEstimate"]=>
+               int(20)
+               ["works"]=>
+               int(25361)
+               ["advanced"]=>
+               int(0)
+               ["needTime"]=>
+               int(25360)
+               ["needYield"]=>
+               int(0)
+               ["saveState"]=>
+               int(198)
+               ["restoreState"]=>
+               int(198)
+               ["isEOF"]=>
+               int(1)
+               ["invalidates"]=>
+               int(0)
+               ["nCounted"]=>
+               int(1069)
+               ["nSkipped"]=>
+               int(0)
+               ["inputStage"]=>
+               object(MongoDB\Model\BSONDocument)#24 (1) {
+                 ["storage":"ArrayObject":private]=>
+                 array(14) {
+                   ["stage"]=>
+                   string(8) "COLLSCAN"
+                   ["filter"]=>
+                   object(MongoDB\Model\BSONDocument)#23 (1) {
+                     ["storage":"ArrayObject":private]=>
+                     array(1) {
+                       ["cuisine"]=>
+                       object(MongoDB\Model\BSONDocument)#22 (1) {
+                         ["storage":"ArrayObject":private]=>
+                         array(1) {
+                           ["$eq"]=>
+                           string(7) "Italian"
+                         }
+                       }
+                     }
+                   }
+                   ["nReturned"]=>
+                   int(1069)
+                   ["executionTimeMillisEstimate"]=>
+                   int(20)
+                   ["works"]=>
+                   int(25361)
+                   ["advanced"]=>
+                   int(1069)
+                   ["needTime"]=>
+                   int(24291)
+                   ["needYield"]=>
+                   int(0)
+                   ["saveState"]=>
+                   int(198)
+                   ["restoreState"]=>
+                   int(198)
+                   ["isEOF"]=>
+                   int(1)
+                   ["invalidates"]=>
+                   int(0)
+                   ["direction"]=>
+                   string(7) "forward"
+                   ["docsExamined"]=>
+                   int(25359)
+                 }
+               }
+             }
+           }
+           ["allPlansExecution"]=>
+           object(MongoDB\Model\BSONArray)#26 (1) {
+             ["storage":"ArrayObject":private]=>
+             array(0) {
+             }
+           }
+         }
+       }
+       ["serverInfo"]=>
+       object(MongoDB\Model\BSONDocument)#28 (1) {
+         ["storage":"ArrayObject":private]=>
+         array(4) {
+           ["host"]=>
+           string(9) "localhost"
+           ["port"]=>
+           int(27017)
+           ["version"]=>
+           string(5) "3.6.1"
+           ["gitVersion"]=>
+           string(40) "025d4f4fe61efd1fb6f0005be20cb45a004093d1"
+         }
+       }
+       ["ok"]=>
+       float(1)
+     }
+   }
+
+See Also
+--------
+
+- :manual:`explain ` command reference in the MongoDB
+  manual

From a81455ab33907f0ad40f201dc5409e136edcbd19 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Fri, 30 Mar 2018 11:20:17 -0400
Subject: [PATCH 155/321] PHPLIB-84: Allow Collection::dropIndex() to accept an
 IndexInfo object

---
 .../apiargs-MongoDBCollection-method-dropIndex-param.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
index 53061d16..7cac6d1d 100644
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
@@ -1,10 +1,10 @@
 arg_name: param
 name: $indexName
-type: string
+type: string| :phpclass:`MongoDB\\Model\\IndexInfo`
 description: |
-  The name of the index to drop. View the existing indexes on the collection
-  using the :phpmethod:`listIndexes() `
-  method.
+  The name or model object of the index to drop. View the existing indexes on
+  the collection using the :phpmethod:`listIndexes()
+  ` method.
 interface: phpmethod
 operation: ~
 optional: false

From a475d13a1bb1db3008dde45865cc7dfdf4d8740d Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Wed, 4 Apr 2018 10:16:48 -0400
Subject: [PATCH 156/321] PHPLIB-278: Add examples for calling methods on
 database, collection, and index models

---
 ...ongoDBModelCollectionInfo-getCappedMax.txt | 22 ++++++++++++++++
 ...ngoDBModelCollectionInfo-getCappedSize.txt | 21 +++++++++++++++
 .../MongoDBModelCollectionInfo-getName.txt    | 15 +++++++++++
 .../MongoDBModelCollectionInfo-getOptions.txt | 26 +++++++++++++++++++
 .../MongoDBModelCollectionInfo-isCapped.txt   | 21 +++++++++++++++
 .../MongoDBModelDatabaseInfo-getName.txt      | 15 +++++++++++
 ...MongoDBModelDatabaseInfo-getSizeOnDisk.txt | 15 +++++++++++
 .../MongoDBModelDatabaseInfo-isEmpty.txt      | 15 +++++++++++
 .../method/MongoDBModelIndexInfo-getKey.txt   | 20 ++++++++++++++
 .../method/MongoDBModelIndexInfo-getName.txt  | 17 ++++++++++++
 .../MongoDBModelIndexInfo-getNamespace.txt    | 17 ++++++++++++
 .../MongoDBModelIndexInfo-getVersion.txt      | 17 ++++++++++++
 .../method/MongoDBModelIndexInfo-isSparse.txt | 17 ++++++++++++
 .../method/MongoDBModelIndexInfo-isTtl.txt    | 17 ++++++++++++
 .../method/MongoDBModelIndexInfo-isUnique.txt | 17 ++++++++++++
 15 files changed, 272 insertions(+)

diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
index 693350f0..fb86ee19 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
@@ -28,6 +28,28 @@ Return Values
 The document limit for the capped collection. If the collection is not capped,
 ``null`` will be returned.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo',
+       'options' => [
+           'capped' => true,
+           'size' => 1048576,
+           'max' => 100,
+       ]
+   ]);
+
+   var_dump($info->getCappedMax());
+
+The output would then resemble::
+
+   int(100)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
index cc0bd769..a3b1ce48 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
@@ -29,6 +29,27 @@ Return Values
 The size limit for the capped collection in bytes. If the collection is not
 capped, ``null`` will be returned.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo',
+       'options' => [
+           'capped' => true,
+           'size' => 1048576,
+       ]
+   ]);
+
+   var_dump($info->getCappedSize());
+
+The output would then resemble::
+
+   int(1048576)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getName.txt b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
index cd04ffac..42226c20 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getName.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
@@ -26,6 +26,21 @@ Return Values
 
 The collection name.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo']);
+
+   echo $info->getName();
+
+The output would then resemble::
+
+   foo
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
index e360522b..84506816 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
@@ -28,6 +28,32 @@ Return Values
 
 The collection options.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo',
+       'options' => [
+           'capped' => true,
+           'size' => 1048576,
+       ]
+   ]);
+
+   var_dump($info->getOptions());
+
+The output would then resemble::
+
+   array(2) {
+     ["capped"]=>
+     bool(true)
+     ["size"]=>
+     int(1048576)
+   }
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
index abfc387d..a583a83f 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
@@ -27,6 +27,27 @@ Return Values
 
 A boolean indicating whether the collection is a capped collection.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo',
+       'options' => [
+           'capped' => true,
+           'size' => 1048576,
+      ]
+   ]);
+
+   var_dump($info->isCapped());
+
+The output would then resemble::
+
+   bool(true)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
index 47991f1a..a2524a4b 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
@@ -26,6 +26,21 @@ Return Values
 
 The database name.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo']);
+
+   echo $info->getName();
+
+The output would then resemble::
+
+   foo
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
index 2a8fe5ad..d42f23ff 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
@@ -26,6 +26,21 @@ Return Values
 
 The total size of the database file on disk in bytes.
 
+Examples
+--------
+
+.. code-block:: php
+
+    1048576]);
+
+   var_dump($info->getSizeOnDisk());
+
+The output would then resemble::
+
+   int(1048576)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
index 878844d0..ae25e67f 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
@@ -26,6 +26,21 @@ Return Values
 
 A boolean indicating whether the database has any data.
 
+Examples
+--------
+
+.. code-block:: php
+
+    true]);
+
+   var_dump($info->isEmpty());
+
+The output would then resemble::
+
+   bool(true)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getKey.txt b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
index 6ad0712e..1a115f9c 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getKey.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
@@ -28,6 +28,26 @@ Return Values
 
 The index specification as an associative array.
 
+Examples
+--------
+
+.. code-block:: php
+
+    ['x' => 1],
+   ]);
+
+   var_dump($info->getKey());
+
+The output would then resemble::
+
+   array(1) {
+     ["x"]=>
+     int(1)
+   }
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getName.txt b/source/reference/method/MongoDBModelIndexInfo-getName.txt
index 26983790..97ad45fa 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getName.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getName.txt
@@ -29,6 +29,23 @@ Return Values
 
 The index name.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'x_1',
+   ]);
+
+   echo $info->getName();
+
+The output would then resemble::
+
+   x_1
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
index 987c8bec..f4a64bb6 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
@@ -27,6 +27,23 @@ Return Values
 
 The index namespace.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo.bar',
+   ]);
+
+   echo $info->getNamespace();
+
+The output would then resemble::
+
+   foo.bar
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
index e2480df0..728f3885 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
@@ -26,6 +26,23 @@ Return Values
 
 The index version.
 
+Examples
+--------
+
+.. code-block:: php
+
+    1,
+   ]);
+
+   var_dump($info->getVersion());
+
+The output would then resemble::
+
+   int(1)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
index 580e2f60..5bbe4dea 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
@@ -28,6 +28,23 @@ Return Values
 
 A boolean indicating whether the index is a sparse index.
 
+Examples
+--------
+
+.. code-block:: php
+
+    true,
+   ]);
+
+   var_dump($info->isSparse());
+
+The output would then resemble::
+
+   bool(true)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
index f2f16e02..a3e70d03 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
@@ -28,6 +28,23 @@ Return Values
 
 A boolean indicating whether the index is a TTL index.
 
+Examples
+--------
+
+.. code-block:: php
+
+    100,
+   ]);
+
+   var_dump($info->isTtl());
+
+The output would then resemble::
+
+   bool(true)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
index 5fbfa765..30cf1ece 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
@@ -28,6 +28,23 @@ Return Values
 
 A boolean indicating whether the index is a unique index.
 
+Examples
+--------
+
+.. code-block:: php
+
+    true,
+   ]);
+
+   var_dump($info->isUnique());
+
+The output would then resemble::
+
+   bool(true)
+
 See Also
 --------
 

From bd7ac9d0cd5e4cb54eb0d4b0a40f3ff60396fdc5 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Mon, 9 Apr 2018 10:20:16 -0400
Subject: [PATCH 157/321] Revert "Merge pull request #522"

This reverts commit 86ce1b5d7f543e7e510aefd845773fdedb860dd8, reversing
changes made to b7c4df4ca533e22b063b1ef5063e44f4a6a00d19.
---
 ...ongoDBModelCollectionInfo-getCappedMax.txt | 22 ----------------
 ...ngoDBModelCollectionInfo-getCappedSize.txt | 21 ---------------
 .../MongoDBModelCollectionInfo-getName.txt    | 15 -----------
 .../MongoDBModelCollectionInfo-getOptions.txt | 26 -------------------
 .../MongoDBModelCollectionInfo-isCapped.txt   | 21 ---------------
 .../MongoDBModelDatabaseInfo-getName.txt      | 15 -----------
 ...MongoDBModelDatabaseInfo-getSizeOnDisk.txt | 15 -----------
 .../MongoDBModelDatabaseInfo-isEmpty.txt      | 15 -----------
 .../method/MongoDBModelIndexInfo-getKey.txt   | 20 --------------
 .../method/MongoDBModelIndexInfo-getName.txt  | 17 ------------
 .../MongoDBModelIndexInfo-getNamespace.txt    | 17 ------------
 .../MongoDBModelIndexInfo-getVersion.txt      | 17 ------------
 .../method/MongoDBModelIndexInfo-isSparse.txt | 17 ------------
 .../method/MongoDBModelIndexInfo-isTtl.txt    | 17 ------------
 .../method/MongoDBModelIndexInfo-isUnique.txt | 17 ------------
 15 files changed, 272 deletions(-)

diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
index fb86ee19..693350f0 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
@@ -28,28 +28,6 @@ Return Values
 The document limit for the capped collection. If the collection is not capped,
 ``null`` will be returned.
 
-Examples
---------
-
-.. code-block:: php
-
-    'foo',
-       'options' => [
-           'capped' => true,
-           'size' => 1048576,
-           'max' => 100,
-       ]
-   ]);
-
-   var_dump($info->getCappedMax());
-
-The output would then resemble::
-
-   int(100)
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
index a3b1ce48..cc0bd769 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
@@ -29,27 +29,6 @@ Return Values
 The size limit for the capped collection in bytes. If the collection is not
 capped, ``null`` will be returned.
 
-Examples
---------
-
-.. code-block:: php
-
-    'foo',
-       'options' => [
-           'capped' => true,
-           'size' => 1048576,
-       ]
-   ]);
-
-   var_dump($info->getCappedSize());
-
-The output would then resemble::
-
-   int(1048576)
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getName.txt b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
index 42226c20..cd04ffac 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getName.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
@@ -26,21 +26,6 @@ Return Values
 
 The collection name.
 
-Examples
---------
-
-.. code-block:: php
-
-    'foo']);
-
-   echo $info->getName();
-
-The output would then resemble::
-
-   foo
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
index 84506816..e360522b 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
@@ -28,32 +28,6 @@ Return Values
 
 The collection options.
 
-Examples
---------
-
-.. code-block:: php
-
-    'foo',
-       'options' => [
-           'capped' => true,
-           'size' => 1048576,
-       ]
-   ]);
-
-   var_dump($info->getOptions());
-
-The output would then resemble::
-
-   array(2) {
-     ["capped"]=>
-     bool(true)
-     ["size"]=>
-     int(1048576)
-   }
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
index a583a83f..abfc387d 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
@@ -27,27 +27,6 @@ Return Values
 
 A boolean indicating whether the collection is a capped collection.
 
-Examples
---------
-
-.. code-block:: php
-
-    'foo',
-       'options' => [
-           'capped' => true,
-           'size' => 1048576,
-      ]
-   ]);
-
-   var_dump($info->isCapped());
-
-The output would then resemble::
-
-   bool(true)
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
index a2524a4b..47991f1a 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
@@ -26,21 +26,6 @@ Return Values
 
 The database name.
 
-Examples
---------
-
-.. code-block:: php
-
-    'foo']);
-
-   echo $info->getName();
-
-The output would then resemble::
-
-   foo
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
index d42f23ff..2a8fe5ad 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
@@ -26,21 +26,6 @@ Return Values
 
 The total size of the database file on disk in bytes.
 
-Examples
---------
-
-.. code-block:: php
-
-    1048576]);
-
-   var_dump($info->getSizeOnDisk());
-
-The output would then resemble::
-
-   int(1048576)
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
index ae25e67f..878844d0 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
@@ -26,21 +26,6 @@ Return Values
 
 A boolean indicating whether the database has any data.
 
-Examples
---------
-
-.. code-block:: php
-
-    true]);
-
-   var_dump($info->isEmpty());
-
-The output would then resemble::
-
-   bool(true)
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getKey.txt b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
index 1a115f9c..6ad0712e 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getKey.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
@@ -28,26 +28,6 @@ Return Values
 
 The index specification as an associative array.
 
-Examples
---------
-
-.. code-block:: php
-
-    ['x' => 1],
-   ]);
-
-   var_dump($info->getKey());
-
-The output would then resemble::
-
-   array(1) {
-     ["x"]=>
-     int(1)
-   }
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getName.txt b/source/reference/method/MongoDBModelIndexInfo-getName.txt
index 97ad45fa..26983790 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getName.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getName.txt
@@ -29,23 +29,6 @@ Return Values
 
 The index name.
 
-Examples
---------
-
-.. code-block:: php
-
-    'x_1',
-   ]);
-
-   echo $info->getName();
-
-The output would then resemble::
-
-   x_1
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
index f4a64bb6..987c8bec 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
@@ -27,23 +27,6 @@ Return Values
 
 The index namespace.
 
-Examples
---------
-
-.. code-block:: php
-
-    'foo.bar',
-   ]);
-
-   echo $info->getNamespace();
-
-The output would then resemble::
-
-   foo.bar
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
index 728f3885..e2480df0 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
@@ -26,23 +26,6 @@ Return Values
 
 The index version.
 
-Examples
---------
-
-.. code-block:: php
-
-    1,
-   ]);
-
-   var_dump($info->getVersion());
-
-The output would then resemble::
-
-   int(1)
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
index 5bbe4dea..580e2f60 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
@@ -28,23 +28,6 @@ Return Values
 
 A boolean indicating whether the index is a sparse index.
 
-Examples
---------
-
-.. code-block:: php
-
-    true,
-   ]);
-
-   var_dump($info->isSparse());
-
-The output would then resemble::
-
-   bool(true)
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
index a3e70d03..f2f16e02 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
@@ -28,23 +28,6 @@ Return Values
 
 A boolean indicating whether the index is a TTL index.
 
-Examples
---------
-
-.. code-block:: php
-
-    100,
-   ]);
-
-   var_dump($info->isTtl());
-
-The output would then resemble::
-
-   bool(true)
-
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
index 30cf1ece..5fbfa765 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
@@ -28,23 +28,6 @@ Return Values
 
 A boolean indicating whether the index is a unique index.
 
-Examples
---------
-
-.. code-block:: php
-
-    true,
-   ]);
-
-   var_dump($info->isUnique());
-
-The output would then resemble::
-
-   bool(true)
-
 See Also
 --------
 

From 1c33eb72d33a4796b232c1ad584c89476250d27e Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Mon, 9 Apr 2018 10:34:50 -0400
Subject: [PATCH 158/321] PHPLIB-278: Add examples for calling methods on
 database, collection, and index models

---
 ...ongoDBModelCollectionInfo-getCappedMax.txt | 22 ++++++++++++++++
 ...ngoDBModelCollectionInfo-getCappedSize.txt | 21 +++++++++++++++
 .../MongoDBModelCollectionInfo-getName.txt    | 15 +++++++++++
 .../MongoDBModelCollectionInfo-getOptions.txt | 26 +++++++++++++++++++
 .../MongoDBModelCollectionInfo-isCapped.txt   | 21 +++++++++++++++
 .../MongoDBModelDatabaseInfo-getName.txt      | 15 +++++++++++
 ...MongoDBModelDatabaseInfo-getSizeOnDisk.txt | 15 +++++++++++
 .../MongoDBModelDatabaseInfo-isEmpty.txt      | 15 +++++++++++
 .../method/MongoDBModelIndexInfo-getKey.txt   | 20 ++++++++++++++
 .../method/MongoDBModelIndexInfo-getName.txt  | 17 ++++++++++++
 .../MongoDBModelIndexInfo-getNamespace.txt    | 17 ++++++++++++
 .../MongoDBModelIndexInfo-getVersion.txt      | 17 ++++++++++++
 .../method/MongoDBModelIndexInfo-isSparse.txt | 17 ++++++++++++
 .../method/MongoDBModelIndexInfo-isTtl.txt    | 17 ++++++++++++
 .../method/MongoDBModelIndexInfo-isUnique.txt | 17 ++++++++++++
 15 files changed, 272 insertions(+)

diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
index 693350f0..fb86ee19 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
@@ -28,6 +28,28 @@ Return Values
 The document limit for the capped collection. If the collection is not capped,
 ``null`` will be returned.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo',
+       'options' => [
+           'capped' => true,
+           'size' => 1048576,
+           'max' => 100,
+       ]
+   ]);
+
+   var_dump($info->getCappedMax());
+
+The output would then resemble::
+
+   int(100)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
index cc0bd769..a3b1ce48 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
@@ -29,6 +29,27 @@ Return Values
 The size limit for the capped collection in bytes. If the collection is not
 capped, ``null`` will be returned.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo',
+       'options' => [
+           'capped' => true,
+           'size' => 1048576,
+       ]
+   ]);
+
+   var_dump($info->getCappedSize());
+
+The output would then resemble::
+
+   int(1048576)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getName.txt b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
index cd04ffac..42226c20 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getName.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
@@ -26,6 +26,21 @@ Return Values
 
 The collection name.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo']);
+
+   echo $info->getName();
+
+The output would then resemble::
+
+   foo
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
index e360522b..84506816 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
@@ -28,6 +28,32 @@ Return Values
 
 The collection options.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo',
+       'options' => [
+           'capped' => true,
+           'size' => 1048576,
+       ]
+   ]);
+
+   var_dump($info->getOptions());
+
+The output would then resemble::
+
+   array(2) {
+     ["capped"]=>
+     bool(true)
+     ["size"]=>
+     int(1048576)
+   }
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
index abfc387d..a583a83f 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
@@ -27,6 +27,27 @@ Return Values
 
 A boolean indicating whether the collection is a capped collection.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo',
+       'options' => [
+           'capped' => true,
+           'size' => 1048576,
+      ]
+   ]);
+
+   var_dump($info->isCapped());
+
+The output would then resemble::
+
+   bool(true)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
index 47991f1a..a2524a4b 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
@@ -26,6 +26,21 @@ Return Values
 
 The database name.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo']);
+
+   echo $info->getName();
+
+The output would then resemble::
+
+   foo
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
index 2a8fe5ad..d42f23ff 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
@@ -26,6 +26,21 @@ Return Values
 
 The total size of the database file on disk in bytes.
 
+Examples
+--------
+
+.. code-block:: php
+
+    1048576]);
+
+   var_dump($info->getSizeOnDisk());
+
+The output would then resemble::
+
+   int(1048576)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
index 878844d0..ae25e67f 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
@@ -26,6 +26,21 @@ Return Values
 
 A boolean indicating whether the database has any data.
 
+Examples
+--------
+
+.. code-block:: php
+
+    true]);
+
+   var_dump($info->isEmpty());
+
+The output would then resemble::
+
+   bool(true)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getKey.txt b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
index 6ad0712e..1a115f9c 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getKey.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
@@ -28,6 +28,26 @@ Return Values
 
 The index specification as an associative array.
 
+Examples
+--------
+
+.. code-block:: php
+
+    ['x' => 1],
+   ]);
+
+   var_dump($info->getKey());
+
+The output would then resemble::
+
+   array(1) {
+     ["x"]=>
+     int(1)
+   }
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getName.txt b/source/reference/method/MongoDBModelIndexInfo-getName.txt
index 26983790..97ad45fa 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getName.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getName.txt
@@ -29,6 +29,23 @@ Return Values
 
 The index name.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'x_1',
+   ]);
+
+   echo $info->getName();
+
+The output would then resemble::
+
+   x_1
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
index 987c8bec..f4a64bb6 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
@@ -27,6 +27,23 @@ Return Values
 
 The index namespace.
 
+Examples
+--------
+
+.. code-block:: php
+
+    'foo.bar',
+   ]);
+
+   echo $info->getNamespace();
+
+The output would then resemble::
+
+   foo.bar
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
index e2480df0..728f3885 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
@@ -26,6 +26,23 @@ Return Values
 
 The index version.
 
+Examples
+--------
+
+.. code-block:: php
+
+    1,
+   ]);
+
+   var_dump($info->getVersion());
+
+The output would then resemble::
+
+   int(1)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
index 580e2f60..5bbe4dea 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
@@ -28,6 +28,23 @@ Return Values
 
 A boolean indicating whether the index is a sparse index.
 
+Examples
+--------
+
+.. code-block:: php
+
+    true,
+   ]);
+
+   var_dump($info->isSparse());
+
+The output would then resemble::
+
+   bool(true)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
index f2f16e02..a3e70d03 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
@@ -28,6 +28,23 @@ Return Values
 
 A boolean indicating whether the index is a TTL index.
 
+Examples
+--------
+
+.. code-block:: php
+
+    100,
+   ]);
+
+   var_dump($info->isTtl());
+
+The output would then resemble::
+
+   bool(true)
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
index 5fbfa765..30cf1ece 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
@@ -28,6 +28,23 @@ Return Values
 
 A boolean indicating whether the index is a unique index.
 
+Examples
+--------
+
+.. code-block:: php
+
+    true,
+   ]);
+
+   var_dump($info->isUnique());
+
+The output would then resemble::
+
+   bool(true)
+
 See Also
 --------
 

From 1793da97ea1f13d36494006fea7ae11508763320 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Tue, 3 Apr 2018 18:00:08 -0400
Subject: [PATCH 159/321] PHPLIB-80: Add IndexInfo helper methods for special
 index type options

---
 source/reference/enumeration-classes.txt      |  3 +
 .../MongoDBModelIndexInfo-is2dSphere.txt      | 59 +++++++++++++++++++
 .../MongoDBModelIndexInfo-isGeoHaystack.txt   | 59 +++++++++++++++++++
 .../method/MongoDBModelIndexInfo-isText.txt   | 58 ++++++++++++++++++
 4 files changed, 179 insertions(+)
 create mode 100644 source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
 create mode 100644 source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
 create mode 100644 source/reference/method/MongoDBModelIndexInfo-isText.txt

diff --git a/source/reference/enumeration-classes.txt b/source/reference/enumeration-classes.txt
index 045091ac..6437fbb5 100644
--- a/source/reference/enumeration-classes.txt
+++ b/source/reference/enumeration-classes.txt
@@ -134,7 +134,10 @@ Methods
    /reference/method/MongoDBModelIndexInfo-getName
    /reference/method/MongoDBModelIndexInfo-getNamespace
    /reference/method/MongoDBModelIndexInfo-getVersion
+   /reference/method/MongoDBModelIndexInfo-is2dSphere
+   /reference/method/MongoDBModelIndexInfo-isGeoHaystack
    /reference/method/MongoDBModelIndexInfo-isSparse
+   /reference/method/MongoDBModelIndexInfo-isText
    /reference/method/MongoDBModelIndexInfo-isTtl
    /reference/method/MongoDBModelIndexInfo-isUnique
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt b/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
new file mode 100644
index 00000000..a6bb398b
--- /dev/null
+++ b/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
@@ -0,0 +1,59 @@
+=======================================
+MongoDB\\Model\\IndexInfo::is2dSphere()
+=======================================
+
+.. versionadded:: 1.4
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\IndexInfo::is2dSphere()
+
+   Return whether the index is a :manual:`2dsphere `
+   index.
+
+   .. code-block:: php
+
+      function is2dSphere(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the index is a 2dsphere index.
+
+Examples
+--------
+
+.. code-block:: php
+
+   selectCollection('test', 'places');
+
+   $collection->createIndex(['pos' => '2dsphere']);
+
+   foreach ($collection->listIndexes() as $index) {
+       if ($index->is2dSphere()) {
+           printf("%s has 2dsphereIndexVersion: %d\n", $index->getName(), $index['2dsphereIndexVersion']);
+       }
+   }
+
+The output would then resemble::
+
+   pos_2dsphere has 2dsphereIndexVersion: 3
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :manual:`2dsphere Indexes ` reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
new file mode 100644
index 00000000..a2d9a028
--- /dev/null
+++ b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
@@ -0,0 +1,59 @@
+==========================================
+MongoDB\\Model\\IndexInfo::isGeoHaystack()
+==========================================
+
+.. versionadded:: 1.4
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\IndexInfo::isGeoHaystack()
+
+   Return whether the index is a :manual:`geoHaystack
+   ` index.
+
+   .. code-block:: php
+
+      function isGeoHaystack(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the index is a geoHaystack index.
+
+Examples
+--------
+
+.. code-block:: php
+
+   selectCollection('test', 'places');
+
+   $collection->createIndex(['pos' => 'geoHaystack', 'x' => 1], ['bucketSize' => 5]);
+
+   foreach ($collection->listIndexes() as $index) {
+       if ($index->isGeoHaystack()) {
+           printf("%s has bucketSize: %d\n", $index->getName(), $index['bucketSize']);
+       }
+   }
+
+The output would then resemble::
+
+   pos_geoHaystack_x_1 has bucketSize: 5
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :manual:`geoHaystack Indexes ` reference in the MongoDB
+  manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isText.txt b/source/reference/method/MongoDBModelIndexInfo-isText.txt
new file mode 100644
index 00000000..08333596
--- /dev/null
+++ b/source/reference/method/MongoDBModelIndexInfo-isText.txt
@@ -0,0 +1,58 @@
+===================================
+MongoDB\\Model\\IndexInfo::isText()
+===================================
+
+.. versionadded:: 1.4
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Model\\IndexInfo::isText()
+
+   Return whether the index is a :manual:`text ` index.
+
+   .. code-block:: php
+
+      function isText(): boolean
+
+Return Values
+-------------
+
+A boolean indicating whether the index is a text index.
+
+Examples
+--------
+
+.. code-block:: php
+
+   selectCollection('test', 'restaurants');
+
+   $collection->createIndex(['name' => 'text']);
+
+   foreach ($collection->listIndexes() as $index) {
+       if ($index->isText()) {
+           printf("%s has default language: %d\n", $index->getName(), $index['default_language']);
+       }
+   }
+
+The output would then resemble::
+
+   name_text has default language: english
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :manual:`Text Indexes ` reference in the MongoDB
+  manual

From 8ece32b4b5431fb9ac46b84d8d85f8ee60ce673b Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 10 Apr 2018 14:16:22 -0400
Subject: [PATCH 160/321] Fix RST syntax for isset() link

---
 source/reference/enumeration-classes.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/reference/enumeration-classes.txt b/source/reference/enumeration-classes.txt
index 045091ac..74593d60 100644
--- a/source/reference/enumeration-classes.txt
+++ b/source/reference/enumeration-classes.txt
@@ -115,7 +115,7 @@ MongoDB\\Model\\IndexInfo
 
    This class implements PHP's :php:`ArrayAccess ` interface. This
    provides a mechanism for accessing index fields for which there exists no
-   helper method. :php`isset() ` may be used to check for the existence
+   helper method. :php:`isset() ` may be used to check for the existence
    of a field before accessing it with ``[]``.
 
    .. note::

From 619cb0747b0c5d74fe147f48160d785bf3a1e1cf Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 10 Apr 2018 14:27:16 -0400
Subject: [PATCH 161/321] Fix titles for createIndex and createIndexes

---
 source/reference/method/MongoDBCollection-createIndex.txt   | 6 +++---
 source/reference/method/MongoDBCollection-createIndexes.txt | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index da7629da..ff4150ea 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -1,6 +1,6 @@
-================================
-MongoDBCollection::createIndex()
-================================
+==================================
+MongoDB\\Collection::createIndex()
+==================================
 
 .. default-domain:: mongodb
 
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index b2fc994b..05a3c0be 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -1,6 +1,6 @@
-==================================
-MongoDBCollection::createIndexes()
-==================================
+====================================
+MongoDB\\Collection::createIndexes()
+====================================
 
 .. default-domain:: mongodb
 

From bd6ad388f6ac8cb336affab153380e1ba6c983da Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 10 Apr 2018 14:20:37 -0400
Subject: [PATCH 162/321] PHPLIB-226: Document ArrayAccess for Collection and
 DatabaseInfo

---
 source/reference/enumeration-classes.txt | 26 ++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/source/reference/enumeration-classes.txt b/source/reference/enumeration-classes.txt
index 6e504af4..7eac097e 100644
--- a/source/reference/enumeration-classes.txt
+++ b/source/reference/enumeration-classes.txt
@@ -22,6 +22,19 @@ Definition
    returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`,
    which is returned by :phpmethod:`MongoDB\\Database::listCollections()`.
 
+.. versionchanged:: 1.4
+
+   This class implements PHP's :php:`ArrayAccess ` interface. This
+   provides a mechanism for accessing index fields for which there exists no
+   helper method. :php:`isset() ` may be used to check for the existence
+   of a field before accessing it with ``[]``.
+
+   .. note::
+
+      The :phpclass:`MongoDB\\Model\\CollectionInfo` class is immutable. Attempting
+      to modify it via the :php:`ArrayAccess ` interface will
+      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+
 Methods
 ~~~~~~~
 
@@ -70,6 +83,19 @@ Definition
    returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`,
    which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`.
 
+.. versionchanged:: 1.4
+
+   This class implements PHP's :php:`ArrayAccess ` interface. This
+   provides a mechanism for accessing index fields for which there exists no
+   helper method. :php:`isset() ` may be used to check for the existence
+   of a field before accessing it with ``[]``.
+
+   .. note::
+
+      The :phpclass:`MongoDB\\Model\\DatabaseInfo` class is immutable. Attempting
+      to modify it via the :php:`ArrayAccess ` interface will
+      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+
 Methods
 ~~~~~~~
 

From 827aba9a3b96ae03e52ef0aaf9eab8f1f05afd2e Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Thu, 12 Apr 2018 15:53:51 -0400
Subject: [PATCH 163/321] PHPLIB-233: Add examples for each GridFS API method

---
 .../method/MongoDBGridFSBucket-delete.txt     | 17 ++++++-
 .../MongoDBGridFSBucket-downloadToStream.txt  | 27 +++++++++++-
 ...oDBGridFSBucket-downloadToStreamByName.txt | 27 +++++++++++-
 .../method/MongoDBGridFSBucket-drop.txt       | 19 +++++++-
 .../method/MongoDBGridFSBucket-find.txt       | 44 ++++++++++++++++++-
 .../method/MongoDBGridFSBucket-findOne.txt    | 41 ++++++++++++++++-
 .../MongoDBGridFSBucket-getBucketName.txt     | 15 ++++++-
 .../MongoDBGridFSBucket-getChunkSizeBytes.txt | 15 ++++++-
 ...ongoDBGridFSBucket-getChunksCollection.txt | 15 ++++++-
 .../MongoDBGridFSBucket-getDatabaseName.txt   | 16 ++++++-
 ...BGridFSBucket-getFileDocumentForStream.txt | 34 +++++++++++++-
 ...MongoDBGridFSBucket-getFileIdForStream.txt | 24 +++++++++-
 ...MongoDBGridFSBucket-getFilesCollection.txt | 18 +++++++-
 ...MongoDBGridFSBucket-openDownloadStream.txt | 23 +++++++++-
 ...BGridFSBucket-openDownloadStreamByName.txt | 21 ++++++++-
 .../MongoDBGridFSBucket-openUploadStream.txt  | 20 ++++++++-
 .../method/MongoDBGridFSBucket-rename.txt     | 23 +++++++++-
 .../MongoDBGridFSBucket-uploadFromStream.txt  | 24 +++++++++-
 .../method/MongoDBGridFSBucket__construct.txt | 20 ++++++++-
 19 files changed, 422 insertions(+), 21 deletions(-)

diff --git a/source/reference/method/MongoDBGridFSBucket-delete.txt b/source/reference/method/MongoDBGridFSBucket-delete.txt
index 6e4eeac5..b063337e 100644
--- a/source/reference/method/MongoDBGridFSBucket-delete.txt
+++ b/source/reference/method/MongoDBGridFSBucket-delete.txt
@@ -37,4 +37,19 @@ Behavior
 If the files collection document is not found, this method will still attempt to
 delete orphaned chunks.
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $stream = fopen('php://temp', 'w+b');
+   fwrite($stream, "foobar");
+   rewind($stream);
+
+   $id = $bucket->uploadFromStream('filename', $stream);
+
+   $bucket->delete($id);
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
index 62009501..3d8e6ebc 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
@@ -26,8 +26,6 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStream-param.rst
 
-.. todo: add examples
-
 Errors/Exceptions
 -----------------
 
@@ -35,6 +33,31 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $stream = fopen('php://temp', 'w+b');
+   fwrite($stream, "foobar");
+   rewind($stream);
+
+   $id = $bucket->uploadFromStream('filename', $stream);
+
+   $destination = fopen('php://temp', 'w+b');
+
+   $bucket->downloadToStream($id, $destination);
+
+   var_dump(stream_get_contents($destination, -1, 0));
+
+The output would then resemble::
+
+   string(6) "foobar"
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index ca294bc3..002bdc65 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -30,8 +30,6 @@ Definition
 
    .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-option.rst
 
-.. todo: add examples
-
 Errors/Exceptions
 -----------------
 
@@ -39,6 +37,31 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $stream = fopen('php://temp', 'w+b');
+   fwrite($stream, "foobar");
+   rewind($stream);
+
+   $bucket->uploadFromStream('filename', $stream);
+
+   $destination = fopen('php://temp', 'w+b');
+
+   $bucket->downloadToStreamByName('filename', $destination);
+
+   var_dump(stream_get_contents($destination, -1, 0));
+
+The output would then resemble::
+
+   string(6) "foobar"
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBGridFSBucket-drop.txt b/source/reference/method/MongoDBGridFSBucket-drop.txt
index a6730fc8..53a10091 100644
--- a/source/reference/method/MongoDBGridFSBucket-drop.txt
+++ b/source/reference/method/MongoDBGridFSBucket-drop.txt
@@ -26,4 +26,21 @@ Errors/Exceptions
 
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test;
+
+   $bucket = $database->selectGridFSBucket();
+
+   $stream = fopen('php://temp', 'w+b');
+   fwrite($stream, "foobar");
+   rewind($stream);
+
+   $bucket->uploadFromStream('filename', $stream);
+
+   $bucket->drop();
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index 8f40253e..c7418ced 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -46,7 +46,49 @@ Behavior
 
 .. include:: /includes/extracts/note-bson-comparison.rst
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $stream = fopen('php://temp', 'w+b');
+   fwrite($stream, "foobar");
+   rewind($stream);
+
+   $bucket->uploadFromStream('b', $stream);
+
+   $cursor = $bucket->find(
+       ['length' => ['$lte' => 6]],
+       [
+           'projection' => [
+               'filename' => 1,
+               'length' => 1,
+               '_id' => 0,
+            ],
+            'sort' => ['length' => -1],
+        ]
+   );
+
+   var_dump($cursor->toArray());
+
+The output would then resemble::
+
+   array(1) {
+     [0]=>
+     object(MongoDB\Model\BSONDocument)#3015 (1) {
+       ["storage":"ArrayObject":private]=>
+       array(2) {
+         ["filename"]=>
+         string(1) "b"
+         ["length"]=>
+         int(6)
+       }
+     }
+   }
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
index f07a6134..7b6fcc8f 100644
--- a/source/reference/method/MongoDBGridFSBucket-findOne.txt
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -49,7 +49,46 @@ Behavior
 
 .. include:: /includes/extracts/note-bson-comparison.rst
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $stream = fopen('php://temp', 'w+b');
+   fwrite($stream, "foobar");
+   rewind($stream);
+
+   $bucket->uploadFromStream('b', $stream);
+
+   $fileDocument = $bucket->findOne(
+       ['length' => ['$lte' => 6]],
+       [
+           'projection' => [
+               'filename' => 1,
+               'length' => 1,
+               '_id' => 0,
+           ],
+           'sort' => ['length' => -1],
+       ]
+   );
+
+   var_dump($fileDocument);
+
+The output would then resemble::
+
+   object(MongoDB\Model\BSONDocument)#3004 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(2) {
+       ["filename"]=>
+       string(1) "b"
+       ["length"]=>
+       int(6)
+     }
+   }
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
index d8a43a3c..0452de0a 100644
--- a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
@@ -26,4 +26,17 @@ Return Values
 
 The name of this bucket as a string.
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   var_dump($bucket->getBucketName());
+
+The output would then resemble::
+
+   string(2) "fs"
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
index 3a97aba7..f592030a 100644
--- a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
@@ -28,4 +28,17 @@ Return Values
 
 The chunk size of this bucket in bytes.
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   var_dump($bucket->getChunkSizeBytes());
+
+The output would then resemble::
+
+   int(261120)
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
index cc98abed..fa5be832 100644
--- a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
@@ -28,4 +28,17 @@ Return Values
 
 A :phpclass:`MongoDB\\Collection` object for the chunks collection.
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   var_dump((string) $bucket->getChunksCollection());
+
+The output would then resemble::
+
+   string(14) "test.fs.chunks"
diff --git a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
index dc3ceeaa..b270b7b5 100644
--- a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
@@ -26,4 +26,18 @@ Return Values
 
 The name of the database containing this bucket as a string.
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   var_dump($bucket->getDatabaseName());
+
+The output would then resemble::
+
+   string(4) "test"
+
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index faa58913..052bc79c 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -37,7 +37,39 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $stream = $bucket->openUploadStream('filename');
+
+   $fileDocument = $bucket->getFileDocumentForStream($stream);
+
+   var_dump($fileDocument);
+
+   fclose($stream);
+
+The output would then resemble::
+
+   object(MongoDB\Model\BSONDocument)#4956 (1) {
+     ["storage":"ArrayObject":private]=>
+     array(3) {
+       ["_id"]=>
+       object(MongoDB\BSON\ObjectId)#4955 (1) {
+         ["oid"]=>
+         string(24) "5acfb05b7e21e83b5a29037c"
+       }
+       ["chunkSize"]=>
+       int(261120)
+       ["filename"]=>
+       string(8) "filename"
+     }
+   }
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index b7ef9964..976843b4 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -38,7 +38,29 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $stream = $bucket->openUploadStream('filename');
+
+   $id = $bucket->getFileIdForStream($stream);
+
+   var_dump($id);
+
+   fclose($stream);
+
+The output would then resemble::
+
+   object(MongoDB\BSON\ObjectId)#3005 (1) {
+     ["oid"]=>
+     string(24) "5acfb37d7e21e83cdb3e1583"
+   }
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
index e989202b..de4196b2 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
@@ -28,4 +28,20 @@ Return Values
 
 A :phpclass:`MongoDB\\Collection` object for the files collection.
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $filesCollection = $bucket->getFilesCollection();
+
+   var_dump($filesCollection->getCollectionName());
+
+The output would then resemble::
+
+   string(8) "fs.files"
+
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
index 69f6d54f..663a69c9 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -36,7 +36,28 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $uploadStream = fopen('php://temp', 'w+b');
+   fwrite($uploadStream, "foobar");
+   rewind($uploadStream);
+
+   $id = $bucket->uploadFromStream('filename', $uploadStream);
+
+   $downloadStream = $bucket->openDownloadStream($id);
+
+   var_dump(stream_get_contents($downloadStream));
+
+The output would then resemble::
+
+   string(6) "foobar"
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
index b4976852..d9f7b5b4 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -40,7 +40,26 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $stream = fopen('php://temp', 'w+b');
+   fwrite($stream, "foobar");
+   rewind($stream);
+
+   $bucket->uploadFromStream('filename', $stream);
+
+   var_dump(stream_get_contents($bucket->openDownloadStreamByName('filename')));
+
+The output would then resemble::
+
+   string(6) "foobar"
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 2ad11c4a..806ad6b8 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -40,7 +40,25 @@ Behavior
 Chunk documents will be created as data is written to the writable stream. The
 metadata document will be created when the writable stream is closed.
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $uploadStream = $bucket->openUploadStream('filename');
+   fwrite($uploadStream, 'foobar');
+   fclose($uploadStream);
+
+   $downloadStream = $bucket->openDownloadStreamByName('filename');
+   var_dump(stream_get_contents($downloadStream));
+
+The output would then resemble::
+
+   string(6) "foobar"
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt
index 77fd899e..346ffd81 100644
--- a/source/reference/method/MongoDBGridFSBucket-rename.txt
+++ b/source/reference/method/MongoDBGridFSBucket-rename.txt
@@ -31,4 +31,25 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-gridfs-filenotfoundexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $stream = fopen('php://temp', 'w+b');
+   fwrite($stream, "foobar");
+   rewind($stream);
+
+   $id = $bucket->uploadFromStream('a', $stream);
+
+   $bucket->rename($id, 'b');
+
+   var_dump(stream_get_contents($bucket->openDownloadStreamByName('b')));
+
+The output would then resemble::
+
+   string(6) "foobar"
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index fa26bacc..b5d5abef 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -43,7 +43,29 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
-.. todo: add examples
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   $stream = fopen('php://temp', 'w+b');
+   fwrite($stream, "foobar");
+   rewind($stream);
+
+   $id = $bucket->uploadFromStream('filename', $stream);
+
+   var_dump($id);
+
+The output would then resemble::
+
+   object(MongoDB\BSON\ObjectId)#3009 (1) {
+     ["oid"]=>
+     string(24) "5acf81017e21e816e538d883"
+   }
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index 94e601ef..49211fba 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -42,7 +42,25 @@ from the :php:`MongoDB\\Driver\\Manager ` object.
 If you select the Bucket from a :phpclass:`Database ` object,
 the Bucket inherits its options from that object.
 
-.. todo: add an example
+Examples
+--------
+
+.. code-block:: php
+
+   test->selectGridFSBucket();
+
+   var_dump($bucket);
+
+The output would then resemble::
+
+   object(MongoDB\GridFS\Bucket)#3053 (2) {
+     ["bucketName"]=>
+     string(4) "test"
+     ["databaseName"]=>
+     string(11) "phplib_test"
+   }
 
 See Also
 --------

From d6f0a3931acf17ba3d0199dad6d9966bf67925d7 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 23 Apr 2018 11:13:12 -0400
Subject: [PATCH 164/321] PHPLIB-346: Deprecate autoIndexId option for
 CreateCollection

---
 ...iargs-MongoDBDatabase-method-createCollection-option.yaml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
index 53441bd7..08efd5b2 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
@@ -9,7 +9,10 @@ description: |
 
      For replica sets, do not set ``autoIndexId`` to ``false``.
 
-  .. deprecated:: 3.2. The ``autoIndexId`` option will be removed in MongoDB 3.4.
+  .. deprecated:: 1.4
+     This option has been deprecated since MongoDB 3.2. As of MongoDB 4.0, this
+     option cannot be ``false`` when creating a replicated collection (i.e. a
+     collection outside of the ``local`` database in any mongod mode).
 interface: phpmethod
 operation: ~
 optional: true

From a390652afe60b58b41e24c46a78e38d0edff3cf8 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Fri, 20 Apr 2018 16:48:00 -0400
Subject: [PATCH 165/321] PHPLIB-339: Deprecate snapshot option

---
 .../includes/apiargs-MongoDBCollection-method-find-option.yaml   | 1 +
 1 file changed, 1 insertion(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index 80ebef1f..0e6e18b9 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -221,6 +221,7 @@ description: |
   Prevents the cursor from returning a document more than once because of an
   intervening write operation.
 
+  .. deprecated:: 1.4
   .. versionadded:: 1.2
 interface: phpmethod
 operation: ~

From 6e527aed2142d503ea1f479dbf7f8ff3f80c9944 Mon Sep 17 00:00:00 2001
From: Katherine Walker 
Date: Fri, 20 Apr 2018 16:45:57 -0400
Subject: [PATCH 166/321] PHPLIB-340: Deprecate maxScan query option

---
 .../includes/apiargs-MongoDBCollection-method-find-option.yaml   | 1 +
 1 file changed, 1 insertion(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
index 0e6e18b9..fe4f85a8 100644
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
@@ -148,6 +148,7 @@ type: integer
 description: |
   Maximum number of documents or index keys to scan when executing the query.
 
+  .. deprecated:: 1.4
   .. versionadded:: 1.2
 interface: phpmethod
 operation: ~

From ed51e127876d5e10c569346fb9a038a7c5f1290f Mon Sep 17 00:00:00 2001
From: Derick Rethans 
Date: Thu, 21 Jun 2018 10:55:43 +0100
Subject: [PATCH 167/321] PHPLIB-319: Added 'disableMD5' option as GridFS MD5
 digest must be optional

---
 ...goDBDatabase-method-selectGridFSBucket-option.yaml | 11 +++++++++++
 .../apiargs-MongoDBGridFSBucket-common-option.yaml    | 11 +++++++++++
 ...s-MongoDBGridFSBucket-method-construct-option.yaml | 11 +++++++++++
 ...DBGridFSBucket-method-openUploadStream-option.yaml |  4 ++++
 ...DBGridFSBucket-method-uploadFromStream-option.yaml |  4 ++++
 5 files changed, 41 insertions(+)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
index 294bf6b6..ab494e71 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
@@ -17,6 +17,17 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+arg_name: option
+name: disableMD5
+type: boolean
+description: |
+  Whether to disable automatic MD5 generation when storing files.
+
+  Defaults to ``false``.
+interface: phpmethod
+operation: ~
+optional: true
+---
 source:
   file: apiargs-common-option.yaml
   ref: readConcern
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
index fbfa0dcf..bf2de660 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
@@ -18,6 +18,17 @@ operation: ~
 optional: true
 ---
 arg_name: option
+name: disableMD5
+type: boolean
+description: |
+  Whether to disable automatic MD5 generation when storing files.
+
+  Defaults to ``false``.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
 name: metadata
 type: array|object
 description: |
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
index 30be1b5d..26d0bc2a 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
@@ -17,6 +17,17 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
+arg_name: option
+name: disableMD5
+type: boolean
+description: |
+  Whether to disable automatic MD5 generation when storing files.
+
+  Defaults to ``false``.
+interface: phpmethod
+operation: ~
+optional: true
+---
 source:
   file: apiargs-common-option.yaml
   ref: readConcern
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
index 6c4d2ff6..165276f5 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
@@ -6,6 +6,10 @@ source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
   ref: chunkSizeBytes
 ---
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: disableMD5
+---
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
   ref: metadata
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
index 6c4d2ff6..165276f5 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
@@ -6,6 +6,10 @@ source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
   ref: chunkSizeBytes
 ---
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: disableMD5
+---
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
   ref: metadata

From 73bcd98f842dc2eb11973c94370558e7dbbfefa0 Mon Sep 17 00:00:00 2001
From: Derick Rethans 
Date: Fri, 22 Jun 2018 11:58:23 +0100
Subject: [PATCH 168/321] Updates due to Jeremy's review

---
 ...Database-method-selectGridFSBucket-option.yaml | 15 +++++----------
 ...ngoDBGridFSBucket-method-construct-option.yaml | 15 +++++----------
 ...idFSBucket-method-openUploadStream-option.yaml |  2 ++
 ...idFSBucket-method-uploadFromStream-option.yaml |  2 ++
 4 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
index ab494e71..8f7baa5c 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
@@ -17,16 +17,11 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
-arg_name: option
-name: disableMD5
-type: boolean
-description: |
-  Whether to disable automatic MD5 generation when storing files.
-
-  Defaults to ``false``.
-interface: phpmethod
-operation: ~
-optional: true
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: disableMD5
+  post: |
+    .. versionadded: 1.4
 ---
 source:
   file: apiargs-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
index 26d0bc2a..770a1dea 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
@@ -17,16 +17,11 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
-arg_name: option
-name: disableMD5
-type: boolean
-description: |
-  Whether to disable automatic MD5 generation when storing files.
-
-  Defaults to ``false``.
-interface: phpmethod
-operation: ~
-optional: true
+source:
+  file: apiargs-MongoDBGridFSBucket-common-option.yaml
+  ref: disableMD5
+  post: |
+    .. versionadded: 1.4
 ---
 source:
   file: apiargs-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
index 165276f5..2df0a51d 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
@@ -9,6 +9,8 @@ source:
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
   ref: disableMD5
+  post: |
+    .. versionadded: 1.4
 ---
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
index 165276f5..2df0a51d 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
@@ -9,6 +9,8 @@ source:
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
   ref: disableMD5
+  post: |
+    .. versionadded: 1.4
 ---
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml

From ca6570eab792d2e39bdd74f1713336a31f3c4a8e Mon Sep 17 00:00:00 2001
From: Derick Rethans 
Date: Thu, 21 Jun 2018 12:13:48 +0100
Subject: [PATCH 169/321] PHPLIB-354: Implement new count API

---
 ...llection-method-countDocuments-option.yaml | 49 ++++++++++++++++
 ...ollection-method-countDocuments-param.yaml | 11 ++++
 ...n-method-estimateDocumentCount-option.yaml | 16 ++++++
 ...on-method-estimateDocumentCount-param.yaml |  4 ++
 source/reference/class/MongoDBCollection.txt  |  2 +
 .../MongoDBCollection-countDocuments.txt      | 57 +++++++++++++++++++
 ...ngoDBCollection-estimatedDocumentCount.txt | 56 ++++++++++++++++++
 7 files changed, 195 insertions(+)
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
 create mode 100644 source/reference/method/MongoDBCollection-countDocuments.txt
 create mode 100644 source/reference/method/MongoDBCollection-estimatedDocumentCount.txt

diff --git a/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml b/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
new file mode 100644
index 00000000..2571b071
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
@@ -0,0 +1,49 @@
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+---
+arg_name: option
+name: hint
+type: string|array|object
+description: |
+  The index to use. Specify either the index name as a string or the index key
+  pattern as a document. If specified, then the query system will only consider
+  plans using the hinted index.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: limit
+type: integer
+description: |
+  The maximum number of matching documents to return.
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: maxTimeMS
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: readConcern
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: readPreference
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
+arg_name: option
+name: skip
+type: integer
+description: |
+  The number of matching documents to skip before returning results.
+interface: phpmethod
+operation: ~
+optional: true
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml b/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
new file mode 100644
index 00000000..e18c616b
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
@@ -0,0 +1,11 @@
+source:
+  file: apiargs-MongoDBCollection-common-param.yaml
+  ref: $filter
+optional: true
+replacement:
+  action: " to count"
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
new file mode 100644
index 00000000..f70487a1
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
@@ -0,0 +1,16 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: maxTimeMS
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: readConcern
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: readPreference
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
new file mode 100644
index 00000000..73ad04d0
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
@@ -0,0 +1,4 @@
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index 4c393df8..4ccd2c17 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -63,6 +63,7 @@ Methods
    /reference/method/MongoDBCollection-aggregate
    /reference/method/MongoDBCollection-bulkWrite
    /reference/method/MongoDBCollection-count
+   /reference/method/MongoDBCollection-countDocuments
    /reference/method/MongoDBCollection-createIndex
    /reference/method/MongoDBCollection-createIndexes
    /reference/method/MongoDBCollection-deleteMany
@@ -71,6 +72,7 @@ Methods
    /reference/method/MongoDBCollection-drop
    /reference/method/MongoDBCollection-dropIndex
    /reference/method/MongoDBCollection-dropIndexes
+   /reference/method/MongoDBCollection-estimatedDocumentCount
    /reference/method/MongoDBCollection-explain
    /reference/method/MongoDBCollection-find
    /reference/method/MongoDBCollection-findOne
diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt
new file mode 100644
index 00000000..13d0591a
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-countDocuments.txt
@@ -0,0 +1,57 @@
+=====================================
+MongoDB\\Collection::countDocuments()
+=====================================
+
+.. versionadded:: 1.4
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::countDocuments()
+
+   Count the number of documents that match the filter criteria.
+
+   .. code-block:: php
+
+      function countDocuments($filter = [], array $options = []): integer
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-countDocuments-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-countDocuments-option.rst
+
+Return Values
+-------------
+
+The number of documents matching the filter criteria.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
+Internally, this method uses the ``$group`` aggregation pipeline operator to
+obtain the result. If a ``filter`` parameter is given, this is converted into
+a ``$match`` pipeline operator. Optional ``skip`` and ``limit`` stages are
+added between ``$match`` and ``group`` if present in the options.
+
+.. todo: add output and examples
diff --git a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
new file mode 100644
index 00000000..61dbc305
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
@@ -0,0 +1,56 @@
+=============================================
+MongoDB\\Collection::estimatedDocumentCount()
+=============================================
+
+.. versionadded:: 1.4
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::estimatedDocumentCount()
+
+   Gets an estimated number of documents in the collection using collection metadata.
+
+   .. code-block:: php
+
+      function countDocuments(array $options = []): integer
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-estimateDocumentCount-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-estimateDocumentCount-option.rst
+
+Return Values
+-------------
+
+An estimated number of documents in the collection.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+Behavior
+--------
+
+.. include:: /includes/extracts/note-bson-comparison.rst
+
+See Also
+--------
+
+- :manual:`count ` command reference in the MongoDB
+  manual

From 15ec9df1023612441b85fef60fea1bf04a8baa9f Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 22 Jun 2018 12:08:03 -0400
Subject: [PATCH 170/321] PHPLIB-319: Fix indentation in disableMD5 option doc
 snippets

---
 ...args-MongoDBDatabase-method-selectGridFSBucket-option.yaml | 4 ++--
 .../apiargs-MongoDBGridFSBucket-method-construct-option.yaml  | 4 ++--
 ...gs-MongoDBGridFSBucket-method-openUploadStream-option.yaml | 4 ++--
 ...gs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
index 8f7baa5c..2039d114 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
@@ -20,8 +20,8 @@ optional: true
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
   ref: disableMD5
-  post: |
-    .. versionadded: 1.4
+post: |
+  .. versionadded: 1.4
 ---
 source:
   file: apiargs-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
index 770a1dea..c8a7eb79 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
@@ -20,8 +20,8 @@ optional: true
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
   ref: disableMD5
-  post: |
-    .. versionadded: 1.4
+post: |
+  .. versionadded: 1.4
 ---
 source:
   file: apiargs-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
index 2df0a51d..592040d6 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
@@ -9,8 +9,8 @@ source:
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
   ref: disableMD5
-  post: |
-    .. versionadded: 1.4
+post: |
+  .. versionadded: 1.4
 ---
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
index 2df0a51d..592040d6 100644
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
+++ b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
@@ -9,8 +9,8 @@ source:
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml
   ref: disableMD5
-  post: |
-    .. versionadded: 1.4
+post: |
+  .. versionadded: 1.4
 ---
 source:
   file: apiargs-MongoDBGridFSBucket-common-option.yaml

From 888b85f7bd727165c1d17a9717f8b5a00ba759f0 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 26 Jun 2018 14:32:47 -0400
Subject: [PATCH 171/321] Fix reference to constants in Collection::watch()
 docs

---
 .../apiargs-MongoDBCollection-method-watch-option.yaml        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index f835e1f0..e7a462d4 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -23,8 +23,8 @@ description: |
   copy of the entire document that was changed from some time after the change
   occurred. The following values are supported:
 
-  - ``MongoDB\Operation\ChangeStream::FULL_DOCUMENT_DEFAULT`` (*default*)
-  - ``MongoDB\Operation\ChangeStream::FULL_DOCUMENT_UPDATE_LOOKUP``
+  - ``MongoDB\Operation\Watch::FULL_DOCUMENT_DEFAULT`` (*default*)
+  - ``MongoDB\Operation\Watch::FULL_DOCUMENT_UPDATE_LOOKUP``
 
   .. note::
 

From f13d5db3271c18d6cd1738565b51d0f0afa1acef Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 26 Jun 2018 14:42:46 -0400
Subject: [PATCH 172/321] Fix monospace formatting in watch() docs

---
 .../apiargs-MongoDBCollection-method-watch-option.yaml        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index e7a462d4..03e23434 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -28,7 +28,7 @@ description: |
 
   .. note::
 
-     This is an option of the `$changeStream` pipeline stage.
+     This is an option of the ``$changeStream`` pipeline stage.
 interface: phpmethod
 operation: ~
 optional: true
@@ -62,7 +62,7 @@ description: |
 
   .. note::
 
-     This is an option of the `$changeStream` pipeline stage.
+     This is an option of the ``$changeStream`` pipeline stage.
 interface: phpmethod
 operation: ~
 optional: true

From 5deffbc17befff6111a4ac2131e0ec633d621432 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 26 Jun 2018 15:47:59 -0400
Subject: [PATCH 173/321] PHPLIB-351: Documentation for watch() methods

---
 .../apiargs-MongoDBClient-common-option.yaml  |  37 ++++++
 ...goDBClient-method-dropDatabase-option.yaml |  14 +-
 ...rgs-MongoDBClient-method-watch-option.yaml |  44 +++++++
 ...args-MongoDBClient-method-watch-param.yaml |   8 ++
 ...iargs-MongoDBCollection-common-option.yaml |  21 +--
 ...MongoDBCollection-method-watch-option.yaml |  69 +++-------
 ...-MongoDBCollection-method-watch-param.yaml |  13 +-
 ...apiargs-MongoDBDatabase-common-option.yaml |  23 ++++
 ...tabase-method-createCollection-option.yaml |   2 +-
 ...s-MongoDBDatabase-method-watch-option.yaml |  44 +++++++
 ...gs-MongoDBDatabase-method-watch-param.yaml |   8 ++
 source/includes/apiargs-common-option.yaml    |  17 +++
 .../includes/apiargs-method-watch-option.yaml |  81 ++++++++++++
 .../includes/apiargs-method-watch-param.yaml  |  13 ++
 source/reference/class/MongoDBClient.txt      |   1 +
 source/reference/class/MongoDBDatabase.txt    |   1 +
 .../reference/method/MongoDBClient-watch.txt  | 121 ++++++++++++++++++
 .../method/MongoDBCollection-watch.txt        |  17 ++-
 .../method/MongoDBDatabase-watch.txt          | 120 +++++++++++++++++
 19 files changed, 561 insertions(+), 93 deletions(-)
 create mode 100644 source/includes/apiargs-MongoDBClient-common-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBClient-method-watch-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBClient-method-watch-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
 create mode 100644 source/includes/apiargs-method-watch-option.yaml
 create mode 100644 source/includes/apiargs-method-watch-param.yaml
 create mode 100644 source/reference/method/MongoDBClient-watch.txt
 create mode 100644 source/reference/method/MongoDBDatabase-watch.txt

diff --git a/source/includes/apiargs-MongoDBClient-common-option.yaml b/source/includes/apiargs-MongoDBClient-common-option.yaml
new file mode 100644
index 00000000..89092358
--- /dev/null
+++ b/source/includes/apiargs-MongoDBClient-common-option.yaml
@@ -0,0 +1,37 @@
+arg_name: option
+name: readConcern
+type: :php:`MongoDB\\Driver\\ReadConcern `
+description: |
+   :manual:`Read concern ` to use for the operation.
+   Defaults to the client's read concern.
+
+   This is not supported for server versions prior to 3.2 and will result in an
+   exception at execution time if used.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: readPreference
+type: :php:`MongoDB\\Driver\\ReadPreference `
+description: |
+   :manual:`Read preference ` to use for the
+   operation. Defaults to the client's read preference.
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: typeMap
+---
+arg_name: option
+name: writeConcern
+type: :php:`MongoDB\\Driver\\WriteConcern `
+description: |
+   :manual:`Write concern ` to use for the operation.
+   Defaults to the client's write concern.
+interface: phpmethod
+operation: ~
+optional: true
+...
diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
index 01a287e5..e219c145 100644
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
@@ -10,16 +10,10 @@ source:
 post: |
   This will be used for the returned command result document.
 ---
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-  :manual:`Write concern ` to use for the operation.
-  Defaults to the client's write concern.
-
+source:
+  file: apiargs-MongoDBClient-common-option.yaml
+  ref: writeConcern
+post: |
   This is not supported for server versions prior to 3.4 and will result in an
   exception at execution time if used.
-interface: phpmethod
-operation: ~
-optional: true
 ...
diff --git a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml
new file mode 100644
index 00000000..1c9aa0ca
--- /dev/null
+++ b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml
@@ -0,0 +1,44 @@
+---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: batchSize
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: collation
+---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: fullDocument
+---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: maxAwaitTimeMS
+---
+source:
+  file: apiargs-MongoDBClient-common-option.yaml
+  ref: readConcern
+---
+source:
+  file: apiargs-MongoDBClient-common-option.yaml
+  ref: readPreference
+post: |
+  This is used for both the initial change stream aggregation and for
+  server selection during an automatic resume.
+---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: resumeAfter
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: startAtOperationTime
+---
+source:
+  file: apiargs-MongoDBClient-common-option.yaml
+  ref: typeMap
+...
diff --git a/source/includes/apiargs-MongoDBClient-method-watch-param.yaml b/source/includes/apiargs-MongoDBClient-method-watch-param.yaml
new file mode 100644
index 00000000..b00e450c
--- /dev/null
+++ b/source/includes/apiargs-MongoDBClient-method-watch-param.yaml
@@ -0,0 +1,8 @@
+source:
+  file: apiargs-method-watch-param.yaml
+  ref: $pipeline
+---
+source:
+  file: apiargs-method-watch-param.yaml
+  ref: $options
+...
diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
index 0f117d69..24bef2cc 100644
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-common-option.yaml
@@ -24,27 +24,14 @@ interface: phpmethod
 operation: ~
 optional: true
 ---
-arg_name: option
-name: collation
-type: array|object
-description: |
-   :manual:`Collation ` allows users to specify
-   language-specific rules for string comparison, such as rules for lettercase
-   and accent marks. When specifying collation, the ``locale`` field is
-   mandatory; all other collation fields are optional. For descriptions of the
-   fields, see :manual:`Collation Document
-   `.
-
+source:
+  file: apiargs-common-option.yaml
+  ref: collation
+post: |
    If the collation is unspecified but the collection has a default collation,
    the operation uses the collation specified for the collection. If no
    collation is specified for the collection or for the operation, MongoDB uses
    the simple binary comparison used in prior versions for string comparisons.
-
-   This option is available in MongoDB 3.4+ and will result in an exception at
-   execution time if specified for an older server version.
-interface: phpmethod
-operation: ~
-optional: true
 ---
 arg_name: option
 name: readConcern
diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index 03e23434..34e95251 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -1,47 +1,19 @@
 ---
-arg_name: option
-name: batchSize
-type: integer
-description: |
-  Specifies the maximum number of change events to return in each batch of the
-  response from the MongoDB cluster.
-interface: phpmethod
-operation: ~
-optional: true
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: batchSize
 ---
 source:
-  file: apiargs-MongoDBCollection-common-option.yaml
+  file: apiargs-common-option.yaml
   ref: collation
 ---
-arg_name: option
-name: fullDocument
-type: string
-description: |
-  Allowed values are 'default' and 'updateLookup'. Defaults to 'default'.
-  When set to 'updateLookup', the change notification for partial updates will
-  include both a delta describing the changes to the document, as well as a
-  copy of the entire document that was changed from some time after the change
-  occurred. The following values are supported:
-
-  - ``MongoDB\Operation\Watch::FULL_DOCUMENT_DEFAULT`` (*default*)
-  - ``MongoDB\Operation\Watch::FULL_DOCUMENT_UPDATE_LOOKUP``
-
-  .. note::
-
-     This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: fullDocument
 ---
-arg_name: option
-name: maxAwaitTimeMS
-type: integer
-description: |
-  Positive integer denoting the time limit in milliseconds for the server to
-  block a getMore operation if no data is available.
-interface: phpmethod
-operation: ~
-optional: true
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: maxAwaitTimeMS
 ---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
@@ -54,23 +26,20 @@ post: |
   This is used for both the initial change stream aggregation and for
   server selection during an automatic resume.
 ---
-arg_name: option
-name: resumeAfter
-type: array|object
-description: |
-  Specifies the logical starting point for the new change stream.
-
-  .. note::
-
-     This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: resumeAfter
 ---
 source:
   file: apiargs-common-option.yaml
   ref: session
 ---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: startAtOperationTime
+post: |
+  .. versionadded:: 1.4
+---
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
index e0da852c..b00e450c 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
@@ -1,13 +1,8 @@
-arg_name: param
-name: $pipeline
-type: array|object
-description: |
-  The pipeline of stages to append to an initial ``$changeStream`` stage.
-interface: phpmethod
-operation: ~
-optional: true
+source:
+  file: apiargs-method-watch-param.yaml
+  ref: $pipeline
 ---
 source:
-  file: apiargs-common-param.yaml
+  file: apiargs-method-watch-param.yaml
   ref: $options
 ...
diff --git a/source/includes/apiargs-MongoDBDatabase-common-option.yaml b/source/includes/apiargs-MongoDBDatabase-common-option.yaml
index c18bd678..69b4c13d 100644
--- a/source/includes/apiargs-MongoDBDatabase-common-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-common-option.yaml
@@ -1,3 +1,26 @@
+arg_name: option
+name: readConcern
+type: :php:`MongoDB\\Driver\\ReadConcern `
+description: |
+   :manual:`Read concern ` to use for the operation.
+   Defaults to the database's read concern.
+
+   This is not supported for server versions prior to 3.2 and will result in an
+   exception at execution time if used.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: readPreference
+type: :php:`MongoDB\\Driver\\ReadPreference `
+description: |
+   :manual:`Read preference ` to use for the
+   operation. Defaults to the database's read preference.
+interface: phpmethod
+operation: ~
+optional: true
+---
 source:
   file: apiargs-common-option.yaml
   ref: typeMap
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
index 08efd5b2..70cb5378 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
@@ -28,7 +28,7 @@ operation: ~
 optional: true
 ---
 source:
-  file: apiargs-MongoDBCollection-common-option.yaml
+  file: apiargs-common-option.yaml
   ref: collation
 pre: |
   Specifies the :manual:`collation
diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
new file mode 100644
index 00000000..1bc2846c
--- /dev/null
+++ b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
@@ -0,0 +1,44 @@
+---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: batchSize
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: collation
+---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: fullDocument
+---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: maxAwaitTimeMS
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: readConcern
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: readPreference
+post: |
+  This is used for both the initial change stream aggregation and for
+  server selection during an automatic resume.
+---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: resumeAfter
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: startAtOperationTime
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: typeMap
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
new file mode 100644
index 00000000..b00e450c
--- /dev/null
+++ b/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
@@ -0,0 +1,8 @@
+source:
+  file: apiargs-method-watch-param.yaml
+  ref: $pipeline
+---
+source:
+  file: apiargs-method-watch-param.yaml
+  ref: $options
+...
diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml
index ebe4d509..6cbd94a0 100644
--- a/source/includes/apiargs-common-option.yaml
+++ b/source/includes/apiargs-common-option.yaml
@@ -1,4 +1,21 @@
 arg_name: option
+name: collation
+type: array|object
+description: |
+   :manual:`Collation ` allows users to specify
+   language-specific rules for string comparison, such as rules for lettercase
+   and accent marks. When specifying collation, the ``locale`` field is
+   mandatory; all other collation fields are optional. For descriptions of the
+   fields, see :manual:`Collation Document
+   `.
+
+   This option is available in MongoDB 3.4+ and will result in an exception at
+   execution time if specified for an older server version.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
 name: maxTimeMS
 type: integer
 description: |
diff --git a/source/includes/apiargs-method-watch-option.yaml b/source/includes/apiargs-method-watch-option.yaml
new file mode 100644
index 00000000..b38964b7
--- /dev/null
+++ b/source/includes/apiargs-method-watch-option.yaml
@@ -0,0 +1,81 @@
+---
+arg_name: option
+name: batchSize
+type: integer
+description: |
+  Specifies the maximum number of change events to return in each batch of the
+  response from the MongoDB cluster.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: fullDocument
+type: string
+description: |
+  Allowed values are 'default' and 'updateLookup'. Defaults to 'default'.
+  When set to 'updateLookup', the change notification for partial updates will
+  include both a delta describing the changes to the document, as well as a
+  copy of the entire document that was changed from some time after the change
+  occurred. The following values are supported:
+
+  - ``MongoDB\Operation\Watch::FULL_DOCUMENT_DEFAULT`` (*default*)
+  - ``MongoDB\Operation\Watch::FULL_DOCUMENT_UPDATE_LOOKUP``
+
+  .. note::
+
+     This is an option of the ``$changeStream`` pipeline stage.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: maxAwaitTimeMS
+type: integer
+description: |
+  Positive integer denoting the time limit in milliseconds for the server to
+  block a getMore operation if no data is available.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: resumeAfter
+type: array|object
+description: |
+  Specifies the logical starting point for the new change stream. The ``_id``
+  field in documents returned by the change stream may be used here.
+
+  Using this option in conjunction with ``startAtOperationTime`` will result in
+  a server error. The options are mutually exclusive.
+
+  .. note::
+
+     This is an option of the ``$changeStream`` pipeline stage.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: startAtOperationTime
+type: :php:`MongoDB\\BSON\\TimestampInterface `
+description: |
+  If specified, the change stream will only provide changes that occurred at or
+  after the specified timestamp. Command responses from a MongoDB 4.0+ server
+  include an ``operationTime`` that can be used here. By default, the
+  ``operationTime`` returned by the initial ``aggregate`` command will be used
+  if available.
+
+  Using this option in conjunction with ``resumeAfter`` will result in a server
+  error. The options are mutually exclusive.
+
+  This is not supported for server versions prior to 4.0 and will result in an
+  exception at execution time if used.
+
+  .. note::
+
+     This is an option of the ``$changeStream`` pipeline stage.
+interface: phpmethod
+operation: ~
+optional: true
+...
diff --git a/source/includes/apiargs-method-watch-param.yaml b/source/includes/apiargs-method-watch-param.yaml
new file mode 100644
index 00000000..e0da852c
--- /dev/null
+++ b/source/includes/apiargs-method-watch-param.yaml
@@ -0,0 +1,13 @@
+arg_name: param
+name: $pipeline
+type: array|object
+description: |
+  The pipeline of stages to append to an initial ``$changeStream`` stage.
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
index 90e93467..ae1906ff 100644
--- a/source/reference/class/MongoDBClient.txt
+++ b/source/reference/class/MongoDBClient.txt
@@ -40,3 +40,4 @@ Methods
    /reference/method/MongoDBClient-selectCollection
    /reference/method/MongoDBClient-selectDatabase
    /reference/method/MongoDBClient-startSession
+   /reference/method/MongoDBClient-watch
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index 66aca2c1..e4e3eb01 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -59,5 +59,6 @@ Methods
    /reference/method/MongoDBDatabase-modifyCollection
    /reference/method/MongoDBDatabase-selectCollection
    /reference/method/MongoDBDatabase-selectGridFSBucket
+   /reference/method/MongoDBDatabase-watch
    /reference/method/MongoDBDatabase-withOptions
 
diff --git a/source/reference/method/MongoDBClient-watch.txt b/source/reference/method/MongoDBClient-watch.txt
new file mode 100644
index 00000000..e3a99b4d
--- /dev/null
+++ b/source/reference/method/MongoDBClient-watch.txt
@@ -0,0 +1,121 @@
+========================
+MongoDB\\Client::watch()
+========================
+
+.. versionadded:: 1.4
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::watch()
+
+   Executes a :manual:`change stream ` operation on the client.
+   The change stream can be watched for cluster-level changes.
+
+   .. code-block:: php
+
+      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-watch-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-watch-option.rst
+
+Return Values
+-------------
+
+A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+events in the change stream via the :php:`Iterator ` interface.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+Examples
+--------
+
+This example reports events while iterating a change stream.
+
+.. code-block:: php
+
+   watch();
+
+   for ($changeStream->rewind(); true; $changeStream->next()) {
+       if ( ! $changeStream->valid()) {
+           continue;
+       }
+
+       $event = $changeStream->current();
+
+       if ($event['operationType'] === 'invalidate') {
+           break;
+       }
+
+       $ns = sprintf('%s.%s', $event['ns']['db'], $event['ns']['coll']);
+       $id = json_encode($event['documentKey']['_id']);
+
+       switch ($event['operationType']) {
+           case 'delete':
+               printf("Deleted document in %s with _id: %s\n\n", $ns, $id);
+               break;
+
+           case 'insert':
+               printf("Inserted new document in %s\n", $ns);
+               echo json_encode($event['fullDocument']), "\n\n";
+               break;
+
+           case 'replace':
+               printf("Replaced new document in %s with _id: %s\n", $ns, $id);
+               echo json_encode($event['fullDocument']), "\n\n";
+               break;
+
+           case 'update':
+               printf("Updated document in %s with _id: %s\n", $ns, $id);
+               echo json_encode($event['updateDescription']), "\n\n";
+               break;
+       }
+   }
+
+Assuming that a document was inserted, updated, and deleted while the above
+script was iterating the change stream, the output would then resemble:
+
+.. code-block:: none
+
+   Inserted new document in app.user
+   {"_id":{"$oid":"5b329b6674083047cc05e607"},"username":"bob"}
+
+   Inserted new document in app.products
+   {"_id":{"$oid":"5b329b6a74083047cc05e608"},"name":"Widget","quantity":5}
+
+   Inserted new document in logs.messages
+   {"_id":{"$oid":"5b329b7374083047cc05e609"},"msg":"bob purchased a widget"}
+
+See Also
+--------
+
+- :manual:`Aggregation Pipeline ` documentation in
+  the MongoDB Manual
+- :manual:`Change Streams ` documentation in the MongoDB manual
+- :manual:`Change Events ` documentation in the
+  MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
index b5688c6b..d99d45a4 100644
--- a/source/reference/method/MongoDBCollection-watch.txt
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -18,7 +18,7 @@ Definition
 .. phpmethod:: MongoDB\\Collection::watch()
 
    Executes a :manual:`change stream ` operation on the
-   collection.
+   collection. The change stream can be watched for collection-level changes.
 
    .. code-block:: php
 
@@ -68,6 +68,10 @@ This example reports events while iterating a change stream.
 
        $event = $changeStream->current();
 
+       if ($event['operationType'] === 'invalidate') {
+           break;
+       }
+
        $ns = sprintf('%s.%s', $event['ns']['db'], $event['ns']['coll']);
        $id = json_encode($event['documentKey']['_id']);
 
@@ -98,13 +102,14 @@ script was iterating the change stream, the output would then resemble:
 
 .. code-block:: none
 
-   Inserted new document in test.inventory
-   {"_id":{"$oid":"5a81fc0d6118fd1af1790d32"},"name":"Widget","quantity":5}
+   Inserted new document in test.user
+   {"_id":{"$oid":"5b329c4874083047cc05e60a"},"username":"bob"}
 
-   Updated document in test.inventory with _id: {"$oid":"5a81fc0d6118fd1af1790d32"}
-   {"updatedFields":{"quantity":4},"removedFields":[]}
+   Inserted new document in test.products
+   {"_id":{"$oid":"5b329c4d74083047cc05e60b"},"name":"Widget","quantity":5}
 
-   Deleted document in test.inventory with _id: {"$oid":"5a81fc0d6118fd1af1790d32"}
+   Updated document in test.user with _id: {"$oid":"5b329a4f74083047cc05e603"}
+   {"updatedFields":{"username":"robert"},"removedFields":[]}
 
 See Also
 --------
diff --git a/source/reference/method/MongoDBDatabase-watch.txt b/source/reference/method/MongoDBDatabase-watch.txt
new file mode 100644
index 00000000..621ff90f
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-watch.txt
@@ -0,0 +1,120 @@
+==========================
+MongoDB\\Database::watch()
+==========================
+
+.. versionadded:: 1.4
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::watch()
+
+   Executes a :manual:`change stream ` operation on the
+   database. The change stream can be watched for database-level changes.
+
+   .. code-block:: php
+
+      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-watch-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-watch-option.rst
+
+Return Values
+-------------
+
+A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+events in the change stream via the :php:`Iterator ` interface.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+Examples
+--------
+
+This example reports events while iterating a change stream.
+
+.. code-block:: php
+
+   test;
+
+   $changeStream = $database->watch();
+
+   for ($changeStream->rewind(); true; $changeStream->next()) {
+       if ( ! $changeStream->valid()) {
+           continue;
+       }
+
+       $event = $changeStream->current();
+
+       if ($event['operationType'] === 'invalidate') {
+           break;
+       }
+
+       $ns = sprintf('%s.%s', $event['ns']['db'], $event['ns']['coll']);
+       $id = json_encode($event['documentKey']['_id']);
+
+       switch ($event['operationType']) {
+           case 'delete':
+               printf("Deleted document in %s with _id: %s\n\n", $ns, $id);
+               break;
+
+           case 'insert':
+               printf("Inserted new document in %s\n", $ns);
+               echo json_encode($event['fullDocument']), "\n\n";
+               break;
+
+           case 'replace':
+               printf("Replaced new document in %s with _id: %s\n", $ns, $id);
+               echo json_encode($event['fullDocument']), "\n\n";
+               break;
+
+           case 'update':
+               printf("Updated document in %s with _id: %s\n", $ns, $id);
+               echo json_encode($event['updateDescription']), "\n\n";
+               break;
+       }
+   }
+
+Assuming that a document was inserted, updated, and deleted while the above
+script was iterating the change stream, the output would then resemble:
+
+.. code-block:: none
+
+   Inserted new document in test.inventory
+   {"_id":{"$oid":"5a81fc0d6118fd1af1790d32"},"name":"Widget","quantity":5}
+
+   Updated document in test.inventory with _id: {"$oid":"5a81fc0d6118fd1af1790d32"}
+   {"updatedFields":{"quantity":4},"removedFields":[]}
+
+   Deleted document in test.inventory with _id: {"$oid":"5a81fc0d6118fd1af1790d32"}
+
+See Also
+--------
+
+- :manual:`Aggregation Pipeline ` documentation in
+  the MongoDB Manual
+- :manual:`Change Streams ` documentation in the MongoDB manual
+- :manual:`Change Events ` documentation in the
+  MongoDB manual

From 67fb29a5cb799ab7e6564432965cb5f515149662 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 26 Jun 2018 16:35:00 -0400
Subject: [PATCH 174/321] Refer to extension docs for Client::startSession()
 options

---
 ...rgs-MongoDBClient-method-startSession-option.yaml | 12 ------------
 .../reference/method/MongoDBClient-startSession.txt  |  8 ++++----
 2 files changed, 4 insertions(+), 16 deletions(-)
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-startSession-option.yaml

diff --git a/source/includes/apiargs-MongoDBClient-method-startSession-option.yaml b/source/includes/apiargs-MongoDBClient-method-startSession-option.yaml
deleted file mode 100644
index 737303f0..00000000
--- a/source/includes/apiargs-MongoDBClient-method-startSession-option.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-arg_name: option
-name: causalConsistency
-type: boolean
-description: |
-  Enables or disables :ref:`causal consistency ` for the
-  session. If true, each operation in the session will be causally ordered after
-  the previous read or write operation. Set to false to disable causal
-  consistency. Defaults to true.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/reference/method/MongoDBClient-startSession.txt b/source/reference/method/MongoDBClient-startSession.txt
index df851d49..c3fcce89 100644
--- a/source/reference/method/MongoDBClient-startSession.txt
+++ b/source/reference/method/MongoDBClient-startSession.txt
@@ -23,14 +23,14 @@ Definition
 
       function startSession(array $options = []): MongoDB\Driver\Session
 
-   The ``$options`` parameter supports the following options:
-
-   .. include:: /includes/apiargs/MongoDBClient-method-startSession-option.rst
+   Refer to the :php:`MongoDB\\Driver\\Manager::startSession()
+   ` extension reference for accepted
+   options.
 
 Return Values
 -------------
 
-A :php:`MongoDB\Driver\Session `
+A :php:`MongoDB\Driver\Session ` object.
 
 Errors/Exceptions
 -----------------

From 00e725036655c7a0dc4286ca4831e1040ff3a91e Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 27 Jun 2018 09:46:43 -0400
Subject: [PATCH 175/321] PHPLIB-359: Alternatives to restricted query
 operators for countDocuments()

---
 .../MongoDBCollection-countDocuments.txt      | 21 ++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt
index 13d0591a..225b0cfd 100644
--- a/source/reference/method/MongoDBCollection-countDocuments.txt
+++ b/source/reference/method/MongoDBCollection-countDocuments.txt
@@ -51,7 +51,26 @@ Behavior
 
 Internally, this method uses the ``$group`` aggregation pipeline operator to
 obtain the result. If a ``filter`` parameter is given, this is converted into
-a ``$match`` pipeline operator. Optional ``skip`` and ``limit`` stages are
+a ``$match`` pipeline operator. Optional ``$skip`` and ``$limit`` stages are
 added between ``$match`` and ``group`` if present in the options.
 
+Since this method uses an aggregation pipeline, some query operators accepted
+within a :phpmethod:`MongoDB\\Collection::count()` ``filter`` cannot be used.
+Consider the following alternatives to these restricted operators:
+
+.. list-table::
+   :header-rows: 1
+
+   * - Restricted
+     - Alternative Syntax
+
+   * - :query:`$near`
+     - :query:`$geoWithin` with :query:`$center`
+
+   * - :query:`$nearSphere`
+     - :query:`$geoWithin` with :query:`$centerSphere`
+
+   * - :query:`$where`
+     - :query:`$expr` (requires MongoDB 3.6+)
+
 .. todo: add output and examples

From 5d9f8b47b860e42510146770c904edc806330ad4 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 27 Jun 2018 11:12:27 -0400
Subject: [PATCH 176/321] PHPLIB-363: Remove support for server versions < 3.0

Since ext-mongodb 1.5.0 drops support for server 2.6, we can remove wire version checks and legacy code for servers before 3.0 (i.e. wire version 3).
---
 ...apiargs-MongoDBDatabase-method-listCollections-option.yaml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
index 4329e221..0d9ab968 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
@@ -6,10 +6,6 @@ description: |
 
   You can specify a query expression for collection fields (e.g. ``name``,
   ``options``).
-
-  For server versions < 3.0, the filter can only be used to match the ``name``
-  field with a string value. More complex filters will result in an exception at
-  execution time if used.
 interface: phpmethod
 operation: ~
 optional: true

From beeda3e94a65f3ffc6871da393f1c1baca1bea43 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 27 Jun 2018 13:02:16 -0400
Subject: [PATCH 177/321] PHPLIB-364: Deprecate count() and elaborate on count
 method behaviors

---
 .../method/MongoDBCollection-count.txt         | 18 ++++++++++++++++--
 .../MongoDBCollection-countDocuments.txt       |  9 +++++++--
 ...ongoDBCollection-estimatedDocumentCount.txt |  6 +++++-
 3 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 396ba25f..0c590630 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -2,6 +2,8 @@
 MongoDB\\Collection::count()
 ============================
 
+.. deprecated:: 1.4
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
@@ -45,12 +47,24 @@ Errors/Exceptions
 Behavior
 --------
 
-.. include:: /includes/extracts/note-bson-comparison.rst
+This method is deprecated and cannot be executed within a transaction. It has
+always been implemented using the :manual:`count `
+command. The behavior of the ``count`` command differs depending on the options
+passed to it and may or may not provide an accurate count. When no query filter
+is provided, the ``count`` command provides an estimate using collection
+metadata. Even when provided with a query filter the ``count`` command can
+return inaccurate results with a sharded cluster if orphaned documents exist or
+if a chunk migration is in progress. The
+:phpmethod:`MongoDB\\Collection::countDocuments()` method avoids these sharded
+cluster problems entirely when used with MongoDB 3.6+, and when a primary read
+preference with older sharded clusters.
 
-.. todo: add output and examples
+.. include:: /includes/extracts/note-bson-comparison.rst
 
 See Also
 --------
 
 - :manual:`count ` command reference in the MongoDB
   manual
+- :phpmethod:`MongoDB\\Collection::countDocuments()`
+- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt
index 225b0cfd..61e292e6 100644
--- a/source/reference/method/MongoDBCollection-countDocuments.txt
+++ b/source/reference/method/MongoDBCollection-countDocuments.txt
@@ -47,8 +47,6 @@ Errors/Exceptions
 Behavior
 --------
 
-.. include:: /includes/extracts/note-bson-comparison.rst
-
 Internally, this method uses the ``$group`` aggregation pipeline operator to
 obtain the result. If a ``filter`` parameter is given, this is converted into
 a ``$match`` pipeline operator. Optional ``$skip`` and ``$limit`` stages are
@@ -73,4 +71,11 @@ Consider the following alternatives to these restricted operators:
    * - :query:`$where`
      - :query:`$expr` (requires MongoDB 3.6+)
 
+.. include:: /includes/extracts/note-bson-comparison.rst
+
 .. todo: add output and examples
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
diff --git a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
index 61dbc305..097e03b4 100644
--- a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
+++ b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
@@ -47,10 +47,14 @@ Errors/Exceptions
 Behavior
 --------
 
-.. include:: /includes/extracts/note-bson-comparison.rst
+This method returns an estimate of the count of documents in the collection
+using collection metadata, rather than counting the documents or consulting an
+index. This method does not take a ``session`` option and cannot be executed
+within a transaction.
 
 See Also
 --------
 
 - :manual:`count ` command reference in the MongoDB
   manual
+- :phpmethod:`MongoDB\\Collection::countDocuments()`

From e002bcd372fb811d0bb83d809c176c417736fe2d Mon Sep 17 00:00:00 2001
From: Derick Rethans 
Date: Tue, 31 Jul 2018 14:41:07 +0100
Subject: [PATCH 178/321] PHPLIB-341: Add LocalDateTime example to tutorial

---
 source/tutorial.txt              |   1 +
 source/tutorial/custom-types.txt | 187 +++++++++++++++++++++++++++++++
 2 files changed, 188 insertions(+)
 create mode 100644 source/tutorial/custom-types.txt

diff --git a/source/tutorial.txt b/source/tutorial.txt
index d94f0682..57a14c8e 100644
--- a/source/tutorial.txt
+++ b/source/tutorial.txt
@@ -8,6 +8,7 @@ Tutorials
    /tutorial/crud
    /tutorial/collation
    /tutorial/commands
+   /tutorial/custom-types
    /tutorial/decimal128
    /tutorial/gridfs
    /tutorial/indexes
diff --git a/source/tutorial/custom-types.txt b/source/tutorial/custom-types.txt
new file mode 100644
index 00000000..a6e24fe1
--- /dev/null
+++ b/source/tutorial/custom-types.txt
@@ -0,0 +1,187 @@
+=================
+Custom Data-Types
+=================
+
+.. default-domain:: mongodb
+
+The MongoDB PHP extension and library support custom classes while
+serializing and deserializing. An example of where this might be useful is
+if you want to store date/time information retaining the time zone
+information that PHP's :php:`DateTimeImmutable `
+class stores with a point in time.
+
+The driver serializes PHP variables, including objects, into BSON when it
+communicates to the server, and deserializes BSON back into PHP variables when
+it receives data from the server.
+
+It is possible to influence the behaviour by implementing the
+:php:`MongoDB\\BSON\\Persistable ` interface.
+If a class implements this interface, then upon serialization the
+:php:`bsonSerialize ` method is
+called. This method is responsible for returning an array or stdClass object
+to convert to BSON and store in the database. That data will later be used to
+reconstruct the object upon reading from the database.
+
+As an example we present the ``LocalDateTime`` class. This class wraps around
+the :php:`MongoDB\\BSON\UTCDateTime ` data
+type and a time zone.
+
+.. code-block:: php
+
+    utc = new \MongoDB\BSON\UTCDateTime($milliseconds);
+            if ($timezone === null) {
+                $timezone = new \DateTimeZone(date_default_timezone_get());
+            }
+            $this->tz = $timezone;
+        }
+    ?>
+
+As it implements the :php:`MongoDB\\BSON\\Persistable
+` interface, the
+class is required to implement the :php:`bsonSerialize
+` and :php:`bsonUnserialize
+` methods. In the
+:php:`bsonSerialize ` method, we
+return an array with the two values that we need to persist: the point in time
+in milliseconds since the Epoch, represented by a
+:php:`MongoDB\\BSON\\UTCDateTime ` object, and
+a string containing the Olson time zone identifier:
+
+.. code-block:: php
+
+     $this->utc,
+                'tz' => $this->tz->getName(),
+            ];
+        }
+    ?>
+
+The driver will additionally add a ``__pclass`` field to the document, and
+store that in the database, too. This field contains the PHP class name so that
+upon deserialization the driver knows which class to use for recreating the
+stored object.
+
+When the document is read from the database, the driver detects whether a
+``__pclass`` field is present and then executes
+:php:`MongoDB\\BSON\\Persistable::bsonUnserialize
+` method which is
+responsible for restoring the object's original state.
+
+In the code below, we make sure that the data in the ``utc`` and ``tz`` fields
+are of the right time, and then assign their values to the two private
+properties.
+
+.. code-block:: php
+
+    utc = $data['utc'];
+            $this->tz = new \DateTimeZone($data['tz']);
+        }
+    ?>
+
+You may have noticed that the class also implements the
+:php:`MongoDB\\BSON\\UTCDateTimeInterface
+` interface. This interface defines
+the two non-constructor methods of the :php:`MongoDB\\BSON\\UTCDateTime
+` class.
+
+It is recommended that wrappers around existing BSON classes implement their
+respective interface (i.e. :php:`MongoDB\\BSON\\UTCDateTimeInterface
+`) so that the wrapper objects can be
+used in the same context as their original unwrapped version. It is also
+recommended that you always type-hint against the interface (i.e.
+:php:`MongoDB\\BSON\\UTCDateTimeInterface
+`) and never against the concrete
+class (i.e. :php:`MongoDB\\BSON\\UTCDateTime
+`), as this would prevent wrapped objects from
+being accepted into methods.
+
+In our new ``toDateTime`` method we return a :php:`DateTime `
+object with the local time zone set, instead of the UTC time zone that
+:php:`MongoDB\\BSON\\UTCDateTime ` normally uses
+in its return value.
+
+.. code-block:: php
+
+    utc->toDateTime()->setTimezone($this->tz);
+        }
+
+        public function __toString()
+        {
+            return (string) $this->utc;
+        }
+    }
+    ?>
+
+With the class defined, we can now use it in our documents. The snippet below
+demonstrates the round tripping from the ``LocalDateTime`` object to BSON, and
+back to ``LocalDateTime``.
+
+.. code-block:: php
+
+     new LocalDateTime]);
+    $document = MongoDB\BSON\toPHP($bson);
+
+    var_dump($document);
+    var_dump($document->date->toDateTime());
+    ?>
+
+Which outputs::
+
+    object(stdClass)#1 (1) {
+      ["date"]=>
+      object(LocalDateTime)#2 (2) {
+        ["utc":"LocalDateTime":private]=>
+        object(MongoDB\BSON\UTCDateTime)#3 (1) {
+          ["milliseconds"]=>
+          string(13) "1533042443716"
+        }
+        ["tz":"LocalDateTime":private]=>
+        object(DateTimeZone)#4 (2) {
+          ["timezone_type"]=>
+          int(3)
+          ["timezone"]=>
+          string(13) "Europe/London"
+        }
+      }
+    }
+    object(DateTime)#5 (3) {
+      ["date"]=>
+      string(26) "2018-07-31 14:07:23.716000"
+      ["timezone_type"]=>
+      int(3)
+      ["timezone"]=>
+      string(13) "Europe/London"
+    }
+
+Storing the Olson time zone identifier in a separate field also works well
+with MongoDB's :manual:`Aggregation Framework `, which allows
+date manipulation, :manual:`formatting
+`, and querying depending on a
+specific time zone.

From 01153b346ac515cd9a743cf832d1a687d31ba215 Mon Sep 17 00:00:00 2001
From: Derick Rethans 
Date: Fri, 30 Nov 2018 15:29:30 +0000
Subject: [PATCH 179/321] PHPLIB-364: Document that transactions do not allow
 per-op read/write concerns

---
 .../apiargs-MongoDBCollection-common-option.yaml       | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
index 24bef2cc..643308ea 100644
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-common-option.yaml
@@ -42,6 +42,11 @@ description: |
 
    This is not supported for server versions prior to 3.2 and will result in an
    exception at execution time if used.
+
+   It is not possible to specify a :manual:`read concern
+   ` for individual operations as part of a
+   transaction. Instead, set the ``readConcern`` option when starting the
+   transaction with :php:`startTransaction `.
 interface: phpmethod
 operation: ~
 optional: true
@@ -68,6 +73,11 @@ type: :php:`MongoDB\\Driver\\WriteConcern `
 description: |
    :manual:`Write concern ` to use for the operation.
    Defaults to the collection's write concern.
+
+   It is not possible to specify a :manual:`write concern
+   ` for individual operations as part of a
+   transaction. Instead, set the ``writeConcern`` option when starting the
+   transaction with :php:`startTransaction `.
 interface: phpmethod
 operation: ~
 optional: true

From c56b33ebff7173f5bfdbeac72af9e708aec571c9 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 9 Jul 2019 09:37:27 -0400
Subject: [PATCH 180/321] PHPLIB-407: Support startAfter change stream option

Note: this does not address using the startAfter option for resuming. That will be implemented in PHPLIB-411 with the introduction of a resume token accessor method and support for postBatchResumeToken.
---
 ...rgs-MongoDBClient-method-watch-option.yaml |  6 ++++
 ...MongoDBCollection-method-watch-option.yaml |  6 ++++
 ...s-MongoDBDatabase-method-watch-option.yaml |  6 ++++
 .../includes/apiargs-method-watch-option.yaml | 32 ++++++++++++++++---
 4 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml
index 1c9aa0ca..2dd040e9 100644
--- a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml
@@ -34,6 +34,12 @@ source:
   file: apiargs-common-option.yaml
   ref: session
 ---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: startAfter
+post: |
+  .. versionadded: 1.5
+---
 source:
   file: apiargs-method-watch-option.yaml
   ref: startAtOperationTime
diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index 34e95251..a873beec 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -34,6 +34,12 @@ source:
   file: apiargs-common-option.yaml
   ref: session
 ---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: startAfter
+post: |
+  .. versionadded: 1.5
+---
 source:
   file: apiargs-method-watch-option.yaml
   ref: startAtOperationTime
diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
index 1bc2846c..b1ad0279 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
@@ -34,6 +34,12 @@ source:
   file: apiargs-common-option.yaml
   ref: session
 ---
+source:
+  file: apiargs-method-watch-option.yaml
+  ref: startAfter
+post: |
+  .. versionadded: 1.5
+---
 source:
   file: apiargs-method-watch-option.yaml
   ref: startAtOperationTime
diff --git a/source/includes/apiargs-method-watch-option.yaml b/source/includes/apiargs-method-watch-option.yaml
index b38964b7..89887884 100644
--- a/source/includes/apiargs-method-watch-option.yaml
+++ b/source/includes/apiargs-method-watch-option.yaml
@@ -46,8 +46,32 @@ description: |
   Specifies the logical starting point for the new change stream. The ``_id``
   field in documents returned by the change stream may be used here.
 
-  Using this option in conjunction with ``startAtOperationTime`` will result in
-  a server error. The options are mutually exclusive.
+  Using this option in conjunction with ``startAfter`` and/or
+  ``startAtOperationTime`` will result in a server error. The options are
+  mutually exclusive.
+
+  .. note::
+
+     This is an option of the ``$changeStream`` pipeline stage.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: startAfter
+type: array|object
+description: |
+  Specifies the logical starting point for the new change stream. The ``_id``
+  field in documents returned by the change stream may be used here. Unlike
+  ``resumeAfter``, this option can be used with a resume token from an
+  "invalidate" event.
+
+  Using this option in conjunction with ``resumeAfter`` and/or
+  ``startAtOperationTime`` will result in a server error. The options are
+  mutually exclusive.
+
+  This is not supported for server versions prior to 4.2 and will result in an
+  exception at execution time if used.
 
   .. note::
 
@@ -66,8 +90,8 @@ description: |
   ``operationTime`` returned by the initial ``aggregate`` command will be used
   if available.
 
-  Using this option in conjunction with ``resumeAfter`` will result in a server
-  error. The options are mutually exclusive.
+  Using this option in conjunction with ``resumeAfter`` and/or ``startAfter``
+  will result in a server error. The options are mutually exclusive.
 
   This is not supported for server versions prior to 4.0 and will result in an
   exception at execution time if used.

From 0f58d6b16eddaa0ea368547b63c87fd4eec8f467 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 16 Jul 2019 14:23:14 -0400
Subject: [PATCH 181/321] PHPLIB-435: Document ChangeStream::getResumeToken()

---
 .../MongoDBChangeStream-getResumeToken.txt    | 75 +++++++++++++++++++
 source/reference/result-classes.txt           |  1 +
 2 files changed, 76 insertions(+)
 create mode 100644 source/reference/method/MongoDBChangeStream-getResumeToken.txt

diff --git a/source/reference/method/MongoDBChangeStream-getResumeToken.txt b/source/reference/method/MongoDBChangeStream-getResumeToken.txt
new file mode 100644
index 00000000..0930d45c
--- /dev/null
+++ b/source/reference/method/MongoDBChangeStream-getResumeToken.txt
@@ -0,0 +1,75 @@
+=======================================
+MongoDB\\ChangeStream::getResumeToken()
+=======================================
+
+.. versionadded:: 1.5
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\ChangeStream::getResumeToken()
+
+   Returns the cached resume token that will be used to resume the change
+   stream.
+
+   .. code-block:: php
+
+      function getResumeToken(): array|object|null
+
+Return Values
+-------------
+
+An array or object, or ``null`` if there is no cached resume token. The return
+type will depend on the ``typeMap`` option for the ``watch()`` method used to
+create the change stream.
+
+Examples
+--------
+
+This example captures the resume token for a change stream after encountering
+an ``invalidate`` event and uses it to construct a second change stream using
+the ``startAfter`` option.
+
+.. code-block:: php
+
+   test->inventory;
+
+   $changeStream = $collection->watch();
+
+   for ($changeStream->rewind(); true; $changeStream->next()) {
+       if ( ! $changeStream->valid()) {
+           continue;
+       }
+
+       $event = $changeStream->current();
+
+       if ($event['operationType'] === 'invalidate') {
+           $startAfter = $changeStream->getResumeToken();
+           break;
+       }
+
+       printf("%d: %s\n", $changeStream->key(), $event['operationType']);
+   }
+
+   $changeStream = $collection->watch([], ['startAfter' => $startAfter]);
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::watch()`
+- :phpmethod:`MongoDB\\Collection::watch()`
+- :phpmethod:`MongoDB\\Database::watch()`
+- :manual:`Resume a Change Stream `
+  documentation in the MongoDB manual
diff --git a/source/reference/result-classes.txt b/source/reference/result-classes.txt
index cb6860ec..bce6246b 100644
--- a/source/reference/result-classes.txt
+++ b/source/reference/result-classes.txt
@@ -36,6 +36,7 @@ Methods
 
    /reference/method/MongoDBChangeStream-current
    /reference/method/MongoDBChangeStream-getCursorId
+   /reference/method/MongoDBChangeStream-getResumeToken
    /reference/method/MongoDBChangeStream-key
    /reference/method/MongoDBChangeStream-next
    /reference/method/MongoDBChangeStream-rewind

From 359fe86f3a8c2f24daf256bd8c0f834b2fcb3484 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 16 Jul 2019 14:23:43 -0400
Subject: [PATCH 182/321] Add references to Client and Database watch() methods

---
 source/reference/method/MongoDBChangeStream-current.txt     | 2 ++
 source/reference/method/MongoDBChangeStream-getCursorId.txt | 2 ++
 source/reference/method/MongoDBChangeStream-key.txt         | 2 ++
 source/reference/method/MongoDBChangeStream-next.txt        | 2 ++
 source/reference/method/MongoDBChangeStream-rewind.txt      | 2 ++
 source/reference/method/MongoDBChangeStream-valid.txt       | 2 ++
 source/reference/method/MongoDBClient-watch.txt             | 2 ++
 source/reference/method/MongoDBCollection-watch.txt         | 2 ++
 source/reference/method/MongoDBDatabase-watch.txt           | 2 ++
 source/reference/result-classes.txt                         | 2 ++
 10 files changed, 20 insertions(+)

diff --git a/source/reference/method/MongoDBChangeStream-current.txt b/source/reference/method/MongoDBChangeStream-current.txt
index 1666fcd8..8057dbaa 100644
--- a/source/reference/method/MongoDBChangeStream-current.txt
+++ b/source/reference/method/MongoDBChangeStream-current.txt
@@ -96,7 +96,9 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
+- :phpmethod:`MongoDB\\Client::watch()`
 - :phpmethod:`MongoDB\\Collection::watch()`
+- :phpmethod:`MongoDB\\Database::watch()`
 - :php:`Iterator::current() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-getCursorId.txt b/source/reference/method/MongoDBChangeStream-getCursorId.txt
index 769e2dca..1938d3c0 100644
--- a/source/reference/method/MongoDBChangeStream-getCursorId.txt
+++ b/source/reference/method/MongoDBChangeStream-getCursorId.txt
@@ -53,6 +53,8 @@ The output would then resemble::
 See Also
 --------
 
+- :phpmethod:`MongoDB\\Client::watch()`
 - :phpmethod:`MongoDB\\Collection::watch()`
+- :phpmethod:`MongoDB\\Database::watch()`
 - :php:`MongoDB\\Driver\\CursorId `
 - :php:`MongoDB\\Driver\\Cursor::getId() `
diff --git a/source/reference/method/MongoDBChangeStream-key.txt b/source/reference/method/MongoDBChangeStream-key.txt
index 338961b7..6225c11f 100644
--- a/source/reference/method/MongoDBChangeStream-key.txt
+++ b/source/reference/method/MongoDBChangeStream-key.txt
@@ -68,7 +68,9 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
+- :phpmethod:`MongoDB\\Client::watch()`
 - :phpmethod:`MongoDB\\Collection::watch()`
+- :phpmethod:`MongoDB\\Database::watch()`
 - :php:`Iterator::key() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
\ No newline at end of file
diff --git a/source/reference/method/MongoDBChangeStream-next.txt b/source/reference/method/MongoDBChangeStream-next.txt
index 629fd14f..c25f039b 100644
--- a/source/reference/method/MongoDBChangeStream-next.txt
+++ b/source/reference/method/MongoDBChangeStream-next.txt
@@ -36,7 +36,9 @@ Errors/Exceptions
 See Also
 --------
 
+- :phpmethod:`MongoDB\\Client::watch()`
 - :phpmethod:`MongoDB\\Collection::watch()`
+- :phpmethod:`MongoDB\\Database::watch()`
 - :php:`Iterator::next() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-rewind.txt b/source/reference/method/MongoDBChangeStream-rewind.txt
index dbdeb161..e59a1399 100644
--- a/source/reference/method/MongoDBChangeStream-rewind.txt
+++ b/source/reference/method/MongoDBChangeStream-rewind.txt
@@ -46,7 +46,9 @@ advanced).
 See Also
 --------
 
+- :phpmethod:`MongoDB\\Client::watch()`
 - :phpmethod:`MongoDB\\Collection::watch()`
+- :phpmethod:`MongoDB\\Database::watch()`
 - :php:`Iterator::rewind() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-valid.txt b/source/reference/method/MongoDBChangeStream-valid.txt
index d5b0d84c..69ea1cd6 100644
--- a/source/reference/method/MongoDBChangeStream-valid.txt
+++ b/source/reference/method/MongoDBChangeStream-valid.txt
@@ -34,7 +34,9 @@ A boolean indicating whether there is a current event in the change stream.
 See Also
 --------
 
+- :phpmethod:`MongoDB\\Client::watch()`
 - :phpmethod:`MongoDB\\Collection::watch()`
+- :phpmethod:`MongoDB\\Database::watch()`
 - :php:`Iterator::valid() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-watch.txt b/source/reference/method/MongoDBClient-watch.txt
index e3a99b4d..0e7aab34 100644
--- a/source/reference/method/MongoDBClient-watch.txt
+++ b/source/reference/method/MongoDBClient-watch.txt
@@ -114,6 +114,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
+- :phpmethod:`MongoDB\\Collection::watch()`
+- :phpmethod:`MongoDB\\Database::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
index d99d45a4..50ef408d 100644
--- a/source/reference/method/MongoDBCollection-watch.txt
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -114,6 +114,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
+- :phpmethod:`MongoDB\\Client::watch()`
+- :phpmethod:`MongoDB\\Database::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-watch.txt b/source/reference/method/MongoDBDatabase-watch.txt
index 621ff90f..7ff19b73 100644
--- a/source/reference/method/MongoDBDatabase-watch.txt
+++ b/source/reference/method/MongoDBDatabase-watch.txt
@@ -113,6 +113,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
+- :phpmethod:`MongoDB\\Collection::watch()`
+- :phpmethod:`MongoDB\\Client::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/result-classes.txt b/source/reference/result-classes.txt
index bce6246b..3371c137 100644
--- a/source/reference/result-classes.txt
+++ b/source/reference/result-classes.txt
@@ -22,6 +22,8 @@ Definition
 
    This class extends PHP's :php:`Iterator `
    interface. An instance of this class is returned by
+   :phpmethod:`MongoDB\\Client::watch()`,
+   :phpmethod:`MongoDB\\Database::watch()`, and
    :phpmethod:`MongoDB\\Collection::watch()`.
 
    This class allows for iteration of events in a change stream. It also allows

From 28446830a6b007355a7bc56740e0be04f7d14291 Mon Sep 17 00:00:00 2001
From: Andreas Braun 
Date: Tue, 23 Jul 2019 08:38:15 +0200
Subject: [PATCH 183/321] PHPLIB-402: Add aggregation helper to Database class

---
 ...oDBCollection-method-aggregate-option.yaml | 82 ++++++-------------
 ...ngoDBDatabase-method-aggregate-option.yaml | 55 +++++++++++++
 ...ongoDBDatabase-method-aggregate-param.yaml | 14 ++++
 source/includes/apiargs-aggregate-option.yaml | 62 ++++++++++++++
 source/reference/class/MongoDBDatabase.txt    |  1 +
 .../method/MongoDBCollection-aggregate.txt    |  3 +-
 .../method/MongoDBDatabase-aggregate.txt      | 63 ++++++++++++++
 source/tutorial/crud.txt                      |  2 +-
 8 files changed, 223 insertions(+), 59 deletions(-)
 create mode 100644 source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
 create mode 100644 source/includes/apiargs-aggregate-option.yaml
 create mode 100644 source/reference/method/MongoDBDatabase-aggregate.txt

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 6c7d37bd..1423e281 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -1,70 +1,32 @@
-arg_name: option
-name: allowDiskUse
-type: boolean
-description: |
-  Enables writing to temporary files. When set to ``true``, aggregation stages
-  can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory. The
-  default is ``false``.
-interface: phpmethod
-operation: ~
-optional: true
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: allowDiskUse
 ---
-arg_name: option
-name: batchSize
-type: integer
-description: |
-  Specifies the initial batch size for the cursor. A batchSize of ``0`` means an
-  empty first batch and is useful for quickly returning a cursor or failure
-  message without doing significant server-side work.
-interface: phpmethod
-operation: ~
-optional: true
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: batchSize
 ---
 source:
-  file: apiargs-MongoDBCollection-common-option.yaml
+  file: apiargs-aggregate-option.yaml
   ref: bypassDocumentValidation
-post: |
-  This only applies when using the :ref:`$out ` stage.
-
-  Document validation requires MongoDB 3.2 or later: if you are using an earlier
-  version of MongoDB, this option will be ignored.
 ---
-arg_name: option
-name: comment
-type: string
-description: |
-  Users can specify an arbitrary string to help trace the operation through the
-  database profiler, currentOp, and logs.
-
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: comment
+post: |
   .. versionadded:: 1.3
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: explain
-type: boolean
-description: |
-  Specifies whether or not to return the information on the processing of the
-  pipeline.
-
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: explain
+post: |
   .. versionadded:: 1.4
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: hint
-type: string|array|object
-description: |
-  The index to use. Specify either the index name as a string or the index key
-  pattern as a document. If specified, then the query system will only consider
-  plans using the hinted index.
-
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: hint
+post: |
   .. versionadded:: 1.3
-interface: phpmethod
-operation: ~
-optional: true
 ---
 source:
   file: apiargs-common-option.yaml
@@ -96,6 +58,12 @@ type: boolean
 description: |
   Indicates whether the command will request that the server provide results
   using a cursor. The default is ``true``.
+
+  .. note::
+
+     MongoDB 3.6+ no longer supports returning results without a cursor (excluding
+     when the explain option is used) and specifying false for this option will
+     result in a server error.
 interface: phpmethod
 operation: ~
 optional: true
diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
new file mode 100644
index 00000000..87f03d29
--- /dev/null
+++ b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
@@ -0,0 +1,55 @@
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: allowDiskUse
+---
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: batchSize
+---
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: bypassDocumentValidation
+---
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: comment
+---
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: explain
+---
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: hint
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: maxTimeMS
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: readConcern
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: readPreference
+post: |
+  This option will be ignored when using the :ref:`$out ` stage.
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: typeMap
+---
+source:
+  file: apiargs-MongoDBDatabase-common-option.yaml
+  ref: writeConcern
+post: |
+  This only applies when the :ref:`$out ` stage is specified.
+
+  This is not supported for server versions prior to 3.4 and will result in an
+  exception at execution time if used.
+...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
new file mode 100644
index 00000000..cbad3b49
--- /dev/null
+++ b/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
@@ -0,0 +1,14 @@
+arg_name: param
+name: $pipeline
+type: array
+description: |
+  Specifies an :manual:`aggregation pipeline `
+  operation.
+interface: phpmethod
+operation: ~
+optional: false
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml
new file mode 100644
index 00000000..8037899a
--- /dev/null
+++ b/source/includes/apiargs-aggregate-option.yaml
@@ -0,0 +1,62 @@
+arg_name: option
+name: allowDiskUse
+type: boolean
+description: |
+  Enables writing to temporary files. When set to ``true``, aggregation stages
+  can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory. The
+  default is ``false``.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: batchSize
+type: integer
+description: |
+  Specifies the initial batch size for the cursor. A batchSize of ``0`` means an
+  empty first batch and is useful for quickly returning a cursor or failure
+  message without doing significant server-side work.
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: bypassDocumentValidation
+post: |
+  This only applies when using the :ref:`$out ` stage.
+
+  Document validation requires MongoDB 3.2 or later: if you are using an earlier
+  version of MongoDB, this option will be ignored.
+---
+arg_name: option
+name: comment
+type: string
+description: |
+  Users can specify an arbitrary string to help trace the operation through the
+  database profiler, currentOp, and logs.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: explain
+type: boolean
+description: |
+  Specifies whether or not to return the information on the processing of the
+  pipeline.
+interface: phpmethod
+operation: ~
+optional: true
+---
+arg_name: option
+name: hint
+type: string|array|object
+description: |
+  The index to use. Specify either the index name as a string or the index key
+  pattern as a document. If specified, then the query system will only consider
+  plans using the hinted index.
+interface: phpmethod
+operation: ~
+optional: true
+...
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index e4e3eb01..e2b3e0ba 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -45,6 +45,7 @@ Methods
 
    /reference/method/MongoDBDatabase__construct
    /reference/method/MongoDBDatabase__get
+   /reference/method/MongoDBDatabase-aggregate
    /reference/method/MongoDBDatabase-command
    /reference/method/MongoDBDatabase-createCollection
    /reference/method/MongoDBDatabase-drop
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index 6d092181..9c7232c2 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -45,7 +45,7 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
-.. _php-agg-method-behavior:
+.. _php-coll-agg-method-behavior:
 
 Behavior
 --------
@@ -63,6 +63,7 @@ value will be :php:`Traversable `.
 See Also
 --------
 
+- :phpmethod:`MongoDB\\Database::aggregate()`
 - :manual:`aggregate ` command reference in the
   MongoDB manual
 - :manual:`Aggregation Pipeline ` documentation in
diff --git a/source/reference/method/MongoDBDatabase-aggregate.txt b/source/reference/method/MongoDBDatabase-aggregate.txt
new file mode 100644
index 00000000..a826e280
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-aggregate.txt
@@ -0,0 +1,63 @@
+==============================
+MongoDB\\Database::aggregate()
+==============================
+
+.. versionadded:: 1.5
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::aggregate()
+
+   Runs a specified :manual:`admin/diagnostic pipeline
+   ` which does
+   not require an underlying collection. For aggregations on collection data,
+   see :phpmethod:`MongoDB\\Collection::aggregate()`.
+
+   .. code-block:: php
+
+      function aggregate(array $pipeline, array $options = []): Traversable
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-aggregate-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-aggregate-option.rst
+
+Return Values
+-------------
+
+A :php:`MongoDB\\Driver\\Cursor ` or
+:php:`ArrayIterator ` object. In both cases, the return value
+will be :php:`Traversable `.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unexpectedvalueexception.rst
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+.. _php-db-agg-method-behavior:
+
+.. todo: add examples
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::aggregate()`
+- :manual:`aggregate ` command reference in the
+  MongoDB manual
+- :manual:`Aggregation Pipeline ` documentation in
+  the MongoDB Manual
diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index 28ba3b6c..1e9f95e2 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -401,7 +401,7 @@ The |php-library|\'s :phpmethod:`MongoDB\\Collection::aggregate()` method
 returns a :php:`Traversable ` object, which you can iterate upon to
 access the results of the aggregation operation. Refer to the
 :phpmethod:`MongoDB\\Collection::aggregate()` method's :ref:`behavior
-reference ` for more about the method's output.
+reference ` for more about the method's output.
 
 The following example lists the 5 US states with the most zip codes associated
 with them:

From a2c7e202cb75c1cf3878d46fd9b0f147c20b439c Mon Sep 17 00:00:00 2001
From: Andreas Braun 
Date: Tue, 23 Jul 2019 15:58:33 +0200
Subject: [PATCH 184/321] PHPLIB-438: Unify handling for write stages in
 aggregation pipelines

---
 .../apiargs-MongoDBCollection-method-aggregate-option.yaml   | 5 ++---
 .../apiargs-MongoDBDatabase-method-aggregate-option.yaml     | 5 ++---
 source/includes/apiargs-aggregate-option.yaml                | 3 ++-
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 1423e281..c2b4021e 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -39,8 +39,6 @@ source:
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: readPreference
-post: |
-  This option will be ignored when using the :ref:`$out ` stage.
 ---
 source:
   file: apiargs-common-option.yaml
@@ -72,7 +70,8 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
 post: |
-  This only applies when the :ref:`$out ` stage is specified.
+  This only applies when a :ref:`$out ` or :ref:`$merge `
+  stage is specified.
 
   This is not supported for server versions prior to 3.4 and will result in an
   exception at execution time if used.
diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
index 87f03d29..d7529a60 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
@@ -33,8 +33,6 @@ source:
 source:
   file: apiargs-MongoDBDatabase-common-option.yaml
   ref: readPreference
-post: |
-  This option will be ignored when using the :ref:`$out ` stage.
 ---
 source:
   file: apiargs-common-option.yaml
@@ -48,7 +46,8 @@ source:
   file: apiargs-MongoDBDatabase-common-option.yaml
   ref: writeConcern
 post: |
-  This only applies when the :ref:`$out ` stage is specified.
+  This only applies when a :ref:`$out ` or :ref:`$merge `
+  stage is specified.
 
   This is not supported for server versions prior to 3.4 and will result in an
   exception at execution time if used.
diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml
index 8037899a..25b121ac 100644
--- a/source/includes/apiargs-aggregate-option.yaml
+++ b/source/includes/apiargs-aggregate-option.yaml
@@ -24,7 +24,8 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: bypassDocumentValidation
 post: |
-  This only applies when using the :ref:`$out ` stage.
+  This only applies when using the :ref:`$out ` and
+  :ref:`$out ` stages.
 
   Document validation requires MongoDB 3.2 or later: if you are using an earlier
   version of MongoDB, this option will be ignored.

From caa9bf669f8bce249b65db0a4b60b54305f63162 Mon Sep 17 00:00:00 2001
From: Andreas Braun 
Date: Thu, 1 Aug 2019 16:16:08 +0200
Subject: [PATCH 185/321] PHPLIB-242: Add typeMap support for distinct

---
 .../apiargs-MongoDBCollection-method-distinct-option.yaml   | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
index b456d8b6..3c2ae6ed 100644
--- a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
@@ -19,4 +19,10 @@ source:
   ref: session
 post: |
   .. versionadded:: 1.3
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: typeMap
+post: |
+  .. versionadded:: 1.5
 ...

From 008236b8270219bd0af2a77b48bc1305ae7b882a Mon Sep 17 00:00:00 2001
From: Andreas Braun 
Date: Mon, 12 Aug 2019 10:35:14 +0200
Subject: [PATCH 186/321] PHPLIB-418: Add the ability to specify a pipeline to
 an update command

---
 source/includes/apiargs-MongoDBCollection-common-param.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/source/includes/apiargs-MongoDBCollection-common-param.yaml b/source/includes/apiargs-MongoDBCollection-common-param.yaml
index 73c18fa4..9c032d15 100644
--- a/source/includes/apiargs-MongoDBCollection-common-param.yaml
+++ b/source/includes/apiargs-MongoDBCollection-common-param.yaml
@@ -24,7 +24,9 @@ type: array|object
 description: |
   Specifies the field and value combinations to update and any relevant update
   operators. ``$update`` uses MongoDB's :method:`update operators
-  `.
+  `. Starting with MongoDB 4.2, an `aggregation
+  pipeline `_
+  can be passed as this parameter.
 interface: phpmethod
 operation: ~
 optional: false

From f771ba4a984acce58d1cb5b1734a865c05a3cdb4 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 6 Sep 2019 14:44:50 -0400
Subject: [PATCH 187/321] Clear value for obsolete options field

The operation field isn't used for anything in our documentation. This was introduced in 1c759511f4abb48b1d1592c373316aa86b2b5bb5 and it looks like we missed cleaning it up in later commits that changed every other operation field to null.
---
 source/includes/apiargs-common-option.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml
index 6cbd94a0..38ea8e74 100644
--- a/source/includes/apiargs-common-option.yaml
+++ b/source/includes/apiargs-common-option.yaml
@@ -33,7 +33,7 @@ description: |
   The default read concern to use for {{resource}} operations. Defaults to the
   {{parent}}'s read concern.
 interface: phpmethod
-operation: selectCollection
+operation: ~
 optional: true
 replacement:
   resource: "collection"

From 641efb28616809bc7c5a7c99bb7479acbef07f3a Mon Sep 17 00:00:00 2001
From: Andreas Braun 
Date: Thu, 5 Sep 2019 18:26:37 +0200
Subject: [PATCH 188/321] PHPLIB-468: Add documentation for with_transaction

---
 ...iargs-function-with_transaction-param.yaml | 31 ++++++++
 source/reference.txt                          |  1 +
 .../reference/function/with_transaction.txt   | 79 +++++++++++++++++++
 source/reference/functions.txt                | 16 ++++
 4 files changed, 127 insertions(+)
 create mode 100644 source/includes/apiargs-function-with_transaction-param.yaml
 create mode 100644 source/reference/function/with_transaction.txt
 create mode 100644 source/reference/functions.txt

diff --git a/source/includes/apiargs-function-with_transaction-param.yaml b/source/includes/apiargs-function-with_transaction-param.yaml
new file mode 100644
index 00000000..78875e91
--- /dev/null
+++ b/source/includes/apiargs-function-with_transaction-param.yaml
@@ -0,0 +1,31 @@
+arg_name: param
+name: $session
+type: :php:`MongoDB\\Driver\\Session `
+description: |
+  A client session used to execute the transaction.
+interface: phpmethod
+operation: ~
+optional: false
+---
+arg_name: param
+name: $callback
+type: callback
+description: |
+  A callback that will be run inside the transaction. The callback must accept a
+  :php:`MongoDB\\Driver\\Session ` object as first
+  argument.
+interface: phpmethod
+operation: ~
+optional: false
+---
+arg_name: param
+name: $transactionOptions
+type: array
+description: |
+  Transaction options, which will be passed to
+  :php:`MongoDB\\Driver\\Session::startTransaction `.
+  See the extension documentation for a list of supported options.
+interface: phpmethod
+operation: ~
+optional: true
+...
diff --git a/source/reference.txt b/source/reference.txt
index e75363af..1d2c76db 100644
--- a/source/reference.txt
+++ b/source/reference.txt
@@ -15,4 +15,5 @@ Reference
    /reference/write-result-classes
    /reference/result-classes
    /reference/enumeration-classes
+   /reference/functions
    /reference/exception-classes
diff --git a/source/reference/function/with_transaction.txt b/source/reference/function/with_transaction.txt
new file mode 100644
index 00000000..f7b7b92d
--- /dev/null
+++ b/source/reference/function/with_transaction.txt
@@ -0,0 +1,79 @@
+===========================
+MongoDB\\with_transaction()
+===========================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+.. versionadded:: 1.5
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\with_transaction()
+
+   Execute a callback within a transaction using the given client session
+
+   .. code-block:: php
+
+      function with_transaction(MongoDB\Driver\Session $session, callable $callback, array $transactionOptions = []): void
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/function-with_transaction-param.rst
+
+Behavior
+--------
+
+This function is responsible for starting a transaction, invoking a callback,
+and committing a transaction. It also applies logic to retry this process after
+certain errors within a preset time limit. The callback is expected to execute
+one or more operations within the transactionby passing the callback's
+:php:`MongoDB\\Driver\\Session ` argument as an option to
+those operations; however, that is not enforced.
+
+.. note::
+
+  Applications are strongly encouraged to use an
+  `idempotent `_ callback, since it
+  may be invoked multiple times if retryable errors are encountered during
+  either callback execution or committing.
+
+Any exception thrown during execution of the callback will be caught and
+evaluated. If an exception has a ``TransientTransactionError`` error label, the
+transaction will be aborted, restarted, and the callback will be invoked again.
+For any other exception, the transaction will be aborted and the exception
+re-thrown to propagate the error to the caller of ``with_transaction()``.
+
+Following successful execution of the callback, the transaction will be
+committed. If an exception with an UnknownTransactionCommitResult error label is
+encountered, the commit will be retried. If an exception with a
+``TransientTransactionError`` error label is encountered, the transaction will
+be restarted and control will return to invoking the callback. Any other
+exception will be re-thrown to propagate the error to the caller of
+``with_transaction()``.
+
+When an error occurs during callback execution or committing, the process is
+only retried if fewer than 120 seconds have elapsed since ``with_transaction()``
+was first called. This time limit is not configurable. After this time, any
+exception that would normally result in a retry attempt will instead be
+re-thrown.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+See Also
+--------
+
+- :php:`MongoDB\\Driver\\Session::startTransaction `
+- :php:`MongoDB\\Driver\\Session::commitTransaction `
+- :manual:`Transactions: Drivers API ` documentation in the MongoDB manual
+- `Convenient API for Transactions `_ specification
diff --git a/source/reference/functions.txt b/source/reference/functions.txt
new file mode 100644
index 00000000..4ce49e3f
--- /dev/null
+++ b/source/reference/functions.txt
@@ -0,0 +1,16 @@
+=========
+Functions
+=========
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+.. toctree::
+   :titlesonly:
+
+   /reference/function/with_transaction

From 31f82c127463093a2b19b7168c38fd16393db872 Mon Sep 17 00:00:00 2001
From: Andreas Braun 
Date: Wed, 2 Oct 2019 09:08:45 +0200
Subject: [PATCH 189/321] PHPLIB-455: Add BSON class mapping to upgrade guide

---
 source/upgrade.txt | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/source/upgrade.txt b/source/upgrade.txt
index 5b0cb919..c5420fa1 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -235,3 +235,63 @@ been replaced with a general-purpose
 :phpmethod:`MongoDB\\Collection::bulkWrite()` method. Whereas the legacy driver
 only allowed bulk operations of the same type, the new method allows operations
 to be mixed (e.g. inserts, updates, and deletes).
+
+BSON class upgrade guide
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+When upgrading from the legacy driver, classes like :php:`MongoId `
+have to be replaced with classes in the ``MongoDB\\BSON`` namespace. The
+following table lists all legacy classes along with the class that replaces
+them. When typehinting against BSON values, use type interfaces instead of their
+implementations.
+
+.. list-table::
+   :header-rows: 1
+
+   * - Legacy class
+     - BSON type class
+     - BSON type interface
+
+   * - :php:`MongoId `
+     - :php:`MongoDB\\BSON\\ObjectId `
+     -
+
+   * - :php:`MongoCode `
+     - :php:`MongoDB\\BSON\\Javascript `
+     - :php:`MongoDB\\BSON\\JavascriptInterface `
+
+   * - :php:`MongoDate `
+     - :php:`MongoDB\\BSON\\UTCDateTime `
+     - :php:`MongoDB\\BSON\\UTCDateTimeInterface `
+
+   * - :php:`MongoRegex `
+     - :php:`MongoDB\\BSON\\Regex `
+     - :php:`MongoDB\\BSON\\RegexInterface `
+
+   * - :php:`MongoBinData `
+     - :php:`MongoDB\\BSON\\Binary `
+     - :php:`MongoDB\\BSON\\BinaryInterface `
+
+   * - :php:`MongoInt32 `
+     - Dropped without replacement.
+     -
+
+   * - :php:`MongoInt64 `
+     - :php:`MongoDB\\BSON\\Int64 `
+     -
+
+   * - :php:`MongoDBRef `
+     - Dropped without replacement.
+     -
+
+   * - :php:`MongoMinKey `
+     - :php:`MongoDB\\BSON\\MinKey `
+     - :php:`MongoDB\\BSON\\MinKeyInterface `
+
+   * - :php:`MongoMaxKey `
+     - :php:`MongoDB\\BSON\\MaxKey `
+     - :php:`MongoDB\\BSON\\MaxKeyInterface `
+
+   * - :php:`MongoTimestamp `
+     - :php:`MongoDB\\BSON\\Timestamp `
+     - :php:`MongoDB\\BSON\\TimestampInterface `

From 439848d92614dfd3cef2d2eb3860c094fb33085c Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 3 Oct 2019 11:57:13 -0400
Subject: [PATCH 190/321] PHPLIB-455: Footnotes for upgrade guide BSON table

This also re-orders the section to appear before the Collection API changes.
---
 source/upgrade.txt | 142 ++++++++++++++++++++++++++-------------------
 1 file changed, 82 insertions(+), 60 deletions(-)

diff --git a/source/upgrade.txt b/source/upgrade.txt
index c5420fa1..564834b4 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -24,6 +24,88 @@ implements the `mongo extension `_ API using this library
 and the new driver. While this adapter library is not officially supported by
 MongoDB, it does bear mentioning.
 
+BSON Type Classes
+-----------------
+
+When upgrading from the legacy driver,
+`type classes `_ such as
+:php:`MongoId ` must be replaced with classes in the
+`MongoDB\\BSON namespace `_. The
+new driver also introduces interfaces for its BSON types, which should be
+preferred if applications need to type hint against BSON values.
+
+The following table lists all legacy classes alongside the equivalent class in
+the new driver.
+
+.. list-table::
+   :header-rows: 1
+
+   * - Legacy class
+     - BSON type class
+     - BSON type interface
+
+   * - :php:`MongoId `
+     - :php:`MongoDB\\BSON\\ObjectId `
+     - :php:`MongoDB\\BSON\\ObjectIdInterface `
+
+   * - :php:`MongoCode `
+     - :php:`MongoDB\\BSON\\Javascript `
+     - :php:`MongoDB\\BSON\\JavascriptInterface `
+
+   * - :php:`MongoDate `
+     - :php:`MongoDB\\BSON\\UTCDateTime `
+     - :php:`MongoDB\\BSON\\UTCDateTimeInterface `
+
+   * - :php:`MongoRegex `
+     - :php:`MongoDB\\BSON\\Regex `
+     - :php:`MongoDB\\BSON\\RegexInterface `
+
+   * - :php:`MongoBinData `
+     - :php:`MongoDB\\BSON\\Binary `
+     - :php:`MongoDB\\BSON\\BinaryInterface `
+
+   * - :php:`MongoInt32 `
+     - Not implemented. [1]_
+     -
+
+   * - :php:`MongoInt64 `
+     - :php:`MongoDB\\BSON\\Int64 `
+     - Not implemented. [2]_
+
+   * - :php:`MongoDBRef `
+     - Not implemented. [3]_
+     -
+
+   * - :php:`MongoMinKey `
+     - :php:`MongoDB\\BSON\\MinKey `
+     - :php:`MongoDB\\BSON\\MinKeyInterface `
+
+   * - :php:`MongoMaxKey `
+     - :php:`MongoDB\\BSON\\MaxKey `
+     - :php:`MongoDB\\BSON\\MaxKeyInterface `
+
+   * - :php:`MongoTimestamp `
+     - :php:`MongoDB\\BSON\\Timestamp `
+     - :php:`MongoDB\\BSON\\TimestampInterface `
+
+.. [1] The new driver does not implement an equivalent class for
+   :php:`MongoInt32 `. When decoding BSON, 32-bit integers will
+   always be represented as a PHP integer. When encoding BSON, PHP integers will
+   encode as either a 32-bit or 64-bit integer depending on their value.
+
+.. [2] :php:`MongoDB\\BSON\\Int64 ` does not have an
+   interface defined. The new driver does not allow applications to instantiate
+   this type (i.e. its constructor is private) and it is only created during
+   BSON decoding when a 64-bit integer cannot be represented as a PHP integer on
+   a 32-bit platform.
+
+.. [3] The new driver does not implement an equivalent class for
+   :php:`MongoDBRef ` since
+   :manual:`DBRefs ` are merely a BSON document
+   with a particular structure and not a proper BSON type. The new driver also
+   does not provide any helpers for working with DBRef objects, since their use
+   is not encouraged.
+
 Collection API
 --------------
 
@@ -235,63 +317,3 @@ been replaced with a general-purpose
 :phpmethod:`MongoDB\\Collection::bulkWrite()` method. Whereas the legacy driver
 only allowed bulk operations of the same type, the new method allows operations
 to be mixed (e.g. inserts, updates, and deletes).
-
-BSON class upgrade guide
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-When upgrading from the legacy driver, classes like :php:`MongoId `
-have to be replaced with classes in the ``MongoDB\\BSON`` namespace. The
-following table lists all legacy classes along with the class that replaces
-them. When typehinting against BSON values, use type interfaces instead of their
-implementations.
-
-.. list-table::
-   :header-rows: 1
-
-   * - Legacy class
-     - BSON type class
-     - BSON type interface
-
-   * - :php:`MongoId `
-     - :php:`MongoDB\\BSON\\ObjectId `
-     -
-
-   * - :php:`MongoCode `
-     - :php:`MongoDB\\BSON\\Javascript `
-     - :php:`MongoDB\\BSON\\JavascriptInterface `
-
-   * - :php:`MongoDate `
-     - :php:`MongoDB\\BSON\\UTCDateTime `
-     - :php:`MongoDB\\BSON\\UTCDateTimeInterface `
-
-   * - :php:`MongoRegex `
-     - :php:`MongoDB\\BSON\\Regex `
-     - :php:`MongoDB\\BSON\\RegexInterface `
-
-   * - :php:`MongoBinData `
-     - :php:`MongoDB\\BSON\\Binary `
-     - :php:`MongoDB\\BSON\\BinaryInterface `
-
-   * - :php:`MongoInt32 `
-     - Dropped without replacement.
-     -
-
-   * - :php:`MongoInt64 `
-     - :php:`MongoDB\\BSON\\Int64 `
-     -
-
-   * - :php:`MongoDBRef `
-     - Dropped without replacement.
-     -
-
-   * - :php:`MongoMinKey `
-     - :php:`MongoDB\\BSON\\MinKey `
-     - :php:`MongoDB\\BSON\\MinKeyInterface `
-
-   * - :php:`MongoMaxKey `
-     - :php:`MongoDB\\BSON\\MaxKey `
-     - :php:`MongoDB\\BSON\\MaxKeyInterface `
-
-   * - :php:`MongoTimestamp `
-     - :php:`MongoDB\\BSON\\Timestamp `
-     - :php:`MongoDB\\BSON\\TimestampInterface `

From f67aae99e12bb635b0afaf58c1983683571a27eb Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 3 Oct 2019 12:06:25 -0400
Subject: [PATCH 191/321] Revise Collection API section in upgrade guide

Replaced DBRef section with references to BSON class table footnotes. Re-ordered sections in order of importance (group helper is least relevant). Removes RST syntax for save flowchart image, which did not appear to work properly and also isn't necessary.
---
 source/images/save-flowchart.png | Bin 47851 -> 0 bytes
 source/upgrade.txt               | 135 +++++++++++++++----------------
 2 files changed, 63 insertions(+), 72 deletions(-)
 delete mode 100644 source/images/save-flowchart.png

diff --git a/source/images/save-flowchart.png b/source/images/save-flowchart.png
deleted file mode 100644
index 45e7b764bd4a5635b3606be97df1cbecf225e5df..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 47851
zcmce-byS;O7bglui)(Rcfuf}pcPrka1&T|HySoIp;_jhnad$5zI20(s2@u?aJ2&+E
z-gjorn)&PAxml1r>&eM^_St94Z_9~LQIf^RAjd#JK){xlllp{!fHaJNfOvhkrRto+Je_czq0pK6c9pto~5fCs5pZ*aMGO|eFH_=?=6{XQu5V7(3@t%Et
zoeIB2<|3`-B57}HYij3$An9cK#l_U*rMsnz#Ys9YS+-RkU
zeGX`{h&US3Z&{RYp06Mub5#%M>}je>NlDSm#<&uvNUtlSuH#WwJ|Zn-t_<)5%TUqr
zKQaeOCc>DC2l|#@iu4rFOC{!zO7E8Fb_*Z@K*Qj9HI|t0@NlL#-v;_HhDIG*fQ2d>
zD2swO*6(TCOC#4=48_1%bQJbzr+Mc^fTBS7*zljV;dgb>(kfaal$DGv-eXgxq3d2W
zE>tlyrnhtzs(
zP%Vds1FHKcl@#Hv$~ksCO3w<8qWH*Hw6wGs!?X##6~W#_g%nllujrLaU55Ecx29Nv
z;Xj8HEf>Q9`ty>BJ8d%-P-P{T^T%T4?Fn%d4`}gUD%O);1e07#o5l&Vl}cgZ$YK(|
zhck>QMVj8cImlY2eUpLs{YgE+j18!nr3?@L$h_(|v;w_*74I!-Jf6Oy)mW=}$oTh(
zV-BqZ%sM<0A#uVLQcF^lW4$2KrhjNXxxDt>fZax6yzIF+
z3A4o+l5^*8U^#}?A>F$x7?%mXPy_AL0^m%OatgajQ&BpkR2ZDMH%u7s+L&X9nG!)W
zRoNOipT<1XV+jb?i{HeymR^im_TU;?b11;0JZFnW>v&(7sf^&@<1LyJO)cf5$90#J
zM=HxAu}V=geQ#>zF7zu9ZNcfP-~0!pjqcp*;BnODv2SAZarNfA?GG>vU00N?N0}=u
zKE(qY+=`B|AUBNzwfMuwuqQHXuJWCi48@}^iG6T&xg~K`2dSZ#G;h1U{NFW(kHO7A^7h&CJSlV)4Cs39fKGw
z<@51Ud)%b6HUrl?IL@X1whC%P7AXY5J-b_5EuZNGwkD6#`24z=X;Up)<@WPv5(3lw
zRO~&3mZtP0UcsQGyb75=8wIABbfDe{yRHj^hgJ8K%fAs&4<}{dTK!~6Xf-ovHSJf{
zmv684J7dvfA40!2fE}Ru5PX6fa{nI~C1*JhT>lPM3?~m?Z6z8e<=ved|HLR0Mu{(?
zk<(eqBaz^8;HPvMB=?$~-WUGBRuK}!IHywl%HP@QR=!E~TmcunKXOxl51bdg=EgzZ
zckM%9yvCp!&FEVChyfjEQZ(r!o7-$t?+Dq?qCp=P+I-QQs+#bVxY(Scc-4Q&=GKO9
zkdYi=O72_LN0rVBZ3(hmw4l!K90#!^#ww$B2>#jD2v
zf(yE|!}ne^PHPhb-Te5BV>$J=^k5Rw!%G>0Ec>GnVo-V{JDuKtWC`vi^hz>fb_lAGg%Y>29P8-3
z@3A?O7bH(Ue?0ygAfDq`bUZgT#uUZMk5^7rDb=3y%sjeoeaAYY($QZ>KgOiP%oo2o
z5Zd7Qq~1S**x~#fZM9}PTD;)!tNL!V?w@P;!)?KW0o6%SK#Jj|)@H?uC3E`4d~rwoA*u^q}yr$ydmggoZVnZ8w$!eIafu
zEA9a?Js&U$4@_gZbXoHN-9|^Sa!C|l
z2f_CcUPL?{BQ7##p4pD|8I=xWJC3iP6*jwvP_?VFuLOwpzP;pM`|%&4$ku)l&#LNj
zZZCgTL_*_6Avv*odhDrBd0#_Agm*Ns`@VRW>BlA5`A
zq<@{>Oi0o4hYF#sVhPIhdW$0FD#fOklh5Q#vv&;TR6&07`%>OIB8=r4TKF8Tm0Q~0
z{CHv1yj#>TFaG3V{@P)wQR)S`9qUl2JnQI#z2VAAtGQ!q!VlkmgduK)0*OZvqN-E+
zoIfY~Sz^ietUwS|XKa}e4ua9%{`_1KiMEsIN`c8e%A7&fJVT0?`z46XCwvx2Z44=`
z@%U7kClw@X$@NfX2r;zcuzVgZC$KT*Rk7jB%IrJZYeKKNvNB&&@Qb(5BnV)h=~q@`
zsJ1!(?#GeE$@Y@=rJ|;#Z&s_w?HZN6EdA542FA7ki^s7*NVZv__PI#F#`GlID=MRLc)f
z@Ae9%NghvQkztnOAxY)8&niHEzS>}q`BCTUhe)taEH6LYHniXg*1e&1Dv{QZD^w|D
z{$+cVeBihJ&GZ^D55*Gv$u{nrpZo-_o{&z0cYP)|W-(VfO0TZrpK+1K*I9|)H!6EE
zjJ1NCgin^n_4qYy0xQ2>N{;hU%QjHA{4>G*iv}>plNq{RT224(^2xmZXSV-)7oM3M
z{R82+pWqnqqY(7xYE&KAOC1YNf~wYw_^$CI<&CSu_bkEdmbWP+sCyc(o+JehxST>c
zGT|of2ON;;?8kgH;{EYIAl{L_^y1i_2KwMsjBN`J&^#OCAH+#l-e3rof2-u9@T2sV
z=jYwQ(r)wr0RUk|%Bz`--X(YmjH8DTq^?IUYunm?5MY9Fc>|Zc@Qbm8N4+vQBCS1)
zF3l2EnY!U*_(A$#E(y@2`7XEdU+E*I+})DHfpPG;{pT+WTTQxM#mRps0)*6nOEGAj
zzF>#4TD(9RJ}m706RUwe*dW@~L|A;u+i0NtkysMGL^vc{U*jep%k{3l_(B`WmhW-E
zlhoxWR#>U1V!EDiy>WX-siPT5M^VWLv(UeL7%v|`t;L{&69V^#PL32f##p}z&3}(x
z-Jf^UggP=jQ_|QPKM6D9AeAk(f@x}rt^C@V4`;L`emAUB#%}))SEW60p8Z6~x4N_J
z@c-#Q7W}}&44&ssmVkfnl=1O3UVPWEP9~zs4+20A2Ll;;9XRI`&(m+6aL+^8{tC%o
z;rqWQF8?oP{)-g;{{9Iv{C|4U0)+DhzvU{5LlddNA62}7qln_TuEDLY^l3*DFk@!Q
z8%hJi2l{Y_#mquCAoJ!G6}h{A;ip$Cmaf$LqzAU#uB>cCxSkGcz#7KT({ozB!GU48-frkDX;T9@|HIR$b?R1gZ8$+8
z>l9JF9n@jg9UMi;EKj2ozQs&G+35AWuyqy6L&s*x50h8RgG7~aBbu?eujmH9u^Vfd
zDbGEPeX>AKA>6GJ628aRG{x%q^7WJ*v|ceMWbkmf)?-0;>r41OF~;Il6*_
z$Dy^K@UsW*lBmZiuIxj>kv=_TJN2F~e663SpDfnjwce5I6yFMD9q#>@@Z`k4Iq1mc
zJ4n-wI)ab~G76w}9ldfzVEBgsPwr|^eg7(@?Af&agxzFd7k4}gU52AcuZrGSv5gGK
zyYw$(;D|=f0DG{|0X3SD3BW?dsKih%1%l*khq+_Xo|};QEPnydXP5rnhNrR1mg?DK
zvJTCMxod2R7AFI-0)nukJ3k3|8G>~ZfrH8$gc;Dc+(X3R!!_d
zR&4+DcHYU#UHR^5*6Y&FC#FBmYKJ+v%D)742$6DzRu3jwyPf3u97m+7bo!Z~lMOPQ
z&W-ff^FHa?)4Xqek#?QV`vs{B_jwX6U?Zg;ISJtr45Qhc(Q${hZ>MJc=YNMP_F5{~
zMp;u{f3q!Kh-z}`Q}CU?R9eGb4nN1K16NMy5d6bikLaSQ`)6Y-sDE|^BfL5;wo20%
z1geI
zVn+u&G_94Nh=5yb`eI2Z?I#j27^Zd_B7%udHq+A|fAn`0Wc~0T=Ni#zQ?yq5@7VPt
zzBr|=d{RwwmZq!`Y~1@KMv||+^^rFBHt$5ot@ci%CUuDaOYyZec0R`_N2Mdtn3PEsrBgVz`iy^@I~4$z%pD@5f3OtYTj
zS0?nWT)-K$+O2~Q^ZhG*$Hw&%iAGZ4P-6;69$|Ln!r_o
zz4Ole|K@6*aJay$miL=niOSCXBN6<1RtSJ2C^eG2s46pDT68s@9Qj|J$)XS{cBYTX
zZB)18N#6^zQ~AksUuWcR58X2v7X{l1s_4nB`;b`*KP#
zQhOaev#Pm4mdO9GG<>~CW+csyw11eWiYp$_aTm?vgwN(z`}}qWr{{}dwZW0@ztig7
z#OdKf$z?rO2^V3jQX1<7H_he%f>{0NCvCA){bxhhKXL0RZ9(~i9;G+HiOqJ$I2!aM
zS6{pY8htp43~#*lPVayiPp0t6n3I(Ca2A=u#gACD5Sj@rqiy+3B54o()#zRQ5LVux
zBm3XgpWueBzlR$E^dXuLr>coes(h*%gME`qtylY|cos#%6Zg3G{vNdPoCa&D4m9m3Yx8$v7X$5o_Hs>e}X
zHvT;Drc?Q|Y5cpc@h}rUoUP&J6MgAkzr+&o!;exYve_oVNDbq#6~&1DEzbd+%-p=E
zZGem5KnS;-goFs}Cg;0)ko@9B;F!2UOsD6KAWkLOv(D$>EpN4dW$Tnj3Z&k*LoRFa
zUDD-on@3|E<5<3`lb*69c@A+F_unnJYs7a#6GIv+QnwdMmkDw!q1B8VrAam$9(m<4
z*{B8F!Y6(btP>k8UJ&U^In%^%qdJ+DEP7_qu^f*-SIK32J{(QK8rU`BS!eIU>^HVI
zzo(Czd_C2&zGn#vzccBmiUsQYnY}G|ADzQ65+UqN>W}xo9T3Nzk@|C
zXQ^Lz#iU*3#S$4~egQQ5*%k`V%|J((Efla({-)#RQweZNe{N
zAEavxkV;~vcsEl&Qw|CD#gM(so|QTzLV_Y>0QJ^`#80A>9TI3ur*RQ0{QW>#fQedmF87}
z5sFpAV@8IEpQ<#y=8cnu?wZ?j7}+`HHce`!uVvWZO-sG3Dh`&qvd6pPEbE;
za!*FD&#kXj7qnv}b0D+&P877?0oHV2!Y6~CjMmnd1dLCQPug@%M7VCjRL8$TUt*A@p
zN*X-$z>%Y)q$fNpK~18a3MqtCE#NL
zsrT`YBfCk{Ugm%@tpQJ+msyp?I-p`}ym|}kshhf|Jp4WQXZNBg@I-9jh(~kX
z$vs;%8x#b>OL~NWc5;lO94(BSgR^>inP%3F;d$jw;Eb`#zpl1R}MLy1oTu@o1c~T2Qll)^31~h^RhJU3`3Av!Bft+hqrjG~h2`0vWx`~8b*?Bv1
z+^5#lm2Z!NHgZzc43joc;V`eeD_}3+c8p`lH@)|;32ab0#-B-OV3MvQF*vn*e)EFz
zTpb<0L8%;|5J&LmqnU)Q5b1t=K&~5(G7n;!NtE{2ifFZX0AW)0SePTqdG6P5^4w&d
z0!Qp|tN}4JRqes0?K+DaX{-*?D7ms}x=vN+^SG
zQ={#=1MH9b6TNsq1q7chm}hW-;_0Cg2*1kTbkA#sCZ_x*?GnRsKla1W%$CT6ZHY>X
z<=;z9j&UOzS=A}3x0@p17a|3`-Z9}Yb4e5T`f3~{|JpDfrJh_U{s#dW!ms||+T+1n
zxk%fHbLlmVW!b@2dxzoe4NpH2o=yN`^byU-R*)bmJfY(Eq*7HUC$!quzMwSGZkZL=
zT*b{?K7V>YXV4s}Gy5@u3L^ir_UG+JT;9jrASon5{}oK6%mZ5sxgMp+tWlf&-s}?%qN~4z
zxU~`HyIxY~UPxLS6Qu;%O)p()FR-b*raF9J4qi4Ics!&1P3AF5TK7}OdzTU_oO6xV
zv;zpEFy2IJn~thvNucfA93p9(XU?>@ezOJo4b+!nXxGg0
zXHS)n^D*PHPdJM+8VLumuPir!{nF<^L@yoAhZn%}kD}Ns6vhe|@4%#7Jv!du-S?yH
z+SX#jJ`jv&<`eB!%kYqKOgVN5@0zB(!627i1>IvqIDZM<=YHX(ZG|F|84};-wCp0O
zu@zaE_wz4(dz1DP2bv}-W8klXY-lroP$-k^2eusu>38aWbP7C;1ERp88@I`t8#r{ZA6oH)35Ts%Hb5fib;H?1{1Ji@w0
z*&D{~9!!(*2cr6ZHW_`I1;6m~+Avf9n5Q&*o2%;-6f(7yX&{xvW=(n607~0CvABgI
z-XLrsh#jxkqZ$Iqa>ckn%@4OoBWPLTQ|0W+D;&lnvY@nOaaHRBI2uxPV(HM%{!cGJ*FJxX
zkf5_}$DNDst#6}WO*qXmnPt`!sKeE@<~q^3t(zcqex_wyp?Ec#`#$|Kr;6l;ApOw|
zO$NaoZ`-?v+&Bf{zPzF9M+nK^i0ry82St!zTiAT}C^Q>&?7V$yO}w;$cO2Q&Sb;GL
zYKox=NW>we>0Fz+iC4Ua(a$h&TS>o6+Qf7jBW|j5_$;drhlbKdws@5*9zQ>#7{oFO
z1l2~r$f2^qL=Gh>Oa67h#ekG}y%WT_uQQo7b&FQJnvD-H&Kbq91@&f!JJPG>-*;?L
z8q}DMn0DY;yM!0YgsHwEorub(0PspkC@(}s?WFc3^qD^_AkF&5tcG#+UXVR&iWJV7
z>w3?)BL9qvq)~0^0qxEpsMk~j9Y3Bm@on#m7V&iR{2Pb+;a#%O?6YU}U3gIQBCd1JGJgu~CnRPuTl5t7;u(YkBx9m{N>c3#Ci
z2qCQYc?!K!i?7PU_(nnNB4`Vhrwn#IbZ}w??Z{B6Yf#&y9-6Mi5
z0M*0U8sN9hEk~MI10~9k-LIQoc}1K-Ua@{aCFrp5-a-GBuW+N^7qa^o?(_x6uAq&F
zc~WOrYQww+f3zPq6-&nunrEp-VwgmHAow382k30TrvF0A+7S5#lBv^%DBn>JuYx^S
zv?U+A@%(6+XVWyA562Hy=Hj=@q2vJiaNHx(o=Nk{E_&BAZ-8bI@4_$G!8O7xM-%DP
zLPz|$x02Frl@3oMuRVk}({gl%t7BAG@B?1_a6CK>ch}P0-a~rIdAxmu8a;*u8jj{L
z_KzA7*GJyY*bAzix@M}(eXHK;dScjWcu}j>vMeV`<6*wZjw5WTT9DO@qpYLx^BX|C
zuAldr%I!t34NxR=s_Se6Dzrq@YDEVNt7Py40N>I!uMrATp@}2+%rxL&&H=pUUTj
zeZUg?${oiA2GS9&#w9)Xm
zxDc?1JM6-9&zyn$g9%6D5&mc9QKyI>0}{Fc{%YO4*0!M>W@zu0NeOZGQONPOiEq>O
z8pN547k%b0Ur!R+(bIqBK^f`@a`ciDH2^ke$8xmU8@G;9N~okA(Ew9}hQGxVd846J
z>3GXq;eT3TlDM8(8KThw>qGQD%6x?aOy&U^BPX{top(enH_|7>f<<)5e={Wh#r_w_
z)P(1dAn+30j0J23F#ErD0B@mMA6&NZ(o;-fLCKYSFfg~dT~~-ZKHqo#%$mI)004UV
zmDg~tL)KiWi$||e=0FEG%cPsjfTSrjp*WATx0Hukc^|qY_h4N)`Yq>k({DVz(8GAK
zOdj3GjVX7K!|tUTVvuSN5$zuUbXp>g=!^jBfrtZ?cZbGO$==yGRbAf8*Kgc=DI3RI
z0usH^2t8vCS0aTD
z&CqZbkxU%>_S3LSo_;%Qd5b=_^-!;WaZyHd%!mxSkr*Z?@Q|kSZ65l51FjI7|XXIVq=EP=liFWL?
zcUj-pCra5mIZI%CU!qx1-)onPWy3VzVPL~;kfXi!XB)`(eBWnz^L^WN80Iij$=Q`&k*
zyg{qW*TD;>kuhm0+@d_hxNzQLRDReLSVin_68oT@o-UP~JvM#NSaa4Ay03jE2ulBu
zZXKppf8&v$%=2Yusw%;a!GULK3(1S%@-#n~L|djMle)ko8vwoBfTn7&JHnfeSlkyS
zuNfo}!Yc(s1>MC^y5a2x1a0>mKQSuv@1k+>R8P2+`moj#m$x7W?K?P~4l^Yn8e~Mw7D)XVMt6>JkRpZJ(5G1Eo18t|A#+Aemm~@qRtU-ZUqsh=a;0HI_r+T
zv7M^dxe*{s~E2s_w41(ZYr~u9V)!Mw~}Z;
z7rr16SpB|?8PH27m2wlv73R&+c9gb%+H&L<*o!;mA?}W$ksz9j1-s6z$2TESd>GK?b}a3B`or+AwmVEzMQXY9^D;Imtyu;P1fxAHKI=
zaLT`}oCS0SljKM?;XZm_-{^?aq=6!qdS?af88jBM?ynj)@~iq1KZQ+3)2udbA^BpN
z(A%#BEqrvgvGz4$ML1l!cX>2&0h8^vTx#C)WG&;3bM-52`zsEl)>+;gP61*U+cu+_&mhceMo>a^qJ{$-tgHBXTQ$>5_TZT7JL_~
z1(kUAODtP)AcXC4FD=uci7&O`9$(nHClKgjUg-%%Kc)2L#*j^mz2Ee#Hk8cyQo4F?
zx0KQX3Qp^BXV0f;JH7Amp;)^CkkhyZUX74zG=XeCg!W}I_deYK&dj<8nl>IRY9``Y?x7K$Z!$VG1hGYad+|PadynYLanQtu$8U-<{
zo63V-5QliQ`y!TNtIg$+N*e`kJ!gu)?jne0#OTGJ>!_r~E}tHa@ESO*Z;G9VmnL#V
zBZy(&ln?NV!J)pBkFJ{A7;6Uc@}tGPD)FZskuDkpZ%v~0=&9I}iF5ppigAZj>c^f(s^6ZsoR9rBJdzY`5h8e(B`}#ucHj*>_p_JbM#x-d
z9Zu1v8giU6GfM5cRvt;^jATGgeu`ca4(A(7yo5(hto+C3^r}#Z7x-BD_M$J=C(8`hQp&kn=e3_3JK3+*=!V(4X7q=sPjF+IMGD09MZ2pMuXfc+Bol2iib_pNG_6xy*mFHTUAqlm(7wt#CDL{yTrrt*R;)D`mUFB1
zeE`fhwfBe6RHS#C?t*F3fX__%zTU4EFoc<80-<7>#+Q?R&5ItWyI>{9B?Q^fWlsfpfUzg_;Y
zskdHBRcifYM|B5f>V>~OQfOImG;{HyHuQS#HQsfbHv)zC_SP6LyOh=+4oCM^m5Wib
z8kYC>xHdU&?LST(UhzrRax@v~LE)}!%O#6bj`$k0sL7ic?XA~X$5y271*RoymCN}p
zNTuuO-6oEuZB`}eT_?QSWccHqKtW%kTKc7mK8~$N4jGjWJi#gA2TUwz-W!y&QIPvX
zJFj@Nj$5pn_dt*1bBn^WCH?aQ4(XLm}=7i;L3r@p1-adWtm74uF#>j%Q#l3Bi@
zT>4FHuS1Nmh8t|+nslN0r}O^Zg8BI78N2WGl@eb_<-FY8_p%5G1Q<6!yvV&KYkNhT
zkg5M*o}&C9j0a@AvyY{FjQUURSSRF4_f<=-BTC0dxpf3P3X!xJHBmK}j1v(#A
z8&cRQJ*?{wVy+F8E12Xy?Tjlre2L)dWdC9(kxAWAc#tup)_w!|tNWsC=MVc9$6p;%
zL?Z6FE-1Gx8)8AvS?j|S+m60G?xr3W%Bq!Yyd=k7bnR&+ZI&#L7K-tO@PS?;wvN9A0(mzdw
zhEVP5b^x~yZJm6f?=?GQCL=PRP?kAP6JzO_kc*%0y#>4-MQjX}Wevj@D2jP_zo0f8
zZJq*YHGQ=zO=2eEwelV`k-qWG+-z%WK#o}!Sao=}Fr_0_$f+x~W8RUI0>FENsco%n
zz$;WeC4ioFsa82?V&}Ie#A6AVO7=0ken0;~V4<|8VXn^No!`-$z0(etxq3DbQ9U?E
z@W?^)I4r5nk$IHn(SRag-SVixH{h&*vAkhV0}KDU1JD>$)pF_n+D;Sj0St(s%RK4>
zs-lM7@}saS6!-3R8GPWe*J53BI|F5^z6hfWS@~gaDZHI*6X1P#uP;zjEaa!mOnJzk
z_hG!Km*U98clge)zlKzneC6f&*=TbwpgU2IVh?v?WHm>@7MzGUJa$@;QquIk6UmtFX
zUJ1W;2(v48NY*xwKAl1{ojn=EnW9IhZGSqn1kwG%kZsqH(f&IJK&Wo__RrTVafx$3R~~z
zSH-N*Hez`^*JU$=IsKK<7VWYQ6|bIr_%M6WYwrb8HL5gZAG->XAIb3kIL!>e1Ep=Wy5c8CWa5S15JhjK>C?s3EIb9ln)WLBs(0VQKGfz{srq3u6?2~?WwWoDDRHr?4
zRX;BNwMk4ytH(8|3x-Jh!4FiDCgC&bt<^aGLBN-5`OG5nGmT{Ykn<1kOMU(<#z9Sw
zx2{L~USron5dP&qWdg)gLEA%9Osad@KFe}$Y+2&)7!=Qgdi92H`88W1hO~7|k$Qgo
zmG2ju>lLcTab~||uQwjmZ2f*-p}z-4lR6IZ-{Nw00tC7+W{-6$R!s2YArbKd9
zjvrM3-KQ?u50x1;T`LOZnbXD)db%3kKI?Y5npR^u{zV++PrWu!-$`p^_}<`sw&2;Y
z_Xr;NWazNzz;1R)b!x5RcY=CRkrmwQnlU*e{9(c>QC@T+P+Iw6OL;UALO41BME&&r
zy6#U)9U2bwmD!vYPC1#xjx|WFO4;3^pvE0W+P)Le=)L2NJy*Bw8pV~&IfGMdaSo#g
zTK$|XHXOa!pMIRiF_hC~29yu~(XJ;wfA>8emsIn&y0L-*;Kja%xbzB&Q4oh&2uD#E
z2ZI!=F1*i}=leFYs%j0uexi!Z?-QrxD8+lq1==6?@=
zKv9%vwm*8T3b@=Jhm4d|Zkz^KX3dI3WuKaTYEWE>$3`Vlr1nk1;L91ixf?yYbwFYK
zo%@*MJZ5-rz_CTyuhaYx;QeFrh93b_mf>W09(H#nZ)!&lqx+u^i3Hd$j_(@|mp?eq
zao4d=&x^T_jSICJBfP?gO!|Vk(yPihd#PX1Qyt{+jHQgM%%*>|=W3!Cb6h7U=Y5RCWkzfEtf5&pD8
zU)nd2`uDmD?m3OLy3?#2EF99mZhUbp@DcdjrSVhy7}IB`TTU|*~TMcKDsa?=bC#^P!vbi)>8fc_J;^T_TRgO
zJ64?!p~>TrNcMc;>G|`KRvqJ+ywP&fQ&TX%*cglaCmRxsBu`fBNB?Ob4yGJ<=CbB4
zM39@RCS8&OZ4GB`6mEi(TnmTW(e5cB6RC8WCyynKwfhamEwBk11pbp=8@TE#MW8;e
zZWcdFo$a^H?CEi3uQ6BU)>!y;GMw?9KL}^?d0`SHXK@)Cvf5qt2C`TYuJKVLM5Jrry5<^{aBZ-Y{`
zX5*s#Q8wvgFMlG;`x!)uq{Rz~@p5_G{L)v-UatOBc=NT}bJh
zLAN5f0o8zKM$x@fxO1&C#f_Yi55`|4J>r-j2bAYxspPJ)-_^dDBt$~%VlF0M#aNOr
z1k2WKvi^IvMs$nYot-&KET21`*xbasw%gV9+bWAgk^@uwWwQ=c#*gk0{D5d>;s-KuIE6$>U~CIazsD!GwpcWY^fxj
zL71)LoIsTY{Gdxu{9N$?j!;Cy+XSW7v4vMdkS6jgEDOx6Yki{&M8nOA`{{_@9eTS<
z*L{Op=9x3hIFi?tl|j9poC~(t$@US(2L&_;j0pcN!@)EfFL}wYh)-#}q6o$KRuuMm
zg_(JnRLnj!#)Qo)r1f9t5Z}tOEZyuqtYKja1L{pG422M#LQ&sVC<&$jXDj4AK9v%x
zeig(?9i1onpX2>=l!o2}=NQ}PTeFQ64uYC%r|ih>o-Xos*Goq`>BF^e>aY)rpBxRw
zu)wQ!Etw0F@;=~oc{c_1@_U(GU&@Dvw*)ws^s6cWH+Esg01UMq?hQ#!0y;$g;{$rL
zdNJ?$9rL_8l-8^@2Qx9QJ(qdBeP_S$@;r3=YX$iDxErV;FyoJ!J1
z%Ef!yRnv{QqVeqVE#os%&1!g$8$56~BntS5G~>8y^iE8{c3@&uM4;tX6|AtVpt4zq
z@@>X9>gUGTp;3X#`Rqr|aU5CNv1)Af7T2G1aOHj!fT(SkcBkjn2M5j>C<~IGw;g+-
z+UtC;>mrq7#$t$upHJi0i|`OZ86!6zoSGrfha&hTk{#ZUK}PlX`6nNiYugApV(6{v
z#oTdsiFHBip`%0aCVU?(ADbvI)$u|1)R1~(KH2>(*-vC^<*lD(*aZkVzYBAcOu
zFj<88k+G;U{bO`&&-F7~<;Ag|+S#TOD_}h9AP1CwwE`bbBUq6Mghcs{a%eOCykzl0
zcHl0MiEd6_B@GvSk<0b~(iX$hu5Oe=`(Z5CCO_nHeA!o4R^zQ6T4_4oS88eA%O5b5121E4^B4$qjI4)6gkAVx<7&A#3Oy{;U+$A#
z@D%3t(**;!k$N7Fv6fF+@5-__$Hk`~D%
zt*xS-m_@O*j9G7!9dBXSC=SKy9lMw1D%TaHhA)}rJvm3c|JY9p)aS9|Y;E`;`)cW(
zPOuq|$QzH4fYQwEQbJ}tmU@qy=LuWedAJ0{WEbTRq&xoQbL5!?-O`jrvqxIfLhTx?;)nW4@W*IZe%I=7rOu#+w{luln81hh@p{_M$q
zk0pBuH-sJ3ZW`rz+Dc*ylm*Je&mh@VJ`Oldkniy~6)%#eu&(#s1bmJVMTx4gMr!p}2{P>7V
z#_ho_<0JmbED_ijoMCzt^ZE)rxXy;xztd46Cwhwadav^)^^#TJo~R!T0G%n(;QQ=7
z^1H9`5-7Qhax0!U63z;iFn@%Q$xiG-R*p{{yxjSsn%*U6wxf$L^%vEdNeO}dZeE80
zGW<<1oxIG&_Wk-TuFg0kHI&V6&+@Ybegm(O*lbc#w!EYav
znyX>Ra&%VW|MUW+i2iKJ=ZU}sWVH93a^d`Olh>b1_wUz;Z@KqUsW^8kb>}bXJE`^i
zO^rrf^QMeS>?}>9W|z=X$SOYJx_JDUf;AmBVE6O0-_JX>eAqZm|BikK?Aq^9sr+={
z`Ne3?=$x_dRb^%(ZE_QV`yKDvPvA@C01a+WOGbpk_nm9ot?X&wFQn3C+i(#e|Vl
z#J73FMPH#L?n~;qR_cj9bC>SfS7#+#ir~?Q3|Mn9bDXu&IlzwbE0oS9Gusa}1O-Wu
zu;oZYP_ZTPr|DGf2G1Rg$i8Lp0p;~9_k%6Tb_>TF0+C
zqt;zCjJ1RSpCUA#(vzleuPd=7{E}a0sj|cI3b=VT#>d}zZTrR>qeN}H{0nz{lhI$fN&1l*O6CsSxq#ui6G=^Yfjb?Yz6uOKwI;7|NYP#RniBmVP
zL0c8?M|yk|Y(xUt2w7N@0asXjzTOC)7!?dR-F1|ZyBD6Awv6_xrs+j{!W(pv>JRJ@
z<{9{%ZuBt5dDZHDDM8=U_aJVzWy6mxZNNS#i~O(9FIm?WGy#2Eu;0gLbjuL%1$W_Y
z*Ry2=_*znf6Cd-wCh|G(SNV}7yf~^V{FEqhCEOGIc*D`p*A+6FBYuu^-`rt-Whw$r
z_QBnhY4c<1OKPOSZ^*|2=?;2KswY(?heu~SyiV1?o9XF!?Y{cq>fWdjQJSFoHv8A%
zz>Qd*z^N@`^X|LAGMs#eLiXoOo#>h;Y;bW&=^JnQllh8vCJ{xwC*GaBY-W!q_{%-J!8)||ll+uM;(oNjo|@}V0?>cBVA&2TvphIX}+Et;pZ2m5p6ZHh*6
zUlza7y(aeid|?D&A=bef*T?P`G^3yJ`KW2o#VxL!cjLRV+(#d}CiW@#u{s>-mrl+c
zpnVh_9h|P^DEkW}Q;L|Pjj%2zvUt||wfoTE3Tkv8+x9~MYn;uyh9!~$5TBsok4CkP
z06(%OTcAp;F$LO+Vp-ruRG!?ld_9eb5cHz?cl+I)8GwLJ_iH18x?Ep6vSekUie}nHFpn
zAt680*yq}D{du86N0r5c-3>E*6Lpn)IMqBnPSV7P2OrLKwc(X+A-|~6la&$oge$cJ
zj?R}S$cF_Fg!Yar{hPl+#X@1kzu1i^F0nlLrYz}6u(n6id-Y*0!$!_BYSsHT^Rek^
zj$UnN{k;6AVet-mbRb>Qw#Qd25WYYVyRE4kq(1_iD#0KFtvvt#VeT!1;_A9^K_r9_
z9Fm~HA-D%<9D-|bx8M#3bGgVVHw`%%V
zSIaqj?Y58K;)qZJv!!G
zwvMJ4Is2X=`j0$bO5rFte|HEhQnlfKX1)sF$sKOETYP!Hb!wZc>vtd4+FO}5{I*=V
ze*JUjtWPjo8)*f*;KV?TMqiA>4f#v8G==%5j6Rk}L4^ai%m&2*QqS&KGh>)+u5_do
zK*T^lw!+#Rw?oLh4y0xxO5C*wzNguWXm>JA9o(SBr=rs^74h!1B}sT~3QT#py-?FW
z>x)X=FDAtb%os_}xhIXW~Vle+MX_|u2XwOjoU4`*}o(jlcEB7!n<6=v-;
zx$uG#d}O@7$MSiwWC>rF!xgU7@{xO+Irgcvjh`3z5bqs76ej3w;MyiSQs|
zI$HJJmOOA$4GAJ%wlt#*CCDhN2ETcM-Js7|$q44aGc#89dq^-{9%_uHoZ~QmpWbUt
zDjN-9FNeJQgyG!1Ltqttt>tG@_2)pL!dr$ypCRH#k$Cj8PSLk0x8q4_IO65{5Nei3
z(aqMIb_MljPt3A_uRwjn4XFfZmZQcSo}yL|^$t9~b8Bm)Xj7~D@ZO88V|oHp`FfJU
zJow7lt(UV{&?1oUT%Dd95}IFr|47qhowPts$`*8ki^m(q6l>p?uA5j1`26X%Trj3@`PDI5U9>Z4qSWIj_y@i}ui$bnL->O(mTm>H3
z+;S26{$T22&%dU01?&0CD2^scDlVv-T?&MaBskx4E)qXarF^cajm?Bb0dBD{(V}vV
z+pg)|X#G-e{4VJin4(yys6bVW`O|&jA33jM*-sb^;j?-l#IK*L=5`(3N+;UmM~#pK
z&Bl}ZCjH`rBR%&lr+B{-4Pz-BwrVbWNvx@PmlKtYV}RF|6+s|Qkk#YKP{F9tyLA;?
zXI#~HmrYy1;IjD0+A8egWe_p{R$njPvB|(UQ9rD4+_H0X=r(ZMb>B-#5He2?
zG~!5;ON%&{9)hoU(@d)Q5ieXw{0Gw*=h17zQuuvheSM(~AB9KbWEqE#MM-BkX>mI-
z`l*ly`82+jprW@z+kG9jD0+GU%##u(!~v>en>5+crqN5PDJ^Bu38o{P$0yOm(24Lj
zM^S@k8y~5-Z)^7qW5%9soS$*_604JO7q(YINOsR)kC3~|@2}x(?ymMz!dAGqKPr)(
zP#8o4o-lnxSN-ktRF3USbJ(l)hoGTHmMkd`cW3Hn>&~yc%@oNLzwP|knKV;u?T?3e
z8**rf!ox+D5%o;D;H_l5F*su(?W>%)H0Ro$c&Jv!<}jwOpB@Ut#+8uHAZ{oeVMy+DS?HNHo?1
z3wY%CalKkO`>^pce8*BrHDUxN8wMfwInM=~5}S~T;m`yPww3=#qt^d%zeJT2S~eT_
zrtzW-%dz7?+)B($Yn0mR-AVt{c)Nwm7;Rt2mOO~)fl7y_RqWhF%L%I)J@=2_z=sE%
z#q*9g(R;PpO3x@7YB^ar^)H#aNxg6n=RchhD02X#oHfl)*771
z4>b@ZYCs4(>u>AKZ@61`X=wP5IVSnqhRR4~^p5d`+B`^OAKu5qMrQIAXLmQk6cS?(
zGL#|*Yz5cO%0Bh((dFiNb=`}>jEwYV^j^k8Lt#iUF>yhB$VVerc;`CK7^T0%y4+#6
z*LX|83~S7hwxgMj%b}Qu?N=wJx)}5guQTgjFbLLDPI`|KTSS=3=13%dc}3gy_Gi_}
z7YTy8rkMSGoih@nHvZ?pB6p_i@=h9mPb-B?JE~bWpbnjUBUTZdZ1((bfR{+pvL$Pv
zbj3XUxH^#&Zr>UZ_<`hE){JrAZ%!kehimS2S%ze4d+*H*I0_%{H$xElyXTUU`b89rmdmG@;<2Y{*isy|I8_13F+
zsFX|M!^s-70K2+GO!+GNAlFrBTz#k50VHL_I3M?0n{58%)TS!*^3R9P5MDQd4-srS
z=WF%YO_dz*QNBkh2MjZ4$SM;2>z78g1^G!
z>dl^M5GZsgGpDpPMDC`$U{~zgZVQ|mAcUo_P94^|EmIfWv=6~;(p9Hy{&u_{^$HRVtYusx8oHlP)U=>!9~5y>&&v)n%s49w4l_mRZpDS
zaZ-0g<8?1=7zb-a-uvK)SnP1*burSG_!n*CdP`rzP>)Ym-yvRaeevrKxS-f}5V7$o
zpwl#Bv=vOfO1x~Uk*5kNxc%wc;RK*=L9RZn(Ag{h!uxxOfsags#lv=N2_YzWu1nEj
z+YnCSkyU2KJD!UYui){=$tA4a6H)6NX7~w1peOl@yW=KEcsgOsp)Yn9QfS3)@~Zgj
z7WLuWMq1c$G|Sbymuh#(Dts$Ve}+kt`9rVo#~dy!%mH+Qs6z}NI5VF0XyG5)#B%NU
z$7NY;^U#(mZQp-v1KDK7zJ7OzrQ#w?r2FoI%KYMWCpaVDFtFU>ar*m^&&c5>)+n)z
zkU*Si1Ari5sB<5BBx0T0S+N^d7_(kRHc$S(Z!35mv}uvryV99)bW0f3l-F4w%7Qd>
z(sf82NvSAK$j_FtxR5dG$WdV^Y)*06B9ljh$W!YGw^B{7IZ7LJzjVxFI~tsTju>fbwVcd=GccmT%zX@Ham!D
zJx`j>721isr2Kx{1pxnmd2dhbkNdQMf+e#>Fbs@t2F>88{_$*-BZ}S-#KpEot+cul
zp1>JRhjN1yWN+2H6nXBX2~XS
z1P!|i>ynlWBqP(4k84P=RIN~`_u9U8J@Slu8kmp#
z!Q;)*cWyvpa)imDb!`U}UtUZil`}ANvIx5R$V?N8?2Y;GLk=X&&S?i5HUu~zvOCMN
ziI$XO1}}|g{M@@Ue}{}28#yI04iq_Taln12dDGxF@0HInj;x;#1SSoS@o80%qsHj>
zpn4N5!7=^~=h+$Mr#2?^KzBmty!pMG&dQSHfKtMaYTFTuhZzf*DTQHdmR5-%=#cmI
zSJ>RXqnqBYWK)alZ@a^{3+S1BpJp-hf>%^B>Vto{O@ta<$_gnKju`bDc(I`rEN;l$
zJZpnvQEIE{Otxnsk0PZ8E5aRa5Vg_tSKkNp<
z!9>kS!G?ZpKKHdWNC)$$IqyL@#P2@&a1SlG10OkrEpli9879NzeJ+@T*({U&(g1ec
zT>)D6cBP)b&K@IEHbz}N|IF4KU@Z+~ccK~ShMqTV#N~WTgZ?@GRF$rdHA|*#oa0B5
zU@FkxNp4K%v3FU03qC}D>_i-*dE6x=g)H5hxIp#O(2qiZxUjNk4euwOjonq(t`$9}
zUjJxOixx)-{JFWpd$kq#LC4W!
zmIMFDsW*wV`b?ie9SuV$3j8hYQOQLNQ9>jb(8nzvUAp+!ftzjv<}cSc7PQwF61IEV
zKMfsvg-Mr6It{f+I9>W8g1}}z#8Z)Tzs%`A+M(6(jcv?uMZ?M2oxbnAGL>_c%=~!a
z-IiI{!ZddbMZnLDyQuW&*B}$mH%gv|NLe;t4)B(?of30}cel9jZX3L1fGQcnV8Eah@YFHE}8m8BbTntExDNK{&`r=?hS5d6q0J>ls+7bOrz9&rG
z-i%GG*ZjiaV65n{1XJViF)$D19P5ua5gE`TDXKnRTy3IE^KAeA{7#!;k*tWV
zS%IS#I}cR1pHw1r;bQiEEmNDYme-Pz@JiuV*tyj)+<
zIRbSicH6mXi9fhQbN2+zt!|Ct3R|(tE3g}y-W|pb#=RtP8Q)=6cM^K%a>G-3hvHQx
zU9WuVU?pn~a4B%Xd@1iX42`ttm`kvoGUcF~3s-m2AdTp_xou7Lmo-hzkdCto><304
z7%qaWT~=38GWU{a{r-q2sL=>clQLpfKv>qacA=xe7}4)KR1{od8_QtWtZy7H0X#LD
zGjZvD>hT84IV%C6u|{4SU})x(RW@*XPUIUm#|JMceWkM%`m|Fr0a_2NBjF0lQjX1fQ$;jNu
zFYlW6#3kDWP+XKZh@uIdhS1Mf0?U}Y<1XwS_GcTf_|YR~->b`hs=Yd^puMJR@G)yQosdQ1%ep1oxe1``5RIv!#Xu8;K)!Q1Y)&^s-RPLRBi+
zlAG@sxH^&4G-oBS#t*7-_P$%odk>g9k+U7KW-5d+8+SZ~0twzpp+K|S^zdj?xS?I{
zv@Eb7Z$xI91yx_tgxNDo>2d;NF4}OS-$Ol>p@vnM@9h1&mTpgI2j5G5qzBKhQ>Ne9
z9~;IPpQZ`>x~0c2FNo^Iik4*_f>Y0E&wiGG
zmcLQ26)I`x7Q2A<&Y(S(hWRA8v)%|ISJ%CbFB1L3$>I?@FC)f0?=MmsvT*sV_cD#m
ztPG(+BoUVLS_TIXl*l}ZtQU(o8Df&x^Fas4`R7k*S+6GmVwwod;}GcQ073mBc#M9@
z-z3R4fZhYJQET5Y($Jf575^~wCNaIFM)sPYOD{Kes?OKm8($Kz$i#_mt9AxcU-$?C
z$+ld_f|eX%aQlg^R^4ji4hMqlQQmwLROM%!Y*9bD>ChGZzRoY?a?d8mg64c-vCYt-
zlk3+8O#2V_6~oKV;`P5$8sPYK6m;0VN;P2!8uxd_6;dJdVBULDB%yn~^8

cx~}OZhVr}^x~PEF)6jk+ zZt>C)rp&^?Fn9ks&(JRFY!m z`XTiuQOkVTyaTVD5k-!a)6@xFP}h*~<%@x{zsQE2?EQv!Q>K752H_jWybgV#nJ^9K z)`OqR5f8MdWQ0yJG&c*s`ZS~>V*HPCpL_K~)mRK|iw=6UfdvIy6{5rxGLlN)u z{eBk85S`lY?`Ipl07cy(0!ExAEcO8N{0M-?U|n-Ut=5aiXu%(MkAqqXYSI?nxjBJv+!@ig9R0m8P|lJ&DDcrPPu0%hiS*b=y%$!VlGt#p zQ&oCGO~ms%oRw*|J??17xol?96IczQrUSc=q>Sb-oJk1e`!^)x`_VVsJJ)Rpxv>-n z*_sctdy_Z=DZo8#L;$Nw0Zs?K@(bRi>P^4MG1Vfs$>jC#lD+)p{$q5+ixP+x_;x4= z)1jLl=?G7You&Y+nA9l4aIXzF$>n{w<}N0!i+s8&i(wR*|zolzJuq^>y$STvW7y?Sbkv?Nze zP#e6t-)SRnwNtcdM||K8n`U{@Kx(G(k{A-m~SE7 zS%Lw@8DH^@ebk;BQpFHG=?+-Zh|8=TR=ail^IsRR=8au#gK^|)&Q z#Vh+?F@R+)T^eZCPStm=5_FO#4h1k688h}ifPmbRWx76%jheC7;dbxdjcDd8K-2>V zf5p%Wh=K4Iw6erg^Y;41#i)*a0c_IA6#o?YGucgh7d{lgzL{scPu;hq3jjF`jO4ke z!y1Ti@Lc=>8?OLVqQPu?HmWs3y0mR`Sfm{0Ze94-;!W~_pDS5jcnDQ7?&);;5DXMC zjab5V@t$eOG+3HnEtY+e5>!DeFGytD{w4?y%$fpkqQ5fug<&|zmfuoOIyAkvxqyZP zVz`)UM}yaL47ZWWLI!eafYk#Hz5vs}R?-4m5Kc`r_g^j5VR`m^S~ebXgqAzQuQ>VLYGYfWL0e%*H*(whezYp!?fyCx z>;?}&*|8g9Cic%GD*?$wmXJty*P8Jk1FXud+~5q}+NtL7AGV}TjzE}4BZ0B#`6ytu zz=i>MQYfG;oWGVUOVk;O*&{pE%*NM>-RDm>|DmQ4VNcZb@I=$!W{@>c`qe+3xSa{) z8q(`Oc72~QsC*dGDWCtJh};~2$o(h42ipR93o)uVcW`%n&&GxGZpHuI1fykS(A^nt$&+&s{n|m z)a0p?Vr7tNxYEmc>}t~pcpuJQMrA^Z2D@u}-{orpBpLhs$!_Vy&js#^0-|!i+m77< z^Hrx6kJdf)hOr*M`i4h~MEs1xkGwZYlbVVm#=Ck9=vwyPEPNhq$$0+Y9)OO7ua5}C zC+oQMKd;wxSvy(G3wvdNdiTn5&&0s#C&I?zuzh6MU_)# z|I12HG;ATmaI*5Z&LD3y%Y9+)^t7+BK}XhEBv{X=h>X?gfL@OAKySt+wUlMcBb@|O zIuz{dFQ6S%4hvOa7i=6a$^}%_)o7-JQjF@<)t@K{GY!#<9+2bShbK8wP;h4q2qPH} z>x+~B^{>DO@I#e@@aKLx-!l>DGL;)B9sx%}-Qys>?k7gpiGLclj`eg)pfV_fy5X&h zq${z{)_{r|!)PXS0gF$J5XFA^T64nCNqid-&8a7gq z+B&pQL@OJ4+#hFowbM2U-u9L?0>IHzhfiH1mo}88$8|U)a!@g=;v);ZI3m-~pF&o# zC!Yd{FK+AD)8BVhlU^VTkw$uS^3U?TX076@fWM|0EcK?&)YCJigKYk)o-vL4*o_w#_cTEa zq5$^LXrhUkqSx~mBg8UOUO`D+dJY9@-P=G(Mh`(X>8Wk+XVf5msj~-tH{Gp@`4|{W zedO0MFNJ9{bM|~K)+`Ql4A-6=<}V`z@*R~`mO^F}TtV=L+CfH|wW{qBgY#xQh;?fU zKfb`Ws2{{IdzYbKd>B43yG5uhdW%?jQNr~ux24l#-nG)5U7(!*uUxua6za&(nEk~& zwo2+=9k?I}e%^=PO5KIE3ie{_iuxmFb^c$~XTU$krrlXDSuNd%#55CT?=r5h~XXz=x@lPNa za3;0=-Yh`<-m6A0CsJywD2kiaw&YV24LEfl)hHD{L9(phgg-b*rC{1!(qT=h=b3Gp zj*tJh#SrWQiYN1C0MV-4+$;I2$yAU$%C*ldirnBBLA24i^|y8L|2G98rf(K$Gz=ee z$}1RYo%)JjmGPtly#A+f4i%-9vk^{Rx-B|=Pkd9tX203Jz6a8GKkZD=;rK1N-n4P1 zY!-68D!N18B6=h;&j7a4NR#FMl*IFgG;|_g$SMlq#hy&`k6fwn!~QY*;ofbz?3Ilu zmFAlrDha{iv2wxB^QS&s`vk-f6;lWEu`=?RJ?WaUOweYu_O~r~AG7W>;8g7w)4vH; zRsRf@Qhx$&0JNV&2zwMxjShpqnk|q`zSh(m{d&JMI931(hM)VZ9kfp2i> z7($!w*|m?(9BwL8JOrIo%Aw}$`hGW_L+p;1-#A6j=@#J)X7h9uyK6ck8P_Ltr`zF; z<3W)nj!jFS>tp7n0cX0!V|Q)uW@0#vi8p5a$_bO6f8aft?`KU`?)mwz+u)`=IQ>yZ zZjGGM@`kFh;R5)5;_S7ZDM6K7te2JB%h9eZdifFj5V~+JW}4GEX24J9^*b!SUs7rccJJqFS!WEzzyI)zdehcIsZ!x-7m4cVsPi ztOKx`?{wzZUspW_?r!Uva2Sk*sJ)pK(+RPJNBvhC+2e%mqib8|kVmymyo@4RgHpn` zT;_LeUR`cB7d*{ncW~VSEAUr^P*1h|+1ILO@AWm1fWX0LyiYEqJj~!%Z+H&cul1IA z%>;%Gu+`nc6;kOC?I0XLxJ8%$1}}xwZAe#P6KUfegQ3O6?D;@qbHZAQn^!)`OY3wu z69UN}O4uOwfe&JTT(5q&ey;n_e2dqAH#h2wAMW@KKNp@9yJ7oG{Ha^{d|##V@inuL z47Drx<{aZOPHq;D7W=XQoB$^b{_I02(1xoa15vO!9BsfA;Bmb}!MOKI5RLC0ciflL zML~k&X|#K#vZ!~JW(gDLc->g?O7mijGF|WilGPcj4)+tbQDx2S0ZsZK?$?j{IJL^; z+r{FPT?azrG9NzDa6?_~$8|C)8o`szag1^6BrPu{K%Nk79gjo|uKP}o#(Gc#x|4Mnq7%&OM& zCZ|rrlE4FYN9+i=8eNB$F_l%!t@k8~e*!1JQzL(gm+6q9n@dNzYQA=)o(ERmOzw0K z@BQ(7%aXtCS1p>NAyM5szY>9_xVL@OsEl)?j5#5 zxu4iKAzR0U;tJlC8_NXOKBz&SmwjGgA#B+~Y`SIf??h(AUT;m#?B6;P zuk9tSW(py=g0W+aQ&vyovcyX3I3hkHP)XM9G#yI6`tdXHH{ys?guPg@$F8Ipv$pZu zorE(Jv&1MM<4LX`^+kox^HWuyQp?60fQ>bD8Yt?P3FiGpI^+|X zf=POP%MO$X(cO@23wZm_bhWju)`;9l75%qV`$Tpydv~uGD96SSO@zqk&bcATlCCX{ zr*sDj$*-(l6Cg9(R((5+)x4Z<(|p**mzlW+jxu{VbHDBq9GYHKFx>l|&**JVEM5%x z(lyq#yS&W0(y3~9LIF3jqT6?-&=fp(#&w!;&EnUi;9%vd(|j1C>P;rF$RDU4OS~LO z>Oo3P#*@YoqzxQ(;y#_}$B=#*=9mEmuO>!i=8Kh@0yWK&=Dh;NuT+x3^ zv~~(b6VCe9ANx>cS_T@dyrAbI9R6UySidSLZhs#aS5*UQ^uaId{u5_=g@B21OW=EJ zFfTLDXV9Lmop9`&iB$pf-j5Xf!@m#(MxO|qqKuVP`aUQXGrA->_h&4437YAJG&_Ek zSAar)_^>!j*XNxPH zE_rL{)a&GRdMifi6|?@nwZD1{EEQ!ub+AAb^k}JY*6S-@2LB7;Sn}L{4L20WK9Zfyi&@9bkQ}#>XpMV< z`U&^8q((h%AVC=s5Ua=2&{Fe;6>#DSY!Y-PlD`t(KffBsuadF^3@}o^0QBFC{&kAr z_`iUVo{L24)OCi=eE_UNauZP9%?)H3UVRO|OMZ&l{=S~Lw!g233=H516#&%adk6q0 z22qNM0KC_E7Qnas^ZFYVJ-z)u^QM6y+2UAxPz3zIVzdKl&m;R643}lhdPh#pt-lln zH&=hB7yj=5Z-6%NGDu2(umGP*(usP$qJ-9Xm@bg~-vI2jy5pgyN)H)mfrWG#sr3cY zf4-m&XOm>xHv;Oh~L5;J6MjrDA1MV{T7x_D=-h9D?Tub9FC$UbRQTa~j{neZJxZN=%SNR6@S-<~#r>y3K^(T3PuILA^=S zPZtXMs~%KC_{P168%#r$@EzaN8D3bN?hk38y5Zn|r!5O63TD@L&B^&sv>Yu{g&EBI zsK^{^swEnORiPHqg*_v=R2ERBV-T3F>O8*itz|&{TaYA=O*h#rk|M2d>={HRT z!kgER_Uyf44F3=?0A|z$`rQ%*!^ild$N=8rFLxj|aesMt#A)l#1mpvLPbob~nLC4^ zUBNh9>D7M(j$r7-A7xr>re?qT&7961a~Lk)0lUMo$Eo_i#bc5@~m;;x834h2gf*Mtew zJOaz6JCCJ16va<> z>K{2tB_rk9d6DKW<1p(xu4?PPT}isx2dSe1yF$W`K*qzEGHOq2^>?+vhez;1xtL!y zXeS+BF$rmUt6?U@SQy(uJE;1e8$G3t*JL#R$FC=je6=+ru{T*CrKK5hvQZ7*4B zsdMBpQ^X)ap@dqa`C0FuLf4qZnfrr^dC8AwwT{(qYj|`rIBjf2X3&U&-+@TVJ%ib{ z(^gP`>YCiszl&;OE6p6Xg)g!~LHGG;T?s*^q4HpWVTDMt#}jJ4yXfj@b6=jY{E!Uu zXq#yQoY(aeO$+Qx>aR_k?vaRnoC;^ai& zc77uuvRV=E5Q{wy5(OvRQfC*I`I2dvQJ6W}sUY z#FYISJRvRy5Cvh8BYD26A!t+V@q5IM+dN>^Cz@C&8q!CB^VERVuK+BdEqK}fO`RZ5 zR9`ERqY9p>ubKUw43v5qgMwcAm1?< zu&@Wvi9??b&I8*@*On|k&DOvQSufv3jRLYZZZBB@ko=%}i%Qcv7B2mx+m}Gz_{KRv zBB9FGwB!k*L=#yq+qhzMB^O}SG)7WvRv61{;*5Cb3seM=cKm(DLmKcpgOyJihu|gR zz0Fb0+O=2ZpwJ*egCAmL?Ynw@jGpFLWn$d=vuzP<=0H~QKZ76D#nb2phf^7>Rq?Z% zzQTY2w6P4sinZ|EACXle>*kelAm3+4!wWF+z@_iR=j|X!k{Lkp=C4csi{%~qL9Oq* zM5((?XO8}ZYL&!3M2tgLg&)N>^R-+pOhBprGfy-}|GDNPS06b1yF-urXJS5`5Zw>A z+leNp0U~b780kXXRg&5NWB8hT%c8qGav1%JlNypr`5mCV7drL5#onx8U0Ux3jAAn?gaZQhhv6Mb?; zql6Tde$L>R4q1ZZ^0|fpXGgoKiZ8aWL2abT$nPt%!;$N{Md+C^P6}fQR?f^CHfC6vQ_+ znwDIdrp@=lCbgQ{H0_z#3-W==ZzftV$OGKK&-wo)VgA*;scoI&uw?Zms)r_w5 zhqctX{+amybopv%u_c0gUl&1w_CFP+W7^uR0?=(Q4@9cu}Un_ z7vz=dIX0Y;J)68?C$>AXIcZ4KkVm){ANRMIZJ!1WSBm32^!+IU`s1M76P0%X2uw^v zz@NI??wM^PJ6;8kafDg$dB=-U5%E;83k9{l4W}l5)?^zn!z&K_3z%(;DR}^vDF2+R zgVs~KUJK=_{q(#jGK?lnvco*&8l(c(`FrIE{t`A|wS6{BOW-)BcuR`VeJ zKmDA-+(&~K)Dk)J03T@m40ckWLrvk|kA=t8%#pOoqoO^#zlRgYsDpO_mtqM1;a{65 zUaVQ&QZFXKuk?I_`sa=W!RRM>foC>T+I=#Wi~~>W9j(lsy;-iE~KE&lL(htaq458zuzm#}vl*-~gS`4z7fuS_`SLR!)i zzq@f$D9ln&kK#6&w$*C&0&DTl_2=owNsT#Yx8`R=raU(M#l-INNN-%o>8r^Xcy+B? zR1jiz_u9nS8oVM3pd$L|6`~Xr>^t6DBNyEPsvRj4M`JA-R9XrDs3{>dtUL=1ci?j0 zOIu!#5*r(He~H(?CtdJ`>Z1Ob8ib?dfq3H33Kp#X-1wLYMl713*iKWt40Tldh{dB~$0TsN@1 z8Nj%)`Qxk8N(iWIVcZWgkpZe<1&+eyM?I8)e(;Y=f{^juJ?JCD-!&p9v5zTH)iY%! zZ7+5cxw)H2ef|hyRKkvuD>yP&&KvqXTxLL*d#!@fuhO=%xUm^8CG1Jiplc!!&#Twd z!=OetjnPhpjs2vj#y>clKCvovgItX=h*(o5M(j+B5H(ktNb6Wy&I@v7IxJfKJX_^C zi8+FrO=H-5S~K+ZeDAAz$M>t&Hc=h;yZD;MX_ijP^G{t>D(?r>OI=x~JuuDBSIq`3 zUMi%fy65QzD*BBVap$EDCkO{K7JrVNCe~RX(j@!zNa2y$TCw}F!M%CMYjSggN7K6Go%%2h<|_!P-o>6Q{h)@xpBOYU5! zJB}}ymU5K;ie!p19*n(3X+Q6iZ z>zXUzviBK{rtge`NT{Tz=Kj8dCh>Vmz1vaFHjxVL@|D8S%?xZBWmy1AcA|~0_ zWBhe>GR*dd%~Z`93X)lNy{T$8kOcJWNrJ_?MNw)#x&j+iPt$b?qr7$z-2KY*q4n{^`hrG zg$Ib3xSJ*NkR?_#qCVMcCe4628!ys&%Da$SmBv+d+V_%3?b8AXzDaxTzF2m|ME;;z z^2T!F=+q~)DYkxtBjzmY=adeinUfVurf9Vgb_w`gFVK2yGdGk|+u@UfAZD12ZZqdjN# zB-Wvd5-$6ezy9q4(PeY-@9N*D)r$LDeGda-X{5c$@1aVyrkb_13~e_`XN8XjT;3mp zezn}j4{$2!ltTN}?)nKT7OC2>v@&OC+Nu882)n3*wdtI-=;Cilj?@%9+e~YtzKmaC z&=io;PP?HmCm?Uvi(QW?lr#G>)vyXa>~S>f=R)0wnRldv3l-*2xEVvX9EO_SevytP zwx$5hh)o~ju_oE!y#0fpHMHz1l+gWS*p@Ao^w!z@F%73Wy&^clZ;w#dwumOxMYs#L@cKKuf3XQkf!p zt=}sfIdQzXaiPjGTWw?Pnfc3KQu>#*gCUAO*H2E3L|l)+Xzo z`yPCz^$mYdO7rAqnd0#4J2(XrY**wF;*eT*9QPI6kKOu51O77tN7|z)e^7-N%Xg~G zED)5)ZG-Ds!-G+~Koy%f59fk;Yq!WGCmIpmXph|Z#ADJkJGBXq(~MQiu+vflRs$&4bj9GB`r!5%})Z{ zqm=1i;QxrTI=$7MkfFn6C8|$LU`2(E&6m;-VIE%wOL5yg8OoYBx-ML+l1#(Be9Uf9 zTuNcwOLZA)hP+6+yhhU^v3Zj}VI7~peHwdPusDcGt@L~b&04`ql$t-3vCnYgS#_)5 z_%5#!Ig7cb-Q)0tri#p3$_{IfRkx7~ND};6D}xBkey<4oN}dMg_q9f5Kwz!wv1#4A z5`^o?Xp=u35L(-)duDq|btibrOB9z|TvJ<&Ecn$th2#SrLrAm_!9}0ddk2?Eoh9B_ zZppYUhFG8My&tvpTh>Kr+obWzJsj60QP2JTEFt(MHas5*eizj!NHtw@ev~;-mZ7H0 zqli=Hh*#E!)N>QWDU&kfG1KKKPaG!O&VIyHdM>ibBYd&V&`eQj5q*%>e zw-vUodshXIb05x}-@S1r=}CB;k%riI6lb#4_1vX-6elJ;VaxS3YWNnvx9tV(-)^Y} z724I?G4T`CJ8Y2|KgzgUmwsV)2KIXDIJ$33NQ&c@A_c(id23#?vARSB$5>?deW^?s zZ1Z-wArf{{&llhC|JuLa<5=ZQb+VM7?=)4PJFbrzoJ2wDl$$XDT;LBR?8aLL;7egY z-}iIXem^(Ljiu?Ov*~f+9LDOR7Rm3m9z3Wrs4-%RlcNe{1sn!iguFe9gg6RnaO`jQ z$z%tWmVcOZ4^?+(S3F>f+C`*!zx1!TITnuce4-G+hk!}XRAnrlti zo7(8d8qUMw#_N?AZ8A-J^`^Do(dXSDr21jTDXaKm`VMICrCZJ(hPAV_zsV9rLE(4IeDl@>Fd<)WI03ypSd}=w=D38(;P}H{n++?I{qs4b#U8sXu83xJh7J6 z`HQ)78wO!7O>-}q!}xOdf8q{^iqUdjT*^x{xxL7iJ(4hI_#bdA_t{Ms+Iew&#}&#} zwKKeIDl~%?G70@Z3Za z@0>O)ghV0t2&Pi)J)ZC0L(w|R)fwUB1y_2u9ltc(=s-k$?$J!8I_3{};B9a7`Wi;U zwMvK$DK9)2a>~y{3DyU;sv;V@@|Rpm8C>TT=U^YY^^O9T|2!l1&NANPVF^~V7kA*R zMs(zE^d~3eK3bk~v!*AxW&)L!?4b#Wq-Wcoe0aPVG!#tW;y%rnb9yk49AvI39#TvXhr+4}~i>KE=_*|yiV>2Bvadin}nmZyUjErravBF#UN%K3%D znp^V~zs}y+Sbd%am*z7eCgeRr4JWG8uLX`ym&nEuml7Swj zhXtP^zB@#manu(=`t=)*!P~&jfrA%Y z`si|x<4nAB@#w}-3c(V(h3$}mYn;I1;VjsdCp6P1T{&_?i22#-Nk)0n>BJ^`w143806kW`pW|=z zAryCEVPu$LDg9=UD6_mzY} zsH6PQ2W?w#&|+9M7iwL)G2!z$rt&U3ciYXokVuF@c;?q?ifypsFtd5#-2C_tFUKa#Tk~ORPzBmGLwJGI$oQPC z9r5jhjzTGYQmbIoNNRAEH{I!pl(wRGh_0X~$_jhDK|x&8&V{QYy<&f@C4QRShQW?N z=nRS9{1y(jIn=Z-F|ufM)b?y^_0C;0=AKs9onPE4q9ftY&{`nJ3%<3l%Re;FFR0e- znnR-=5khB)zRusHk$WP}^E7q{)af)HAcfApMf0_vS1elE_`=5~?U7KpI(y6{5GMLs zsMqX#bLs1V7&2e)$GH<}bY`2hNOl^fk_)Mm#8fd+RlVBqR0*(6f?ZntKi(LsrpaC4 z97Oy)?QwFk&hc~fT@{o;IXR~(mz@yW^Lr|CLcZXn^LRt~hv;30>|-6?+)(ALC*2o! zNg$ervcpLFzTXRAOQN0#KxehBiNCz|DUBNp%Z>M7{0TfWD0I-UowhTR{P^==igK(VuYV8&NT1K-XJkVWp912v9w<4^5@FX1@Xjrp8LS)QbZpr z6C0{=b-nGBi#BS6yvCoL&d2-)V;v%iK1cT>sz_!Ad0;1KXf}T#QNZvyi7!r9FtU&P zLXNL*U@L6y1}bs+dxrU+i2h6XvlMuPyWR5xVU|4AE+OZh!_?5y4(6<_T|*CDf&x;~4N8hIAPoXT zcY}1dGITfJMt$!4`QGC_Uj8!2n!VTBbFK3_V{Mo#3cCU08nVLu*?^y9Zw4sdZA9m< z-m}$wrb4tyKsk@g);Lvh3pIbgMv!f7>?HECV4ZJ7S2^9gsK#@LULbFrGAu~vC6_2< zWy|Md+g{>s?e#)_L>La2vv)1!LyNG7&U8rMOsbRa$wU^vRV#kk(a&2(!ddJnYK;IJm-uv2hI8Kxdemr=zEan2f^zH`ZA%tiht1Z9s@UC zplrTF#Co7hY`gw6r(ZOvTPoYAFHRFP7 zjC9=;#Qm`jCr8WgmRcE9cB|sD@bQ|WKZYC6bpe>IJ_XngViaofvjZ~YRGIxf{2z8k zd9ID_$Rd$ChUfV_nnWe+;E+Bvhq<~$zA)iiIOM+AJ6(mM%h$C#3Yj8-PNI~(;Gpde z`_q;bFaT)rW>;9fEEYk595=iJDq#Bsp&c6bxUnBgCg`F^K<<1%`~r}mJ4Xn~8E3s=&L8&SaqLXO@Lx%X=8ID^G< z?r_IP_PD<%KkyI5k}aDw!I-;#ujF>Ak}y~OCE2Ka#64mEQ86vpu^P#1S(1orj-+6f z)pM$p@R?_H^lhM_tzH9v1MOLlZ=6YWd9MBNkD)u#Am&`(UCjoRPM6n>_i-x5Ek>VQ zqI|n25^%ftGoyiNdtuq_MZSVXw+$PF{6z_M z8{YH6#k}yfmmEneuiv}(RKri5PX@Vhd`WEFw*bf9|_g zLt@OJeu4|OeBL>c<ABg`XL@HJ8(7K{Az=v!9Rm}U5u=DX$`I()oOhs#ta3e3H= zm4^VRQkt=)1T9^vY&5#tBY#_Bo3CC;((ZLwj$67)Mgg1VCy;bJh}jM z*#|aC(NDD)RfV4WoWDw+?=)2M7ti-=ye{MWW_00PH{4uIE5*~)emM_=GnQ&N^jzz{ z-|(*X(HD7P@9ceB<4H+<;z>VXKOkR_NM>S?2CzYk+iJ4m7x?y#fo%&v@%<(L2yO#+8yvZ}6OB`7x#@Mf%d= zL}Yzu&%KNq_jk^R+ISVvJmb1Ir?UxD+q8@vu0SMRK$K1*g#S?!tla(+w(O)WE0VhJ zwh$Dp%6uYmwC0;HZ;$25`mir?I;$F@U(x+Mch9Hu8H)W)%uo4p2R85Mq@e@J;QCOT zc@6h?neQ7_4Oe8aCO)Nxo@uxKinHbBbz(O47a>D)2Bn|+Q7}=8n)7gi$oE}ff0L^ci4bU#2o3ZOt8;B8$_&#L}JwSHYhX<(bh$J})>1YpJtET>_(TOsf zOIBH(x|w9zaiY0GhUMSNgoR!^9{R2>ZQ z5T}+<5tNr}M;m5U1@Sbg&3JTDA>CB|0vZff$Vv zgg36h;+$#gt!LI+%iC>7g@qPxzT*A%YdPuViW-kG88#g2QzBwyaKo;L%G0i38Yy&Jsg zjj1$x*0=980;dUloow?UIKFY_eDnTZH#jaj#Ajl?^1TNQcIRKv5~0{=mkM^}iv3cj zPeu(C8FS;FhAW2>RHTY1E8VXZEvulsIC*}s{N@igW|}WKWl0v%z4lm+FI6s`n%>!k zy+x^})a*)(z@A59#@WOPBTuIC7x%?3E0TFb#bdTc)VAP;Ai4tDjP~`#WvEa?;n6_o zb|@w^oUGn@5mF!Kqj>4T6@m*jYn`kP!L#{LfdnzgBcuwB1b0OJ3J5EZU_ns|!SmT-XGL#C9W z>da*;ly7zBhwe|of*5<5+~@V}O|T8juOCgCSAlWtUgwc2NEr6;`klLK4r$e$;y@l_ zn){SF@SI@I&0mlkNyP|Z;XrZ%0Rg(@>;!e_TX`X?$p(}C`rAS5%>5FbPYh1dgxHN-Yx6kO{Or7w{#zql%A$mtl{t;&eV&NW9NrPkt zW%tdL!OC`ZXo|fHRpKB7l1|qD+2aOjD?>fwqunSw|6E7ofEOW5q#&@U#ZI6k;;z%SFcHRu3&yL;!x&j?_)Fo>CXlX z+Sfh`16sANPS`^9>OK2J=E3$GhqIrefD-N3W0{f_*RzSEF^J6L|Emcn_lHETx=Af^ z*p{45LM9o}r%KhYaY1){|1&f8@uv3CzOY@qESU&mj0fNByzN**;~8}j9_frQqvPV%X7Kpg+LsH@2hl`5%d5~JB`m3x)pd7s zL0;2;vF(^X-g=h=>GKWZucxjGfiA~}egG}`>$|u6g=3M&jMCY!c`(S^B4biQLsT(U z2}9y^dn57I_Su%Y>!M{OhzMC{f$G!oWfA4r$HGRv*K+;$m&<<+6UtxCaBc4vi*e<~ zp?20E5Us5rqW|tyWvKw7&Tp6elTahxIqRJ$$Rw40&n#}<*pKirnB?2A;nB&_MB1$F z5qO5D)oCC@nqo6~r)x3AKYg>IDwfPEpJGkL6n%-F)WKZQ7bvKgGp=6oGFcnbqDbJ` zoz}{0-&x!jN+a9W{?R{BOgvS+*dXtea&Lv~89VW4YY#Hy{rdS}VHG@#ZaTR>0Jk^E z&efTC`OvY7m_zG6k`OfPJYyyVhs#8kCCaTdnItlMZI!1f1-m!F#*6BD!MD};Ud55mx1R?I%h?HFy6dZ5~}6kLY>NkuCGVHgen?JCC%+olKmu|Jt_;543iVL7^6MYX_bU zyYblL5;~~KY%S10J-0idD(Y^w)U|?D(qS!FY~Irdn5=Mi<=TrFzeub&MVAlwBQZaS zF0h30-G3Z6%%5VPsyMih>`l_|IB8eAYyJ7!RZd__iWEQshf(7;?46&n_v7rZ*F_fm z@~rldVH=BYm%&p)4=tk7)wlR#dgfS-oT|#}wfrE#>K?26lkDc)vMM-?U{{uV;5iWn)8Awo2kXKCRX7ms(ClP4&molRpAqCa0G zUSw9md}C^H5SDpY&(dSeQ|*MuSBukb3XsF<>Lcb-xF~P;kA$#^r!HjYjwVzeg{SFU zK1{4?I9cSOGjl`Xh0PRIFNjynrRSg!{h>n7rjQ2ge+71586t3mv?*Zyao$$EW0&Bz z)vZaT7FY^WRQ;@~ap7XzC0~l7b`$_qk*a+3$)#JnDXY!oZySUCIM>1Xp?D>kMtY3{ zmQA_o;*!B~e2B{_pi4IAOO`&W#J8*bG4MQ;vxyewY6d%&kd1qlw@=)-kz;n}0qBBY zl#e%yk>;wSuXF1uHp{75J*=UYMqSD+tvfHC<0#&u1n|;rtH=Tmgv|b3zv@TTh}**^ z1V>$`0738Ie2&;VKvpad+!dmrc0Wv%G)Q^pwG`GClt3@Ist7(TZYh);L5A@eoR5Nq ztT&d|;gf0`F)3Ru5etHbimb?DE?=-}y(#qE^vY*sRgE{x%(b1p<$~}XpZn`tEQpcB ze47IAT=5%*KU>ly*MxgStUpRr`O@Pe;ihb4G=p)5RzxGvkr=`i2yk(cAGS*#m1(fn zfWCY5r7Ke60fcJww_D;BbxP86^iRMJRej z`>kv6*lyocWFGb-`~#}g&$-{|^zOR*Yk=Jwt}UCGtaWQ$>(i|S1`GK=^6U!?$tO@V10mH% zlrwIrBRcXQ@0=jEN{kwh%`n@_hd2cLQUOJN`Qa4T@tc8b;RmT^fmLsuj-npO6*Qm4 zF^Jbq9hSA>mOTBDuor7$B?61AV6jkHsJsmNA?fD{LtMyAT)teGm(&+#p8Iw;G?|!< z&jZU(;T<=9kg|}hLG)qMS&Gnb{M(jg)Y&^*d6h{aiHhe;+mGzFqPJx;J(wDB$5d$&L4vC~%^8D+8Oe6DdMz*e-(p`@{!h}+ zTt@wWWBdpUA0|?FH+(Z=7+*!gUU#_4@cK5-2*UArr)%M5R8H8k<@urBEMdN~uLIA< z(az7Ws5|!_GwXcam-7xnIX?L4%F>=UNa>0_DDG^Nflvt|&2VZ>1(4cH6O3#8H!Bhu zRFD2*a1w(H4+98%}u%gk%syMAA?>)QD zez#|K7QWG_9T?0 zS*V_lNkTZM@);>t;jlG9Hm^ zObHm_CgSmISUEtDUqzCxcbZZ z!EJeDM`)uI%vY~VjVa_zx1?<8R@0E3UIiwNcYy8+ub0(O8>F-m}_sq*FyeRcyn+~kv|K(4f4aQGbq>zM`%!H%Euh3| z&^CU{n>7`5oThgui1w26#dBO5dy>v3f5bxAVo%AVTh1qZN~f*uCVYAcH}h+LL}B{Q z)HhOzLcRZr|2NbBL;Sad5LL{*yJ(%yGF9tzB-114voAMya?(JmbpoAPZakkDt;jqD zAu+kYTehUG0mXdO%7_X{!!w9;W38C>y#|V}X|EsR<5R7$xAC1rP9xJ5m0L#Qq{_u) zWSF+{2G!EdxfK}~&yaw&&P=~|ye)VP^$Eey1zPY%r->S)`mWcKW18p4Z-3e9Y>r1* zl`fOB&>b}DH`Ovk4gG+BT3V!~jO%+y!MJ~$|DvF^VmyWcB%7O(rgU39{Nky9%i~?_ zaSIn$7yHP@UzP&f-;W-B_r66nqMx07MA($F#O8eHE{{~isB}8pu}|6ixiZ=NF|UPt zLvM`oPxwK)(2NtVqH^55`pjBvF*z^HMU@s0}ZG&&4Jwu0ZkY)z39OP`KPvQQT34ulJ9}@yD5EFcy z=9Dg@9OtJjb!ls>)Ow01tUkrRA)3B)+d~)_tJ^XE1kFU4w=mn5CeY?S^y}$#21O=t z5frbWhVsW7eJNLNF>5p=6L##c46Eye3r3Z6e%lt)GPq}K4H$A09L)8o5>I*ZjwcM3 z*3DwO9t5mR4ffWdBac@0A5@{NGCHz(y2PWx;+K1q9D>1yP)FLz zs>|8=B1e6s)d9atw$paQz8W^Ea+5Yw7>;DdDGFifgjd-o*TK5#=*?8<%5mGO%cXMY zrw+r&`dz4fuqV=DoY2aK@b#{6FqvEHXlb}~n_i~Yx=cm?K74L7)VVk;D#tc%f2WLt zcqj8nS55dHG6-kRWAOCZ;N@}*Uvo4}&@BPs5Tb}PYC2f=_L_ar*SaCOK{O+}kwv>tCwD6=Ks5>p8N zrDw{OZT{3*$?EWH=Q}g9-ld--Es_~*ZCLh{7neEk5EF8WcSMU?hdbxn=?&z&q>97Z zY5+S2T(HN2>jvX5OBLnF{q8-_E1VLc88&=Gh`8;1-9-AGp8;0UCX8FSw!^{98&w!# zfBt%lX&W7>ZeN+%5&h*sBNJty0Ipd`zBhtz_xy%SF%V^+N#gb&CVml?f)>V5nMyD(Sa;@e+&<&jB(+ogMIGw&#MwwqbgSUi9?QYA zV=0P`{4d#nJ;M}Mf!*aeM-nIUg4*S(QDHQe!E9+g6pduu&Dz6W0vg`hy}j!-3vAZG zQ)^`1!)6|kuI?jHJL!7|-$SHg@}i$IDGet8%_`*6^uqr|<`2mk=Q+1II)t>53tX%( zK958n*qYL>aV&k1vqxRCB=iTq_1z@rmgdE^@I;xkL9}+CFfSTE zL_X$t{K4(Y!J+*1#iiD%r?D*4aY=9I%r4dRj*{wI`S--{GI18K5=4{w@L~t1RfMZ9 zzx?$u?c_|EljO#IZTtK#AZ@|rgA$gxygEfGxqpbvL=sZCjMiekwDx_JqZ8;=8Ffa7-~(F~wCJs@-!{Dnp)b$N8X4 z693^}&w1vx(Ztp!;3gJ^Hc%gd2rPs}b~rDDVmo;F7iZ=C?A=C#>qjKlmRzmPBV+WM z7m~jFp0n*1abU%7j=ta~EU~xF77FLaI&C2e#dx9Y(v@1XuJ=wWly>skzqU*O*T&k> zcWWY@v!CzL(8)!%aQvUm6aQ2xsZ#Xoc0!^|jbq%DVnUgftzKx)Gne0xIZX72#ccf} z$DRiC)B32YTrQ5Dz651B4M*8Scy42^d&3gH7sb;0eksc?54&_+=Q8U{{$n-iqV74M zAeE+ldXp5J8eyS}jckIQ2t{);2VT(KeeQ0gZGqh(lf|Y5r483RSy_dK)F9Gpd}{=d z$Tv`z)QmA5mm+E_ObGUkA{bxaJkwFWUJ9sQSY6SJ`vM}a<6)z2^z9f!rZi;lcsNu= z37|^gZNRxz>F;i9QuvE9M_vj^j@j`wp}K) zr}0RyPFY6rD1Sn*^9qIsIL2#ipI+Vv=1}EJhm4MQDdY7qYKgCulZ(%H){;a~R3&Kn zPI?{~#7TT-8utuMOS;_@X z)2|57vS1xZK(E_x)d7Qs&;j%3Cp~t4z1A5&3_A;!o{vAC_&`vMI)$QBv>ygiCxbmE zMwbi4gb#F+W|oDhk~3^BO|?&FpB%CaE+FZ$#+Z=5I9{lCPqKJ=+M4}k1wG`f>pqJm zS8`m94nw?Tu{UVcwuP`BGk1Or#|uzYW(6k_TgKq47twsB`A=F6aXa(dgr^k@65w-( zsfP!M3OAWh7>*cZA+tG2Le+)J-#vQF{KgHM<>}q_Nq=e-DSoa-WDQ3QJ zJs1DL(z&lT0W)ywyRtgsnsFdQh+WViM{WXF-O`QIr#3__+rg3gSG*hYKHv8; zGu!G*q7VJS2x&BxqH$X5WBcI334KU9Nq>fw**$3@M7n_zJx?*yc_vPd;aHT+hhl}T zYoW>GOye97zzB-8ln5^LKRj73PhXIEE7;J(%0oF42X@ zyXYKwOl$ITRlj+>++u^|ymN^49^;k>a4;tMAf1WuMbkA*J6s#;En@46T8F<_Be}2R znmxcStxECT9+Wz7;I+UHo=geWGf;R57zlt}2 zegyOZTK>3l1>-C`z%h$!>q7^Hm2WOS=_u;rvH*$OzWp^{$+QW9dtb-t~eM^Z&ik7X>LREG{lvZ|M^RIi`K6YKBiOGyR$^z2c z9cND}c`Qm)zS=CA=4#fOq(b|OSK5XPZ4?JA9Qi5kJ*a=p%Bg2ErkK#u$0GUuW37kv zc7k4S@5@BGwnARW6eRjx%=kD!6?@L!mgNs3dx3UPRd2yelcS<0)t)Bob8rL~+J;Px zbXom*Bb%WtOK15DgTW`E2R(d(0HZ@t=UOxFSq?6Z(zstmsEiTVbzs|F8zA`~pE*Dw znpLQN74A$>pm9f_3bI}a_L8>&+Ul<_^wcG zjmJ-$7tm_`eDqLCRRMB$C8`8Y$V;3}iFffE3cZ%1V+=b*JB6$M>pts>G@NXN1q@Tw z7Qp1UQso$k(T!(wCmyb3QN;zp@~Y|E?oTd4+q&M)jC zHunGl$BjN$U`a~#$oUiu|79U>C3M}+;zf}6ocJ6*I+Lb5@x;c7-mcu6No)O)Goj50 z7Xe!I+M8Ip`<;J$v~AhSDL@osxC#?|4P!af_35g0g}*WG?1#|HMie%u81+v94a{c1 zc5Q{LaL>me;9$QY1oN0NPgR_;WgWVPSIJ-!bLz^syeAs~mB1CAa{Yzp#{H3bqI250 z2Mq|vs{P{hY1s|v_T`KS(xqOn{mmy-#Qb#{b6tHIa4?FwHrIOfO+e5d&$P9Nh7CE5 z*2<&$ol1B>mGs`sR?J-@;hMLOme(d|{NnxJ-w*il2CbbuxtQE63RLkT?y-+S?~#z6 z*B()g=hpiAzDk;oK-i3ye%4X%?&4N$U|doUUISc?yaYg#LFE&?AI3s@_cCs=3SZ~x zO6rqI?hSm1+D=j!fNsJ?h%HVZ1*Ma<1H1F$vMV;xV7j5qcboIJ89JFrn7l-VbArGW z?%=5jq?fJMwMTab<_o+c#0gcDju$~Ta6O`WpSrBbxv~Cj)d1RS9UF|0-%BoJ#*N!* zxGBC*ls~ix3U+Q2r_|F)x*qk*k_@bN{}pJE*&|ApruBC3(csY8ieggQZUyb2hX=_( zt@4QLR1FLHirL&HzFWC4FTw$KY*ahK*<1;6(vg7iZK&;x*#L8tOJ)F$3tWJX6)>j% zO;p9gB$+kvvqw$APP$ft)FHw*-BSl*rwTp^h3K0PDaTO)%SKl62Z$Av^G7P_8T?~G zENyeA(g&!v9p*d^2p29u>VN&&PWg^Lm+x>Nog{iNCxrh4nD}%?Ev>xo13v6YZbKW1 zkh`x37{mv4xe4Qfnt$_Ou%07k;_!g8gmme`0-LhAdyva|P9opr56#|z2jtQ!k9Ks_qvZToH@b=xVqF1kYM@O3=bbBj{uZxC}wd0Pi^M7U~4w=UpuFj))!=U zK}8y^40)Fu-}jP|vu2kY@ek%X@#}nQtKPsr`kR*8%vw@}br)a`P^hdjS7(AL_T4X} zvnpeLhR|QV%MSgXgf8z5fnfW@zKt7VK}%1LYpv*WAYllIVt^R-z_GFCgX%e%GnW^!<%J6V-{>FC?!?OG zjX1+`ZB^btg8zfRCjKDzy_{Ns9>Ng&U+oncRlwonIB5%Mi4AIKMv9p7sa$V-AN(`$ zeiRd%`G%vRcc{~geAPo(IYBhbW-weY1k*043U^dz_v63Ao>f04&h0Ve1}qDwXz7ia zOb@#y068aFUKh=znr(!)7v;ZhOBHYqH!BTDctNh>_!fKM z;>6*UHa45!|GLAzMDE7$-|0jN)w2>JPQ z@_u#+qspLkm!dfcf&H9`NE-5-ECOh+I=bJv&EGdyCYLK+ph~P5P_v4$QrXVQcbNTc z<{xoarfM^zhjeVzk#+?+UoD3^OHHm7lng z0zP<-3IIS{RQyTp-YuM@QUM`jJbJbOe*SE&CBHf5yRU6)XP=7vN~pC?@mdV8UhArD zbietXHN9ItnvLiEim&rz&l14m2olh07gZWy_ChX4GgicHHYfR9sT9uzcxnCw5`)A@ zB6dw&AhN&K)!cnw5B&11&vJ7!E*6gJ7nHDRkRCw!=k91sUda~3FpSd99!d>)49D5} zeA5*zXwKb64iK155PT(Pa5w0moe|$Jk=spz_~B*?yB9+Y1N$0>^RS z8M2oR1+40SKZ~dD$eBWK3@s3AFBVtd@uusg90E#VjceYsX;I)Jl;pJk`I(+s#M9?~ z{S1U|AB)Oe);gE1if<)rCOF%m8a(p9)7FgrIWkp&yTD6DS4q~pX?{0y4Q)$AvJy7gZ{g4kAr^C?O zKv(UF+%KU0{Cmk!LROF_k+M&)=FuUqb|_0imBd?;loTKd+6zipB}kLt#1sOe| diff --git a/source/upgrade.txt b/source/upgrade.txt index 564834b4..d783f13a 100644 --- a/source/upgrade.txt +++ b/source/upgrade.txt @@ -7,7 +7,7 @@ Upgrade Guide .. contents:: On this page :local: :backlinks: none - :depth: 1 + :depth: 2 :class: singlecol Overview @@ -119,14 +119,23 @@ new specifications, the new class provides the same functionality as the legacy driver's :php:`MongoCollection ` class with some notable exceptions. -Old and New Methods -~~~~~~~~~~~~~~~~~~~ +A guiding principle in designing the new APIs was that explicit method names are +preferable to overloaded terms found in the old API. For instance, +:php:`MongoCollection::save() ` and +:php:`MongoCollection::findAndModify() ` +have different modes of operation, depending on their arguments. Methods were +also split to distinguish between :manual:`updating specific fields +` and :manual:`full-document replacement +`. + +The following table lists all legacy methods alongside the +equivalent method(s) in the new driver. .. list-table:: :header-rows: 1 - * - :php:`MongoCollection ` - - :phpclass:`MongoDB\\Collection` + * - :php:`MongoCollection ` method + - :phpclass:`MongoDB\\Collection` method(s) * - :php:`MongoCollection::aggregate() ` - :phpmethod:`MongoDB\\Collection::aggregate()` @@ -141,7 +150,7 @@ Old and New Methods - :phpmethod:`MongoDB\\Collection::count()` * - :php:`MongoCollection::createDBRef() ` - - Not yet implemented. See :issue:`PHPLIB-24`. + - Not yet implemented. [3]_ * - :php:`MongoCollection::createIndex() ` - :phpmethod:`MongoDB\\Collection::createIndex()` @@ -173,7 +182,7 @@ Old and New Methods - :phpmethod:`MongoDB\\Collection::findOne()` * - :php:`MongoCollection::getDBRef() ` - - Not implemented. See :issue:`PHPLIB-24`. + - Not implemented. [3]_ * - :php:`MongoCollection::getIndexInfo() ` - :phpmethod:`MongoDB\\Collection::listIndexes()` @@ -191,7 +200,8 @@ Old and New Methods - Not implemented. * - :php:`MongoCollection::group() ` - - Not implemented. Use :phpmethod:`MongoDB\\Database::command()`. + - Not implemented. Use :phpmethod:`MongoDB\\Database::command()`. See + `Group Command Helper`_ for an example. * - :php:`MongoCollection::insert() ` - :phpmethod:`MongoDB\\Collection::insertOne()` @@ -209,13 +219,13 @@ Old and New Methods option. * - :php:`MongoCollection::setReadPreference() ` - - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()` + - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`. * - :php:`MongoCollection::setSlaveOkay() ` - Not implemented. * - :php:`MongoCollection::setWriteConcern() ` - - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()` + - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`. * - :php:`MongoCollection::update() ` - :phpmethod:`MongoDB\\Collection::replaceOne()`, @@ -225,67 +235,6 @@ Old and New Methods * - :php:`MongoCollection::validate() ` - Not implemented. -A guiding principle in designing the new APIs was that explicit method names are -preferable to overloaded terms found in the old API. For instance, -:php:`MongoCollection::save() ` and -:php:`MongoCollection::findAndModify() ` -have different modes of operation, depending on their arguments. Methods were -also split to distinguish between :manual:`updating specific fields -` and :manual:`full-document replacement -`. - -Group Command Helper --------------------- - -:phpclass:`MongoDB\\Collection` does have a helper method for the -:manual:`group ` command; The following example -demonstrates how to execute a group command using the -:phpmethod:`MongoDB\\Database::command()` method: - -.. code-block:: php - - selectDatabase('db_name'); - $cursor = $database->command([ - 'group' => [ - 'ns' => 'collection_name', - 'key' => ['field_name' => 1], - 'initial' => ['total' => 0], - '$reduce' => new MongoDB\BSON\Javascript('...'), - ], - ]); - - $resultDocument = $cursor->toArray()[0]; - -DBRef Helpers -------------- - -:phpclass:`MongoDB\\Collection` does not yet have helper methods for working -with :manual:`DBRef ` objects; however, that is -planned in :issue:`PHPLIB-24`. - -MongoCollection::save() Removed -------------------------------- - -:php:`MongoCollection::save() `, which was syntactic sugar -for an insert or upsert operation, has been removed in favor of explicitly using -:phpmethod:`MongoDB\\Collection::insertOne` or -:phpmethod:`MongoDB\\Collection::replaceOne` (with the ``upsert`` option). - -.. .. figure:: /images/save-flowchart.png -.. :alt: save() flowchart - -While the ``save`` method does have its uses for interactive environments, such -as the mongo shell, it was intentionally excluded from the `CRUD specification -`_ -for language drivers. Generally, application code should know if the document -has an identifier and be able to explicitly insert or replace the document and -handle the returned :phpclass:`MongoDB\\InsertOneResult` or -:phpclass:`MongoDB\\UpdateResult`, respectively. This also helps avoid -inadvertent and potentially dangerous :manual:`full-document replacements -`. - Accessing IDs of Inserted Documents ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -310,10 +259,52 @@ following methods on the write result objects: :phpmethod:`MongoDB\\Collection::bulkWrite()` Bulk Write Operations ---------------------- +~~~~~~~~~~~~~~~~~~~~~ The legacy driver's :php:`MongoWriteBatch ` classes have been replaced with a general-purpose :phpmethod:`MongoDB\\Collection::bulkWrite()` method. Whereas the legacy driver only allowed bulk operations of the same type, the new method allows operations to be mixed (e.g. inserts, updates, and deletes). + +MongoCollection::save() Removed +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:php:`MongoCollection::save() `, which was syntactic sugar +for an insert or upsert operation, has been removed in favor of explicitly using +:phpmethod:`MongoDB\\Collection::insertOne` or +:phpmethod:`MongoDB\\Collection::replaceOne` (with the ``upsert`` option). + +While the ``save`` method does have its uses for interactive environments, such +as the ``mongo`` shell, it was intentionally excluded from the +`CRUD specification `_ +for language drivers. Generally, application code should know if the document +has an identifier and be able to explicitly insert or replace the document and +handle the returned :phpclass:`MongoDB\\InsertOneResult` or +:phpclass:`MongoDB\\UpdateResult`, respectively. This also helps avoid +inadvertent and potentially dangerous :manual:`full-document replacements +`. + +Group Command Helper +~~~~~~~~~~~~~~~~~~~~ + +:phpclass:`MongoDB\\Collection` does have a helper method for the +:manual:`group ` command. The following example +demonstrates how to execute a group command using the +:phpmethod:`MongoDB\\Database::command()` method: + +.. code-block:: php + + selectDatabase('db_name'); + $cursor = $database->command([ + 'group' => [ + 'ns' => 'collection_name', + 'key' => ['field_name' => 1], + 'initial' => ['total' => 0], + '$reduce' => new MongoDB\BSON\Javascript('...'), + ], + ]); + + $resultDocument = $cursor->toArray()[0]; From e68ddc51330c867b790e6282e2855eadd037f781 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 29 Oct 2019 16:18:59 +0100 Subject: [PATCH 192/321] PHPLIB-477: Deprecate CodeWScope for use within the mapReduce command --- ...args-MongoDBCollection-method-mapReduce-option.yaml | 5 +++++ ...iargs-MongoDBCollection-method-mapReduce-param.yaml | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml index 8d02ffb7..33ef3892 100644 --- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml @@ -13,6 +13,11 @@ name: finalize type: :php:`MongoDB\\BSON\\Javascript ` description: | Follows the reduce method and modifies the output. + + .. note:: + + Passing a Javascript instance with a scope is deprecated. Put all scope + variables in the ``scope`` option of the MapReduce operation. interface: phpmethod operation: ~ optional: true diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml index 401d49ed..e8254f3e 100644 --- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml @@ -4,6 +4,11 @@ type: :php:`MongoDB\\BSON\\Javascript ` description: | A JavaScript function that associates or "maps" a value with a key and emits the key and value pair. + + .. note:: + + Passing a Javascript instance with a scope is deprecated. Put all scope + variables in the ``scope`` option of the MapReduce operation. interface: phpmethod operation: ~ optional: false @@ -14,6 +19,11 @@ type: :php:`MongoDB\\BSON\\Javascript ` description: | A JavaScript function that "reduces" to a single object all the values associated with a particular key. + + .. note:: + + Passing a Javascript instance with a scope is deprecated. Put all scope + variables in the ``scope`` option of the MapReduce operation. interface: phpmethod operation: ~ optional: false From e476a44d04a46c8f0ad553dc643a4f9c61956660 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 22 Jan 2020 08:45:57 +0100 Subject: [PATCH 193/321] PHPLIB-511: Document autoEncryption options in Client constructor docs --- ...ngoDBClient-method-construct-driverOptions.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml index 318d9d50..eb410d83 100644 --- a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml +++ b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml @@ -112,4 +112,18 @@ description: | interface: phpmethod operation: ~ optional: true +--- +arg_name: option +name: autoEncryption +type: array +description: | + Options to configure client-side field-level encryption in the driver. The + encryption options are documented in the :php:`extension documentation + `. + For the ``keyVaultClient`` option, you may pass a :phpclass:`MongoDB\\Client` + instance, which will be unwrapped to provide a :php:`MongoDB\\Driver\\Manager ` + to the extension. +interface: phpmethod +operation: ~ +optional: true ... From dd59b25750931037144feb9540fd3200bceee1e8 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 22 Jan 2020 09:41:01 +0100 Subject: [PATCH 194/321] PHPLIB-512: Document createClientEncryption method --- ...t-method-createClientEncryption-param.yaml | 4 ++ source/reference/class/MongoDBClient.txt | 1 + .../MongoDBClient-createClientEncryption.txt | 51 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml create mode 100644 source/reference/method/MongoDBClient-createClientEncryption.txt diff --git a/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml b/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml new file mode 100644 index 00000000..73ad04d0 --- /dev/null +++ b/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml @@ -0,0 +1,4 @@ +source: + file: apiargs-common-param.yaml + ref: $options +... diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt index ae1906ff..b638dc4b 100644 --- a/source/reference/class/MongoDBClient.txt +++ b/source/reference/class/MongoDBClient.txt @@ -30,6 +30,7 @@ Methods /reference/method/MongoDBClient__construct /reference/method/MongoDBClient__get + /reference/method/MongoDBClient-createClientEncryption /reference/method/MongoDBClient-dropDatabase /reference/method/MongoDBClient-getManager /reference/method/MongoDBClient-getReadConcern diff --git a/source/reference/method/MongoDBClient-createClientEncryption.txt b/source/reference/method/MongoDBClient-createClientEncryption.txt new file mode 100644 index 00000000..9b6f817e --- /dev/null +++ b/source/reference/method/MongoDBClient-createClientEncryption.txt @@ -0,0 +1,51 @@ +========================================= +MongoDB\\Client::createClientEncryption() +========================================= + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Definition +---------- + +.. phpmethod:: MongoDB\\Client::createClientEncryption() + + Returns a :php:`MongoDB\\Driver\\ClientEncryption ` + object for manual encryption and decryption of values. + + .. code-block:: php + + function createClientEncryption(array $options): MongoDB\Driver\ClientEncryption + + This method has the following parameters: + + .. include:: /includes/apiargs/MongoDBClient-method-createClientEncryption-param.rst + + The ``$options`` parameter supports all options documented in the + :php:`extension manual `. + For the ``keyVaultClient`` option, an instance of :phpclass:`MongoDB\\Client` + is automatically unwrapped and the :php:`MongoDB\\Driver\\Manager ` + instance is passed to the extension. + +Return Values +------------- + +A :php:`MongoDB\\Driver\\ClientEncryption ` +instance which can be used to encrypt and decrypt values. + +Errors/Exceptions +----------------- + +.. include:: /includes/extracts/error-invalidargumentexception.rst +.. include:: /includes/extracts/error-driver-invalidargumentexception.rst + +See Also +-------- + +- :php:`MongoDB\\Driver\\Manager::createClientEncryption() + ` From 418fb501b01d3bdac556615ba609ab9cfae379f8 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 28 Jan 2020 13:23:44 +0100 Subject: [PATCH 195/321] PHPLIB-521: Deprecate obsolete driver options --- ...Client-method-construct-driverOptions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml index eb410d83..2597b544 100644 --- a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml +++ b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml @@ -26,6 +26,10 @@ description: | Allowing invalid hostnames may expose the driver to a `man-in-the-middle attack `_. + + .. deprecated:: 1.6 + This option has been deprecated. Use the ``tlsAllowInvalidHostnames`` URI + option instead. interface: phpmethod operation: ~ optional: true @@ -50,6 +54,9 @@ description: | used by default. Falls back to the deprecated ``cafile`` SSL context option if not specified. + + .. deprecated:: 1.6 + This option has been deprecated. Use the ``tlsCAFile`` URI option instead. interface: phpmethod operation: ~ optional: true @@ -71,6 +78,10 @@ description: | Falls back to the deprecated ``local_cert`` SSL context option if not specified. + + .. deprecated:: 1.6 + This option has been deprecated. Use the ``tlsCertificateKeyFile`` URI + option instead. interface: phpmethod operation: ~ optional: true @@ -83,6 +94,10 @@ description: | Falls back to the deprecated ``passphrase`` SSL context option if not specified. + + .. deprecated:: 1.6 + This option has been deprecated. Use the ``tlsCertificateKeyFilePassword`` + URI option instead. interface: phpmethod operation: ~ optional: true @@ -95,6 +110,10 @@ description: | Falls back to the deprecated ``allow_self_signed`` SSL context option if not specified. + + .. deprecated:: 1.6 + This option has been deprecated. Use the ``tlsAllowInvalidCertificates`` + URI option instead. interface: phpmethod operation: ~ optional: true From 3bc1501d22d3cd67920e74e3ce3f55a51a293d24 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 29 Jan 2020 21:06:36 -0500 Subject: [PATCH 196/321] Common docs for hint option --- ...MongoDBCollection-method-aggregate-option.yaml | 2 +- ...args-MongoDBCollection-method-find-option.yaml | 15 ++++----------- ...s-MongoDBCollection-method-findOne-option.yaml | 4 +++- ...s-MongoDBDatabase-method-aggregate-option.yaml | 2 +- source/includes/apiargs-aggregate-option.yaml | 11 ----------- source/includes/apiargs-common-option.yaml | 11 +++++++++++ 6 files changed, 20 insertions(+), 25 deletions(-) diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml index c2b4021e..86edc1d5 100644 --- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml @@ -23,7 +23,7 @@ post: | .. versionadded:: 1.4 --- source: - file: apiargs-aggregate-option.yaml + file: apiargs-common-option.yaml ref: hint post: | .. versionadded:: 1.3 diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml index fe4f85a8..450df8a7 100644 --- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml @@ -87,18 +87,11 @@ interface: phpmethod operation: ~ optional: true --- -arg_name: option -name: hint -type: string|array|object -description: | - The index to use. Specify either the index name as a string or the index key - pattern as a document. If specified, then the query system will only consider - plans using the hinted index. - +source: + file: apiargs-common-option.yaml + ref: hint +post: | .. versionadded:: 1.2 -interface: phpmethod -operation: ~ -optional: true --- arg_name: option name: maxAwaitTimeMS diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml index 7c06a855..05247166 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml @@ -19,8 +19,10 @@ source: ref: comment --- source: - file: apiargs-MongoDBCollection-method-find-option.yaml + file: apiargs-common-option.yaml ref: hint +post: | + .. versionadded:: 1.2 --- source: file: apiargs-common-option.yaml diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml index d7529a60..5d80f32a 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml @@ -19,7 +19,7 @@ source: ref: explain --- source: - file: apiargs-aggregate-option.yaml + file: apiargs-common-option.yaml ref: hint --- source: diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml index 25b121ac..3de7a09d 100644 --- a/source/includes/apiargs-aggregate-option.yaml +++ b/source/includes/apiargs-aggregate-option.yaml @@ -49,15 +49,4 @@ description: | interface: phpmethod operation: ~ optional: true ---- -arg_name: option -name: hint -type: string|array|object -description: | - The index to use. Specify either the index name as a string or the index key - pattern as a document. If specified, then the query system will only consider - plans using the hinted index. -interface: phpmethod -operation: ~ -optional: true ... diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml index 38ea8e74..41f91820 100644 --- a/source/includes/apiargs-common-option.yaml +++ b/source/includes/apiargs-common-option.yaml @@ -16,6 +16,17 @@ operation: ~ optional: true --- arg_name: option +name: hint +type: string|array|object +description: | + The index to use. Specify either the index name as a string or the index key + pattern as a document. If specified, then the query system will only consider + plans using the hinted index. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: maxTimeMS type: integer description: | From bd843cfc52f1c92a0aaa83855fd7ce3238c29f95 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 29 Jan 2020 21:04:17 -0500 Subject: [PATCH 197/321] PHPLIB-491: Support hint for update command Spec tests from mongodb/specifications@60adafcffa07174ac54c6e8658bd37a3faf350c3 --- ...iargs-MongoDBCollection-method-replaceOne-option.yaml | 9 +++++++++ ...iargs-MongoDBCollection-method-updateMany-option.yaml | 9 +++++++++ ...piargs-MongoDBCollection-method-updateOne-option.yaml | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml index 55eb32a7..cfc3a71d 100644 --- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml @@ -10,6 +10,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: hint +post: | + This option is available in MongoDB 4.2+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.6 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml index ae27c0d9..b94cb750 100644 --- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml @@ -16,6 +16,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: hint +post: | + This option is available in MongoDB 4.2+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.6 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml index ae27c0d9..b94cb750 100644 --- a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml @@ -16,6 +16,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: hint +post: | + This option is available in MongoDB 4.2+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.6 +--- source: file: apiargs-common-option.yaml ref: session From e35350c534ba7fd4c226ed5b3fb70d141edbbeb2 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 29 Jan 2020 11:23:18 +0100 Subject: [PATCH 198/321] PHPLIB-492: Create tutorial for client side encryption --- source/tutorial.txt | 1 + source/tutorial/client-side-encryption.txt | 241 +++++++++++++++++++++ 2 files changed, 242 insertions(+) create mode 100644 source/tutorial/client-side-encryption.txt diff --git a/source/tutorial.txt b/source/tutorial.txt index 57a14c8e..7735508e 100644 --- a/source/tutorial.txt +++ b/source/tutorial.txt @@ -10,6 +10,7 @@ Tutorials /tutorial/commands /tutorial/custom-types /tutorial/decimal128 + /tutorial/client-side-encryption /tutorial/gridfs /tutorial/indexes /tutorial/tailable-cursor diff --git a/source/tutorial/client-side-encryption.txt b/source/tutorial/client-side-encryption.txt new file mode 100644 index 00000000..cc77b07b --- /dev/null +++ b/source/tutorial/client-side-encryption.txt @@ -0,0 +1,241 @@ +====================== +Client-Side Encryption +====================== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Client-Side Field Level Encryption allows administrators and developers to +encrypt specific data fields in addition to other MongoDB encryption features. + + +Automatic Encryption and Decryption +----------------------------------- + +.. note:: + + Auto encryption is an enterprise only feature. + +The following example uses a local key, however using AWS Key Management Service +is also an option. The data in the ``encryptedField`` field is automatically +encrypted on insertion and decrypted when querying on the client side. + +.. code-block:: php + + ', Binary::TYPE_GENERIC); + + $encryptionOpts = [ + 'keyVaultNamespace' => 'admin.datakeys', + 'kmsProviders' => [ + 'local' => ['key' => $localKey], + ], + ]; + + $client = new Client('mongodb://127.0.0.1'); + $clientEncryption = $client->createClientEncryption($encryptionOpts); + + $database = $client->selectDatabase('test'); + $database->dropCollection('coll'); // remove old data + + // Create new key in the key vault and store its ID for later use + $keyId = $clientEncryption->createDataKey('local'); + + $database->createCollection('coll', [ + 'validator' => [ + '$jsonSchema' => [ + 'bsonType' => 'object', + 'properties' => [ + 'encryptedField' => [ + 'encrypt' => [ + 'keyId' => [$keyId], + 'bsonType' => 'string', + 'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC, + ], + ], + ], + ], + ], + ]); + + $encryptedClient = new Client('mongodb://127.0.0.1', [], ['autoEncryption' => $encryptionOpts]); + + $collection = $encryptedClient->selectCollection('test', 'coll'); + + $collection->insertOne(['encryptedField' => '123456789']); + + var_dump($collection->findOne([])); + + +Specifying an Explicit Schema for Encryption +-------------------------------------------- + +The following example shows how to create a new key and store it in the key +vault collection. The encrypted client configures an explicit schema for +encryption using the newly created key. + +.. note:: + + Supplying a ``schemaMap`` provides more security than relying on JSON schemas + obtained from the server. It protects against a malicious server advertising + a false JSON schema, which could trick the client into sending unencrypted + data that should be encrypted. + +.. code-block:: php + + ', Binary::TYPE_GENERIC); + + $clientEncryptionOpts = [ + 'keyVaultNamespace' => 'admin.datakeys', + 'kmsProviders' => [ + 'local' => ['key' => $localKey], + ], + ]; + + $client = new Client(); + $clientEncryption = $client->createClientEncryption($clientEncryptionOpts); + + // Create new key in the key vault and store its ID for later use + $keyId = $clientEncryption->createDataKey('local'); + + $autoEncryptionOpts = [ + 'keyVaultNamespace' => 'admin.datakeys', + 'kmsProviders' => [ + 'local' => ['key' => $localKey], + ], + 'schemaMap' => [ + 'test.coll' => [ + 'bsonType' => 'object', + 'properties' => [ + 'encryptedField' => [ + 'encrypt' => [ + 'keyId' => [$keyId], + 'bsonType' => 'string', + 'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC, + ], + ], + ], + ], + ], + ]; + + $encryptedClient = new Client('mongodb://127.0.0.1', [], ['autoEncryption' => $autoEncryptionOpts]); + + $collection = $encryptedClient->selectCollection('test', 'coll'); + $collection->drop(); // clear old data + + $collection->insertOne(['encryptedField' => '123456789']); + + var_dump($collection->findOne([])); + + +Manually Encrypting and Decrypting Values +----------------------------------------- + +In the MongoDB Community Edition, you will have to manually encrypt and decrypt +values before storing them in the database. The following example assumes that +you have already created an encryption key in the key vault collection and +explicitly encrypts and decrypts values in the document. + +.. code-block:: php + + ', Binary::TYPE_GENERIC); + + $clientEncryptionOpts = [ + 'keyVaultNamespace' => 'admin.datakeys', + 'kmsProviders' => [ + 'local' => ['key' => $localKey], + ], + ]; + + $client = new Client(); + $clientEncryption = $client->createClientEncryption($clientEncryptionOpts); + + // Create new key in the key vault and store its ID for later use + $keyId = $clientEncryption->createDataKey('local'); + + $collection = $client->selectCollection('test', 'coll'); + $collection->drop(); // clear old data + + $encryptionOpts = [ + 'keyId' => $keyId, + 'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC, + ]; + $encryptedValue = $clientEncryption->encrypt('123456789', $encryptionOpts); + + $collection->insertOne(['encryptedField' => $encryptedValue]); + + $document = $collection->findOne(); + var_dump($clientEncryption->decrypt($document->encryptedField)); + + +Referencing Encryption Keys by an Alternative Name +-------------------------------------------------- + +While it is possible to create an encryption key every time data is encrypted, +this is not the recommended approach. Instead, you should create your encryption +keys depending on your use-case, e.g. by creating a user-specific encryption +key. To reference keys in your software, you can use the keyAltName attribute +specified when creating the key. The following example creates an encryption key +with an alternative name, which could be done when deploying the application. +The software then encrypts data by referencing the key by its alternative name. + +.. code-block:: php + + ', Binary::TYPE_GENERIC); + + $clientEncryptionOpts = [ + 'keyVaultNamespace' => 'admin.datakeys', + 'kmsProviders' => [ + 'local' => ['key' => $localKey], + ], + ]; + + $client = new Client(); + $clientEncryption = $client->createClientEncryption($clientEncryptionOpts); + + // Create an encryption key with an alternative name. This could be done when + // deploying the application + $keyId = $clientEncryption->createDataKey('local', ['keyAltNames' => ['altname']]); + + $collection = $client->selectCollection('test', 'coll'); + $collection->drop(); // clear old data + + // Reference the encryption key we created earlier by its alternative name + $encryptionOpts = [ + 'keyAltName' => 'altname', + 'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC, + ]; + $encryptedValue = $clientEncryption->encrypt('123456789', $encryptionOpts); + + $collection->insertOne(['encryptedField' => $encryptedValue]); + + $document = $collection->findOne(); + var_dump($clientEncryption->decrypt($document->encryptedField)); From 3e28ca9e05a01ec3688a64b76e1530f7eba6761b Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Fri, 24 Jan 2020 13:52:32 -0500 Subject: [PATCH 199/321] PHPLIB-497: Allow passing hint to findAndModify update/replace ops --- ...ongoDBCollection-method-findOneAndReplace-option.yaml | 9 +++++++++ ...MongoDBCollection-method-findOneAndUpdate-option.yaml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml index caaac953..6b282dd2 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml @@ -10,6 +10,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: hint +post: | + This option is available in MongoDB 4.4+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.7 +--- source: file: apiargs-common-option.yaml ref: maxTimeMS diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml index 858ddb2a..8393d26a 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml @@ -16,6 +16,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: hint +post: | + This option is available in MongoDB 4.4+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.7 +--- source: file: apiargs-common-option.yaml ref: maxTimeMS From 0eaabec21c2e9966d4d928fb951ba8a3cf3e7313 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 7 Feb 2020 11:03:30 +0100 Subject: [PATCH 200/321] PHPLIB-500: Support for allowDiskUse on find operations --- .../apiargs-MongoDBCollection-method-find-option.yaml | 11 +++++++++++ ...iargs-MongoDBCollection-method-findOne-option.yaml | 4 ++++ ...piargs-MongoDBGridFSBucket-method-find-option.yaml | 4 ++++ ...rgs-MongoDBGridFSBucket-method-findOne-option.yaml | 4 ++++ 4 files changed, 23 insertions(+) diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml index 450df8a7..311905a4 100644 --- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml @@ -47,6 +47,17 @@ operation: ~ optional: true --- arg_name: option +name: allowDiskUse +type: boolean +description: | + Enables writing to temporary files. When set to ``true``, queries can write + data to the ``_tmp`` sub-directory in the ``dbPath`` directory. The default is + ``false``. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: batchSize type: integer description: | diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml index 05247166..2371aabe 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml @@ -10,6 +10,10 @@ source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: skip --- +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: allowDiskUse +--- source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml index 84bab2c3..1f2e9d8e 100644 --- a/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml +++ b/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml @@ -14,6 +14,10 @@ source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: limit --- +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: allowDiskUse +--- source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: batchSize diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml index 25a9dc1d..3d0d0ed8 100644 --- a/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml +++ b/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml @@ -10,6 +10,10 @@ source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: skip --- +source: + file: apiargs-MongoDBCollection-method-find-option.yaml + ref: allowDiskUse +--- source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation From 091b0b04db2746dce4016609a5fbbbba859f740a Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 24 Mar 2020 12:38:35 +0100 Subject: [PATCH 201/321] PHPLIB-520: Document deprecation of oplogReplay find option --- .../includes/apiargs-MongoDBCollection-method-find-option.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml index 311905a4..d6ff4c53 100644 --- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml @@ -182,6 +182,8 @@ description: | The :php:`MongoDB\\BSON\\Timestamp ` class reference describes how to represent MongoDB's BSON timestamp type with PHP. + + .. deprecated:: 1.7 interface: phpmethod operation: ~ optional: true From 69518ebf37d48e11ceb6f162c7622a342d54c695 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 24 Mar 2020 13:27:25 +0100 Subject: [PATCH 202/321] PHPLIB-516: Append PHPLIB version information to handshake data --- ...Client-method-construct-driverOptions.yaml | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml index 2597b544..77520c0d 100644 --- a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml +++ b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml @@ -142,6 +142,34 @@ description: | For the ``keyVaultClient`` option, you may pass a :phpclass:`MongoDB\\Client` instance, which will be unwrapped to provide a :php:`MongoDB\\Driver\\Manager ` to the extension. + .. versionadded:: 1.6 +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option +name: driver +type: array +description: | + Additional driver metadata to be passed on to the server handshake. This is an + array containing ``name``, ``version``, and ``platform`` fields: + + .. code-block:: php + + [ + 'name' => 'my-driver', + 'version' => '1.2.3-dev', + 'platform' => 'some-platform', + ] + + .. note:: + + This feature is primarily designed for custom drivers and ODMs, which may + want to identify themselves to the server for diagnostic purposes. + Applications should use the ``appName`` URI option instead of driver + metadata. + + .. versionadded:: 1.7 interface: phpmethod operation: ~ optional: true From a33d049401f7c109b72748a5148614591a42586e Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 30 Mar 2020 15:30:00 +0200 Subject: [PATCH 203/321] PHPLIB-539: Allow hinting for delete --- ...iargs-MongoDBCollection-method-deleteMany-option.yaml | 9 +++++++++ ...piargs-MongoDBCollection-method-deleteOne-option.yaml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml index 81e520bb..55f6af9b 100644 --- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml @@ -2,6 +2,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: hint +post: | + This option is available in MongoDB 4.4+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.7 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml index 81e520bb..55f6af9b 100644 --- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml @@ -2,6 +2,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: hint +post: | + This option is available in MongoDB 4.4+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.7 +--- source: file: apiargs-common-option.yaml ref: session From afe0ea21479996f800111fe22761ba109dfb2d19 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 6 Apr 2020 13:51:41 +0200 Subject: [PATCH 204/321] PHPLIB-434: Add note about performance of countDocuments --- .../reference/method/MongoDBCollection-countDocuments.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt index 61e292e6..b66171c2 100644 --- a/source/reference/method/MongoDBCollection-countDocuments.txt +++ b/source/reference/method/MongoDBCollection-countDocuments.txt @@ -52,6 +52,14 @@ obtain the result. If a ``filter`` parameter is given, this is converted into a ``$match`` pipeline operator. Optional ``$skip`` and ``$limit`` stages are added between ``$match`` and ``group`` if present in the options. +.. note:: + + This method counts documents on the server side. To obtain an approximate + total number of documents without filters, the + :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()` method can be + used. This method estimates the number of documents based on collection + metadata, thus sacrificing accuracy for performance. + Since this method uses an aggregation pipeline, some query operators accepted within a :phpmethod:`MongoDB\\Collection::count()` ``filter`` cannot be used. Consider the following alternatives to these restricted operators: From c869367488457e3ae2cb84d179122c52f4101d1d Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 6 Apr 2020 13:51:57 +0200 Subject: [PATCH 205/321] Fix typo in index documentation --- source/reference/method/MongoDBCollection-createIndex.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt index ff4150ea..6385b578 100644 --- a/source/reference/method/MongoDBCollection-createIndex.txt +++ b/source/reference/method/MongoDBCollection-createIndex.txt @@ -73,7 +73,7 @@ The output would then resemble:: Create a Partial Index ~~~~~~~~~~~~~~~~~~~~~~ -The following example adds a :manual:`partial index ` on +The following example adds a :manual:`partial index ` on the ``borough`` field in the ``restaurants`` collection in the ``test`` database. The partial index indexes only documents where the ``borough`` field exists. From e303a087f5f7b0d7380513ad49a1debf065933d7 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 20 Apr 2020 15:34:54 +0200 Subject: [PATCH 206/321] PHPLIB-545: Support the authorizedDatabases options for listDatabases --- ...gs-MongoDBClient-method-listDatabases-option.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml index 95c4a54e..3d839f17 100644 --- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml +++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml @@ -1,4 +1,16 @@ arg_name: option +name: authorizedDatabases +type: boolean +description: | + A flag that determines which databases are returned based on the user + privileges when access control is enabled. For more information, see the + `listDatabases command documentation `_. + + For servers < 4.0.5, this option is ignored. + + .. versionadded:: 1.7 +--- +arg_name: option name: filter type: array|object description: | From e4d0720ce9e076df7a089ed562acd0085a4f7494 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 4 May 2020 09:23:22 -0400 Subject: [PATCH 207/321] Fix type for createCollection validator option docs --- .../apiargs-MongoDBDatabase-method-createCollection-option.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml index d70a905f..a8c8670b 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -132,7 +132,7 @@ post: | --- arg_name: option name: validator -type: array +type: array|object description: | Allows users to specify :manual:`validation rules or expressions ` for the collection. For more information, see From ef308f56d6074c0a057fe7d0b2bfec6582e1a5dc Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 28 Apr 2020 12:45:34 +0200 Subject: [PATCH 208/321] PHPLIB-544: Add commitQuorum option to createIndexes --- ...BCollection-method-createIndex-option.yaml | 19 +++++++++++++++++++ ...ollection-method-createIndexes-option.yaml | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml index 456b0f25..8576d913 100644 --- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml @@ -1,4 +1,23 @@ arg_name: option +name: commitQuorum +type: string|integer +description: | + Specifies how many data-bearing members of a replica set, including the + primary, must complete the index builds successfully before the primary marks + the indexes as ready. + + This option accepts the same values for the "w" field in a write concern plus + "votingMembers", which indicates all voting data-bearing nodes. + + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.7 +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: unique type: boolean description: | diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml index 2b67712f..bea00033 100644 --- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml @@ -1,3 +1,22 @@ +arg_name: option +name: commitQuorum +type: string|integer +description: | + Specifies how many data-bearing members of a replica set, including the + primary, must complete the index builds successfully before the primary marks + the indexes as ready. + + This option accepts the same values for the "w" field in a write concern plus + "votingMembers", which indicates all voting data-bearing nodes. + + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.7 +interface: phpmethod +operation: ~ +optional: true +--- source: file: apiargs-common-option.yaml ref: maxTimeMS From 55c7306648e1dc1045c143a5932f637731755b02 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 29 Apr 2020 12:43:24 +0200 Subject: [PATCH 209/321] Don't duplicate description for docs --- ...BCollection-method-createIndex-option.yaml | 4 ++-- ...ollection-method-createIndexes-option.yaml | 21 +++---------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml index 8576d913..1a76b33c 100644 --- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml @@ -6,8 +6,8 @@ description: | primary, must complete the index builds successfully before the primary marks the indexes as ready. - This option accepts the same values for the "w" field in a write concern plus - "votingMembers", which indicates all voting data-bearing nodes. + This option accepts the same values for the ``w`` field in a write concern + plus ``"votingMembers"``, which indicates all voting data-bearing nodes. This is not supported for server versions prior to 4.4 and will result in an exception at execution time if used. diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml index bea00033..8808ddd1 100644 --- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml @@ -1,21 +1,6 @@ -arg_name: option -name: commitQuorum -type: string|integer -description: | - Specifies how many data-bearing members of a replica set, including the - primary, must complete the index builds successfully before the primary marks - the indexes as ready. - - This option accepts the same values for the "w" field in a write concern plus - "votingMembers", which indicates all voting data-bearing nodes. - - This is not supported for server versions prior to 4.4 and will result in an - exception at execution time if used. - - .. versionadded:: 1.7 -interface: phpmethod -operation: ~ -optional: true +source: + file: apiargs-MongoDBCollection-method-createIndex-option.yaml + ref: commitQuorum --- source: file: apiargs-common-option.yaml From fc7a52f3f66993d6a2b0b0a8df21d63c24cdffde Mon Sep 17 00:00:00 2001 From: Chris Cho Date: Mon, 1 Jun 2020 16:08:42 -0400 Subject: [PATCH 210/321] DOCSP-10188: fix yaml file preventing docs build --- .../apiargs-MongoDBClient-method-listDatabases-option.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml index 3d839f17..4e3d616d 100644 --- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml +++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml @@ -9,6 +9,9 @@ description: | For servers < 4.0.5, this option is ignored. .. versionadded:: 1.7 +interface: phpmethod +operation: ~ +optional: true --- arg_name: option name: filter From c9845daf41bf1bd163608c9bc948bf2d5546fbc0 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 30 Jun 2020 12:57:12 +0200 Subject: [PATCH 211/321] PHPLIB-559: Make aggregate command explainable --- source/reference/method/MongoDBCollection-explain.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt index df1c82e7..5ae73c91 100644 --- a/source/reference/method/MongoDBCollection-explain.txt +++ b/source/reference/method/MongoDBCollection-explain.txt @@ -50,6 +50,7 @@ Explainable Commands Explainable commands include, but are not limited to: + - :phpclass:`MongoDB\\Operation\\Aggregate` - :phpclass:`MongoDB\\Operation\\Count` - :phpclass:`MongoDB\\Operation\\DeleteMany` - :phpclass:`MongoDB\\Operation\\DeleteOne` From 45d00ef8c12a6bf4950a712dbae530154587c6bb Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 29 Jun 2020 13:30:19 +0200 Subject: [PATCH 212/321] PHPLIB-547: Implement listDatabaseNames helper --- .../MongoDBClient-listDatabaseNames.txt | 75 +++++++++++++++++++ .../method/MongoDBClient-listDatabases.txt | 4 + 2 files changed, 79 insertions(+) create mode 100644 source/reference/method/MongoDBClient-listDatabaseNames.txt diff --git a/source/reference/method/MongoDBClient-listDatabaseNames.txt b/source/reference/method/MongoDBClient-listDatabaseNames.txt new file mode 100644 index 00000000..f5834792 --- /dev/null +++ b/source/reference/method/MongoDBClient-listDatabaseNames.txt @@ -0,0 +1,75 @@ +==================================== +MongoDB\\Client::listDatabaseNames() +==================================== + +.. versionadded:: 1.7 + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Definition +---------- + +.. phpmethod:: MongoDB\\Client::listDatabaseNames() + + Returns names for all databases on the server. + + .. code-block:: php + + function listDatabaseNames(array $options = []): Iterator + + This method has the following parameters: + + .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-param.rst + + The ``$options`` parameter supports the following options: + + .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-option.rst + +Return Values +------------- + +An :php:`Iterator `, which provides the name of each +database on the server. + +Errors/Exceptions +----------------- + +.. include:: /includes/extracts/error-unexpectedvalueexception.rst +.. include:: /includes/extracts/error-invalidargumentexception.rst +.. include:: /includes/extracts/error-driver-runtimeexception.rst + +Example +------- + +The following example lists all databases on the server: + +.. code-block:: php + + listDatabaseNames() as $databaseName) { + var_dump($databaseName); + } + +The output would then resemble:: + + string(5) "local" + string(4) "test" + +See Also +-------- + +- :phpmethod:`MongoDB\\Database::listDatabases()` +- :manual:`listDatabases ` command reference + in the MongoDB manual +- `Enumerating Databases + `_ + specification diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt index 876a3f0e..10e7dbbb 100644 --- a/source/reference/method/MongoDBClient-listDatabases.txt +++ b/source/reference/method/MongoDBClient-listDatabases.txt @@ -80,5 +80,9 @@ The output would then resemble:: See Also -------- +- :phpmethod:`MongoDB\\Database::listDatabaseNames()` - :manual:`listDatabases ` command reference in the MongoDB manual +- `Enumerating Databases + `_ + specification From e937569de3f9fb20e33660c51571564efb0dec2b Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 29 Jun 2020 13:30:55 +0200 Subject: [PATCH 213/321] PHPLIB-547: Implement listCollectionNames helper --- .../MongoDBDatabase-listCollectionNames.txt | 98 +++++++++++++++++++ .../MongoDBDatabase-listCollections.txt | 1 + 2 files changed, 99 insertions(+) create mode 100644 source/reference/method/MongoDBDatabase-listCollectionNames.txt diff --git a/source/reference/method/MongoDBDatabase-listCollectionNames.txt b/source/reference/method/MongoDBDatabase-listCollectionNames.txt new file mode 100644 index 00000000..6e973df1 --- /dev/null +++ b/source/reference/method/MongoDBDatabase-listCollectionNames.txt @@ -0,0 +1,98 @@ +======================================== +MongoDB\\Database::listCollectionNames() +======================================== + +.. versionadded:: 1.7 + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Definition +---------- + +.. phpmethod:: MongoDB\\Database::listCollectionNames() + + Returns names for all collections in this database. + + .. code-block:: php + + function listCollectionNames(array $options = []): Iterator + + This method has the following parameters: + + .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-param.rst + + The ``$options`` parameter supports the following options: + + .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-option.rst + +Return Values +------------- + +An :php:`Iterator `, which provides the name of each +collection in the database. + +Example +------- + +The following example lists all of the collections in the ``test`` database: + +.. code-block:: php + + test; + + foreach ($database->listCollectionNames() as $collectionName) { + var_dump($collectionName); + } + +The output would then resemble:: + + string(11) "restaurants" + string(5) "users" + string(6) "restos" + +The following example lists all collections whose name starts with ``"rest"`` +in the ``test`` database: + +.. code-block:: php + + test; + + $collections = $database->listCollectionNames([ + 'filter' => [ + 'name' => new MongoDB\BSON\Regex('^rest.*'), + ], + ]); + + foreach ($collections as $collectionName) { + var_dump($collectionName); + } + +The output would then resemble:: + + string(11) "restaurants" + string(6) "restos" + +.. note:: + + When enumerating collection names, a filter expression can only filter based + on a collection's name and type. No other fields are available. + +See Also +-------- + +- :phpmethod:`MongoDB\\Database::listCollections()` +- :manual:`listCollections `_ + specification diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt index 99fd69f5..eb0c4c92 100644 --- a/source/reference/method/MongoDBDatabase-listCollections.txt +++ b/source/reference/method/MongoDBDatabase-listCollections.txt @@ -114,6 +114,7 @@ The output would then resemble:: See Also -------- +- :phpmethod:`MongoDB\\Database::listCollectionNames()` - :manual:`listCollections Date: Wed, 8 Jul 2020 22:12:36 -0400 Subject: [PATCH 214/321] PHPLIB-524 Restructure docs index This revises the intro text and links to PHPLIB and MongoDB tutorials. --- source/index.txt | 60 ++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/source/index.txt b/source/index.txt index 6c3a9740..ffdd4b16 100644 --- a/source/index.txt +++ b/source/index.txt @@ -8,45 +8,53 @@ The |php-library| provides a high-level abstraction around the lower-level `PHP driver `_, also known as the ``mongodb`` extension. -While the ``mongodb`` extension provides a limited API for executing commands, -queries, and write operations, the |php-library| implements an API similar to -that of the `legacy PHP driver `_. The -library contains abstractions for client, database, and collection objects, and -provides methods for CRUD operations and common commands such as index and -collection management. +The ``mongodb`` extension provides a limited API to connect to the database and +execute generic commands, queries, and write operations. In contrast, the +|php-library| provides a full-featured API and models client, database, and +collection objects. Each of those classes provide various helper methods for +performing operations in context. For example, :phpclass:`MongoDB\\Collection` +implements methods for executing CRUD operations and managing indexes on the +collection, among other things. If you are developing a PHP application with MongoDB, you should consider using -this library, or another high-level abstraction, instead of the extension alone. +the |php-library| instead of the extension alone. -For additional information about this library and the ``mongodb`` extension, see -the `Architecture Overview `_ -article in the extension documentation. `Derick Rethans -`_ has also written a series of blog posts entitled -*New MongoDB Drivers for PHP and HHVM*: +New to the PHP Library? +----------------------- -- `Part One: History `_ +If you have some experience with MongoDB but are new to the PHP library, the +following pages should help you get started: -- `Part Two: Architecture - `_ +- :doc:`/tutorial/install-php-library` -- `Part Three: Cursor Behaviour - `_ +- :doc:`/tutorial/crud` + +- :doc:`/tutorial/commands` + +- :doc:`/tutorial/gridfs` + +- :doc:`/reference/bson` + +If you have previously worked with the +`legacy PHP driver `_ (i.e. ``mongo`` +extension), it will be helpful to review the :doc:`/upgrade` for a summary of +API changes between the old driver and this library. New to MongoDB? --------------- -If you are a new MongoDB user, these links should help you become more familiar -with MongoDB and introduce some of the concepts and terms you will encounter in -this documentation: +If you are a new MongoDB user, the following links should help you become more +familiar with MongoDB and introduce some of the concepts and terms you will +encounter in the library documentation: -- :manual:`Introduction to CRUD operations in MongoDB ` +- :manual:`Introduction to MongoDB ` -- :manual:`What is a MongoDB document? ` +- :manual:`Databases and Collections ` -- :manual:`Dot notation for accessing document properties - ` +- :manual:`Documents ` and + :manual:`BSON Types ` -- :manual:`ObjectId: MongoDB's document identifier ` +- :manual:`MongoDB CRUD Operations ` .. class:: hidden @@ -57,5 +65,3 @@ this documentation: /tutorial /upgrade /reference - -.. /getting-started From 03311dcd06fa7f452b58b78f6b8b1192081bb8c2 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 8 Jul 2020 22:14:24 -0400 Subject: [PATCH 215/321] PHPLIB-523 Document install steps for extension This adds inline instructions for installing the extension in lieu of sending readers to PHP.net. --- source/tutorial/install-php-library.txt | 100 ++++++++++++++++++------ 1 file changed, 74 insertions(+), 26 deletions(-) diff --git a/source/tutorial/install-php-library.txt b/source/tutorial/install-php-library.txt index 0c4098a0..acaa8ed1 100644 --- a/source/tutorial/install-php-library.txt +++ b/source/tutorial/install-php-library.txt @@ -4,55 +4,103 @@ Install the |php-library| .. default-domain:: mongodb -Prerequisites -------------- +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +The |php-library| is a high-level abstraction for the +`PHP driver `_ (i.e. ``mongodb`` extension). This page +will briefly explain how to install both the ``mongodb`` extension and the +|php-library|. + +Installing the Extension +------------------------ + +Linux, Unix, and macOS users can either +:php:`install the extension with PECL ` +(recommended) or +:php:`manually compile from source `. +The following command may be used to install the extension with PECL: -The |php-library| is a high-level abstraction for the MongoDB PHP driver. As -such, you must install the `mongodb` extension to use the library. +.. code-block:: sh + + sudo pecl install mongodb + +.. note:: + + If the build process for either installation method fails to find a TLS + library, check that the development packages (e.g. ``libssl-dev``) and + `pkg-config `_ are both installed. + +Once the extension is installed, add the following line to your ``php.ini`` +file: + +.. code-block:: ini -:php:`Installing the MongoDB PHP Driver ` -describes how to install the `mongodb` extension for PHP. Instructions for -installing the driver for HHVM may be found in the :php:`Installation with HHVM -` article. + extension=mongodb.so -Procedure ---------- +Windows users can download precompiled binaries of the extension from +`PECL `_. After extracting the +``php_mongodb.dll`` file to PHP's extension directory, add the following line to +your ``php.ini`` file: -Install the Library -~~~~~~~~~~~~~~~~~~~ +.. code-block:: ini -The preferred method of installing |php-library| is with `Composer -`_ by running the following from your project -root: + extension=php_mongodb.dll + +Windows binaries are available for various combinations of PHP version, +thread-safety, and architecture. Failure to select the correct binary will +result in an error attempting to load the extension DLL at runtime. Additional +considerations for Windows are discussed in the +:php:`Windows installation documentation `. + +.. note:: + + If your system has multiple versions of PHP installed, each version will have + its own ``pecl`` command and ``php.ini`` file. Additionally, PHP may also use + separate ``php.ini`` files for its web and CLI environments. If the extension + has been installed but is not available at runtime, double-check that you + have used the correct ``pecl`` command (or binary in the case of Windows) and + have modified the appropriate ``php.ini`` file(s). + +Installing the Library +---------------------- + +The preferred method of installing the |php-library| is with +`Composer `_ by running the following command from +your project root: .. code-block:: sh composer require mongodb/mongodb -While not recommended, you may also manually install the package via -the source tarballs attached to the `GitHub releases -`_. +While not recommended, you may also manually install the library using a source +archive attached to the +`GitHub releases `_. Configure Autoloading ~~~~~~~~~~~~~~~~~~~~~ -Once you have installed the library, ensure that your application -includes Composer's autoloader. The ``require_once`` -statement should point to Composer's autoloader, as in the following example: +Once you have installed the library, ensure that your application includes +Composer's autoloader as in the following example: .. code-block:: php - require_once __DIR__ . "/vendor/autoload.php"; + `_ for more information about setting up autoloading. -If you installed the library manually from a source tarball, you -will also need to manually configure autoloading: +If you installed the library manually from a source archive, you will need to +manually configure autoloading: #. Map the top-level ``MongoDB\`` namespace to the ``src/`` directory using your preferred autoloader implementation. -#. Manually require the ``src/functions.php`` file, since PHP does not - yet support function autoloading. +#. Manually require the ``src/functions.php`` file. This is necessary because + PHP does not support autoloading for functions. From d6b0ae22dd0b69636a9f9f90f1fc73fa897386fe Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 8 Jul 2020 22:16:10 -0400 Subject: [PATCH 216/321] Fix doc syntax and formatting --- source/reference/method/MongoDBCollection-createIndex.txt | 2 +- source/reference/method/MongoDBCollection-deleteMany.txt | 2 +- source/reference/method/MongoDBCollection-deleteOne.txt | 2 +- source/tutorial/example-data.txt | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt index ff4150ea..4d06b1b0 100644 --- a/source/reference/method/MongoDBCollection-createIndex.txt +++ b/source/reference/method/MongoDBCollection-createIndex.txt @@ -82,7 +82,7 @@ exists. selectCollection('test, 'restaurants'); + $collection = (new MongoDB\Client)->selectCollection('test', 'restaurants'); $indexName = $collection->createIndex( ['borough' => 1], diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt index fb84bd99..df1a1ac8 100644 --- a/source/reference/method/MongoDBCollection-deleteMany.txt +++ b/source/reference/method/MongoDBCollection-deleteMany.txt @@ -78,5 +78,5 @@ See Also - :phpmethod:`MongoDB\\Collection::deleteOne()` - :phpmethod:`MongoDB\\Collection::bulkWrite()` - :doc:`/tutorial/crud` -- :manual:`delete ` command reference in the MongoDB manual diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt index 27ba5a7c..0c31bfb5 100644 --- a/source/reference/method/MongoDBCollection-deleteOne.txt +++ b/source/reference/method/MongoDBCollection-deleteOne.txt @@ -80,5 +80,5 @@ See Also - :phpmethod:`MongoDB\\Collection::deleteMany()` - :phpmethod:`MongoDB\\Collection::bulkWrite()` - :doc:`/tutorial/crud` -- :manual:`delete ` command reference in the MongoDB manual diff --git a/source/tutorial/example-data.txt b/source/tutorial/example-data.txt index e9370f2b..cf323095 100644 --- a/source/tutorial/example-data.txt +++ b/source/tutorial/example-data.txt @@ -39,7 +39,7 @@ The output would then resemble:: You may also import the datasets using :manual:`mongoimport `, which is included with MongoDB: -.. code-block:: none +.. code-block:: sh - $ mongoimport --db test --collection zips --file zips.json --drop - $ mongoimport --db test --collection restaurants --file primer-dataset.json --drop + mongoimport --db test --collection zips --file zips.json --drop + mongoimport --db test --collection restaurants --file primer-dataset.json --drop From 86c9e3f4d7656d679f149f6b449f66bc1d5986a7 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 16 Jul 2020 15:44:41 -0400 Subject: [PATCH 217/321] PHPLIB-547: Fix links to new enumeration methods --- source/reference/class/MongoDBClient.txt | 1 + source/reference/class/MongoDBDatabase.txt | 1 + source/reference/method/MongoDBClient-listDatabaseNames.txt | 2 +- source/reference/method/MongoDBClient-listDatabases.txt | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt index b638dc4b..b677ebb1 100644 --- a/source/reference/class/MongoDBClient.txt +++ b/source/reference/class/MongoDBClient.txt @@ -37,6 +37,7 @@ Methods /reference/method/MongoDBClient-getReadPreference /reference/method/MongoDBClient-getTypeMap /reference/method/MongoDBClient-getWriteConcern + /reference/method/MongoDBClient-listDatabaseNames /reference/method/MongoDBClient-listDatabases /reference/method/MongoDBClient-selectCollection /reference/method/MongoDBClient-selectDatabase diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt index e2b3e0ba..464c32c5 100644 --- a/source/reference/class/MongoDBDatabase.txt +++ b/source/reference/class/MongoDBDatabase.txt @@ -56,6 +56,7 @@ Methods /reference/method/MongoDBDatabase-getReadPreference /reference/method/MongoDBDatabase-getTypeMap /reference/method/MongoDBDatabase-getWriteConcern + /reference/method/MongoDBDatabase-listCollectionNames /reference/method/MongoDBDatabase-listCollections /reference/method/MongoDBDatabase-modifyCollection /reference/method/MongoDBDatabase-selectCollection diff --git a/source/reference/method/MongoDBClient-listDatabaseNames.txt b/source/reference/method/MongoDBClient-listDatabaseNames.txt index f5834792..5047b88d 100644 --- a/source/reference/method/MongoDBClient-listDatabaseNames.txt +++ b/source/reference/method/MongoDBClient-listDatabaseNames.txt @@ -67,7 +67,7 @@ The output would then resemble:: See Also -------- -- :phpmethod:`MongoDB\\Database::listDatabases()` +- :phpmethod:`MongoDB\\Client::listDatabases()` - :manual:`listDatabases ` command reference in the MongoDB manual - `Enumerating Databases diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt index 10e7dbbb..7f27cee8 100644 --- a/source/reference/method/MongoDBClient-listDatabases.txt +++ b/source/reference/method/MongoDBClient-listDatabases.txt @@ -80,7 +80,7 @@ The output would then resemble:: See Also -------- -- :phpmethod:`MongoDB\\Database::listDatabaseNames()` +- :phpmethod:`MongoDB\\Client::listDatabaseNames()` - :manual:`listDatabases ` command reference in the MongoDB manual - `Enumerating Databases From a9d12bef48c78f403a9c03a09a275d0891fe8744 Mon Sep 17 00:00:00 2001 From: Yosmany Garcia Date: Thu, 12 Nov 2020 06:47:32 -0800 Subject: [PATCH 218/321] Fixed missing backslash in documentation (#794) --- source/tutorial/custom-types.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tutorial/custom-types.txt b/source/tutorial/custom-types.txt index a6e24fe1..57460430 100644 --- a/source/tutorial/custom-types.txt +++ b/source/tutorial/custom-types.txt @@ -23,7 +23,7 @@ to convert to BSON and store in the database. That data will later be used to reconstruct the object upon reading from the database. As an example we present the ``LocalDateTime`` class. This class wraps around -the :php:`MongoDB\\BSON\UTCDateTime ` data +the :php:`MongoDB\\BSON\\UTCDateTime ` data type and a time zone. .. code-block:: php From 046403b96e31a8c667eb4ec6b787713bcf558e62 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 18 Nov 2020 14:48:26 +0100 Subject: [PATCH 219/321] PHPLIB-577: Add examples for aggregation methods (#797) * Fix wrong collection name in aggregation example * Add example for MongoDB\Collection::aggregate * Add example for MongoDB\Database::aggregate --- .../method/MongoDBCollection-aggregate.txt | 20 ++++++++++++++++++- .../method/MongoDBDatabase-aggregate.txt | 20 ++++++++++++++++++- source/tutorial/collation.txt | 2 +- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt index 9c7232c2..d26d8c8e 100644 --- a/source/reference/method/MongoDBCollection-aggregate.txt +++ b/source/reference/method/MongoDBCollection-aggregate.txt @@ -58,7 +58,25 @@ MongoDB server version and whether the ``useCursor`` option is specified. If ``result`` array from the command response document. In both cases, the return value will be :php:`Traversable `. -.. todo: add examples +Examples +-------- + +The following aggregation example uses a collection called ``names`` and groups +the ``first_name`` field together, counts the total number of results in each +group, and sorts the results by name. + +.. code-block:: php + + test->names; + + $cursor = $collection->aggregate( + [ + ['$group' => ['_id' => '$first_name', 'name_count' => ['$sum' => 1]]], + ['$sort' => ['_id' => 1]], + ] + ); See Also -------- diff --git a/source/reference/method/MongoDBDatabase-aggregate.txt b/source/reference/method/MongoDBDatabase-aggregate.txt index a826e280..a7884bfe 100644 --- a/source/reference/method/MongoDBDatabase-aggregate.txt +++ b/source/reference/method/MongoDBDatabase-aggregate.txt @@ -51,7 +51,25 @@ Errors/Exceptions .. _php-db-agg-method-behavior: -.. todo: add examples +Examples +-------- + +The following aggregation example lists all running commands using the +``$currentOp`` aggregation pipeline stage, then filters this list to only show +running command operations. + +.. code-block:: php + + admin; + + $cursor = $database->aggregate( + [ + ['$currentOp' => []], + ['$match' => ['op' => 'command'], + ] + ); See Also -------- diff --git a/source/tutorial/collation.txt b/source/tutorial/collation.txt index 71b28a87..0b1bfabd 100644 --- a/source/tutorial/collation.txt +++ b/source/tutorial/collation.txt @@ -360,7 +360,7 @@ group, and sorts the results by German phonebook order. test->recipes; + $collection = (new MongoDB\Client)->test->names; $cursor = $collection->aggregate( [ From c41bca3c3242745c520a47706a9743f4bc31d93c Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 20 Jan 2021 18:26:08 +0100 Subject: [PATCH 220/321] PHPLIB-598: Clean up cursor usages to account for iterator changes (#801) * Bump required ext-mongodb version * Remove unnecessary cursor wrapping for iterators * Update tailable cursor documentation to account for cursor changes * Apply review feedback to docs * Update evergreen config to no longer test against 1.8 driver --- source/tutorial/tailable-cursor.txt | 59 ++++++++++++++--------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/source/tutorial/tailable-cursor.txt b/source/tutorial/tailable-cursor.txt index c4ff3b0e..2c84b080 100644 --- a/source/tutorial/tailable-cursor.txt +++ b/source/tutorial/tailable-cursor.txt @@ -18,7 +18,7 @@ Overview When the driver executes a query or command (e.g. :manual:`aggregate `), results from the operation are returned via a :php:`MongoDB\\Driver\\Cursor ` -object. The Cursor class implements PHP's :php:`Traversable ` +object. The Cursor class implements PHP's :php:`Iterator ` interface, which allows it to be iterated with ``foreach`` and interface with any PHP functions that work with :php:`iterables `. Similar to result objects in other database drivers, cursors in MongoDB only support @@ -35,20 +35,21 @@ While normal cursors can be iterated once with ``foreach``, that approach will not work with tailable cursors. When ``foreach`` is used with a tailable cursor, the loop will stop upon reaching the end of the initial result set. Attempting to continue iteration on the cursor with a second ``foreach`` would throw an -exception, since PHP attempts to rewind the cursor. +exception, since PHP attempts to rewind the cursor. Therefore, reading from a +tailable cursor will require direct usage of the :php:`Iterator ` API. -In order to continuously read from a tailable cursor, we will need to wrap the -Cursor object with an :php:`IteratorIterator `. This will -allow us to directly control the cursor's iteration (e.g. call ``next()``), -avoid inadvertently rewinding the cursor, and decide when to wait for new -results or stop iteration entirely. +.. note:: + + Before version 1.9.0 of the ``ext-mongodb`` extension, the cursor class does + not implement the :php:`Iterator ` interface. To manually iterate + a cursor using the method below, it must first be wrapped with an + :php:`IteratorIterator `. -Wrapping a Normal Cursor ------------------------- +Manually Iterating a Normal Cursor +---------------------------------- -Before looking at how a tailable cursor can be wrapped with -:php:`IteratorIterator `, we'll start by examining how the -class interacts with a normal cursor. +Before looking at how a tailable cursor can be iterated, we'll start by +examining how the ``Iterator`` methods interact with a normal cursor. The following example finds five restaurants and uses ``foreach`` to view the results: @@ -74,7 +75,7 @@ not occurred, the iterator then advances to the next position, control jumps back to the validity check, and the loop continues. With the inner workings of ``foreach`` under our belt, we can now translate the -preceding example to use IteratorIterator: +preceding example to use the Iterator methods directly: .. code-block:: php @@ -84,28 +85,26 @@ preceding example to use IteratorIterator: $cursor = $collection->find([], ['limit' => 5]); - $iterator = new IteratorIterator($cursor); + $cursor->rewind(); - $iterator->rewind(); - - while ($iterator->valid()) { - $document = $iterator->current(); + while ($cursor->valid()) { + $document = $cursor->current(); var_dump($document); - $iterator->next(); + $cursor->next(); } .. note:: - Calling ``$iterator->next()`` after the ``while`` loop naturally ends would + Calling ``$cursor->next()`` after the ``while`` loop naturally ends would throw an exception, since all results on the cursor have been exhausted. The purpose of this example is simply to demonstrate the functional equivalence between ``foreach`` and manual iteration with PHP's :php:`Iterator ` -API. For normal cursors, there is little reason to use IteratorIterator instead -of a concise ``foreach`` loop. +API. For normal cursors, there is little reason to manually iterate results +instead of a concise ``foreach`` loop. -Wrapping a Tailable Cursor --------------------------- +Iterating a Tailable Cursor +--------------------------- In order to demonstrate a tailable cursor in action, we'll need two scripts: a "producer" and a "consumer". The producer script will create a new capped @@ -154,7 +153,7 @@ If you execute this consumer script, you'll notice that it quickly exhausts all results in the capped collection and then terminates. We cannot add a second ``foreach``, as that would throw an exception when attempting to rewind the cursor. This is a ripe use case for directly controlling the iteration process -using :php:`IteratorIterator `. +using the :php:`Iterator ` interface. .. code-block:: php @@ -167,17 +166,15 @@ using :php:`IteratorIterator `. 'maxAwaitTimeMS' => 100, ]); - $iterator = new IteratorIterator($cursor); - - $iterator->rewind(); + $cursor->rewind(); while (true) { - if ($iterator->valid()) { - $document = $iterator->current(); + if ($cursor->valid()) { + $document = $cursor->current(); printf("Consumed document created at: %s\n", $document->createdAt); } - $iterator->next(); + $cursor->next(); } Much like the ``foreach`` example, this version on the consumer script will From 6966d03d42443769b1a2944a4fca246602d5cb3f Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 31 Mar 2021 08:05:58 +0200 Subject: [PATCH 221/321] PHPLIB-621 Document Versioned API usage (#815) * Move non-deprecated driver options to the top * Document versioned API usage * Document serverApi driver option * Apply suggestions from code review Co-authored-by: Jeremy Mikola Co-authored-by: Jeremy Mikola --- ...Client-method-construct-driverOptions.yaml | 96 +++++++++++-------- source/tutorial.txt | 1 + source/tutorial/versioned-api.txt | 94 ++++++++++++++++++ 3 files changed, 149 insertions(+), 42 deletions(-) create mode 100644 source/tutorial/versioned-api.txt diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml index 77520c0d..f47e56ba 100644 --- a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml +++ b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml @@ -1,4 +1,58 @@ arg_name: option +name: autoEncryption +type: array +description: | + Options to configure client-side field-level encryption in the driver. The + encryption options are documented in the :php:`extension documentation + `. + For the ``keyVaultClient`` option, you may pass a :phpclass:`MongoDB\\Client` + instance, which will be unwrapped to provide a :php:`MongoDB\\Driver\\Manager ` + to the extension. + .. versionadded:: 1.6 +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option +name: driver +type: array +description: | + Additional driver metadata to be passed on to the server handshake. This is an + array containing ``name``, ``version``, and ``platform`` fields: + + .. code-block:: php + + [ + 'name' => 'my-driver', + 'version' => '1.2.3-dev', + 'platform' => 'some-platform', + ] + + .. note:: + + This feature is primarily designed for custom drivers and ODMs, which may + want to identify themselves to the server for diagnostic purposes. + Applications should use the ``appName`` URI option instead of driver + metadata. + + .. versionadded:: 1.7 +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option +name: serverApi +type: :php:`MongoDB\\Driver\\ServerApi ` +description: | + Used to declare an API version on the client. See the + :manual:`Versioned API tutorial ` for usage. + + .. versionadded:: 1.9 +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: typeMap type: array description: | @@ -131,46 +185,4 @@ description: | interface: phpmethod operation: ~ optional: true ---- -arg_name: option -name: autoEncryption -type: array -description: | - Options to configure client-side field-level encryption in the driver. The - encryption options are documented in the :php:`extension documentation - `. - For the ``keyVaultClient`` option, you may pass a :phpclass:`MongoDB\\Client` - instance, which will be unwrapped to provide a :php:`MongoDB\\Driver\\Manager ` - to the extension. - .. versionadded:: 1.6 -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option -name: driver -type: array -description: | - Additional driver metadata to be passed on to the server handshake. This is an - array containing ``name``, ``version``, and ``platform`` fields: - - .. code-block:: php - - [ - 'name' => 'my-driver', - 'version' => '1.2.3-dev', - 'platform' => 'some-platform', - ] - - .. note:: - - This feature is primarily designed for custom drivers and ODMs, which may - want to identify themselves to the server for diagnostic purposes. - Applications should use the ``appName`` URI option instead of driver - metadata. - - .. versionadded:: 1.7 -interface: phpmethod -operation: ~ -optional: true ... diff --git a/source/tutorial.txt b/source/tutorial.txt index 7735508e..6ad6400a 100644 --- a/source/tutorial.txt +++ b/source/tutorial.txt @@ -15,3 +15,4 @@ Tutorials /tutorial/indexes /tutorial/tailable-cursor /tutorial/example-data + /tutorial/versioned-api diff --git a/source/tutorial/versioned-api.txt b/source/tutorial/versioned-api.txt new file mode 100644 index 00000000..ebe971d1 --- /dev/null +++ b/source/tutorial/versioned-api.txt @@ -0,0 +1,94 @@ +============= +Versioned API +============= + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Declaring an API version +------------------------ + +To declare an API version, pass a ``serverApi`` driver option when creating your +client. The value is a +:php:`MongoDB\\Driver\\ServerApi ` instance that +contains API version information. This feature is introduced in MongoDB 5.0, +which will initially support only API version "1". Additional versions may be +introduced in future versions of the server. + +.. code-block:: php + + $serverApi]); + + // Command includes the declared API version + $client->database->collection->find([]); + +.. note:: + + Only declare an API version when connecting to a deployment that has no + pre-5.0 members. Older servers will error when encountering commands with a + declared API version. + +Strict API +---------- + +By default, declaring an API version guarantees behavior for commands that are +part of the versioned API, but does not forbid using commands that are not part +of the API version. To only allow commands and options that are part of the +versioned API, specify the ``strict`` option when creating the +specify the ``strict`` option when creating the +:php:`MongoDB\\Driver\\ServerApi ` instance: + +.. code-block:: php + + $serverApi]); + + // Will fail as the tailable option is not supported in versioned API + $client->database->collection->find([], ['tailable' => true]); + +Fail on Deprecated Commands +--------------------------- + +The optional ``deprecationErrors`` option causes MongoDB to fail all commands +or behaviors that have been deprecated in the API version. This can be used in +testing to ensure a smooth transition to a future API version. + +.. code-block:: php + + $serverApi]); + +.. note:: + + At the time of this writing, no part of API version "1" has been deprecated. + +Usage with the command helper +----------------------------- + +When using the :phpmethod:`MongoDB\\Database::command()` method to run arbitrary +commands, the API version declared to the client is automatically appended to +the command document. Setting any of the ``apiVersion``, ``apiStrict``, or +``apiDeprecationErrors`` command options in the command document and calling +:phpmethod:`MongoDB\\Database::command()` from a client with a declared API +version is not supported and will lead to undefined behavior. From 0c7e2978c1e054c6193ad389fd070b74357e0e84 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 29 Jun 2021 10:29:49 +0200 Subject: [PATCH 222/321] PHPLIB-659 Support options for time-series collections (#829) * PHPLIB-659 Support options for time-series collections * Update wording about 5.0 support --- ...tabase-method-createCollection-option.yaml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml index 76dbf405..7695309b 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -35,6 +35,21 @@ pre: | ` for the collection. --- arg_name: option +name: expireAfterSeconds +type: integer +description: | + Allows specifying a TTL after which documents will be removed from a + time-series collection. + + This option is available in MongoDB 5.0+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.9 +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: flags type: integer description: | @@ -133,6 +148,20 @@ interface: phpmethod operation: ~ optional: true --- +arg_name: option +name: timeseries +type: array|object +description: | + Allows users to specify options for time-series collections. + + This option is available in MongoDB 5.0+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.9 +interface: phpmethod +operation: ~ +optional: true +--- source: file: apiargs-MongoDBDatabase-common-option.yaml ref: typeMap From aabf1500d8beb89a1f0f86fe8e98f32d177744c9 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 29 Jun 2021 10:30:50 +0200 Subject: [PATCH 223/321] PHPLIB-654 Remove deprecated terminology (#828) * Remove deprecated terminology * Update spec tests Updates spec tests to commit mongodb/specifications#6d7fd374ca14a80edabeefdd27cdd6187c43a0eb * Use ping instead of hello in docs --- .../method/MongoDBDatabase-command.txt | 27 ++++--------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt index 46b28fbe..63ddeeaa 100644 --- a/source/reference/method/MongoDBDatabase-command.txt +++ b/source/reference/method/MongoDBDatabase-command.txt @@ -43,8 +43,8 @@ Errors/Exceptions Example ------- -The following example executes an :manual:`isMaster -` command, which returns a cursor with a single +The following example executes a :manual:`ping +` command, which returns a cursor with a single result document: .. code-block:: php @@ -53,7 +53,7 @@ result document: $database = (new MongoDB\Client)->test; - $cursor = $database->command(['isMaster' => 1]); + $cursor = $database->command(['ping' => 1]); var_dump($c->toArray()[0]); @@ -61,24 +61,7 @@ The output would resemble:: object(MongoDB\Model\BSONDocument)#11 (1) { ["storage":"ArrayObject":private]=> - array(8) { - ["ismaster"]=> - bool(true) - ["maxBsonObjectSize"]=> - int(16777216) - ["maxMessageSizeBytes"]=> - int(48000000) - ["maxWriteBatchSize"]=> - int(1000) - ["localTime"]=> - object(MongoDB\BSON\UTCDateTime)#3 (1) { - ["milliseconds"]=> - string(13) "1477608046464" - } - ["maxWireVersion"]=> - int(4) - ["minWireVersion"]=> - int(0) + array(1) { ["ok"]=> float(1) } @@ -94,7 +77,7 @@ multiple result documents: $database = (new MongoDB\Client)->test; - $cursor = $database->command(['isMaster' => 1]); + $cursor = $database->command(['listCollections' => 1]); var_dump($c->toArray()); From 430425b38ad48d0a6c9ad31312b28ed1ce68db28 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 13 Jul 2021 17:33:29 +0200 Subject: [PATCH 224/321] PHPLIB-675 Document new CollectionInfo methods (#841) * Document deprecation of capped collection helpers * Add detail about where collection information comes from * Document new CollectionInfo helpers * Address review feedback * Fix wrong backticks --- source/reference/enumeration-classes.txt | 3 + ...ongoDBModelCollectionInfo-getCappedMax.txt | 6 ++ ...ngoDBModelCollectionInfo-getCappedSize.txt | 6 ++ .../MongoDBModelCollectionInfo-getIdIndex.txt | 73 +++++++++++++++++++ .../MongoDBModelCollectionInfo-getInfo.txt | 59 +++++++++++++++ .../MongoDBModelCollectionInfo-getName.txt | 3 +- .../MongoDBModelCollectionInfo-getOptions.txt | 3 +- .../MongoDBModelCollectionInfo-getType.txt | 52 +++++++++++++ .../MongoDBModelCollectionInfo-isCapped.txt | 6 ++ 9 files changed, 209 insertions(+), 2 deletions(-) create mode 100644 source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt create mode 100644 source/reference/method/MongoDBModelCollectionInfo-getInfo.txt create mode 100644 source/reference/method/MongoDBModelCollectionInfo-getType.txt diff --git a/source/reference/enumeration-classes.txt b/source/reference/enumeration-classes.txt index 7eac097e..bb2a629a 100644 --- a/source/reference/enumeration-classes.txt +++ b/source/reference/enumeration-classes.txt @@ -43,8 +43,11 @@ Methods /reference/method/MongoDBModelCollectionInfo-getCappedMax /reference/method/MongoDBModelCollectionInfo-getCappedSize + /reference/method/MongoDBModelCollectionInfo-getIdIndex + /reference/method/MongoDBModelCollectionInfo-getInfo /reference/method/MongoDBModelCollectionInfo-getName /reference/method/MongoDBModelCollectionInfo-getOptions + /reference/method/MongoDBModelCollectionInfo-getType /reference/method/MongoDBModelCollectionInfo-isCapped ---- diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt index fb86ee19..99a7d082 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt @@ -2,6 +2,8 @@ MongoDB\\Model\\CollectionInfo::getCappedMax() ============================================== +.. deprecated:: 1.9 + .. default-domain:: mongodb .. contents:: On this page @@ -28,6 +30,10 @@ Return Values The document limit for the capped collection. If the collection is not capped, ``null`` will be returned. +This method is deprecated in favor of using +:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the +``max`` key. + Examples -------- diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt index a3b1ce48..1d94a404 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt @@ -2,6 +2,8 @@ MongoDB\\Model\\CollectionInfo::getCappedSize() =============================================== +.. deprecated:: 1.9 + .. default-domain:: mongodb .. contents:: On this page @@ -29,6 +31,10 @@ Return Values The size limit for the capped collection in bytes. If the collection is not capped, ``null`` will be returned. +This method is deprecated in favor of using +:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the +``size`` key. + Examples -------- diff --git a/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt b/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt new file mode 100644 index 00000000..4c0e4aa3 --- /dev/null +++ b/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt @@ -0,0 +1,73 @@ +============================================ +MongoDB\\Model\\CollectionInfo::getIdIndex() +============================================ + +.. versionadded:: 1.9 + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Definition +---------- + +.. phpmethod:: MongoDB\\Model\\CollectionInfo::getIdIndex() + + Returns information about the ``_id`` field index. + + .. code-block:: php + + function getIdIndex(): array + +Return Values +------------- + +An array containing information on the ``_id`` index. This corresponds to the +``idIndex`` field returned in the ``listCollections`` command reply. + +Examples +-------- + +.. code-block:: php + + 'view', + 'name' => 'foo', + 'idIndex' => [ + 'v' => 2, + 'key' => ['_id' => 1], + 'name' => '_id', + 'ns' => 'test.foo', + ], + ]); + + var_dump($info->getIdIndex()); + +The output would then resemble:: + + array(4) { + ["v"]=> + int(2) + ["key"]=> + array(1) { + ["_id"]=> + int(1) + } + ["name"]=> + string(3) "_id" + ["ns"]=> + string(8) "test.foo" + } + +See Also +-------- + +- :phpmethod:`MongoDB\\Database::createCollection()` +- :manual:`listCollections ` command + reference in the MongoDB manual diff --git a/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt b/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt new file mode 100644 index 00000000..40068e3b --- /dev/null +++ b/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt @@ -0,0 +1,59 @@ +========================================= +MongoDB\\Model\\CollectionInfo::getInfo() +========================================= + +.. versionadded:: 1.9 + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Definition +---------- + +.. phpmethod:: MongoDB\\Model\\CollectionInfo::getInfo() + + Returns additional information about the collection. + + .. code-block:: php + + function getInfo(): array + +Return Values +------------- + +An array containing extra information about the collection. This corresponds to +the ``info`` field returned in the ``listCollections`` command reply. + +Examples +-------- + +.. code-block:: php + + 'view', + 'name' => 'foo', + 'info' => ['readOnly' => true] + ]); + + var_dump($info->getInfo()); + +The output would then resemble:: + + array(1) { + ["readOnly"]=> + bool(true) + } + +See Also +-------- + +- :phpmethod:`MongoDB\\Database::createCollection()` +- :manual:`listCollections ` command + reference in the MongoDB manual diff --git a/source/reference/method/MongoDBModelCollectionInfo-getName.txt b/source/reference/method/MongoDBModelCollectionInfo-getName.txt index 42226c20..76af1fa9 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-getName.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-getName.txt @@ -24,7 +24,8 @@ Definition Return Values ------------- -The collection name. +The collection name. This corresponds to the ``name`` field returned in the +``listCollections`` command reply. Examples -------- diff --git a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt index 84506816..4c7fabe5 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt @@ -26,7 +26,8 @@ Definition Return Values ------------- -The collection options. +The collection options. This corresponds to the ``options`` field returned in +the ``listCollections`` command reply. Examples -------- diff --git a/source/reference/method/MongoDBModelCollectionInfo-getType.txt b/source/reference/method/MongoDBModelCollectionInfo-getType.txt new file mode 100644 index 00000000..b900efed --- /dev/null +++ b/source/reference/method/MongoDBModelCollectionInfo-getType.txt @@ -0,0 +1,52 @@ +========================================= +MongoDB\\Model\\CollectionInfo::getType() +========================================= + +.. versionadded:: 1.9 + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Definition +---------- + +.. phpmethod:: MongoDB\\Model\\CollectionInfo::getType() + + Return the collection type. + + .. code-block:: php + + function getType(): string + +Return Values +------------- + +The collection type. This corresponds to the ``type`` field returned in the +``listCollections`` command reply. + +Examples +-------- + +.. code-block:: php + + 'collection', 'name' => 'foo']); + + echo $info->getType(); + +The output would then resemble:: + + collection + +See Also +-------- + +- :phpmethod:`MongoDB\\Database::createCollection()` +- :manual:`listCollections ` command + reference in the MongoDB manual diff --git a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt index a583a83f..15957ae8 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt @@ -2,6 +2,8 @@ MongoDB\\Model\\CollectionInfo::isCapped() ========================================== +.. deprecated:: 1.9 + .. default-domain:: mongodb .. contents:: On this page @@ -27,6 +29,10 @@ Return Values A boolean indicating whether the collection is a capped collection. +This method is deprecated in favor of using +:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the +``capped`` key. + Examples -------- From dcd716eb3670be594fdfca9ddeadf958829cbd8c Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 13 Jul 2021 21:08:13 +0200 Subject: [PATCH 225/321] PHPLIB-690 Update documentation for time series collection options (#843) * PHPLIB-690 Update documentation for time series collection options * Apply suggestions from code review Co-authored-by: Jeremy Mikola Co-authored-by: Jeremy Mikola --- ...s-MongoDBDatabase-method-createCollection-option.yaml | 9 ++++++--- .../method/MongoDBDatabase-createCollection.txt | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml index 7695309b..f0f32117 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -38,8 +38,9 @@ arg_name: option name: expireAfterSeconds type: integer description: | - Allows specifying a TTL after which documents will be removed from a - time-series collection. + Used to automatically delete documents in time series collections. See the + :manual:`create ` command documentation for more + information. This option is available in MongoDB 5.0+ and will result in an exception at execution time if specified for an older server version. @@ -152,7 +153,9 @@ arg_name: option name: timeseries type: array|object description: | - Allows users to specify options for time-series collections. + An object containing options for creating time series collections. See the + :manual:`create ` command documentation for + supported options. This option is available in MongoDB 5.0+ and will result in an exception at execution time if specified for an older server version. diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt index 8db6696c..f024806d 100644 --- a/source/reference/method/MongoDBDatabase-createCollection.txt +++ b/source/reference/method/MongoDBDatabase-createCollection.txt @@ -97,3 +97,4 @@ See Also - :manual:`create ` command reference in the MongoDB manual - :manual:`db.createCollection() ` +- :manual:`Time Series Collections ` From f97595e0f0d0239fb0bfedb3d5d87d2d03193977 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 14 Jul 2021 11:21:23 -0400 Subject: [PATCH 226/321] Fix RST syntax for listCollections link --- source/reference/method/MongoDBDatabase-listCollections.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt index 99fd69f5..0ca7b226 100644 --- a/source/reference/method/MongoDBDatabase-listCollections.txt +++ b/source/reference/method/MongoDBDatabase-listCollections.txt @@ -114,7 +114,7 @@ The output would then resemble:: See Also -------- -- :manual:`listCollections ` command reference in the MongoDB manual - `Enumerating Collections `_ From aafd4d6238980aa537085d197e1c7bce1a91d985 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 14 Jul 2021 11:24:15 -0400 Subject: [PATCH 227/321] Use "array|object" instead of "document" in MapReduce docs --- .../apiargs-MongoDBCollection-method-mapReduce-option.yaml | 4 ++-- .../apiargs-MongoDBCollection-method-mapReduce-param.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml index a2e97d11..008fb0fb 100644 --- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml @@ -40,7 +40,7 @@ source: --- arg_name: option name: query -type: document +type: array|object description: | Specifies the selection criteria using query operators for determining the documents input to the map function. @@ -58,7 +58,7 @@ source: --- arg_name: option name: scope -type: document +type: array|object description: | Specifies global variables that are accessible in the map, reduce, and finalize functions. diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml index 401d49ed..b6b92531 100644 --- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml @@ -20,7 +20,7 @@ optional: false --- arg_name: param name: $out -type: string|document +type: string|array|object description: | Specifies where to output the result of the map-reduce operation. You can either output to a collection or return the result inline. On a primary member From a5e536a8e82d6ddb29732ff03fef8d9460c8265f Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 14 Jul 2021 11:26:58 -0400 Subject: [PATCH 228/321] PHPLIB-309 and PHPLIB-315: Fix docs for jsMode and verbose MapReduce opts PHPLIB no longer specifies a default value for either of these options. --- .../apiargs-MongoDBCollection-method-mapReduce-option.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml index a93239c8..0579b794 100644 --- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml @@ -22,7 +22,7 @@ name: jsMode type: boolean description: | Specifies whether to convert intermediate data into BSON format between the - execution of the map and reduce functions. The default is ``false``. + execution of the map and reduce functions. interface: phpmethod operation: ~ optional: true @@ -89,7 +89,6 @@ name: verbose type: boolean description: | Specifies whether to include the timing information in the result information. - The default is ``true``. interface: phpmethod operation: ~ optional: true From 1d9db87804c26c44d57086aa017a1e2b93072268 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 14 Jul 2021 11:30:57 -0400 Subject: [PATCH 229/321] Fix RST syntax for listCollections link --- source/reference/method/MongoDBDatabase-listCollectionNames.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/reference/method/MongoDBDatabase-listCollectionNames.txt b/source/reference/method/MongoDBDatabase-listCollectionNames.txt index 6e973df1..86872bbb 100644 --- a/source/reference/method/MongoDBDatabase-listCollectionNames.txt +++ b/source/reference/method/MongoDBDatabase-listCollectionNames.txt @@ -91,7 +91,7 @@ See Also -------- - :phpmethod:`MongoDB\\Database::listCollections()` -- :manual:`listCollections ` command reference in the MongoDB manual - `Enumerating Collections `_ From 64ad932b46f21357c3dd25753eca06d5ddd7aafa Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 14 Jul 2021 11:36:52 -0400 Subject: [PATCH 230/321] PHPLIB-663: Document aggregate "let" option (#846) --- ...-MongoDBCollection-method-aggregate-option.yaml | 6 ++++++ ...gs-MongoDBDatabase-method-aggregate-option.yaml | 6 ++++++ source/includes/apiargs-aggregate-option.yaml | 14 ++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml index 86edc1d5..6d1f0c43 100644 --- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml @@ -28,6 +28,12 @@ source: post: | .. versionadded:: 1.3 --- +source: + file: apiargs-aggregate-option.yaml + ref: let +post: | + .. versionadded:: 1.9 +--- source: file: apiargs-common-option.yaml ref: maxTimeMS diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml index 5d80f32a..b94d80d4 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml @@ -22,6 +22,12 @@ source: file: apiargs-common-option.yaml ref: hint --- +source: + file: apiargs-aggregate-option.yaml + ref: let +post: | + .. versionadded:: 1.9 +--- source: file: apiargs-common-option.yaml ref: maxTimeMS diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml index 3de7a09d..7e61ff82 100644 --- a/source/includes/apiargs-aggregate-option.yaml +++ b/source/includes/apiargs-aggregate-option.yaml @@ -49,4 +49,18 @@ description: | interface: phpmethod operation: ~ optional: true +--- +arg_name: option +name: let +type: array|object +description: | + Map of parameter names and values. Values must be constant or closed + expressions that do not reference document fields. Parameters can then be + accessed as variables in an aggregate expression context (e.g. ``$$var``). + + This is not supported for server versions prior to 5.0 and will result in an + exception at execution time if used. +interface: phpmethod +operation: ~ +optional: true ... From 383e1ab9a1de853a1fa855e160e493cb41f8660a Mon Sep 17 00:00:00 2001 From: Tanli Su <46271307+tanlisu@users.noreply.github.com> Date: Mon, 26 Jul 2021 15:12:01 -0400 Subject: [PATCH 231/321] PHPLIB-518: RenameCollection operation (#840) * PHPLIB-518: RenameCollection operation * Adds Database::renameCollection() and Collection::rename() methods. * Move assertCollectionDoesNotExist() and assertCollectionExists() to FunctionalTestCase --- ...ongoDBCollection-method-rename-option.yaml | 27 +++++++ ...MongoDBCollection-method-rename-param.yaml | 25 ++++++ ...tabase-method-renameCollection-option.yaml | 27 +++++++ ...atabase-method-renameCollection-param.yaml | 34 ++++++++ source/reference/class/MongoDBCollection.txt | 1 + source/reference/class/MongoDBDatabase.txt | 1 + .../method/MongoDBCollection-rename.txt | 79 +++++++++++++++++++ .../MongoDBDatabase-renameCollection.txt | 79 +++++++++++++++++++ 8 files changed, 273 insertions(+) create mode 100644 source/includes/apiargs-MongoDBCollection-method-rename-option.yaml create mode 100644 source/includes/apiargs-MongoDBCollection-method-rename-param.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml create mode 100644 source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml create mode 100644 source/reference/method/MongoDBCollection-rename.txt create mode 100644 source/reference/method/MongoDBDatabase-renameCollection.txt diff --git a/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml b/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml new file mode 100644 index 00000000..e0d9dbf2 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml @@ -0,0 +1,27 @@ +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: typeMap +post: | + This will be used for the returned command result document. +--- +source: + file: apiargs-common-option.yaml + ref: session +--- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: writeConcern +post: | + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. +--- +arg_name: option +name: dropTarget +type: boolean +description: | + If ``true``, MongoDB will drop the target before renaming the collection. The + default value is ``false``. +interface: phpmethod +operation: ~ +optional: true +... diff --git a/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml b/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml new file mode 100644 index 00000000..459b2789 --- /dev/null +++ b/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml @@ -0,0 +1,25 @@ +arg_name: param +name: $toCollectionName +type: string +description: | + The new name of the collection. +interface: phpmethod +operation: ~ +optional: false +--- +arg_name: param +name: $toDatabaseName +type: string +description: | + The new database name of the collection. If a new database name is not + specified, the database of the original collection will be used. If the new + name specifies a different database, the command copies the collection + to the new database and drops the source collection. +interface: phpmethod +operation: ~ +optional: true +--- +source: + file: apiargs-common-param.yaml + ref: $options +... diff --git a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml new file mode 100644 index 00000000..973957cf --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml @@ -0,0 +1,27 @@ +source: + file: apiargs-common-option.yaml + ref: session +--- +source: + file: apiargs-MongoDBDatabase-common-option.yaml + ref: typeMap +post: | + This will be used for the returned command result document. +--- +source: + file: apiargs-MongoDBDatabase-common-option.yaml + ref: writeConcern +post: | + This is not supported for server versions prior to 3.4 and will result in an + exception at execution time if used. +--- +arg_name: option +name: dropTarget +type: boolean +description: | + If ``true``, MongoDB will drop the target before renaming the collection. The + default value is ``false``. +interface: phpmethod +operation: ~ +optional: true +... diff --git a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml new file mode 100644 index 00000000..3043f4dd --- /dev/null +++ b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml @@ -0,0 +1,34 @@ +arg_name: param +name: $fromCollectionName +type: string +description: | + The name of the collection to rename. +interface: phpmethod +operation: ~ +optional: false +--- +arg_name: param +name: $toCollectionName +type: string +description: | + The new name of the collection. +interface: phpmethod +operation: ~ +optional: false +--- +arg_name: param +name: $toDatabaseName +type: string +description: | + The new database name of the collection. If a new database name is not + specified, the current database will be used. If the new name specifies a + different database, the command copies the collection to the new database + and drops the source collection. +interface: phpmethod +operation: ~ +optional: true +--- +source: + file: apiargs-common-param.yaml + ref: $options +... diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt index 4ccd2c17..57625ed0 100644 --- a/source/reference/class/MongoDBCollection.txt +++ b/source/reference/class/MongoDBCollection.txt @@ -91,6 +91,7 @@ Methods /reference/method/MongoDBCollection-insertOne /reference/method/MongoDBCollection-listIndexes /reference/method/MongoDBCollection-mapReduce + /reference/method/MongoDBCollection-rename /reference/method/MongoDBCollection-replaceOne /reference/method/MongoDBCollection-updateMany /reference/method/MongoDBCollection-updateOne diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt index 464c32c5..7e7cb73d 100644 --- a/source/reference/class/MongoDBDatabase.txt +++ b/source/reference/class/MongoDBDatabase.txt @@ -59,6 +59,7 @@ Methods /reference/method/MongoDBDatabase-listCollectionNames /reference/method/MongoDBDatabase-listCollections /reference/method/MongoDBDatabase-modifyCollection + /reference/method/MongoDBDatabase-renameCollection /reference/method/MongoDBDatabase-selectCollection /reference/method/MongoDBDatabase-selectGridFSBucket /reference/method/MongoDBDatabase-watch diff --git a/source/reference/method/MongoDBCollection-rename.txt b/source/reference/method/MongoDBCollection-rename.txt new file mode 100644 index 00000000..23a9290c --- /dev/null +++ b/source/reference/method/MongoDBCollection-rename.txt @@ -0,0 +1,79 @@ +============================= +MongoDB\\Collection::rename() +============================= + +.. versionadded:: 1.10 + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Definition +---------- + +.. phpmethod:: MongoDB\\Collection::rename() + + Rename the collection. + + .. code-block:: php + + function rename(string $toCollectionName, ?string $toDatabaseName = null, array $options = []): array|object + + This method has the following parameters: + + .. include:: /includes/apiargs/MongoDBCollection-method-rename-param.rst + + The ``$options`` parameter supports the following options: + + .. include:: /includes/apiargs/MongoDBCollection-method-rename-option.rst + +Return Values +------------- + +An array or object with the result document of the :manual:`renameCollection +` command. The return type will depend on the +``typeMap`` option. + +Errors/Exceptions +----------------- + +.. include:: /includes/extracts/error-unsupportedexception.rst +.. include:: /includes/extracts/error-invalidargumentexception.rst +.. include:: /includes/extracts/error-driver-runtimeexception.rst + +Example +------- + +The following operation renames the ``restaurants`` collection in the ``test`` +database to ``places``: + +.. code-block:: php + + test->restaurants; + + $result = $collection->rename('places'); + + var_dump($result); + +The output would then resemble:: + + object(MongoDB\Model\BSONDocument)#9 (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["ok"]=> + float(1) + } + } + +See Also +-------- + +- :phpmethod:`MongoDB\\Database::renameCollection()` +- :manual:`renameCollection ` command reference in the MongoDB + manual diff --git a/source/reference/method/MongoDBDatabase-renameCollection.txt b/source/reference/method/MongoDBDatabase-renameCollection.txt new file mode 100644 index 00000000..55844319 --- /dev/null +++ b/source/reference/method/MongoDBDatabase-renameCollection.txt @@ -0,0 +1,79 @@ +===================================== +MongoDB\\Database::renameCollection() +===================================== + +.. versionadded:: 1.10 + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Definition +---------- + +.. phpmethod:: MongoDB\\Database::renameCollection() + + Rename a collection within the current database. + + .. code-block:: php + + function renameCollection(string $fromCollectionName, string $toCollectionName, ?string $toDatabaseName = null, array $options = []): array|object + + This method has the following parameters: + + .. include:: /includes/apiargs/MongoDBDatabase-method-renameCollection-param.rst + + The ``$options`` parameter supports the following options: + + .. include:: /includes/apiargs/MongoDBDatabase-method-renameCollection-option.rst + +Return Values +------------- + +An array or object with the result document of the :manual:`renameCollection +` command. The return type will depend on the +``typeMap`` option. + +Errors/Exceptions +----------------- + +.. include:: /includes/extracts/error-unsupportedexception.rst +.. include:: /includes/extracts/error-invalidargumentexception.rst +.. include:: /includes/extracts/error-driver-runtimeexception.rst + +Example +------- + +The following example renames the ``restaurants`` collection in the ``test`` +database to ``places``: + +.. code-block:: php + + test; + + $result = $db->renameCollection('restaurants', 'places'); + + var_dump($result); + +The output would then resemble:: + + object(MongoDB\Model\BSONDocument)#8 (1) { + ["storage":"ArrayObject":private]=> + array(1) { + ["ok"]=> + float(1) + } + } + +See Also +-------- + +- :phpmethod:`MongoDB\\Collection::rename()` +- :manual:`renameCollection ` command reference in the MongoDB + manual From 2b1f468d603bb08b225f22deb7a36ba10b51bb64 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 11 Aug 2021 11:43:45 +0200 Subject: [PATCH 232/321] PHPLIB-706 Fix syntax error in docs example (#853) --- source/tutorial/collation.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/tutorial/collation.txt b/source/tutorial/collation.txt index 0b1bfabd..7145de0d 100644 --- a/source/tutorial/collation.txt +++ b/source/tutorial/collation.txt @@ -206,7 +206,7 @@ specify a collation. $collection = (new MongoDB\Client)->test->names; $document = $collection->findOneAndUpdate( - ['first_name' => ['$lt' =-> 'Gunter']], + ['first_name' => ['$lt' => 'Gunter']], ['$set' => ['verified' => true]] ); @@ -231,7 +231,7 @@ specified, which uses the locale ``de@collation=phonebook``. $collection = (new MongoDB\Client)->test->names; $document = $collection->findOneAndUpdate( - ['first_name' => ['$lt' =-> 'Gunter']], + ['first_name' => ['$lt' => 'Gunter']], ['$set' => ['verified' => true]], [ 'collation' => ['locale' => 'de@collation=phonebook'], From b64a1f38929b29315a67899bc80e54449acce1c9 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 30 Aug 2021 13:08:06 -0400 Subject: [PATCH 233/321] PHPLIB-713: Document hint option for findOneAndDelete --- ...MongoDBCollection-method-findOneAndDelete-option.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml index 520b4de1..894b51b8 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml @@ -10,6 +10,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: hint +post: | + This option is available in MongoDB 4.4+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.7 +--- source: file: apiargs-common-option.yaml ref: maxTimeMS From c8c49fff5e183d90482e0b03dc5b587dc399ef02 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 29 Nov 2021 17:39:04 -0500 Subject: [PATCH 234/321] PHPLIB-765: Remove links to legacy extension docs (#872) --- source/index.txt | 7 +- source/reference/bson.txt | 6 +- .../method/MongoDBClient__construct.txt | 2 +- source/upgrade.txt | 157 +++++++++--------- 4 files changed, 82 insertions(+), 90 deletions(-) diff --git a/source/index.txt b/source/index.txt index ffdd4b16..8c167eb6 100644 --- a/source/index.txt +++ b/source/index.txt @@ -35,10 +35,9 @@ following pages should help you get started: - :doc:`/reference/bson` -If you have previously worked with the -`legacy PHP driver `_ (i.e. ``mongo`` -extension), it will be helpful to review the :doc:`/upgrade` for a summary of -API changes between the old driver and this library. +If you have previously worked with the legacy ``mongo`` extension, it will be +helpful to review the :doc:`/upgrade` for a summary of API changes between the +old driver and this library. New to MongoDB? --------------- diff --git a/source/reference/bson.txt b/source/reference/bson.txt index c366ea8a..b465ef61 100644 --- a/source/reference/bson.txt +++ b/source/reference/bson.txt @@ -199,9 +199,9 @@ The same document in the MongoDB shell might display as: Emulating the Legacy Driver --------------------------- -The legacy :php:`mongo extension ` returned both BSON documents and -arrays as PHP arrays. While PHP arrays are convenient to work with, this -behavior was problematic: +The legacy ``mongo`` extension returned both BSON documents and arrays as PHP +arrays. While PHP arrays are convenient to work with, this behavior was +problematic: - Different BSON types could deserialize to the same PHP value (e.g. ``{"0": "foo"}`` and ``["foo"]``), which made it impossible to infer the diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt index ad864d18..091ae614 100644 --- a/source/reference/method/MongoDBClient__construct.txt +++ b/source/reference/method/MongoDBClient__construct.txt @@ -113,7 +113,7 @@ By default, the |php-library| deserializes BSON documents and arrays as :phpclass:`MongoDB\\Model\\BSONDocument` and :phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The following example demonstrates how to have the library unserialize everything as a PHP -array, as was done in the legacy :php:`mongo extension `. +array, as was done in the legacy ``mongo`` extension. .. code-block:: php diff --git a/source/upgrade.txt b/source/upgrade.txt index d783f13a..b785b655 100644 --- a/source/upgrade.txt +++ b/source/upgrade.txt @@ -14,22 +14,20 @@ Overview -------- The |php-library| and underlying :php:`mongodb extension ` have notable -API differences from the legacy :php:`mongo extension `. This page will -summarize those differences for the benefit of those upgrading from the legacy -driver. +API differences from the legacy ``mongo`` extension. This page will summarize +those differences for the benefit of those upgrading from the legacy driver. Additionally, a community-developed `mongo-php-adapter `_ library exists, which -implements the `mongo extension `_ API using this library -and the new driver. While this adapter library is not officially supported by -MongoDB, it does bear mentioning. +implements the ``mongo`` extension API using this library and the new driver. +While this adapter library is not officially supported by MongoDB, it does bear +mentioning. BSON Type Classes ----------------- -When upgrading from the legacy driver, -`type classes `_ such as -:php:`MongoId ` must be replaced with classes in the +When upgrading from the legacy driver, type classes such as MongoId must be +replaced with classes in the `MongoDB\\BSON namespace `_. The new driver also introduces interfaces for its BSON types, which should be preferred if applications need to type hint against BSON values. @@ -44,54 +42,54 @@ the new driver. - BSON type class - BSON type interface - * - :php:`MongoId ` + * - MongoId - :php:`MongoDB\\BSON\\ObjectId ` - :php:`MongoDB\\BSON\\ObjectIdInterface ` - * - :php:`MongoCode ` + * - MongoCode - :php:`MongoDB\\BSON\\Javascript ` - :php:`MongoDB\\BSON\\JavascriptInterface ` - * - :php:`MongoDate ` + * - MongoDate - :php:`MongoDB\\BSON\\UTCDateTime ` - :php:`MongoDB\\BSON\\UTCDateTimeInterface ` - * - :php:`MongoRegex ` + * - MongoRegex - :php:`MongoDB\\BSON\\Regex ` - :php:`MongoDB\\BSON\\RegexInterface ` - * - :php:`MongoBinData ` + * - MongoBinData - :php:`MongoDB\\BSON\\Binary ` - :php:`MongoDB\\BSON\\BinaryInterface ` - * - :php:`MongoInt32 ` + * - MongoInt32 - Not implemented. [1]_ - - * - :php:`MongoInt64 ` + * - MongoInt64 - :php:`MongoDB\\BSON\\Int64 ` - Not implemented. [2]_ - * - :php:`MongoDBRef ` + * - MongoDBRef - Not implemented. [3]_ - - * - :php:`MongoMinKey ` + * - MongoMinKey - :php:`MongoDB\\BSON\\MinKey ` - :php:`MongoDB\\BSON\\MinKeyInterface ` - * - :php:`MongoMaxKey ` + * - MongoMaxKey - :php:`MongoDB\\BSON\\MaxKey ` - :php:`MongoDB\\BSON\\MaxKeyInterface ` - * - :php:`MongoTimestamp ` + * - MongoTimestamp - :php:`MongoDB\\BSON\\Timestamp ` - :php:`MongoDB\\BSON\\TimestampInterface ` -.. [1] The new driver does not implement an equivalent class for - :php:`MongoInt32 `. When decoding BSON, 32-bit integers will - always be represented as a PHP integer. When encoding BSON, PHP integers will - encode as either a 32-bit or 64-bit integer depending on their value. +.. [1] The new driver does not implement an equivalent class for MongoInt32. + When decoding BSON, 32-bit integers will always be represented as a PHP + integer. When encoding BSON, PHP integers will encode as either a 32-bit or + 64-bit integer depending on their value. .. [2] :php:`MongoDB\\BSON\\Int64 ` does not have an interface defined. The new driver does not allow applications to instantiate @@ -99,12 +97,11 @@ the new driver. BSON decoding when a 64-bit integer cannot be represented as a PHP integer on a 32-bit platform. -.. [3] The new driver does not implement an equivalent class for - :php:`MongoDBRef ` since - :manual:`DBRefs ` are merely a BSON document - with a particular structure and not a proper BSON type. The new driver also - does not provide any helpers for working with DBRef objects, since their use - is not encouraged. +.. [3] The new driver does not implement an equivalent class for MongoDBRef + since :manual:`DBRefs ` are merely a BSON + document with a particular structure and not a proper BSON type. The new + driver also does not provide any helpers for working with DBRef objects, + since their use is not encouraged. Collection API -------------- @@ -116,15 +113,13 @@ and `Index Management `_ specifications. Although some method names have changed in accordance with the new specifications, the new class provides the same functionality as the legacy -driver's :php:`MongoCollection ` class with some notable -exceptions. +driver's MongoCollection class with some notable exceptions. A guiding principle in designing the new APIs was that explicit method names are preferable to overloaded terms found in the old API. For instance, -:php:`MongoCollection::save() ` and -:php:`MongoCollection::findAndModify() ` -have different modes of operation, depending on their arguments. Methods were -also split to distinguish between :manual:`updating specific fields +``MongoCollection::save()`` and ``MongoCollection::findAndModify()`` have +different modes of operation, depending on their arguments. Methods were also +split to distinguish between :manual:`updating specific fields ` and :manual:`full-document replacement `. @@ -134,116 +129,115 @@ equivalent method(s) in the new driver. .. list-table:: :header-rows: 1 - * - :php:`MongoCollection ` method + * - MongoCollection method - :phpclass:`MongoDB\\Collection` method(s) - * - :php:`MongoCollection::aggregate() ` + * - ``MongoCollection::aggregate()`` - :phpmethod:`MongoDB\\Collection::aggregate()` - * - :php:`MongoCollection::aggregateCursor() ` + * - ``MongoCollection::aggregateCursor()`` - :phpmethod:`MongoDB\\Collection::aggregate()` - * - :php:`MongoCollection::batchInsert() ` + * - ``MongoCollection::batchInsert()`` - :phpmethod:`MongoDB\\Collection::insertMany()` - * - :php:`MongoCollection::count() ` + * - ``MongoCollection::count()`` - :phpmethod:`MongoDB\\Collection::count()` - * - :php:`MongoCollection::createDBRef() ` + * - ``MongoCollection::createDBRef()`` - Not yet implemented. [3]_ - * - :php:`MongoCollection::createIndex() ` + * - ``MongoCollection::createIndex()`` - :phpmethod:`MongoDB\\Collection::createIndex()` - * - :php:`MongoCollection::deleteIndex() ` + * - ``MongoCollection::deleteIndex()`` - :phpmethod:`MongoDB\\Collection::dropIndex()` - * - :php:`MongoCollection::deleteIndexes() ` + * - ``MongoCollection::deleteIndexes()`` - :phpmethod:`MongoDB\\Collection::dropIndexes()` - * - :php:`MongoCollection::drop() ` + * - ``MongoCollection::drop()`` - :phpmethod:`MongoDB\\Collection::drop()` - * - :php:`MongoCollection::distinct() ` + * - ``MongoCollection::distinct()`` - :phpmethod:`MongoDB\\Collection::distinct()` - * - :php:`MongoCollection::ensureIndex() ` + * - ``MongoCollection::ensureIndex()`` - :phpmethod:`MongoDB\\Collection::createIndex()` - * - :php:`MongoCollection::find() ` + * - ``MongoCollection::find()`` - :phpmethod:`MongoDB\\Collection::find()` - * - :php:`MongoCollection::findAndModify() ` + * - ``MongoCollection::findAndModify()`` - :phpmethod:`MongoDB\\Collection::findOneAndDelete()`, :phpmethod:`MongoDB\\Collection::findOneAndReplace()`, and :phpmethod:`MongoDB\\Collection::findOneAndUpdate()` - * - :php:`MongoCollection::findOne() ` + * - ``MongoCollection::findOne()`` - :phpmethod:`MongoDB\\Collection::findOne()` - * - :php:`MongoCollection::getDBRef() ` + * - ``MongoCollection::getDBRef()`` - Not implemented. [3]_ - * - :php:`MongoCollection::getIndexInfo() ` + * - ``MongoCollection::getIndexInfo()`` - :phpmethod:`MongoDB\\Collection::listIndexes()` - * - :php:`MongoCollection::getName() ` + * - ``MongoCollection::getName()`` - :phpmethod:`MongoDB\\Collection::getCollectionName()` - * - :php:`MongoCollection::getReadPreference() ` - - Not implemented. + * - ``MongoCollection::getReadPreference()`` + - :phpmethod:`MongoDB\\Collection::getReadPreference()` - * - :php:`MongoCollection::getSlaveOkay() ` + * - ``MongoCollection::getSlaveOkay()`` - Not implemented. - * - :php:`MongoCollection::getWriteConcern() ` - - Not implemented. + * - ``MongoCollection::getWriteConcern()`` + - :phpmethod:`MongoDB\\Collection::getWriteConcern()` - * - :php:`MongoCollection::group() ` + * - ``MongoCollection::group()`` - Not implemented. Use :phpmethod:`MongoDB\\Database::command()`. See `Group Command Helper`_ for an example. - * - :php:`MongoCollection::insert() ` + * - ``MongoCollection::insert()`` - :phpmethod:`MongoDB\\Collection::insertOne()` - * - :php:`MongoCollection::parallelCollectionScan() ` + * - ``MongoCollection::parallelCollectionScan()`` - Not implemented. - * - :php:`MongoCollection::remove() ` + * - ``MongoCollection::remove()`` - :phpmethod:`MongoDB\\Collection::deleteMany()` and :phpmethod:`MongoDB\\Collection::deleteOne()` - * - :php:`MongoCollection::save() ` + * - ``MongoCollection::save()`` - :phpmethod:`MongoDB\\Collection::insertOne()` or :phpmethod:`MongoDB\\Collection::replaceOne()` with the ``upsert`` option. - * - :php:`MongoCollection::setReadPreference() ` + * - ``MongoCollection::setReadPreference()`` - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`. - * - :php:`MongoCollection::setSlaveOkay() ` + * - ``MongoCollection::setSlaveOkay()`` - Not implemented. - * - :php:`MongoCollection::setWriteConcern() ` + * - ``MongoCollection::setWriteConcern()`` - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`. - * - :php:`MongoCollection::update() ` + * - ``MongoCollection::update()`` - :phpmethod:`MongoDB\\Collection::replaceOne()`, :phpmethod:`MongoDB\\Collection::updateMany()`, and :phpmethod:`MongoDB\\Collection::updateOne()`. - * - :php:`MongoCollection::validate() ` + * - ``MongoCollection::validate()`` - Not implemented. Accessing IDs of Inserted Documents ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In the legacy driver, :php:`MongoCollection::insert() `, -:php:`MongoCollection::batchInsert() `, and -:php:`MongoCollection::save() ` (when inserting) would -modify their input argument by injecting an ``_id`` key with a generated -ObjectId (i.e. :php:`MongoId ` object). This behavior was a bit -of a hack, as it did not rely on the argument being :php:`passed by reference +In the legacy driver, ``MongoCollection::insert()``, +``MongoCollection::batchInsert()``, and ``MongoCollection::save()`` (when +inserting) would modify their input argument by injecting an ``_id`` key with a +generated ObjectId (i.e. MongoId object). This behavior was a bit of a hack, as +it did not rely on the argument being :php:`passed by reference `; instead, it directly modified memory through the extension API and could not be implemented in PHP userland. As such, it is no longer done in the new driver and library. @@ -261,17 +255,16 @@ following methods on the write result objects: Bulk Write Operations ~~~~~~~~~~~~~~~~~~~~~ -The legacy driver's :php:`MongoWriteBatch ` classes have -been replaced with a general-purpose -:phpmethod:`MongoDB\\Collection::bulkWrite()` method. Whereas the legacy driver -only allowed bulk operations of the same type, the new method allows operations -to be mixed (e.g. inserts, updates, and deletes). +The legacy driver's MongoWriteBatch classes have been replaced with a +general-purpose :phpmethod:`MongoDB\\Collection::bulkWrite()` method. Whereas +the legacy driver only allowed bulk operations of the same type, the new method +allows operations to be mixed (e.g. inserts, updates, and deletes). MongoCollection::save() Removed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -:php:`MongoCollection::save() `, which was syntactic sugar -for an insert or upsert operation, has been removed in favor of explicitly using +``MongoCollection::save()``, which was syntactic sugar for an insert or upsert +operation, has been removed in favor of explicitly using :phpmethod:`MongoDB\\Collection::insertOne` or :phpmethod:`MongoDB\\Collection::replaceOne` (with the ``upsert`` option). From d95406dde0b0657087435e50be87ef55dfc1ac08 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 30 Nov 2021 18:21:15 -0500 Subject: [PATCH 235/321] PHPLIB-721: Aggregate allowDiskUse option should be unset by default (#873) --- .../includes/apiargs-MongoDBCollection-method-find-option.yaml | 3 +-- source/includes/apiargs-aggregate-option.yaml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml index d6ff4c53..7e298924 100644 --- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml @@ -51,8 +51,7 @@ name: allowDiskUse type: boolean description: | Enables writing to temporary files. When set to ``true``, queries can write - data to the ``_tmp`` sub-directory in the ``dbPath`` directory. The default is - ``false``. + data to the ``_tmp`` sub-directory in the ``dbPath`` directory. interface: phpmethod operation: ~ optional: true diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml index 7e61ff82..27454044 100644 --- a/source/includes/apiargs-aggregate-option.yaml +++ b/source/includes/apiargs-aggregate-option.yaml @@ -3,8 +3,7 @@ name: allowDiskUse type: boolean description: | Enables writing to temporary files. When set to ``true``, aggregation stages - can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory. The - default is ``false``. + can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory. interface: phpmethod operation: ~ optional: true From 0dee625aaceb6f961f4565a4e65c3246c95e5eb9 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 30 Dec 2021 13:08:29 -0500 Subject: [PATCH 236/321] PHPLIB-740: Support authorizedCollections option for listCollections (#884) * PHPLIB-740: Support authorizedCollections option for listCollections * Update tests and docs for authorizedDatabases option --- ...MongoDBClient-method-listDatabases-option.yaml | 2 +- ...oDBDatabase-method-listCollections-option.yaml | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml index 4e3d616d..b9a9c23e 100644 --- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml +++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml @@ -4,7 +4,7 @@ type: boolean description: | A flag that determines which databases are returned based on the user privileges when access control is enabled. For more information, see the - `listDatabases command documentation `_. + `listDatabases command documentation `_. For servers < 4.0.5, this option is ignored. diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml index 0d9ab968..de05bf33 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml @@ -1,4 +1,19 @@ arg_name: option +name: authorizedCollections +type: boolean +description: | + A flag that determines which collections are returned based on the user + privileges when access control is enabled. For more information, see the + `listCollections command documentation `_. + + For servers < 4.0, this option is ignored. + + .. versionadded:: 1.12 +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: filter type: array|object description: | From ffc722a0a2f38dbf1f3d0a2c30c4bc3591f0e272 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Fri, 14 Jan 2022 10:49:08 -0500 Subject: [PATCH 237/321] PHPLIB-697: Deprecate Collection::mapReduce() --- source/reference/method/MongoDBCollection-mapReduce.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt index 2796e385..1da9c4bd 100644 --- a/source/reference/method/MongoDBCollection-mapReduce.txt +++ b/source/reference/method/MongoDBCollection-mapReduce.txt @@ -2,6 +2,8 @@ MongoDB\\Collection::mapReduce() ================================= +.. deprecated:: 1.12 + .. versionadded:: 1.2 .. default-domain:: mongodb From deab125d926dfa2c4e7aa9d6dd34434a02ac83aa Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Fri, 11 Feb 2022 15:58:23 -0500 Subject: [PATCH 238/321] PHPLIB-786: Rename "Versioned API" to "Stable API" in docs (#888) --- ...goDBClient-method-construct-driverOptions.yaml | 2 +- source/tutorial.txt | 2 +- .../{versioned-api.txt => stable-api.txt} | 15 +++++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) rename source/tutorial/{versioned-api.txt => stable-api.txt} (90%) diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml index f47e56ba..5d30540d 100644 --- a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml +++ b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml @@ -45,7 +45,7 @@ name: serverApi type: :php:`MongoDB\\Driver\\ServerApi ` description: | Used to declare an API version on the client. See the - :manual:`Versioned API tutorial ` for usage. + :manual:`Stable API tutorial ` for usage. .. versionadded:: 1.9 interface: phpmethod diff --git a/source/tutorial.txt b/source/tutorial.txt index 6ad6400a..cca3ee34 100644 --- a/source/tutorial.txt +++ b/source/tutorial.txt @@ -15,4 +15,4 @@ Tutorials /tutorial/indexes /tutorial/tailable-cursor /tutorial/example-data - /tutorial/versioned-api + /tutorial/stable-api diff --git a/source/tutorial/versioned-api.txt b/source/tutorial/stable-api.txt similarity index 90% rename from source/tutorial/versioned-api.txt rename to source/tutorial/stable-api.txt index ebe971d1..1220f032 100644 --- a/source/tutorial/versioned-api.txt +++ b/source/tutorial/stable-api.txt @@ -1,6 +1,6 @@ -============= -Versioned API -============= +========== +Stable API +========== .. default-domain:: mongodb @@ -10,7 +10,7 @@ Versioned API :depth: 1 :class: singlecol -Declaring an API version +Declaring an API Version ------------------------ To declare an API version, pass a ``serverApi`` driver option when creating your @@ -43,10 +43,9 @@ Strict API ---------- By default, declaring an API version guarantees behavior for commands that are -part of the versioned API, but does not forbid using commands that are not part +part of the stable API, but does not forbid using commands that are not part of the API version. To only allow commands and options that are part of the -versioned API, specify the ``strict`` option when creating the -specify the ``strict`` option when creating the +stable API, specify the ``strict`` option when creating the :php:`MongoDB\\Driver\\ServerApi ` instance: .. code-block:: php @@ -83,7 +82,7 @@ testing to ensure a smooth transition to a future API version. At the time of this writing, no part of API version "1" has been deprecated. -Usage with the command helper +Usage with the Command Helper ----------------------------- When using the :phpmethod:`MongoDB\\Database::command()` method to run arbitrary From 89428dc7ee67e302e4f85a3a3e23b48aab6e3fe3 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 28 Feb 2022 22:50:45 -0500 Subject: [PATCH 239/321] PHPLIB-795, PHPLIB-796: Remove references to pre-3.6 servers (#893) * Remove pre-3.6 server versions from Evergreen matrix * Remove references to unsupported pre-3.6 features in docs * Remove version checks for pre-3.6 servers Preserve behavior for only sending bypassDocumentValidation if true. This also removes a reference to an undeclared var in ModifyCollection (PHPLIB-796). * Remove skipped tests for pre-3.6 servers --- source/includes/apiargs-MongoDBClient-common-option.yaml | 3 --- ...apiargs-MongoDBClient-method-dropDatabase-option.yaml | 3 --- .../apiargs-MongoDBCollection-common-option.yaml | 9 --------- ...piargs-MongoDBCollection-method-aggregate-option.yaml | 3 --- ...args-MongoDBCollection-method-createIndex-option.yaml | 3 --- ...gs-MongoDBCollection-method-createIndexes-option.yaml | 3 --- .../apiargs-MongoDBCollection-method-drop-option.yaml | 3 --- ...piargs-MongoDBCollection-method-dropIndex-option.yaml | 3 --- ...args-MongoDBCollection-method-dropIndexes-option.yaml | 3 --- ...MongoDBCollection-method-findOneAndDelete-option.yaml | 3 --- ...ongoDBCollection-method-findOneAndReplace-option.yaml | 3 --- ...MongoDBCollection-method-findOneAndUpdate-option.yaml | 3 --- .../apiargs-MongoDBCollection-method-rename-option.yaml | 3 --- .../includes/apiargs-MongoDBDatabase-common-option.yaml | 3 --- .../apiargs-MongoDBDatabase-method-aggregate-option.yaml | 3 --- ...s-MongoDBDatabase-method-createCollection-option.yaml | 3 --- .../apiargs-MongoDBDatabase-method-drop-option.yaml | 3 --- ...rgs-MongoDBDatabase-method-dropCollection-option.yaml | 3 --- ...s-MongoDBDatabase-method-renameCollection-option.yaml | 3 --- source/includes/apiargs-aggregate-option.yaml | 3 --- source/includes/apiargs-common-option.yaml | 5 ----- source/reference/exception-classes.txt | 6 ------ source/reference/method/MongoDBCollection-count.txt | 3 +-- .../method/MongoDBCollection-countDocuments.txt | 2 +- .../method/MongoDBDatabase-createCollection.txt | 8 +++----- 25 files changed, 5 insertions(+), 85 deletions(-) diff --git a/source/includes/apiargs-MongoDBClient-common-option.yaml b/source/includes/apiargs-MongoDBClient-common-option.yaml index 89092358..4ffc52a9 100644 --- a/source/includes/apiargs-MongoDBClient-common-option.yaml +++ b/source/includes/apiargs-MongoDBClient-common-option.yaml @@ -4,9 +4,6 @@ type: :php:`MongoDB\\Driver\\ReadConcern ` description: | :manual:`Read concern ` to use for the operation. Defaults to the client's read concern. - - This is not supported for server versions prior to 3.2 and will result in an - exception at execution time if used. interface: phpmethod operation: ~ optional: true diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml index e219c145..07e75df7 100644 --- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml +++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml @@ -13,7 +13,4 @@ post: | source: file: apiargs-MongoDBClient-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml index 643308ea..fb919ea4 100644 --- a/source/includes/apiargs-MongoDBCollection-common-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-common-option.yaml @@ -4,9 +4,6 @@ type: array description: | An array of filter documents that determines which array elements to modify for an update operation on an array field. - - This is not supported for server versions prior to 3.6 and will result in an - exception at execution time if used. interface: phpmethod operation: ~ optional: true @@ -17,9 +14,6 @@ type: boolean description: | If ``true``, allows the write operation to circumvent document level validation. Defaults to ``false``. - - This option is available in MongoDB 3.2+ and is ignored for older server - versions, which do not support document level validation. interface: phpmethod operation: ~ optional: true @@ -40,9 +34,6 @@ description: | :manual:`Read concern ` to use for the operation. Defaults to the collection's read concern. - This is not supported for server versions prior to 3.2 and will result in an - exception at execution time if used. - It is not possible to specify a :manual:`read concern ` for individual operations as part of a transaction. Instead, set the ``readConcern`` option when starting the diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml index 6d1f0c43..1d0346da 100644 --- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml @@ -78,7 +78,4 @@ source: post: | This only applies when a :ref:`$out ` or :ref:`$merge ` stage is specified. - - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml index 1a76b33c..18d1ce07 100644 --- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml @@ -105,7 +105,4 @@ post: | source: file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml index 8808ddd1..5728ab31 100644 --- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml @@ -17,7 +17,4 @@ post: | source: file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml index b1f39752..3a66ad3b 100644 --- a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml @@ -13,7 +13,4 @@ post: | source: file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml index 00db41c6..9bc36f4b 100644 --- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml @@ -19,7 +19,4 @@ post: | source: file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml index 0b1970c3..0aa5048f 100644 --- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml @@ -17,7 +17,4 @@ post: | source: file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml index 894b51b8..c8a1e58c 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml @@ -38,7 +38,4 @@ post: | source: file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.2 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml index 6b282dd2..2987f9b0 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml @@ -59,7 +59,4 @@ source: source: file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.2 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml index 8393d26a..d3a6eff4 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml @@ -65,7 +65,4 @@ source: source: file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.2 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml b/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml index e0d9dbf2..3aed74eb 100644 --- a/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml @@ -11,9 +11,6 @@ source: source: file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. --- arg_name: option name: dropTarget diff --git a/source/includes/apiargs-MongoDBDatabase-common-option.yaml b/source/includes/apiargs-MongoDBDatabase-common-option.yaml index 69b4c13d..b03dac7a 100644 --- a/source/includes/apiargs-MongoDBDatabase-common-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-common-option.yaml @@ -4,9 +4,6 @@ type: :php:`MongoDB\\Driver\\ReadConcern ` description: | :manual:`Read concern ` to use for the operation. Defaults to the database's read concern. - - This is not supported for server versions prior to 3.2 and will result in an - exception at execution time if used. interface: phpmethod operation: ~ optional: true diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml index b94d80d4..4d0bf4b2 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml @@ -54,7 +54,4 @@ source: post: | This only applies when a :ref:`$out ` or :ref:`$merge ` stage is specified. - - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml index f0f32117..4c341d91 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -265,7 +265,4 @@ optional: true source: file: apiargs-MongoDBDatabase-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml index 89969685..5b3c18c3 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml @@ -13,7 +13,4 @@ post: | source: file: apiargs-MongoDBDatabase-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml index 89969685..5b3c18c3 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml @@ -13,7 +13,4 @@ post: | source: file: apiargs-MongoDBDatabase-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. ... diff --git a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml index 973957cf..bf7d9663 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml @@ -11,9 +11,6 @@ post: | source: file: apiargs-MongoDBDatabase-common-option.yaml ref: writeConcern -post: | - This is not supported for server versions prior to 3.4 and will result in an - exception at execution time if used. --- arg_name: option name: dropTarget diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml index 27454044..557cd98f 100644 --- a/source/includes/apiargs-aggregate-option.yaml +++ b/source/includes/apiargs-aggregate-option.yaml @@ -25,9 +25,6 @@ source: post: | This only applies when using the :ref:`$out ` and :ref:`$out ` stages. - - Document validation requires MongoDB 3.2 or later: if you are using an earlier - version of MongoDB, this option will be ignored. --- arg_name: option name: comment diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml index 41f91820..6ef2c761 100644 --- a/source/includes/apiargs-common-option.yaml +++ b/source/includes/apiargs-common-option.yaml @@ -8,9 +8,6 @@ description: | mandatory; all other collation fields are optional. For descriptions of the fields, see :manual:`Collation Document `. - - This option is available in MongoDB 3.4+ and will result in an exception at - execution time if specified for an older server version. interface: phpmethod operation: ~ optional: true @@ -68,8 +65,6 @@ name: session type: :php:`MongoDB\\Driver\\Session ` description: | Client session to associate with the operation. - - Sessions are not supported for server versions prior to 3.6. interface: phpmethod operation: ~ optional: true diff --git a/source/reference/exception-classes.txt b/source/reference/exception-classes.txt index 289e4ffa..b5f9fb0b 100644 --- a/source/reference/exception-classes.txt +++ b/source/reference/exception-classes.txt @@ -70,12 +70,6 @@ MongoDB\\Exception\\UnsupportedException selected server. It is used sparingly in cases where silently ignoring the unsupported option might otherwise lead to unexpected behavior. - For example, the ``collation`` option for - :phpmethod:`MongoDB\\Collection::deleteOne()` is only supported by - MongoDB 3.4+. Since collation determines how a document is matched, silently - ignoring the option for an older server version could result in an - unintended document being deleted. - This class extends the library's :phpclass:`RuntimeException ` class. diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt index 0c590630..012b3cb6 100644 --- a/source/reference/method/MongoDBCollection-count.txt +++ b/source/reference/method/MongoDBCollection-count.txt @@ -56,8 +56,7 @@ metadata. Even when provided with a query filter the ``count`` command can return inaccurate results with a sharded cluster if orphaned documents exist or if a chunk migration is in progress. The :phpmethod:`MongoDB\\Collection::countDocuments()` method avoids these sharded -cluster problems entirely when used with MongoDB 3.6+, and when a primary read -preference with older sharded clusters. +cluster problems entirely. .. include:: /includes/extracts/note-bson-comparison.rst diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt index b66171c2..0b150361 100644 --- a/source/reference/method/MongoDBCollection-countDocuments.txt +++ b/source/reference/method/MongoDBCollection-countDocuments.txt @@ -77,7 +77,7 @@ Consider the following alternatives to these restricted operators: - :query:`$geoWithin` with :query:`$centerSphere` * - :query:`$where` - - :query:`$expr` (requires MongoDB 3.6+) + - :query:`$expr` .. include:: /includes/extracts/note-bson-comparison.rst diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt index f024806d..a3e74ef5 100644 --- a/source/reference/method/MongoDBDatabase-createCollection.txt +++ b/source/reference/method/MongoDBDatabase-createCollection.txt @@ -41,11 +41,9 @@ Definition .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-option.rst - Note that not all options are available on all versions of MongoDB. Document - validation, for example, was added in MongoDB 3.2; similarly, the WiredTiger - storage engine is available only for MongoDB 3.0 and later. Refer to the - :manual:`create ` command reference in the MongoDB - manual for compatibility considerations. + Note that not all options are available on all versions of MongoDB. Refer to + the :manual:`create ` command reference in the + MongoDB manual for compatibility considerations. Return Values ------------- From 963e9c19c704c6c9a35ae760ff0a34d88f819bf8 Mon Sep 17 00:00:00 2001 From: Nathan Date: Wed, 30 Mar 2022 09:48:04 -0700 Subject: [PATCH 240/321] DOCSP-20374: Migrate docs.mongodb.com to mongodb.com/docs (#903) Also updates a few broken links Co-authored-by: Jeremy Mikola --- .../apiargs-MongoDBClient-method-listDatabases-option.yaml | 3 +-- source/includes/apiargs-MongoDBCollection-common-param.yaml | 2 +- .../apiargs-MongoDBDatabase-method-listCollections-option.yaml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml index b9a9c23e..fa544cce 100644 --- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml +++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml @@ -4,7 +4,7 @@ type: boolean description: | A flag that determines which databases are returned based on the user privileges when access control is enabled. For more information, see the - `listDatabases command documentation `_. + `listDatabases command documentation `_. For servers < 4.0.5, this option is ignored. @@ -36,4 +36,3 @@ source: ref: session post: | .. versionadded:: 1.3 -... diff --git a/source/includes/apiargs-MongoDBCollection-common-param.yaml b/source/includes/apiargs-MongoDBCollection-common-param.yaml index 9c032d15..47100d19 100644 --- a/source/includes/apiargs-MongoDBCollection-common-param.yaml +++ b/source/includes/apiargs-MongoDBCollection-common-param.yaml @@ -25,7 +25,7 @@ description: | Specifies the field and value combinations to update and any relevant update operators. ``$update`` uses MongoDB's :method:`update operators `. Starting with MongoDB 4.2, an `aggregation - pipeline `_ + pipeline `_ can be passed as this parameter. interface: phpmethod operation: ~ diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml index de05bf33..49f41dac 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml @@ -4,7 +4,7 @@ type: boolean description: | A flag that determines which collections are returned based on the user privileges when access control is enabled. For more information, see the - `listCollections command documentation `_. + `listCollections command documentation `_. For servers < 4.0, this option is ignored. From f35e9b082fda12ddcaa7fa7c6603b1de4c716eff Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 30 Mar 2022 14:55:44 -0400 Subject: [PATCH 241/321] PHPLIB-827: Use https links in documentation and comments (#907) Remove redundant www subdomains from URLs. The Apache license links are intentionally left as-is Also updates outdated ICU link, which had no https equivalent. --- .../apiargs-MongoDBClient-method-construct-param.yaml | 4 ++-- source/reference/bson.txt | 2 +- source/tutorial/collation.txt | 2 +- source/upgrade.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml index 4b6ff420..62998287 100644 --- a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml +++ b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml @@ -9,7 +9,7 @@ description: | Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified. Any special characters in the URI components need to be encoded according to - `RFC 3986 `_. This is particularly + `RFC 3986 `_. This is particularly relevant to the username and password, which can often include special characters such as ``@``, ``:``, or ``%``. When connecting via a Unix domain socket, the socket path may contain special characters such as slashes and @@ -26,7 +26,7 @@ description: | Specifies additional URI options, such as authentication credentials or query string parameters. The options specified in ``$uriOptions`` take precedence over any analogous options present in the ``$uri`` string and do not need to - be encoded according to `RFC 3986 `_. + be encoded according to `RFC 3986 `_. Refer to the :php:`MongoDB\\Driver\\Manager::__construct() ` extension reference and :manual:`MongoDB diff --git a/source/reference/bson.txt b/source/reference/bson.txt index b465ef61..2d4851a1 100644 --- a/source/reference/bson.txt +++ b/source/reference/bson.txt @@ -15,7 +15,7 @@ Overview MongoDB stores data records as BSON documents. BSON is a binary representation of :term:`JSON` documents, though it contains more data types than JSON. For the -BSON spec, see `bsonspec.org `_. +BSON spec, see `bsonspec.org `_. By default, the |php-library| returns BSON documents as :phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as diff --git a/source/tutorial/collation.txt b/source/tutorial/collation.txt index 7145de0d..76df18fe 100644 --- a/source/tutorial/collation.txt +++ b/source/tutorial/collation.txt @@ -66,7 +66,7 @@ Collation Parameters ] The only required parameter is ``locale``, which the server parses as an `ICU -format locale ID `_. For example, set +format locale ID `_. For example, set ``locale`` to ``en_US`` to represent US English or ``fr_CA`` to represent Canadian French. diff --git a/source/upgrade.txt b/source/upgrade.txt index b785b655..b3d9ab38 100644 --- a/source/upgrade.txt +++ b/source/upgrade.txt @@ -28,7 +28,7 @@ BSON Type Classes When upgrading from the legacy driver, type classes such as MongoId must be replaced with classes in the -`MongoDB\\BSON namespace `_. The +`MongoDB\\BSON namespace `_. The new driver also introduces interfaces for its BSON types, which should be preferred if applications need to type hint against BSON values. From 4889f736ffd242da23c998938bc38a9e20f5fc00 Mon Sep 17 00:00:00 2001 From: Aleksandr Rudo Date: Mon, 18 Apr 2022 21:06:10 +0300 Subject: [PATCH 242/321] PHPLIB-748: Support 'let' option for multiple CRUD commands (#910) * Updating all necessary classes with new 'let' option support. * Adding actual tests from specifications for "let" option by syncing unified spec tests with https://github.com/mongodb/specifications/commit/1028c348c86bb2c0ea313c30ed8320825048fe5d * Updating tests skips as some features are not yet implemented. * Updating driver version requirements. * Updating Mongo docs. Co-authored-by: Jeremy Mikola --- ...-MongoDBCollection-method-aggregate-option.yaml | 2 +- ...-MongoDBCollection-method-bulkWrite-option.yaml | 6 ++++++ ...MongoDBCollection-method-deleteMany-option.yaml | 6 ++++++ ...-MongoDBCollection-method-deleteOne-option.yaml | 6 ++++++ ...iargs-MongoDBCollection-method-find-option.yaml | 6 ++++++ ...gs-MongoDBCollection-method-findOne-option.yaml | 6 ++++++ ...BCollection-method-findOneAndDelete-option.yaml | 6 ++++++ ...Collection-method-findOneAndReplace-option.yaml | 6 ++++++ ...BCollection-method-findOneAndUpdate-option.yaml | 6 ++++++ ...MongoDBCollection-method-replaceOne-option.yaml | 6 ++++++ ...MongoDBCollection-method-updateMany-option.yaml | 6 ++++++ ...-MongoDBCollection-method-updateOne-option.yaml | 6 ++++++ ...gs-MongoDBDatabase-method-aggregate-option.yaml | 2 +- source/includes/apiargs-aggregate-option.yaml | 14 -------------- source/includes/apiargs-common-option.yaml | 14 ++++++++++++++ 15 files changed, 82 insertions(+), 16 deletions(-) diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml index 1d0346da..a2fc460d 100644 --- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml @@ -29,7 +29,7 @@ post: | .. versionadded:: 1.3 --- source: - file: apiargs-aggregate-option.yaml + file: apiargs-common-option.yaml ref: let post: | .. versionadded:: 1.9 diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml index d5d2e5df..7949954d 100644 --- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml @@ -2,6 +2,12 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation --- +source: + file: apiargs-common-option.yaml + ref: let +post: | + .. versionadded:: 1.13 +--- arg_name: option name: ordered type: boolean diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml index 55f6af9b..b11e4f5f 100644 --- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml @@ -11,6 +11,12 @@ post: | .. versionadded:: 1.7 --- +source: + file: apiargs-common-option.yaml + ref: let +post: | + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml index 55f6af9b..b11e4f5f 100644 --- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml @@ -11,6 +11,12 @@ post: | .. versionadded:: 1.7 --- +source: + file: apiargs-common-option.yaml + ref: let +post: | + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml index 7e298924..e80f2365 100644 --- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml @@ -257,4 +257,10 @@ description: | interface: phpmethod operation: ~ optional: true +--- +source: + file: apiargs-common-option.yaml + ref: let +post: | + .. versionadded:: 1.13 ... diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml index 2371aabe..139e700a 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml @@ -75,4 +75,10 @@ source: source: file: apiargs-MongoDBCollection-method-find-option.yaml ref: modifiers +--- +source: + file: apiargs-common-option.yaml + ref: let +post: | + .. versionadded:: 1.13 ... diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml index c8a1e58c..06270057 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml @@ -19,6 +19,12 @@ post: | .. versionadded:: 1.7 --- +source: + file: apiargs-common-option.yaml + ref: let +post: | + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: maxTimeMS diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml index 2987f9b0..37f326cf 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml @@ -27,6 +27,12 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation --- +source: + file: apiargs-common-option.yaml + ref: let +post: | + .. versionadded:: 1.13 +--- arg_name: option name: returnDocument type: integer diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml index d3a6eff4..41212523 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml @@ -33,6 +33,12 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation --- +source: + file: apiargs-common-option.yaml + ref: let +post: | + .. versionadded:: 1.13 +--- arg_name: option name: returnDocument type: integer diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml index cfc3a71d..dcd0847b 100644 --- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml @@ -19,6 +19,12 @@ post: | .. versionadded:: 1.6 --- +source: + file: apiargs-common-option.yaml + ref: let +post: | + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml index b94cb750..e102f561 100644 --- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml @@ -25,6 +25,12 @@ post: | .. versionadded:: 1.6 --- +source: + file: apiargs-common-option.yaml + ref: let +post: | + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml index b94cb750..e102f561 100644 --- a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml @@ -25,6 +25,12 @@ post: | .. versionadded:: 1.6 --- +source: + file: apiargs-common-option.yaml + ref: let +post: | + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml index 4d0bf4b2..f24d99d2 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml @@ -23,7 +23,7 @@ source: ref: hint --- source: - file: apiargs-aggregate-option.yaml + file: apiargs-common-option.yaml ref: let post: | .. versionadded:: 1.9 diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml index 557cd98f..77d6d535 100644 --- a/source/includes/apiargs-aggregate-option.yaml +++ b/source/includes/apiargs-aggregate-option.yaml @@ -45,18 +45,4 @@ description: | interface: phpmethod operation: ~ optional: true ---- -arg_name: option -name: let -type: array|object -description: | - Map of parameter names and values. Values must be constant or closed - expressions that do not reference document fields. Parameters can then be - accessed as variables in an aggregate expression context (e.g. ``$$var``). - - This is not supported for server versions prior to 5.0 and will result in an - exception at execution time if used. -interface: phpmethod -operation: ~ -optional: true ... diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml index 6ef2c761..667b35bd 100644 --- a/source/includes/apiargs-common-option.yaml +++ b/source/includes/apiargs-common-option.yaml @@ -24,6 +24,20 @@ operation: ~ optional: true --- arg_name: option +name: let +type: array|object +description: | + Map of parameter names and values. Values must be constant or closed + expressions that do not reference document fields. Parameters can then be + accessed as variables in an aggregate expression context (e.g. ``$$var``). + + This is not supported for server versions prior to 5.0 and will result in an + exception at execution time if used. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: maxTimeMS type: integer description: | From c9f96d71c7a45e6ee40bf356d21615d29660b9a1 Mon Sep 17 00:00:00 2001 From: Aleksandr Rudo Date: Mon, 18 Apr 2022 22:51:23 +0300 Subject: [PATCH 243/321] PHPLIB-826: Remove use of admin database in CSFLE driver doc examples --- source/tutorial/client-side-encryption.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/tutorial/client-side-encryption.txt b/source/tutorial/client-side-encryption.txt index cc77b07b..184bcc07 100644 --- a/source/tutorial/client-side-encryption.txt +++ b/source/tutorial/client-side-encryption.txt @@ -35,7 +35,7 @@ encrypted on insertion and decrypted when querying on the client side. $localKey = new Binary('', Binary::TYPE_GENERIC); $encryptionOpts = [ - 'keyVaultNamespace' => 'admin.datakeys', + 'keyVaultNamespace' => 'encryption.__keyVault', 'kmsProviders' => [ 'local' => ['key' => $localKey], ], @@ -101,7 +101,7 @@ encryption using the newly created key. $localKey = new Binary('', Binary::TYPE_GENERIC); $clientEncryptionOpts = [ - 'keyVaultNamespace' => 'admin.datakeys', + 'keyVaultNamespace' => 'encryption.__keyVault', 'kmsProviders' => [ 'local' => ['key' => $localKey], ], @@ -114,7 +114,7 @@ encryption using the newly created key. $keyId = $clientEncryption->createDataKey('local'); $autoEncryptionOpts = [ - 'keyVaultNamespace' => 'admin.datakeys', + 'keyVaultNamespace' => 'encryption.__keyVault', 'kmsProviders' => [ 'local' => ['key' => $localKey], ], @@ -163,7 +163,7 @@ explicitly encrypts and decrypts values in the document. $localKey = new Binary('', Binary::TYPE_GENERIC); $clientEncryptionOpts = [ - 'keyVaultNamespace' => 'admin.datakeys', + 'keyVaultNamespace' => 'encryption.__keyVault', 'kmsProviders' => [ 'local' => ['key' => $localKey], ], @@ -212,7 +212,7 @@ The software then encrypts data by referencing the key by its alternative name. $localKey = new Binary('', Binary::TYPE_GENERIC); $clientEncryptionOpts = [ - 'keyVaultNamespace' => 'admin.datakeys', + 'keyVaultNamespace' => 'encryption.__keyVault', 'kmsProviders' => [ 'local' => ['key' => $localKey], ], From dcb31907c95081e58f09c8c3231f5be65a2ac4a5 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 20 Apr 2022 12:00:49 -0400 Subject: [PATCH 244/321] PHPLIB-814: Change stream support for point-in-time pre and post-images (#911) Introduces fullDocumentBeforeChange option. Tests for specifying "whenAvailable" and "required" for both fullDocument and fullDocumentBeforeChange (requires MongoDB 6.0+ with changeStreamPreAndPostImages enabled on the collection). Intentionally omits mention of FULL_DOCUMENT_DEFAULT (related to PHPLIB-808) and FULL_DOCUMENT_BEFORE_CHANGE_OFF constants, since those redundantly specified default behavior. Tests synced with mongodb/specifications@89788990924ac3bfe43586233dd4f0159e2bf9b9 --- ...rgs-MongoDBClient-method-watch-option.yaml | 6 +++ ...MongoDBCollection-method-watch-option.yaml | 6 +++ ...s-MongoDBDatabase-method-watch-option.yaml | 6 +++ .../includes/apiargs-method-watch-option.yaml | 51 ++++++++++++++++--- 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml index 2dd040e9..7fa5400a 100644 --- a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml +++ b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml @@ -11,6 +11,12 @@ source: file: apiargs-method-watch-option.yaml ref: fullDocument --- +source: + file: apiargs-method-watch-option.yaml + ref: fullDocumentBeforeChange +post: | + .. versionadded: 1.13 +--- source: file: apiargs-method-watch-option.yaml ref: maxAwaitTimeMS diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml index a873beec..d785b471 100644 --- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml @@ -11,6 +11,12 @@ source: file: apiargs-method-watch-option.yaml ref: fullDocument --- +source: + file: apiargs-method-watch-option.yaml + ref: fullDocumentBeforeChange +post: | + .. versionadded: 1.13 +--- source: file: apiargs-method-watch-option.yaml ref: maxAwaitTimeMS diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml index b1ad0279..7de7df6d 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml @@ -11,6 +11,12 @@ source: file: apiargs-method-watch-option.yaml ref: fullDocument --- +source: + file: apiargs-method-watch-option.yaml + ref: fullDocumentBeforeChange +post: | + .. versionadded: 1.13 +--- source: file: apiargs-method-watch-option.yaml ref: maxAwaitTimeMS diff --git a/source/includes/apiargs-method-watch-option.yaml b/source/includes/apiargs-method-watch-option.yaml index 89887884..00aba313 100644 --- a/source/includes/apiargs-method-watch-option.yaml +++ b/source/includes/apiargs-method-watch-option.yaml @@ -13,14 +13,53 @@ arg_name: option name: fullDocument type: string description: | - Allowed values are 'default' and 'updateLookup'. Defaults to 'default'. - When set to 'updateLookup', the change notification for partial updates will - include both a delta describing the changes to the document, as well as a - copy of the entire document that was changed from some time after the change - occurred. The following values are supported: + Determines how the "fullDocument" response field will be populated for update + operations. + + By default, change streams only return the delta of fields (via an + "udateDescription" field) for update operations and "fullDocument" is omitted. + Insert and replace operations always include the "fullDocument" field. Delete + operations omit the field as the document no longer exists. + + Specify "updateLookup" to return the current majority-committed version of the + updated document. + + MongoDB 6.0+ allows returning the post-image of the modified document if the + collection has ``changeStreamPreAndPostImages`` enabled. Specify + "whenAvailable" to return the post-image if available or a null value if not. + Specify "required" to return the post-image if available or raise an error if + not. + + The following values are supported: - - ``MongoDB\Operation\Watch::FULL_DOCUMENT_DEFAULT`` (*default*) - ``MongoDB\Operation\Watch::FULL_DOCUMENT_UPDATE_LOOKUP`` + - ``MongoDB\Operation\Watch::FULL_DOCUMENT_WHEN_AVAILABLE`` + - ``MongoDB\Operation\Watch::FULL_DOCUMENT_REQUIRED`` + + .. note:: + + This is an option of the ``$changeStream`` pipeline stage. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option +name: fullDocumentBeforeChange +type: string +description: | + Determines how the "fullDocumentBeforeChange" response field will be + populated. By default, the field is omitted. + + MongoDB 6.0+ allows returning the pre-image of the modified document if the + collection has ``changeStreamPreAndPostImages`` enabled. Specify + "whenAvailable" to return the pre-image if available or a null value if not. + Specify "required" to return the pre-image if available or raise an error if + not. + + The following values are supported: + + - ``MongoDB\Operation\Watch::FULL_DOCUMENT_BEFORE_CHANGE_WHEN_AVAILABLE`` + - ``MongoDB\Operation\Watch::FULL_DOCUMENT_BEFORE_CHANGE_REQUIRED`` .. note:: From 8be87b63984930691d8d77b03d24004a917e1c73 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 16 May 2022 14:24:09 -0400 Subject: [PATCH 245/321] PHPLIB-843: Support clusteredIndex option for createCollection Fixes preparation of database, collection, and index enumeration results. The new spec tests are the first to assert these results (including those for legacy test runners). Sync collection-management spec tests with mongodb/specifications@d1458823bd810014df9da16d3a5354d2269ab865, which also covers PHPLIB-856 --- ...Database-method-createCollection-option.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml index 4c341d91..549c053f 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -27,6 +27,23 @@ interface: phpmethod operation: ~ optional: true --- +arg_name: option +name: clusteredIndex +type: document +description: | + A clustered index specification. See + :manual:`Clustered Collections ` or the + :manual:`create ` command documentation for more + information. + + This option is available in MongoDB 5.3+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.13 +interface: phpmethod +operation: ~ +optional: true +--- source: file: apiargs-common-option.yaml ref: collation From 463b1c3a04622bb312e1f4fb2c23d7c419589ba9 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 16 May 2022 15:08:22 -0400 Subject: [PATCH 246/321] PHPLIB-856: changeStreamPreAndPostImages create and collMod option This should originally have been added in dcb31907c95081e58f09c8c3231f5be65a2ac4a5 for PHPLIB-814. --- ...BDatabase-method-createCollection-option.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml index 549c053f..9b0ae8a6 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -28,6 +28,22 @@ operation: ~ optional: true --- arg_name: option +name: changeStreamPreAndPostImages +type: document +description: | + Used to configure support for pre- and post-images in change streams. See the + :manual:`create ` command documentation for more + information. + + This option is available in MongoDB 6.0+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.13 +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: clusteredIndex type: document description: | From 63f28c278a48a35f86cee0c5821595d498866958 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 19 May 2022 12:55:35 -0400 Subject: [PATCH 247/321] PHPLIB-810: Document behavior for estimatedDocumentCount --- .../MongoDBCollection-estimatedDocumentCount.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt index 097e03b4..1a831629 100644 --- a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt +++ b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt @@ -50,7 +50,15 @@ Behavior This method returns an estimate of the count of documents in the collection using collection metadata, rather than counting the documents or consulting an index. This method does not take a ``session`` option and cannot be executed -within a transaction. +within a transaction. See +`Count: Behavior `_ +in the MongoDB manual for more information. + +This method is implemented using the :manual:`count ` +command. Due to an oversight in versions 5.0.0-5.0.8 of MongoDB, the ``count`` +command was not included in version "1" of the Stable API. Applications using +this method with the Stable API are recommended to upgrade their server version +to 5.0.9+ or disable strict mode to avoid encountering errors. See Also -------- From 70b3ab6a37fa7709f059c8d876736d12b498e85e Mon Sep 17 00:00:00 2001 From: Aleksandr Rudo Date: Mon, 6 Jun 2022 18:59:41 +0300 Subject: [PATCH 248/321] PHPLIB-869: Support viewOn and pipeline options in createCollection helper (#935) --- ...tabase-method-createCollection-option.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml index 9b0ae8a6..10d9252b 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -145,6 +145,20 @@ source: file: apiargs-common-option.yaml ref: maxTimeMS --- +arg_name: option +name: pipeline +type: array +description: | + An array that consists of the aggregation pipeline stage(s), which will be + applied to the collection or view specified by ``viewOn``. See the + :manual:`create ` command documentation for more + information. + + .. versionadded:: 1.13 +interface: phpmethod +operation: ~ +optional: true +--- source: file: apiargs-common-option.yaml ref: session @@ -295,6 +309,23 @@ interface: phpmethod operation: ~ optional: true --- +arg_name: option +name: viewOn +type: string +description: | + The name of the source collection or view from which to create the view. + + .. note:: + + The name is not the full namespace of the collection or view (i.e. it does + not include the database name). Views must be created in the same databases + as the source collection or view. + + .. versionadded:: 1.13 +interface: phpmethod +operation: ~ +optional: true +--- source: file: apiargs-MongoDBDatabase-common-option.yaml ref: writeConcern From f0cd039d5308b651991acbc21b70a96f4ea329af Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 31 May 2022 10:38:02 -0400 Subject: [PATCH 249/321] PHPLIB-851: Queryable encryption support for create/drop collection helpers --- ...s-MongoDBCollection-method-drop-option.yaml | 12 +++++++++--- ...atabase-method-createCollection-option.yaml | 18 ++++++++++++++++++ ...BDatabase-method-dropCollection-option.yaml | 6 ++++++ .../apiargs-dropCollection-option.yaml | 15 +++++++++++++++ 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 source/includes/apiargs-dropCollection-option.yaml diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml index 3a66ad3b..7e08cf43 100644 --- a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml @@ -1,8 +1,8 @@ source: - file: apiargs-MongoDBCollection-common-option.yaml - ref: typeMap + file: apiargs-dropCollection-option.yaml + ref: encryptedFields post: | - This will be used for the returned command result document. + .. versionadded:: 1.13 --- source: file: apiargs-common-option.yaml @@ -10,6 +10,12 @@ source: post: | .. versionadded:: 1.3 --- +source: + file: apiargs-MongoDBCollection-common-option.yaml + ref: typeMap +post: | + This will be used for the returned command result document. +--- source: file: apiargs-MongoDBCollection-common-option.yaml ref: writeConcern diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml index 10d9252b..82865dc1 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -68,6 +68,24 @@ pre: | ` for the collection. --- arg_name: option +name: encryptedFields +type: document +description: | + A document describing encrypted fields for queryable encryption. If omitted, + the ``encryptedFieldsMap`` option within the ``autoEncryption`` driver option + will be consulted. See the + `Client Side Encryption specification `_ + for more information. + + This option is available in MongoDB 6.0+ and will result in an exception at + execution time if specified for an older server version. + + .. versionadded:: 1.13 +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: expireAfterSeconds type: integer description: | diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml index 5b3c18c3..f08f9e06 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml @@ -1,3 +1,9 @@ +source: + file: apiargs-dropCollection-option.yaml + ref: encryptedFields +post: | + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-dropCollection-option.yaml b/source/includes/apiargs-dropCollection-option.yaml new file mode 100644 index 00000000..018effa9 --- /dev/null +++ b/source/includes/apiargs-dropCollection-option.yaml @@ -0,0 +1,15 @@ +arg_name: option +name: encryptedFields +type: array|object +description: | + A document describing encrypted fields for queryable encryption. If omitted, + the ``encryptedFieldsMap`` option within the ``autoEncryption`` driver option + will be consulted. If ``encryptedFieldsMap`` was defined but does not specify + this collection, the library will make a final attempt to consult the + server-side value for ``encryptedFields``. See the + `Client Side Encryption specification `_ + for more information. +interface: phpmethod +operation: ~ +optional: true +... From dac59aabe4366cb718282e17d23c9198e4d69f69 Mon Sep 17 00:00:00 2001 From: Aleksandr Rudo Date: Tue, 7 Jun 2022 18:27:34 +0300 Subject: [PATCH 250/321] PHPLIB-749: Support comment option on command helpers (#925) Co-authored-by: Jeremy Mikola --- ...-MongoDBClient-method-dropDatabase-option.yaml | 9 +++++++++ ...MongoDBClient-method-listDatabases-option.yaml | 9 +++++++++ ...apiargs-MongoDBClient-method-watch-option.yaml | 9 +++++++++ ...MongoDBCollection-method-aggregate-option.yaml | 5 ++++- ...MongoDBCollection-method-bulkWrite-option.yaml | 9 +++++++++ ...rgs-MongoDBCollection-method-count-option.yaml | 9 +++++++++ ...DBCollection-method-countDocuments-option.yaml | 7 +++++++ ...ngoDBCollection-method-createIndex-option.yaml | 9 +++++++++ ...oDBCollection-method-createIndexes-option.yaml | 9 +++++++++ ...ongoDBCollection-method-deleteMany-option.yaml | 9 +++++++++ ...MongoDBCollection-method-deleteOne-option.yaml | 9 +++++++++ ...-MongoDBCollection-method-distinct-option.yaml | 9 +++++++++ ...args-MongoDBCollection-method-drop-option.yaml | 9 +++++++++ ...MongoDBCollection-method-dropIndex-option.yaml | 9 +++++++++ ...ngoDBCollection-method-dropIndexes-option.yaml | 9 +++++++++ ...ction-method-estimateDocumentCount-option.yaml | 9 +++++++++ ...s-MongoDBCollection-method-explain-option.yaml | 11 +++++++++++ ...args-MongoDBCollection-method-find-option.yaml | 15 ++++++--------- ...Collection-method-findOneAndDelete-option.yaml | 9 +++++++++ ...ollection-method-findOneAndReplace-option.yaml | 9 +++++++++ ...Collection-method-findOneAndUpdate-option.yaml | 9 +++++++++ ...ongoDBCollection-method-insertMany-option.yaml | 9 +++++++++ ...MongoDBCollection-method-insertOne-option.yaml | 9 +++++++++ ...ngoDBCollection-method-listIndexes-option.yaml | 9 +++++++++ ...MongoDBCollection-method-mapReduce-option.yaml | 9 +++++++++ ...gs-MongoDBCollection-method-rename-option.yaml | 9 +++++++++ ...ongoDBCollection-method-replaceOne-option.yaml | 9 +++++++++ ...ongoDBCollection-method-updateMany-option.yaml | 9 +++++++++ ...MongoDBCollection-method-updateOne-option.yaml | 9 +++++++++ ...rgs-MongoDBCollection-method-watch-option.yaml | 9 +++++++++ ...s-MongoDBDatabase-method-aggregate-option.yaml | 5 ++++- ...DBDatabase-method-createCollection-option.yaml | 9 +++++++++ ...piargs-MongoDBDatabase-method-drop-option.yaml | 9 +++++++++ ...goDBDatabase-method-dropCollection-option.yaml | 9 +++++++++ ...oDBDatabase-method-listCollections-option.yaml | 9 +++++++++ ...DBDatabase-method-modifyCollection-option.yaml | 9 +++++++++ ...DBDatabase-method-renameCollection-option.yaml | 9 +++++++++ ...iargs-MongoDBDatabase-method-watch-option.yaml | 9 +++++++++ source/includes/apiargs-aggregate-option.yaml | 10 ---------- source/includes/apiargs-common-option.yaml | 12 ++++++++++++ 40 files changed, 341 insertions(+), 21 deletions(-) diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml index 07e75df7..be0a19aa 100644 --- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml +++ b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml @@ -1,3 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml index fa544cce..38baf93a 100644 --- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml +++ b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml @@ -13,6 +13,15 @@ interface: phpmethod operation: ~ optional: true --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- arg_name: option name: filter type: array|object diff --git a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml index 7fa5400a..96d11eac 100644 --- a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml +++ b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml @@ -7,6 +7,15 @@ source: file: apiargs-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + The comment can be any valid BSON type for server versions 4.4 and above. + Earlier server versions only support string values. + + .. versionadded:: 1.13 +--- source: file: apiargs-method-watch-option.yaml ref: fullDocument diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml index a2fc460d..b3d19c3e 100644 --- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml @@ -11,9 +11,12 @@ source: ref: bypassDocumentValidation --- source: - file: apiargs-aggregate-option.yaml + file: apiargs-common-option.yaml ref: comment post: | + The comment can be any valid BSON type for server versions 4.4 and above. + Earlier server versions only support string values. + .. versionadded:: 1.3 --- source: diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml index 7949954d..25d8e24d 100644 --- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml @@ -2,6 +2,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: let diff --git a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml index 62227f1c..3d839e04 100644 --- a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml @@ -2,6 +2,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- arg_name: option name: hint type: string|array|object diff --git a/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml b/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml index 2571b071..da1f0113 100644 --- a/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml @@ -2,6 +2,13 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + The comment can be any valid BSON type for server versions 4.4 and above. + Earlier server versions only support string values. +--- arg_name: option name: hint type: string|array|object diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml index 18d1ce07..18283767 100644 --- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml @@ -17,6 +17,15 @@ interface: phpmethod operation: ~ optional: true --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- arg_name: option name: unique type: boolean diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml index 5728ab31..54c33bfa 100644 --- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml @@ -1,3 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-MongoDBCollection-method-createIndex-option.yaml ref: commitQuorum diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml index b11e4f5f..110911f5 100644 --- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml @@ -2,6 +2,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: hint diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml index b11e4f5f..110911f5 100644 --- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml @@ -2,6 +2,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: hint diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml index 3c2ae6ed..05a1b285 100644 --- a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml @@ -2,6 +2,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: maxTimeMS diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml index 7e08cf43..5eb5efab 100644 --- a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml @@ -1,3 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-dropCollection-option.yaml ref: encryptedFields diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml index 9bc36f4b..b87e09b7 100644 --- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml @@ -1,3 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: maxTimeMS diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml index 0aa5048f..aff9f4d7 100644 --- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml @@ -1,3 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: maxTimeMS diff --git a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml index f70487a1..7289296e 100644 --- a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml @@ -1,3 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: maxTimeMS diff --git a/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml b/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml index 7c6a4dcd..650633bc 100644 --- a/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml @@ -1,3 +1,14 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + Defaults to the ``comment`` of the explained operation (if any). + + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-MongoDBCollection-common-option.yaml ref: readPreference diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml index e80f2365..1b01599e 100644 --- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml @@ -74,15 +74,12 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- -arg_name: option -name: comment -type: string -description: | - A comment to attach to the query to help interpret and trace query - :dbcommand:`profile` data. -interface: phpmethod -operation: ~ -optional: true +source: + file: apiargs-common-option.yaml + ref: comment +post: | + The comment can be any valid BSON type for server versions 4.4 and above. + Earlier server versions only support string values. --- arg_name: option name: cursorType diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml index 06270057..d8f2b3a4 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml @@ -10,6 +10,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: hint diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml index 37f326cf..b509ac94 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml @@ -10,6 +10,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: hint diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml index 41212523..a8f895f1 100644 --- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml @@ -16,6 +16,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: hint diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml index 39193578..60f197d2 100644 --- a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml @@ -2,6 +2,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-MongoDBCollection-method-bulkWrite-option.yaml ref: ordered diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml index 61d795c7..adf17cb6 100644 --- a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml @@ -2,6 +2,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: bypassDocumentValidation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml index cbfb6501..aa939b95 100644 --- a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml @@ -1,3 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: maxTimeMS diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml index 97f320ee..478d12dd 100644 --- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml @@ -8,6 +8,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- arg_name: option name: finalize type: :php:`MongoDB\\BSON\\Javascript ` diff --git a/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml b/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml index 3aed74eb..0b0b0809 100644 --- a/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml @@ -1,3 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-MongoDBCollection-common-option.yaml ref: typeMap diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml index dcd0847b..676296d2 100644 --- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml @@ -10,6 +10,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: hint diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml index e102f561..64eec34e 100644 --- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml @@ -16,6 +16,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: hint diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml index e102f561..64eec34e 100644 --- a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml @@ -16,6 +16,15 @@ source: file: apiargs-MongoDBCollection-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: hint diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml index d785b471..d1c42622 100644 --- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml @@ -7,6 +7,15 @@ source: file: apiargs-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + The comment can be any valid BSON type for server versions 4.4 and above. + Earlier server versions only support string values. + + .. versionadded:: 1.13 +--- source: file: apiargs-method-watch-option.yaml ref: fullDocument diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml index f24d99d2..f59192a0 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml @@ -11,8 +11,11 @@ source: ref: bypassDocumentValidation --- source: - file: apiargs-aggregate-option.yaml + file: apiargs-common-option.yaml ref: comment +post: | + The comment can be any valid BSON type for server versions 4.4 and above. + Earlier server versions only support string values. --- source: file: apiargs-aggregate-option.yaml diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml index 82865dc1..f95b406c 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -67,6 +67,15 @@ pre: | Specifies the :manual:`collation ` for the collection. --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- arg_name: option name: encryptedFields type: document diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml index 5b3c18c3..e725fc1b 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml @@ -1,3 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml index f08f9e06..0034b5e8 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml @@ -4,6 +4,15 @@ source: post: | .. versionadded:: 1.13 --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml index 49f41dac..bacf7280 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml @@ -13,6 +13,15 @@ interface: phpmethod operation: ~ optional: true --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- arg_name: option name: filter type: array|object diff --git a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml index ca8d6fef..b27c16cf 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml @@ -1,3 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml index bf7d9663..bb026bd9 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml @@ -1,3 +1,12 @@ +source: + file: apiargs-common-option.yaml + ref: comment +post: | + This is not supported for server versions prior to 4.4 and will result in an + exception at execution time if used. + + .. versionadded:: 1.13 +--- source: file: apiargs-common-option.yaml ref: session diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml index 7de7df6d..3ee3c144 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml @@ -7,6 +7,15 @@ source: file: apiargs-common-option.yaml ref: collation --- +source: + file: apiargs-common-option.yaml + ref: comment +post: | + The comment can be any valid BSON type for server versions 4.4 and above. + Earlier server versions only support string values. + + .. versionadded:: 1.13 +--- source: file: apiargs-method-watch-option.yaml ref: fullDocument diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml index 77d6d535..c75880df 100644 --- a/source/includes/apiargs-aggregate-option.yaml +++ b/source/includes/apiargs-aggregate-option.yaml @@ -27,16 +27,6 @@ post: | :ref:`$out ` stages. --- arg_name: option -name: comment -type: string -description: | - Users can specify an arbitrary string to help trace the operation through the - database profiler, currentOp, and logs. -interface: phpmethod -operation: ~ -optional: true ---- -arg_name: option name: explain type: boolean description: | diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml index 667b35bd..cae14187 100644 --- a/source/includes/apiargs-common-option.yaml +++ b/source/includes/apiargs-common-option.yaml @@ -13,6 +13,18 @@ operation: ~ optional: true --- arg_name: option +name: comment +type: mixed +description: | + Enables users to specify an arbitrary comment to help trace the operation + through the :manual:`database profiler `, + :manual:`currentOp ` output, and + :manual:`logs `. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: hint type: string|array|object description: | From 9cbe36c193ec4a85a703dcf8efdf4aa524885d30 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 7 Jun 2022 17:03:38 -0400 Subject: [PATCH 251/321] Fix versionadded syntax for autoEncryption driver option --- .../apiargs-MongoDBClient-method-construct-driverOptions.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml index 5d30540d..8406bd09 100644 --- a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml +++ b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml @@ -8,6 +8,7 @@ description: | For the ``keyVaultClient`` option, you may pass a :phpclass:`MongoDB\\Client` instance, which will be unwrapped to provide a :php:`MongoDB\\Driver\\Manager ` to the extension. + .. versionadded:: 1.6 interface: phpmethod operation: ~ From 0c771bac19336218524d4f96030c3221e04d9600 Mon Sep 17 00:00:00 2001 From: Aleksandr Rudo Date: Thu, 7 Jul 2022 20:22:16 +0300 Subject: [PATCH 252/321] PHPLIB-846: Improved change stream event visibility for C2C Replication (#949) Spec tests synced with mongodb/specifications@8da1a8990611687cfc9217322f90df47b047726a Co-authored-by: Jeremy Mikola --- ...rgs-MongoDBClient-method-watch-option.yaml | 6 +++++ ...MongoDBCollection-method-watch-option.yaml | 6 +++++ ...s-MongoDBDatabase-method-watch-option.yaml | 6 +++++ .../includes/apiargs-method-watch-option.yaml | 25 +++++++++++++++++++ 4 files changed, 43 insertions(+) diff --git a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml index 96d11eac..cad9c3f7 100644 --- a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml +++ b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml @@ -49,6 +49,12 @@ source: file: apiargs-common-option.yaml ref: session --- +source: + file: apiargs-method-watch-option.yaml + ref: showExpandedEvents +post: | + .. versionadded:: 1.13 +--- source: file: apiargs-method-watch-option.yaml ref: startAfter diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml index d1c42622..0a47ae62 100644 --- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml +++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml @@ -49,6 +49,12 @@ source: file: apiargs-common-option.yaml ref: session --- +source: + file: apiargs-method-watch-option.yaml + ref: showExpandedEvents +post: | + .. versionadded:: 1.13 +--- source: file: apiargs-method-watch-option.yaml ref: startAfter diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml index 3ee3c144..b24efbec 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml @@ -49,6 +49,12 @@ source: file: apiargs-common-option.yaml ref: session --- +source: + file: apiargs-method-watch-option.yaml + ref: showExpandedEvents +post: | + .. versionadded:: 1.13 +--- source: file: apiargs-method-watch-option.yaml ref: startAfter diff --git a/source/includes/apiargs-method-watch-option.yaml b/source/includes/apiargs-method-watch-option.yaml index 00aba313..01b7f765 100644 --- a/source/includes/apiargs-method-watch-option.yaml +++ b/source/includes/apiargs-method-watch-option.yaml @@ -97,6 +97,31 @@ operation: ~ optional: true --- arg_name: option +name: showExpandedEvents +type: boolean +description: | + If true, instructs the server to include additional DDL events in the change + stream. The additional events that may be included are: + + - ``createIndexes`` + - ``dropIndexes`` + - ``modify`` + - ``create`` + - ``shardCollection`` + - ``reshardCollection`` (server 6.1+) + - ``refineCollectionShardKey`` (server 6.1+) + + This is not supported for server versions prior to 6.0 and will result in an + exception at execution time if used. + + .. note:: + + This is an option of the ``$changeStream`` pipeline stage. +interface: phpmethod +operation: ~ +optional: true +--- +arg_name: option name: startAfter type: array|object description: | From 04d4c5632a74386c49a4a3908d8f4d6865fa9ce9 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 14 Jul 2022 01:07:37 -0400 Subject: [PATCH 253/321] PHPLIB-893: Automatic queryable encryption in CSFLE tutorial (#952) --- source/tutorial/client-side-encryption.txt | 98 +++++++++++++++++++++- 1 file changed, 94 insertions(+), 4 deletions(-) diff --git a/source/tutorial/client-side-encryption.txt b/source/tutorial/client-side-encryption.txt index 184bcc07..6ed2e00d 100644 --- a/source/tutorial/client-side-encryption.txt +++ b/source/tutorial/client-side-encryption.txt @@ -21,8 +21,8 @@ Automatic Encryption and Decryption Auto encryption is an enterprise only feature. -The following example uses a local key, however using AWS Key Management Service -is also an option. The data in the ``encryptedField`` field is automatically +The following example uses a local key; however, other key providers such as AWS +are also an option. The data in the ``encryptedField`` field is automatically encrypted on insertion and decrypted when querying on the client side. .. code-block:: php @@ -31,6 +31,7 @@ encrypted on insertion and decrypted when querying on the client side. use MongoDB\BSON\Binary; use MongoDB\Client; + use MongoDB\Driver\ClientEncryption; $localKey = new Binary('', Binary::TYPE_GENERIC); @@ -41,7 +42,7 @@ encrypted on insertion and decrypted when querying on the client side. ], ]; - $client = new Client('mongodb://127.0.0.1'); + $client = new Client(); $clientEncryption = $client->createClientEncryption($encryptionOpts); $database = $client->selectDatabase('test'); @@ -134,7 +135,7 @@ encryption using the newly created key. ], ]; - $encryptedClient = new Client('mongodb://127.0.0.1', [], ['autoEncryption' => $autoEncryptionOpts]); + $encryptedClient = new Client(null, [], ['autoEncryption' => $autoEncryptionOpts]); $collection = $encryptedClient->selectCollection('test', 'coll'); $collection->drop(); // clear old data @@ -239,3 +240,92 @@ The software then encrypts data by referencing the key by its alternative name. $document = $collection->findOne(); var_dump($clientEncryption->decrypt($document->encryptedField)); + + +Automatic Queryable Encryption +------------------------------ + +.. note:: + + Automatic queryable encryption is an enterprise only feature and requires + MongoDB 6.0+. + +The following example uses a local key; however, other key providers such as AWS +are also an option. The data in the ``encryptedIndexed`` and +``encryptedUnindexed`` fields will be automatically encrypted on insertion and +decrypted when querying on the client side. Additionally, it is possible to +query on the ``encryptedIndexed`` field. + +.. code-block:: php + + ', Binary::TYPE_GENERIC); + + $encryptionOpts = [ + 'keyVaultNamespace' => 'encryption.__keyVault', + 'kmsProviders' => ['local' => ['key' => $localKey]], + ]; + + $client = new Client(); + $clientEncryption = $client->createClientEncryption($encryptionOpts); + + // Create two data keys, one for each encrypted field + $dataKeyId1 = $clientEncryption->createDataKey('local'); + $dataKeyId2 = $clientEncryption->createDataKey('local'); + + $autoEncryptionOpts = [ + 'keyVaultNamespace' => 'encryption.__keyVault', + 'kmsProviders' => ['local' => ['key' => $localKey]], + 'encryptedFieldsMap' => [ + 'test.coll' => [ + 'fields' => [ + [ + 'path' => 'encryptedIndexed', + 'bsonType' => 'string', + 'keyId' => $dataKeyId1, + 'queries' => ['queryType' => 'equality'], + ], + [ + 'path' => 'encryptedUnindexed', + 'bsonType' => 'string', + 'keyId' => $dataKeyId2, + ], + ], + ], + ], + ]; + + $encryptedClient = new Client(null, [], ['autoEncryption' => $autoEncryptionOpts]); + + /* Drop and create the collection under test. The createCollection() helper + * will reference the client's encryptedFieldsMap and create additional, + * internal collections automatically. */ + $encryptedClient->selectDatabase('test')->dropCollection('coll'); + $encryptedClient->selectDatabase('test')->createCollection('coll'); + $encryptedCollection = $encryptedClient->selectCollection('test', 'coll'); + + /* Using a client with auto encryption, insert a document with encrypted + * fields and assert that those fields are automatically decrypted when + * querying. The encryptedIndexed and encryptedUnindexed fields should both + * be strings. */ + $indexedValue = 'indexedValue'; + $unindexedValue = 'unindexedValue'; + + $encryptedCollection->insertOne([ + '_id' => 1, + 'encryptedIndexed' => $indexedValue, + 'encryptedUnindexed' => $unindexedValue, + ]); + + var_dump($encryptedCollection->findOne(['encryptedIndexed' => $indexedValue])); + + /* Using a client without auto encryption, query for the same document and + * assert that encrypted data is returned. The encryptedIndexed and + * encryptedUnindexed fields should both be Binary objects. */ + $unencryptedCollection = $client->selectCollection('test', 'coll'); + + var_dump($unencryptedCollection->findOne(['_id' => 1])); From 15b7461e142750d13ede18ee08051e47816f6d1e Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 6 Sep 2022 14:12:46 -0400 Subject: [PATCH 254/321] Fix typo in fullDocument option docs (#969) This typo originated in dcb31907c95081e58f09c8c3231f5be65a2ac4a5 for PHPLIB-814 --- source/includes/apiargs-method-watch-option.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/includes/apiargs-method-watch-option.yaml b/source/includes/apiargs-method-watch-option.yaml index 01b7f765..1aa1de2b 100644 --- a/source/includes/apiargs-method-watch-option.yaml +++ b/source/includes/apiargs-method-watch-option.yaml @@ -17,9 +17,9 @@ description: | operations. By default, change streams only return the delta of fields (via an - "udateDescription" field) for update operations and "fullDocument" is omitted. - Insert and replace operations always include the "fullDocument" field. Delete - operations omit the field as the document no longer exists. + "updateDescription" field) for update operations and "fullDocument" is + omitted. Insert and replace operations always include the "fullDocument" + field. Delete operations omit the field as the document no longer exists. Specify "updateLookup" to return the current majority-committed version of the updated document. From 078656a79a0124a739a8bed06fb4f7645bc22543 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 28 Sep 2022 08:35:15 +0200 Subject: [PATCH 255/321] PHPLIB-596: Add tutorial for connecting to MongoDB (#979) * PHPLIB-596: Add tutorial for connecting to MongoDB * Fix formatting breaking TOC Co-authored-by: Jeremy Mikola * Link connecting tutorial on tutorials page Co-authored-by: Jeremy Mikola --- source/index.txt | 2 ++ .../method/MongoDBClient__construct.txt | 23 ++++++++++++++--- source/tutorial.txt | 1 + source/tutorial/connecting.txt | 25 +++++++++++++++++++ 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 source/tutorial/connecting.txt diff --git a/source/index.txt b/source/index.txt index 8c167eb6..ae9da18a 100644 --- a/source/index.txt +++ b/source/index.txt @@ -27,6 +27,8 @@ following pages should help you get started: - :doc:`/tutorial/install-php-library` +- :doc:`/tutorial/connecting` + - :doc:`/tutorial/crud` - :doc:`/tutorial/commands` diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt index 091ae614..0b89b690 100644 --- a/source/reference/method/MongoDBClient__construct.txt +++ b/source/reference/method/MongoDBClient__construct.txt @@ -49,12 +49,27 @@ initialized on demand, when the first operation is executed. Examples -------- +.. start-connecting-include + +Connecting to a Standalone server +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you do not specify a ``$uri`` value, the driver connects to a standalone +:program:`mongod` on ``127.0.0.1`` via port ``27017``. To connect to a different +server, pass the corresponding connection string as the first parameter when +creating the :phpclass:`Client ` instance: + +.. code-block:: php + + ` documentation. +.. end-connecting-include + Specifying a Custom Type Map ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/tutorial.txt b/source/tutorial.txt index cca3ee34..e28bcf4c 100644 --- a/source/tutorial.txt +++ b/source/tutorial.txt @@ -5,6 +5,7 @@ Tutorials .. toctree:: + /tutorial/connecting /tutorial/crud /tutorial/collation /tutorial/commands diff --git a/source/tutorial/connecting.txt b/source/tutorial/connecting.txt new file mode 100644 index 00000000..c964362a --- /dev/null +++ b/source/tutorial/connecting.txt @@ -0,0 +1,25 @@ +===================== +Connecting to MongoDB +===================== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +Creating a Client instance +-------------------------------------------------------- + +.. include:: /reference/method/MongoDBClient__construct.txt + :start-after: start-connecting-include + :end-before: end-connecting-include + +Specifying connection options +----------------------------- + +Connection options can be passed via the ``$uri`` parameter, or through the +``$options`` and ``$driverOptions`` parameters. The available options are +documented in the :phpmethod:`MongoDB\\Client::__construct()` reference. From 2d48dead8179dbf6b15ca9c145d51d2421de620c Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Fri, 30 Sep 2022 11:58:13 -0400 Subject: [PATCH 256/321] PHPLIB-790: Docs for common troubleshooting issues (#982) * Clarify how batchSize option applies to aggregate and getMore * FAQ for common extension install errors * Server selection tutorial and FAQ entry * PHPLIB-937: Clarify install steps when not using Composer * Fix indentation for list in GridFS tutorial --- source/faq.txt | 135 ++++++++++++ source/includes/apiargs-aggregate-option.yaml | 11 +- .../includes/apiargs-method-watch-option.yaml | 13 +- source/index.txt | 1 + source/tutorial.txt | 1 + source/tutorial/gridfs.txt | 16 +- source/tutorial/install-php-library.txt | 47 ++--- source/tutorial/server-selection.txt | 192 ++++++++++++++++++ 8 files changed, 376 insertions(+), 40 deletions(-) create mode 100644 source/faq.txt create mode 100644 source/tutorial/server-selection.txt diff --git a/source/faq.txt b/source/faq.txt new file mode 100644 index 00000000..ec541a82 --- /dev/null +++ b/source/faq.txt @@ -0,0 +1,135 @@ +========================== +Frequently Asked Questions +========================== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +Common Extension Installation Errors +------------------------------------ + +PHP Headers Not Found +~~~~~~~~~~~~~~~~~~~~~ + +For example: + +.. code-block:: none + + /private/tmp/pear/install/mongodb/php_phongo.c:24:10: fatal error: 'php.h' file not found + + #include + ^~~~~~~ + +This error indicates that PHP's build system cannot find the necessary headers. +All PHP extensions require headers in order to compile. Additionally, those +headers must correspond to the PHP runtime for which the extension will be used. +Generally, the ``phpize`` command (invoked by ``pecl``) will ensure that the +extension builds with the correct headers. + +Note that the mere presence of a PHP runtime does not mean that headers are +available. On various Linux distributions, headers are often published under a +separate ``php-dev`` or ``php-devel`` package. On macOS, the default PHP runtime +does not include headers and users typically need to install PHP (and headers) +via `Homebrew `_ in order to build an extension. + +Multiple PHP Runtimes Installed +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If your system has multiple versions of PHP installed, each version will have +its own ``pecl`` and ``phpize`` commands. Additionally, each PHP runtime may +have separate ``php.ini`` files for each SAPI (e.g. FPM, CLI). If the extension +has been installed but is not available at runtime, double-check that you have +used the correct ``pecl`` command and have modified the appropriate ``php.ini`` +file(s). + +If there is any doubt about the ``php.ini`` file being used by a PHP runtime, +you should examine the output of :php:`phpinfo() ` for that particular +SAPI. Additionally, :php:`php_ini_loaded_file() ` and +:php:`php_ini_scanned_files() ` may be used to determine +exactly which INI files have been loaded by PHP. + +Loading an Incompatible DLL on Windows +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +PECL builds Windows binaries for various combinations of PHP version, +thread-safety (TS or NTS), and architecture (x86 or x64). Failure to select the +correct binary will result in an error when attempting to load the extension DLL +at runtime: + +.. code-block:: none + + PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb' + +Ensure that you have downloaded a DLL that corresponds to the following PHP +runtime properties: + +- PHP version (``PHP_VERSION``) +- Thread-safety (``PHP_ZTS``) +- Architecture (``PHP_INT_SIZE``) + +In addition to the aforementioned constants, these properties can also be +inferred from :php:`phpinfo() `. If your system has multiple PHP +runtimes installed, double-check that you are examining the ``phpinfo()`` output +for the correct environment. + +Server Selection Failures +------------------------- + +The follow are all examples of +:doc:`Server Selection ` failures: + +.. code-block:: none + + No suitable servers found (`serverSelectionTryOnce` set): + [connection refused calling hello on 'a.example.com:27017'] + [connection refused calling hello on 'b.example.com:27017'] + + No suitable servers found: `serverSelectionTimeoutMS` expired: + [socket timeout calling hello on 'example.com:27017'] + + No suitable servers found: `serverSelectionTimeoutMS` expired: + [connection timeout calling hello on 'a.example.com:27017'] + [connection timeout calling hello on 'b.example.com:27017'] + [TLS handshake failed: -9806 calling hello on 'c.example.com:27017'] + + No suitable servers found: `serverselectiontimeoutms` timed out: + [TLS handshake failed: certificate verify failed (64): IP address mismatch calling hello on 'a.example.com:27017'] + [TLS handshake failed: certificate verify failed (64): IP address mismatch calling hello on 'b.example.com:27017'] + +These errors typically manifest as a +:php:`MongoDB\\Driver\\Exception\\ConnectionTimeoutException ` +exception from the driver. The actual exception messages originate from +libmongoc, which is the underlying library used by the PHP driver. Since these +messages can take many forms, it's helpful to break down the structure of the +message so you can better diagnose errors in your application. + +Messages will typically start with "No suitable servers found". The next part of +the message indicates *how* server selection failed. By default, the PHP driver +avoids a server selection loop and instead makes a single attempt (according to +the ``serverSelectionTryOnce`` connection string option). If the driver is +configured to utilize a loop, a message like "serverSelectionTimeoutMS expired" +will tell us that we exhausted its time limit. + +The last component of the message tells us *why* server selection failed, and +includes one or more errors directly from the topology scanner, which is the +service responsible for connecting to and monitoring each host. Any host that +last experienced an error during monitoring will be included in this list. These +messages typically originate from low-level socket or TLS functions. + +The following is not meant to be exhaustive, but will hopefully point you in the +right direction for analyzing the contributing factor(s) for a server selection +failure: + +- "connection refused" likely indicates that the remote host is not listening on + the expected port. +- "connection timeout" could indicate a routing or firewall issue, or perhaps + a timeout due to latency. +- "socket timeout" suggests that a connection *was* established at some point + but was dropped or otherwise timeout out due to latency. +- "TLS handshake failed" suggests something related to TLS or OCSP verification + and is sometimes indicative of misconfigured TLS certificates. diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml index c75880df..e5b410c4 100644 --- a/source/includes/apiargs-aggregate-option.yaml +++ b/source/includes/apiargs-aggregate-option.yaml @@ -12,9 +12,14 @@ arg_name: option name: batchSize type: integer description: | - Specifies the initial batch size for the cursor. A batchSize of ``0`` means an - empty first batch and is useful for quickly returning a cursor or failure - message without doing significant server-side work. + Specifies the batch size for the cursor, which will apply to both the initial + ``aggregate`` command and any subsequent ``getMore`` commands. This determines + the maximum number of documents to return in each response from the server. + + A batchSize of ``0`` is special in that and will only apply to the initial + ``aggregate`` command; subsequent ``getMore`` commands will use the server's + default batch size. This may be useful for quickly returning a cursor or + failure from ``aggregate`` without doing significant server-side work. interface: phpmethod operation: ~ optional: true diff --git a/source/includes/apiargs-method-watch-option.yaml b/source/includes/apiargs-method-watch-option.yaml index 1aa1de2b..d0927828 100644 --- a/source/includes/apiargs-method-watch-option.yaml +++ b/source/includes/apiargs-method-watch-option.yaml @@ -3,8 +3,17 @@ arg_name: option name: batchSize type: integer description: | - Specifies the maximum number of change events to return in each batch of the - response from the MongoDB cluster. + Specifies the batch size for the cursor, which will apply to both the initial + ``aggregate`` command and any subsequent ``getMore`` commands. This determines + the maximum number of change events to return in each response from the + server. + + .. note:: + + Irrespective of the ``batchSize`` option, the initial ``aggregate`` command + response for a change stream generally does not include any documents + unless another option is used to configure its starting point (e.g. + ``startAfter``). interface: phpmethod operation: ~ optional: true diff --git a/source/index.txt b/source/index.txt index ae9da18a..20045f52 100644 --- a/source/index.txt +++ b/source/index.txt @@ -66,3 +66,4 @@ encounter in the library documentation: /tutorial /upgrade /reference + FAQ diff --git a/source/tutorial.txt b/source/tutorial.txt index e28bcf4c..a749af2d 100644 --- a/source/tutorial.txt +++ b/source/tutorial.txt @@ -6,6 +6,7 @@ Tutorials .. toctree:: /tutorial/connecting + /tutorial/server-selection /tutorial/crud /tutorial/collation /tutorial/commands diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt index ba9b8368..81f6d263 100644 --- a/source/tutorial/gridfs.txt +++ b/source/tutorial/gridfs.txt @@ -28,14 +28,14 @@ method. The bucket can be constructed with various options: - - ``bucketName`` determines the prefix for the bucket's metadata and chunk - collections. The default value is ``"fs"``. - - ``chunkSizeBytes`` determines the size of each chunk. GridFS divides the - file into chunks of this length, except for the last, which is only as large - as needed. The default size is ``261120`` (i.e. 255 KiB). - - ``readConcern``, ``readPreference`` and ``writeConcern`` options can be used - to specify defaults for read and write operations, much like the - :phpclass:`MongoDB\\GridFS\\Collection` options. +- ``bucketName`` determines the prefix for the bucket's metadata and chunk + collections. The default value is ``"fs"``. +- ``chunkSizeBytes`` determines the size of each chunk. GridFS divides the file + into chunks of this length, except for the last, which is only as large as + needed. The default size is ``261120`` (i.e. 255 KiB). +- ``readConcern``, ``readPreference`` and ``writeConcern`` options can be used + to specify defaults for read and write operations, much like the + :phpclass:`MongoDB\\GridFS\\Collection` options. Uploading Files with Writable Streams ------------------------------------- diff --git a/source/tutorial/install-php-library.txt b/source/tutorial/install-php-library.txt index acaa8ed1..f4087cba 100644 --- a/source/tutorial/install-php-library.txt +++ b/source/tutorial/install-php-library.txt @@ -50,24 +50,15 @@ your ``php.ini`` file: extension=php_mongodb.dll -Windows binaries are available for various combinations of PHP version, -thread-safety, and architecture. Failure to select the correct binary will -result in an error attempting to load the extension DLL at runtime. Additional -considerations for Windows are discussed in the +Additional considerations for Windows are discussed in the :php:`Windows installation documentation `. -.. note:: - - If your system has multiple versions of PHP installed, each version will have - its own ``pecl`` command and ``php.ini`` file. Additionally, PHP may also use - separate ``php.ini`` files for its web and CLI environments. If the extension - has been installed but is not available at runtime, double-check that you - have used the correct ``pecl`` command (or binary in the case of Windows) and - have modified the appropriate ``php.ini`` file(s). - Installing the Library ---------------------- +Using Composer +~~~~~~~~~~~~~~ + The preferred method of installing the |php-library| is with `Composer `_ by running the following command from your project root: @@ -76,13 +67,6 @@ your project root: composer require mongodb/mongodb -While not recommended, you may also manually install the library using a source -archive attached to the -`GitHub releases `_. - -Configure Autoloading -~~~~~~~~~~~~~~~~~~~~~ - Once you have installed the library, ensure that your application includes Composer's autoloader as in the following example: @@ -96,11 +80,20 @@ Refer to Composer's `autoloading documentation `_ for more information about setting up autoloading. -If you installed the library manually from a source archive, you will need to -manually configure autoloading: - -#. Map the top-level ``MongoDB\`` namespace to the ``src/`` directory - using your preferred autoloader implementation. +Manual Installation Without Composer +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#. Manually require the ``src/functions.php`` file. This is necessary because - PHP does not support autoloading for functions. +While not recommended, you may also manually install the library using a source +archive attached to the +`GitHub releases `_. When +installing the library without Composer, you must ensure that all library +classes *and* functions are loaded for your application: + +#. If you are using a `PSR-4 `_ autoloader, + map the top-level ``MongoDB\`` namespace to the ``src/`` directory. If you + are not using an autoloader, manually require _all_ class files found + recursively within the ``src/`` directory. + +#. Regardless of whether you are using an autoloader, manually require the + ``src/functions.php`` file. This is necessary because PHP does not support + autoloading for functions. diff --git a/source/tutorial/server-selection.txt b/source/tutorial/server-selection.txt new file mode 100644 index 00000000..31047d93 --- /dev/null +++ b/source/tutorial/server-selection.txt @@ -0,0 +1,192 @@ +=============================== +Server Selection and Monitoring +=============================== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +Server Selection and Monitoring +------------------------------- + +Before any operation can be executed, the |php-library| must first select a +server from the topology (e.g. replica set, sharded cluster). Selecting a server +requires an accurate view of the topology, so the driver (i.e. ``mongodb`` +extension) regularly monitors the servers to which it is connected. + +In most other drivers, server discovery and monitoring is handled by a +background thread; however, the PHP driver is single-threaded and must therefore +perform monitoring *between* operations initiated by the application. + +Consider the following example application: + +.. code-block:: php + + test; + + /** + * The library creates an internal object for this operation and must select + * a server to use for executing that operation. + * + * If this is the first operation on the underlying libmongoc client, it must + * first discover the topology. It does so by establishing connections to any + * host(s) in the seed list (this may entail TLS and OCSP verification) and + * issuing "hello" commands. + * + * In the case of a replica set, connecting to a single host in the seed list + * should allow the driver to discover all other members in the replica set. + * In the case of a sharded cluster, the driver will start with an initial + * seed list of mongos hosts and, if SRV polling is utilized, may discover + * additional mongos hosts over time. + * + * If the topology was already initialized (i.e. this is not the first + * operation on the client), the driver may still need to perform monitoring + * (i.e. "hello" commands) and refresh its view of the topology. This process + * may entail adding or removing hosts from the topology. + * + * Once the topology has been discovered and any necessary monitoring has + * been performed, the driver may select a server according to the rules + * outlined in the server selection specification (e.g. applying a read + * preference, filtering hosts by latency). + */ + $database->command(['ping' => 1]); + +Although the application consists of only a few lines of PHP, there is actually +quite a lot going on behind the scenes! Interested readers can find this process +discussed in greater detail in the following documents: + +- `Single-threaded Mode `_ in the libmongoc documentation +- `Server Discovery and Monitoring `_ specification +- `Server Selection `_ specification + +Connection String Options +------------------------- + +There are several connection string options relevant to server selection and +monitoring. + +connectTimeoutMS +~~~~~~~~~~~~~~~~ + +``connectTimeoutMS`` specifies the limit for both establishing a connection to +a server *and* the socket timeout for server monitoring (``hello`` commands). +This defaults to 10 seconds for single-threaded drivers such as PHP. + +When a server times out during monitoring, it will not be re-checked until at +least five seconds +(`cooldownMS `_) +have elapsed. This timeout is intended to avoid having single-threaded drivers +block for ``connectTimeoutMS`` on *each* subsequent scan after an error. + +Applications can consider setting this option to slightly more than the greatest +latency among servers in the cluster. For example, if the greatest ``ping`` time +between the PHP application server and a database server is 200ms, it may be +reasonable to specify a timeout of one second. This would allow ample time for +establishing a connection and monitoring an accessible server, while also +significantly reducing the time to detect an inaccessible server. + +heartbeatFrequencyMS +~~~~~~~~~~~~~~~~~~~~ + +``heartbeatFrequencyMS`` determines how often monitoring should occur. This +defaults to 60 seconds for single-threaded drivers and can be set as low as +500ms. + +serverSelectionTimeoutMS +~~~~~~~~~~~~~~~~~~~~~~~~ + +``serverSelectionTimeoutMS`` determines the maximum amount of time to spend in +the server selection loop. This defaults to 30 seconds, but applications will +typically fail sooner if ``serverSelectionTryOnce`` is ``true`` and a smaller +``connectTimeoutMS`` value is in effect. + +The original default was established at a time when replica set elections took +much longer to complete. Applications can consider setting this option to +slightly more than the expected completion time for an election. For example, +:manual:`Replica Set Elections ` states that +elections will not typically exceed 12 seconds, so a 15-second timeout may be +reasonable. Applications connecting to a sharded cluster may consider a smaller +value still, since ``mongos`` insulates the driver from elections. + +That said, ``serverSelectionTimeoutMS`` should generally not be set to a value +smaller than ``connectTimeoutMS``. + +serverSelectionTryOnce +~~~~~~~~~~~~~~~~~~~~~~ + +``serverSelectionTryOnce`` determines whether the driver should give up after +the first failed server selection attempt or continue waiting until +``serverSelectionTimeoutMS`` is reached. PHP defaults to ``true``, which allows +the driver to "fail fast" when a server cannot be selected (e.g. no primary +during a failover). + +The default behavior is generally desirable for a high-traffic web applications, +as it means the worker process will not be blocked in a server selection loop +and can instead return an error response and immediately go on to serve another +request. Additionally, other driver features such as retryable reads and writes +can still enable applications to avoid transient errors such as a failover. + +That said, applications that prioritize resiliency over response time (and +worker pool utilization) may want to specify ``false`` for +``serverSelectionTryOnce``. + +socketCheckIntervalMS +~~~~~~~~~~~~~~~~~~~~~ + +``socketCheckIntervalMS`` determines how often a socket should be checked (using +a ``ping`` command) if it has not been used recently. This defaults to 5 seconds +and is intentionally lower than ``heartbeatFrequencyMS`` to better allow +single-threaded drivers to recover dropped connections. + +socketTimeoutMS +~~~~~~~~~~~~~~~ + +``socketTimeoutMS`` determines the maximum amount of time to spend reading or +writing to a socket. Since server monitoring uses ``connectTimeoutMS`` for its +socket timeouts, ``socketTimeoutMS`` only applies to operations executed by the +application. + +``socketTimeoutMS`` defaults to 5 minutes; however, it's likely that a PHP web +request would be terminated sooner due to +`max_execution_time `_, +which defaults to 30 seconds for web SAPIs. In a CLI environment, where +``max_execution_time`` is unlimited by default, it is more likely that +``socketTimeoutMS`` could be reached. + +.. note:: + + ``socketTimeoutMS`` is not directly related to server selection and + monitoring; however, it is frequently associated with the other options and + therefore bears mentioning. From 2b7be07870ddb9c6ab9f0626cf238aceb879a7b6 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 4 Oct 2022 08:37:35 +0200 Subject: [PATCH 257/321] PHPLIB-987: Add more examples (#981) * Fix include path for autoload file * Add examples for bulk writes and with_transaction * Add aggregation example * Add example for persistable objects * Ignore certain phpcs errors for all examples * Add example for deserialisation using typemap * Remove unnecessary batchSize option * Use __DIR__ instead of dirname(__FILE__) * Fix capitalisation for TypeMap * Simplify persistable example models * Add note about replica set requirements * Add note about examples to the documentation --- source/index.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/index.txt b/source/index.txt index 20045f52..77890982 100644 --- a/source/index.txt +++ b/source/index.txt @@ -37,6 +37,8 @@ following pages should help you get started: - :doc:`/reference/bson` +Code examples can be found in the ``examples`` directory in the source code. + If you have previously worked with the legacy ``mongo`` extension, it will be helpful to review the :doc:`/upgrade` for a summary of API changes between the old driver and this library. From 2293cf9c071807ce8121c8ec810c59e40c440e75 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 6 Oct 2022 10:02:26 +0200 Subject: [PATCH 258/321] PHPLIB-980: Make uri parameter for MongoDB\Client::__construct nullable (#986) --- source/reference/method/MongoDBClient__construct.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt index 0b89b690..07694c91 100644 --- a/source/reference/method/MongoDBClient__construct.txt +++ b/source/reference/method/MongoDBClient__construct.txt @@ -19,7 +19,7 @@ Definition .. code-block:: php - function __construct($uri = 'mongodb://127.0.0.1/', array $uriOptions = [], array $driverOptions = []) + function __construct(?string $uri = null, array $uriOptions = [], array $driverOptions = []) This constructor has the following parameters: From e4991b640deb9f110f39e7fa318ee4ece4865e17 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 7 Oct 2022 08:37:26 +0200 Subject: [PATCH 259/321] PHPLIB-601: Document upcoming typing changes (#985) * Fix wrong information about group helper in upgrade guide * Rename upgrade guide to "Legacy Driver Upgrade Guide" * PHPLIB-601: Document upcoming typing changes * Update method signatures in documentation * Rename upgrade file to account for new version number * Document method signature changes by class * Fix wrong method signature in docs * Fix syntax and update wording --- source/reference/method/MongoDBClient-dropDatabase.txt | 2 +- .../reference/method/MongoDBClient-selectCollection.txt | 2 +- source/reference/method/MongoDBClient-selectDatabase.txt | 2 +- source/reference/method/MongoDBClient__get.txt | 2 +- source/reference/method/MongoDBCollection-distinct.txt | 2 +- source/reference/method/MongoDBCollection__construct.txt | 2 +- .../method/MongoDBGridFSBucket-downloadToStreamByName.txt | 2 +- .../MongoDBGridFSBucket-openDownloadStreamByName.txt | 2 +- .../method/MongoDBGridFSBucket-openUploadStream.txt | 2 +- source/reference/method/MongoDBGridFSBucket-rename.txt | 2 +- .../method/MongoDBGridFSBucket-uploadFromStream.txt | 2 +- .../reference/method/MongoDBGridFSBucket__construct.txt | 2 +- source/upgrade.txt | 8 ++++---- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt index ccb303ff..4369d07f 100644 --- a/source/reference/method/MongoDBClient-dropDatabase.txt +++ b/source/reference/method/MongoDBClient-dropDatabase.txt @@ -19,7 +19,7 @@ Definition .. code-block:: php - function dropDatabase($databaseName, array $options []): array|object + function dropDatabase(string $databaseName, array $options = []): array|object This method has the following parameters: diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt index 6ce12df7..34a25198 100644 --- a/source/reference/method/MongoDBClient-selectCollection.txt +++ b/source/reference/method/MongoDBClient-selectCollection.txt @@ -19,7 +19,7 @@ Definition .. code-block:: php - function selectCollection($databaseName, $collectionName, array $options = []): MongoDB\Collection + function selectCollection(string $databaseName, string $collectionName, array $options = []): MongoDB\Collection This method has the following parameters: diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt index 10dc4d8a..73ecc2b9 100644 --- a/source/reference/method/MongoDBClient-selectDatabase.txt +++ b/source/reference/method/MongoDBClient-selectDatabase.txt @@ -19,7 +19,7 @@ Definition .. code-block:: php - function selectDatabase($databaseName, array $options = []): MongoDB\Database + function selectDatabase(string $databaseName, array $options = []): MongoDB\Database This method has the following parameters: diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt index c0824578..c0af748c 100644 --- a/source/reference/method/MongoDBClient__get.txt +++ b/source/reference/method/MongoDBClient__get.txt @@ -21,7 +21,7 @@ Definition .. code-block:: php - function __get($databaseName): MongoDB\Database + function __get(string $databaseName): MongoDB\Database This method has the following parameters: diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt index bf7ffb4c..bb0c94ca 100644 --- a/source/reference/method/MongoDBCollection-distinct.txt +++ b/source/reference/method/MongoDBCollection-distinct.txt @@ -19,7 +19,7 @@ Definition .. code-block:: php - function distinct($fieldName, $filter = [], array $options = []): mixed[] + function distinct(string $fieldName, $filter = [], array $options = []): mixed[] This method has the following parameters: diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt index c3ef0c6b..e8077c73 100644 --- a/source/reference/method/MongoDBCollection__construct.txt +++ b/source/reference/method/MongoDBCollection__construct.txt @@ -19,7 +19,7 @@ Definition .. code-block:: php - function __construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = []) + function __construct(MongoDB\Driver\Manager $manager, string $databaseName, string $collectionName, array $options = []) This constructor has the following parameters: diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt index 002bdc65..a505e115 100644 --- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt +++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt @@ -20,7 +20,7 @@ Definition .. code-block:: php - function downloadToStreamByName($filename, $destination, array $options = []): void + function downloadToStreamByName(string $filename, $destination, array $options = []): void This method has the following parameters: diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt index d9f7b5b4..f796fee0 100644 --- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt +++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt @@ -19,7 +19,7 @@ Definition .. code-block:: php - function openDownloadStreamByName($filename, array $options = []): resource + function openDownloadStreamByName(string $filename, array $options = []): resource This method has the following parameters: diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt index 806ad6b8..b27420f2 100644 --- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt +++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt @@ -19,7 +19,7 @@ Definition .. code-block:: php - function openUploadStream($filename, array $options = []): resource + function openUploadStream(string $filename, array $options = []): resource This method has the following parameters: diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt index 346ffd81..a2fbfe32 100644 --- a/source/reference/method/MongoDBGridFSBucket-rename.txt +++ b/source/reference/method/MongoDBGridFSBucket-rename.txt @@ -19,7 +19,7 @@ Definition .. code-block:: php - function rename($id, $newFilename): void + function rename($id, string $newFilename): void This method has the following parameters: diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt index b5d5abef..fd2eceee 100644 --- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt +++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt @@ -19,7 +19,7 @@ Definition .. code-block:: php - function uploadFromStream($filename, $source, array $options = []): mixed + function uploadFromStream(string $filename, $source, array $options = []): mixed This method has the following parameters: diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt index 49211fba..5eeee5fc 100644 --- a/source/reference/method/MongoDBGridFSBucket__construct.txt +++ b/source/reference/method/MongoDBGridFSBucket__construct.txt @@ -19,7 +19,7 @@ Definition .. code-block:: php - function __construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = []) + function __construct(MongoDB\Driver\Manager $manager, string $databaseName, array $options = []) This constructor has the following parameters: diff --git a/source/upgrade.txt b/source/upgrade.txt index b3d9ab38..200e49c9 100644 --- a/source/upgrade.txt +++ b/source/upgrade.txt @@ -1,6 +1,6 @@ -============= -Upgrade Guide -============= +=========================== +Legacy Driver Upgrade Guide +=========================== .. default-domain:: mongodb @@ -281,7 +281,7 @@ inadvertent and potentially dangerous :manual:`full-document replacements Group Command Helper ~~~~~~~~~~~~~~~~~~~~ -:phpclass:`MongoDB\\Collection` does have a helper method for the +:phpclass:`MongoDB\\Collection` does not have a helper method for the :manual:`group ` command. The following example demonstrates how to execute a group command using the :phpmethod:`MongoDB\\Database::command()` method: From 61c28e0d05155dba687f22eece3b01a40233e037 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 12 Oct 2022 09:43:11 +0200 Subject: [PATCH 260/321] Add Github Actions workflow to build documentation (#993) * Add workflow to build and check docs * Fix docs build warnings --- source/reference/bson.txt | 8 ++++---- source/reference/method/MongoDBChangeStream-current.txt | 2 +- source/reference/method/MongoDBChangeStream-key.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/reference/bson.txt b/source/reference/bson.txt index 2d4851a1..7ac5b6bc 100644 --- a/source/reference/bson.txt +++ b/source/reference/bson.txt @@ -14,8 +14,8 @@ Overview -------- MongoDB stores data records as BSON documents. BSON is a binary representation -of :term:`JSON` documents, though it contains more data types than JSON. For the -BSON spec, see `bsonspec.org `_. +of JSON documents, though it contains more data types than JSON. For the BSON +spec, see `bsonspec.org `_. By default, the |php-library| returns BSON documents as :phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as @@ -106,7 +106,7 @@ of the PHP class in a special property within the BSON document. When deserializing a PHP variable from BSON, the encoded class name of a :php:`Persistable ` object will override any class specified in the type map, but it will not override ``"array"`` and - ``"stdClass"`` or ``"object"``. This is discussed in the + ``"stdClass"`` or ``"object"``. This is discussed in the :php:`persistence specification ` but it bears repeating. @@ -121,7 +121,7 @@ Consider the following class definition: private $id; private $name; private $createdAt; - + public function __construct($name) { $this->id = new MongoDB\BSON\ObjectId; diff --git a/source/reference/method/MongoDBChangeStream-current.txt b/source/reference/method/MongoDBChangeStream-current.txt index 8057dbaa..a8578607 100644 --- a/source/reference/method/MongoDBChangeStream-current.txt +++ b/source/reference/method/MongoDBChangeStream-current.txt @@ -103,4 +103,4 @@ See Also - :ref:`Tailable Cursor Iteration ` - :manual:`Change Streams ` documentation in the MongoDB manual - :manual:`Change Events ` documentation in the - MongoDB manual \ No newline at end of file + MongoDB manual diff --git a/source/reference/method/MongoDBChangeStream-key.txt b/source/reference/method/MongoDBChangeStream-key.txt index 6225c11f..de4754b4 100644 --- a/source/reference/method/MongoDBChangeStream-key.txt +++ b/source/reference/method/MongoDBChangeStream-key.txt @@ -73,4 +73,4 @@ See Also - :phpmethod:`MongoDB\\Database::watch()` - :php:`Iterator::key() ` - :ref:`Tailable Cursor Iteration ` -- :manual:`Change Streams ` documentation in the MongoDB manual \ No newline at end of file +- :manual:`Change Streams ` documentation in the MongoDB manual From b6bc50dad80d06291b8324f0ce4a6f49fe508dcd Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 12 Oct 2022 10:45:53 +0200 Subject: [PATCH 261/321] PHPLIB-989: Move persistable class documentation to tutorial (#987) * PHPLIB-989: Move persistable class documentation to tutorial * Move legacy driver section from BSON reference to upgrade guide * Move type map documentation to persistable classes tutorial * Rename persistence tutorial and move sections around --- source/index.txt | 2 + source/reference/bson.txt | 214 +------------------------ source/tutorial.txt | 1 + source/tutorial/modeling-bson-data.txt | 158 ++++++++++++++++++ source/upgrade.txt | 71 +++++++- 5 files changed, 232 insertions(+), 214 deletions(-) create mode 100644 source/tutorial/modeling-bson-data.txt diff --git a/source/index.txt b/source/index.txt index 77890982..5cbf328a 100644 --- a/source/index.txt +++ b/source/index.txt @@ -35,6 +35,8 @@ following pages should help you get started: - :doc:`/tutorial/gridfs` +- :doc:`/tutorial/modeling-bson-data` + - :doc:`/reference/bson` Code examples can be found in the ``examples`` directory in the source code. diff --git a/source/reference/bson.txt b/source/reference/bson.txt index 7ac5b6bc..b9fbbaa2 100644 --- a/source/reference/bson.txt +++ b/source/reference/bson.txt @@ -21,8 +21,8 @@ By default, the |php-library| returns BSON documents as :phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as :phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. -BSON Classes ------------- +Classes +------- .. phpclass:: MongoDB\\Model\\BSONArray @@ -49,213 +49,3 @@ BSON Classes class. During BSON and JSON serialization, instances of this class will serialize as a document type (:php:`object casting ` is used internally). - -.. _php-type-map: - -Type Maps ---------- - -Most methods that read data from MongoDB support a ``typeMap`` option, which -allows control over how BSON is converted to PHP. Additionally, -the :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and -:phpclass:`MongoDB\\Collection` classes accept a ``typeMap`` option, which can -be used to specify a default type map to apply to any supporting methods and -selected classes (e.g. :phpmethod:`MongoDB\\Client::selectDatabase()`). - -The :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and -:phpclass:`MongoDB\\Collection` classes use the following type map by -default: - -.. code-block:: php - - [ - 'array' => 'MongoDB\Model\BSONArray', - 'document' => 'MongoDB\Model\BSONDocument', - 'root' => 'MongoDB\Model\BSONDocument', - ] - -The type map above will convert BSON documents and arrays to -:phpclass:`MongoDB\\Model\\BSONDocument` and -:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The ``root`` and -``document`` keys are used to distinguish the top-level BSON document from -embedded documents, respectively. - -A type map may specify any class that implements -:php:`MongoDB\\BSON\\Unserializable ` as well as -``"array"``, ``"stdClass``", and ``"object"`` (``"stdClass``" and ``"object"`` -are aliases of one another). - -.. seealso:: :php:`Deserialization from BSON ` in the PHP manual - -``Persistable`` Classes ------------------------ - -The driver's :php:`persistence specification ` outlines how -classes implementing its :php:`MongoDB\\BSON\\Persistable -` interface are serialized to and deserialized from -BSON. The :php:`Persistable ` interface is analogous -to PHP's :php:`Serializable interface `. - -The driver automatically handles serialization and deserialization for classes -implementing the :php:`Persistable ` interface without -requiring the use of the ``typeMap`` option. This is done by encoding the name -of the PHP class in a special property within the BSON document. - -.. note:: - - When deserializing a PHP variable from BSON, the encoded class name of a - :php:`Persistable ` object will override any class - specified in the type map, but it will not override ``"array"`` and - ``"stdClass"`` or ``"object"``. This is discussed in the - :php:`persistence specification ` but it bears - repeating. - -Consider the following class definition: - -.. code-block:: php - - id = new MongoDB\BSON\ObjectId; - $this->name = (string) $name; - $this->createdAt = new MongoDB\BSON\UTCDateTime; - } - - function bsonSerialize() - { - return [ - '_id' => $this->id, - 'name' => $this->name, - 'createdAt' => $this->createdAt, - ]; - } - - function bsonUnserialize(array $data) - { - $this->id = $data['_id']; - $this->name = $data['name']; - $this->createdAt = $data['createdAt']; - } - } - -The following example constructs a ``Person`` object, inserts it into the -database, and reads it back as an object of the same type: - -.. code-block:: php - - test->persons; - - $result = $collection->insertOne(new Person('Bob')); - - $person = $collection->findOne(['_id' => $result->getInsertedId()]); - - var_dump($person); - -The output would then resemble: - -.. code-block:: none - - object(Person)#18 (3) { - ["id":"Person":private]=> - object(MongoDB\BSON\ObjectId)#15 (1) { - ["oid"]=> - string(24) "56fad2c36118fd2e9820cfc1" - } - ["name":"Person":private]=> - string(3) "Bob" - ["createdAt":"Person":private]=> - object(MongoDB\BSON\UTCDateTime)#17 (1) { - ["milliseconds"]=> - int(1459278531218) - } - } - -The same document in the MongoDB shell might display as: - -.. code-block:: js - - { - "_id" : ObjectId("56fad2c36118fd2e9820cfc1"), - "__pclass" : BinData(128,"UGVyc29u"), - "name" : "Bob", - "createdAt" : ISODate("2016-03-29T19:08:51.218Z") - } - -.. note:: - - :php:`MongoDB\\BSON\\Persistable ` may only be used - for root and embedded BSON documents. It may not be used for BSON arrays. - -Emulating the Legacy Driver ---------------------------- - -The legacy ``mongo`` extension returned both BSON documents and arrays as PHP -arrays. While PHP arrays are convenient to work with, this behavior was -problematic: - -- Different BSON types could deserialize to the same PHP value (e.g. - ``{"0": "foo"}`` and ``["foo"]``), which made it impossible to infer the - original BSON type. - -- Numerically-indexed PHP arrays would be serialized as BSON documents if there - was a gap in their key sequence. Such gaps were easily caused by unsetting a - key to remove an element and forgetting to numerically reindex the array. - -The |php-library|'s :phpclass:`BSONDocument ` and -:phpclass:`BSONArray ` classes address these concerns -by preserving the BSON type information during serialization and -deserialization; however, some users may still prefer the legacy behavior. If -desired, you can use the ``typeMap`` option to have the library return -everything as a PHP array: - -.. code-block:: php - - [ - 'array' => 'array', - 'document' => 'array', - 'root' => 'array', - ], - ] - ); - - $document = $client->test->zips->findOne(['_id' => '94301']); - - var_dump($document); - -The above example would output something similar to: - -.. code-block:: php - - array(5) { - ["_id"]=> - string(5) "94301" - ["city"]=> - string(9) "PALO ALTO" - ["loc"]=> - array(2) { - [0]=> - float(-122.149685) - [1]=> - float(37.444324) - } - ["pop"]=> - int(15965) - ["state"]=> - string(2) "CA" - } diff --git a/source/tutorial.txt b/source/tutorial.txt index a749af2d..91333fb4 100644 --- a/source/tutorial.txt +++ b/source/tutorial.txt @@ -17,4 +17,5 @@ Tutorials /tutorial/indexes /tutorial/tailable-cursor /tutorial/example-data + /tutorial/modeling-bson-data /tutorial/stable-api diff --git a/source/tutorial/modeling-bson-data.txt b/source/tutorial/modeling-bson-data.txt new file mode 100644 index 00000000..8d2e9006 --- /dev/null +++ b/source/tutorial/modeling-bson-data.txt @@ -0,0 +1,158 @@ +================== +Modeling BSON Data +================== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + + +Type Maps +--------- + +Most methods that read data from MongoDB support a ``typeMap`` option, which +allows control over how BSON is converted to PHP. Additionally, +the :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and +:phpclass:`MongoDB\\Collection` classes accept a ``typeMap`` option, which can +be used to specify a default type map to apply to any supporting methods and +selected classes (e.g. :phpmethod:`MongoDB\\Client::selectDatabase()`). + +The :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and +:phpclass:`MongoDB\\Collection` classes use the following type map by +default: + +.. code-block:: php + + [ + 'array' => 'MongoDB\Model\BSONArray', + 'document' => 'MongoDB\Model\BSONDocument', + 'root' => 'MongoDB\Model\BSONDocument', + ] + +The type map above will convert BSON documents and arrays to +:phpclass:`MongoDB\\Model\\BSONDocument` and +:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The ``root`` and +``document`` keys are used to distinguish the top-level BSON document from +embedded documents, respectively. + +A type map may specify any class that implements +:php:`MongoDB\\BSON\\Unserializable ` as well as +``"array"``, ``"stdClass``", and ``"object"`` (``"stdClass``" and ``"object"`` +are aliases of one another). + +.. seealso:: :php:`Deserialization from BSON ` in the PHP manual + + +Persistable Classes +------------------- + +The driver's :php:`persistence specification ` outlines how +classes implementing its :php:`MongoDB\\BSON\\Persistable +` interface are serialized to and deserialized from +BSON. The :php:`Persistable ` interface is analogous +to PHP's :php:`Serializable interface `. + +The driver automatically handles serialization and deserialization for classes +implementing the :php:`Persistable ` interface without +requiring the use of the ``typeMap`` option. This is done by encoding the name +of the PHP class in a special property within the BSON document. + +.. note:: + + When deserializing a PHP variable from BSON, the encoded class name of a + :php:`Persistable ` object will override any class + specified in the type map, but it will not override ``"array"`` and + ``"stdClass"`` or ``"object"``. This is discussed in the + :php:`persistence specification ` but it bears + repeating. + +Consider the following class definition: + +.. code-block:: php + + id = new MongoDB\BSON\ObjectId; + $this->name = $name; + $this->createdAt = new MongoDB\BSON\UTCDateTime; + } + + function bsonSerialize() + { + return [ + '_id' => $this->id, + 'name' => $this->name, + 'createdAt' => $this->createdAt, + ]; + } + + function bsonUnserialize(array $data) + { + $this->id = $data['_id']; + $this->name = $data['name']; + $this->createdAt = $data['createdAt']; + } + } + +The following example constructs a ``Person`` object, inserts it into the +database, and reads it back as an object of the same type: + +.. code-block:: php + + test->persons; + + $result = $collection->insertOne(new Person('Bob')); + + $person = $collection->findOne(['_id' => $result->getInsertedId()]); + + var_dump($person); + +The output would then resemble: + +.. code-block:: none + + object(Person)#18 (3) { + ["id":"Person":private]=> + object(MongoDB\BSON\ObjectId)#15 (1) { + ["oid"]=> + string(24) "56fad2c36118fd2e9820cfc1" + } + ["name":"Person":private]=> + string(3) "Bob" + ["createdAt":"Person":private]=> + object(MongoDB\BSON\UTCDateTime)#17 (1) { + ["milliseconds"]=> + int(1459278531218) + } + } + +The same document in the MongoDB shell might display as: + +.. code-block:: js + + { + "_id" : ObjectId("56fad2c36118fd2e9820cfc1"), + "__pclass" : BinData(128,"UGVyc29u"), + "name" : "Bob", + "createdAt" : ISODate("2016-03-29T19:08:51.218Z") + } + +.. note:: + + :php:`MongoDB\\BSON\\Persistable ` may only be used + for root and embedded BSON documents. It may not be used for BSON arrays. +.. _php-type-map: diff --git a/source/upgrade.txt b/source/upgrade.txt index 200e49c9..4a67b7fb 100644 --- a/source/upgrade.txt +++ b/source/upgrade.txt @@ -23,8 +23,11 @@ implements the ``mongo`` extension API using this library and the new driver. While this adapter library is not officially supported by MongoDB, it does bear mentioning. -BSON Type Classes ------------------ +BSON +---- + +Type Classes +~~~~~~~~~~~~ When upgrading from the legacy driver, type classes such as MongoId must be replaced with classes in the @@ -103,6 +106,70 @@ the new driver. driver also does not provide any helpers for working with DBRef objects, since their use is not encouraged. +Emulating the Legacy Driver +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The legacy ``mongo`` extension returned both BSON documents and arrays as PHP +arrays. While PHP arrays are convenient to work with, this behavior was +problematic: + +- Different BSON types could deserialize to the same PHP value (e.g. + ``{"0": "foo"}`` and ``["foo"]``), which made it impossible to infer the + original BSON type. + +- Numerically-indexed PHP arrays would be serialized as BSON documents if there + was a gap in their key sequence. Such gaps were easily caused by unsetting a + key to remove an element and forgetting to numerically reindex the array. + +The |php-library|'s :phpclass:`BSONDocument ` and +:phpclass:`BSONArray ` classes address these concerns +by preserving the BSON type information during serialization and +deserialization; however, some users may still prefer the legacy behavior. If +desired, you can use the ``typeMap`` option to have the library return +everything as a PHP array: + +.. code-block:: php + + [ + 'array' => 'array', + 'document' => 'array', + 'root' => 'array', + ], + ] + ); + + $document = $client->test->zips->findOne(['_id' => '94301']); + + var_dump($document); + +The above example would output something similar to: + +.. code-block:: php + + array(5) { + ["_id"]=> + string(5) "94301" + ["city"]=> + string(9) "PALO ALTO" + ["loc"]=> + array(2) { + [0]=> + float(-122.149685) + [1]=> + float(37.444324) + } + ["pop"]=> + int(15965) + ["state"]=> + string(2) "CA" + } + Collection API -------------- From b8d6feca850dca53f9776c427c2afe399ad297f4 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 24 Oct 2022 08:54:23 +0200 Subject: [PATCH 262/321] PHPLIB-986: Split keyAltName example and link key management docs (#995) * PHPLIB-986: Split keyAltName example and link key management docs * Apply grammar suggestions * Move key creation to top of csfle tutorial * Apply suggestions from code review Co-authored-by: Jeremy Mikola Co-authored-by: Jeremy Mikola --- source/tutorial/client-side-encryption.txt | 103 ++++++++++++++------- 1 file changed, 70 insertions(+), 33 deletions(-) diff --git a/source/tutorial/client-side-encryption.txt b/source/tutorial/client-side-encryption.txt index 6ed2e00d..10a3a56c 100644 --- a/source/tutorial/client-side-encryption.txt +++ b/source/tutorial/client-side-encryption.txt @@ -14,6 +14,50 @@ Client-Side Field Level Encryption allows administrators and developers to encrypt specific data fields in addition to other MongoDB encryption features. +Creating an Encryption Key +-------------------------- + +.. note:: + + The following examples use a local master key; however, other key providers + such as AWS KMS are also an option. This master key is used to encrypt data + keys that are stored locally. It is important that you keep this key secure. + +To create an encryption key, create a :php:`MongoDB\\Driver\\ClientEncryption ` +instance with encryption options and create a new data key. The method will +return the key ID which can be used to reference the key later. You can also +pass multiple alternate names for this key and reference the key by these names +instead of the key ID. Creating a new data encryption key would typically be +done on initial deployment, but depending on your use case you may want to use +more than one encryption key or create them dynamically. + +.. code-block:: php + + ', Binary::TYPE_GENERIC); + + $clientEncryptionOpts = [ + 'keyVaultNamespace' => 'encryption.__keyVault', + 'kmsProviders' => [ + 'local' => ['key' => $localKey], + ], + ]; + + $client = new Client(); + $clientEncryption = $client->createClientEncryption($clientEncryptionOpts); + + // Create an encryption key with an alternate name + // To store the key ID for later use, you can use serialize or var_export + $keyId = $clientEncryption->createDataKey('local', ['keyAltNames' => ['my-encryption-key']]); + +.. seealso:: :manual:`Encryption Key Management ` in the MongoDB manual + + Automatic Encryption and Decryption ----------------------------------- @@ -21,9 +65,10 @@ Automatic Encryption and Decryption Auto encryption is an enterprise only feature. -The following example uses a local key; however, other key providers such as AWS -are also an option. The data in the ``encryptedField`` field is automatically -encrypted on insertion and decrypted when querying on the client side. +The following example sets up a collection with automatic encryption based on a +``$jsonSchema`` validator. The data in the ``encryptedField`` field is +automatically encrypted on insertion and decrypted when reading on the client +side. .. code-block:: php @@ -34,7 +79,6 @@ encrypted on insertion and decrypted when querying on the client side. use MongoDB\Driver\ClientEncryption; $localKey = new Binary('', Binary::TYPE_GENERIC); - $encryptionOpts = [ 'keyVaultNamespace' => 'encryption.__keyVault', 'kmsProviders' => [ @@ -43,13 +87,13 @@ encrypted on insertion and decrypted when querying on the client side. ]; $client = new Client(); - $clientEncryption = $client->createClientEncryption($encryptionOpts); $database = $client->selectDatabase('test'); $database->dropCollection('coll'); // remove old data - // Create new key in the key vault and store its ID for later use - $keyId = $clientEncryption->createDataKey('local'); + // This uses the key ID from the first example. The key ID could be read from + // a configuration file. + $keyId = readDataKey(); $database->createCollection('coll', [ 'validator' => [ @@ -80,9 +124,8 @@ encrypted on insertion and decrypted when querying on the client side. Specifying an Explicit Schema for Encryption -------------------------------------------- -The following example shows how to create a new key and store it in the key -vault collection. The encrypted client configures an explicit schema for -encryption using the newly created key. +The following example uses the ``schemaMap`` encryption option to define +encrypted fields. .. note:: @@ -101,18 +144,11 @@ encryption using the newly created key. $localKey = new Binary('', Binary::TYPE_GENERIC); - $clientEncryptionOpts = [ - 'keyVaultNamespace' => 'encryption.__keyVault', - 'kmsProviders' => [ - 'local' => ['key' => $localKey], - ], - ]; - $client = new Client(); - $clientEncryption = $client->createClientEncryption($clientEncryptionOpts); - // Create new key in the key vault and store its ID for later use - $keyId = $clientEncryption->createDataKey('local'); + // This uses the key ID from the first example. The key ID could be read from + // a configuration file. + $keyId = readDataKey(); $autoEncryptionOpts = [ 'keyVaultNamespace' => 'encryption.__keyVault', @@ -148,10 +184,10 @@ encryption using the newly created key. Manually Encrypting and Decrypting Values ----------------------------------------- -In the MongoDB Community Edition, you will have to manually encrypt and decrypt -values before storing them in the database. The following example assumes that -you have already created an encryption key in the key vault collection and -explicitly encrypts and decrypts values in the document. +In the MongoDB Community Edition, you will have to manually encrypt values +before storing them in the database. The following example assumes that you have +already created an encryption key in the key vault collection and explicitly +encrypts and decrypts values in the document. .. code-block:: php @@ -173,8 +209,9 @@ explicitly encrypts and decrypts values in the document. $client = new Client(); $clientEncryption = $client->createClientEncryption($clientEncryptionOpts); - // Create new key in the key vault and store its ID for later use - $keyId = $clientEncryption->createDataKey('local'); + // This uses the key ID from the first example. The key ID could be read from + // a configuration file. + $keyId = readDataKey(); $collection = $client->selectCollection('test', 'coll'); $collection->drop(); // clear old data @@ -196,12 +233,15 @@ Referencing Encryption Keys by an Alternative Name While it is possible to create an encryption key every time data is encrypted, this is not the recommended approach. Instead, you should create your encryption -keys depending on your use-case, e.g. by creating a user-specific encryption +keys depending on your use case, e.g. by creating a user-specific encryption key. To reference keys in your software, you can use the keyAltName attribute specified when creating the key. The following example creates an encryption key with an alternative name, which could be done when deploying the application. The software then encrypts data by referencing the key by its alternative name. +To use an alternate name when referencing an encryption key, use the +``keyAltName`` option instead of ``keyId``. + .. code-block:: php createClientEncryption($clientEncryptionOpts); - // Create an encryption key with an alternative name. This could be done when - // deploying the application - $keyId = $clientEncryption->createDataKey('local', ['keyAltNames' => ['altname']]); - $collection = $client->selectCollection('test', 'coll'); $collection->drop(); // clear old data - // Reference the encryption key we created earlier by its alternative name + // Reference the encryption key created in the first example by its + // alternative name $encryptionOpts = [ - 'keyAltName' => 'altname', + 'keyAltName' => 'my-encryption-key', 'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC, ]; $encryptedValue = $clientEncryption->encrypt('123456789', $encryptionOpts); From 3f5a86adfbfe17f016849a465b7b654d9fa4e725 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 25 Oct 2022 08:10:05 +0200 Subject: [PATCH 263/321] PHPLIB-572: Add debugging tools (#996) * Add connection debugging script * Fix grammar * Add extension detection script * Fix wording feedback * Document using pre tags for formatted output in web SAPI --- source/faq.txt | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/source/faq.txt b/source/faq.txt index ec541a82..ff9acc02 100644 --- a/source/faq.txt +++ b/source/faq.txt @@ -53,6 +53,25 @@ SAPI. Additionally, :php:`php_ini_loaded_file() ` and :php:`php_ini_scanned_files() ` may be used to determine exactly which INI files have been loaded by PHP. +To debug issues with the extension not being loaded, you can use the +``detect-extension`` script provided in the tools directory. You can run this +script from the CLI or include it in a script accessible via your web server. +The tool will point out potential issues and installation instructions for your +system. Assuming you've installed the library through Composer, you can call the +script from the vendor directory: + +.. code-block:: none + + php vendor/mongodb/mongodb/tools/detect-extension.php + +If you want to check configuration for a web server SAPI, include the file in +a script accessible from the web server and open it in your browser. Remember to +wrap the script in ``

`` tags to properly format its output:
+
+.. code-block:: php
+
+   
+ Loading an Incompatible DLL on Windows ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -80,7 +99,7 @@ for the correct environment. Server Selection Failures ------------------------- -The follow are all examples of +The following are all examples of :doc:`Server Selection ` failures: .. code-block:: none @@ -133,3 +152,28 @@ failure: but was dropped or otherwise timeout out due to latency. - "TLS handshake failed" suggests something related to TLS or OCSP verification and is sometimes indicative of misconfigured TLS certificates. + +In the case of a connection failure, you can use the ``connect`` tool to try and +receive more information. This tool attempts to connect to each host in a +connection string using socket functions to see if it is able to establish a +connection, send, and receive data. The tool takes the connection string to a +MongoDB deployment as its only argument. Assuming you've installed the library +through Composer, you would call the script from the vendor directory: + +.. code-block:: none + + php vendor/mongodb/mongodb/tools/connect.php mongodb://127.0.0.1:27017 + +In case the server does not accept connections, the output will look like this: + +.. code-block:: none + + Looking up MongoDB at mongodb://127.0.0.1:27017 + Found 1 host(s) in the URI. Will attempt to connect to each. + + Could not connect to 127.0.0.1:27017: Connection refused + +.. note:: + + The tool only supports the ``mongodb://`` URI schema. Using the + ``mongodb+srv`` scheme is not supported. From 8b82bda43a94a642a672ec801a2a511f9bea8569 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 22 Nov 2022 18:03:57 +0800 Subject: [PATCH 264/321] PHPLIB-1040: Demonstrate enum handling in BSON tutorial (#1004) --- source/tutorial/modeling-bson-data.txt | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/source/tutorial/modeling-bson-data.txt b/source/tutorial/modeling-bson-data.txt index 8d2e9006..38f44769 100644 --- a/source/tutorial/modeling-bson-data.txt +++ b/source/tutorial/modeling-bson-data.txt @@ -156,3 +156,60 @@ The same document in the MongoDB shell might display as: :php:`MongoDB\\BSON\\Persistable ` may only be used for root and embedded BSON documents. It may not be used for BSON arrays. .. _php-type-map: + +Working with Enums +------------------ + +:php:`Backed enums ` can be used with BSON and will +serialize as their case value (i.e. integer or string). +:php:`Pure enums `, which have no backed cases, cannot be +directly serialized. This is similar to how enums are handled by +:php:`json_encode() `. + +Round-tripping a backed enum through BSON requires special handling. In the +following example, the `bsonUnserialize()` method in the class containing the +enum is responsible for converting the value back to an enum case: + +.. code-block:: php + + $this->_id, + 'username' => $this->username, + 'role' => $this->role, + ]; + } + + public function bsonUnserialize(array $data): void + { + $this->_id = $data['_id']; + $this->username = $data['username']; + $this->role = Role::from($data['role']); + } + } + +Enums are prohibited from implementing +:php:`MongoDB\\BSON\\Unserializable ` and +:php:`MongoDB\\BSON\\Persistable `, since enum cases +have no state and cannot be instantiated like ordinary objects. Pure and backed +enums can, however, implement +:php:`MongoDB\\BSON\\Serializable `, which can be +used to overcome the default behavior whereby backed enums are serialized as +their case value and pure enums cannot be serialized. From e5411c11ec1d9a0ab545ee7bb26467b83196f945 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 14 Dec 2022 08:46:21 +0100 Subject: [PATCH 265/321] PHPLIB-1046: Fix snooty errors in documentation (#1010) * Remove literal code blocks * Fix minor errors in documentation * Add missing code-block directives * Fix more docs errors * Fix wrong backticks style --- ...tabase-method-createCollection-option.yaml | 8 ++- source/reference/class/MongoDBCollection.txt | 23 ++++--- source/reference/class/MongoDBDatabase.txt | 2 +- .../reference/class/MongoDBGridFSBucket.txt | 2 +- .../MongoDBChangeStream-getCursorId.txt | 4 +- .../method/MongoDBClient-dropDatabase.txt | 4 +- .../method/MongoDBClient-getReadConcern.txt | 4 +- .../MongoDBClient-getReadPreference.txt | 4 +- .../method/MongoDBClient-getTypeMap.txt | 4 +- .../method/MongoDBClient-getWriteConcern.txt | 4 +- .../MongoDBClient-listDatabaseNames.txt | 4 +- .../method/MongoDBClient-listDatabases.txt | 4 +- .../method/MongoDBClient-startSession.txt | 4 +- .../reference/method/MongoDBClient__get.txt | 4 +- .../method/MongoDBCollection-createIndex.txt | 8 ++- .../MongoDBCollection-createIndexes.txt | 10 ++- .../method/MongoDBCollection-deleteMany.txt | 4 +- .../method/MongoDBCollection-deleteOne.txt | 4 +- .../method/MongoDBCollection-distinct.txt | 8 ++- .../method/MongoDBCollection-drop.txt | 4 +- .../method/MongoDBCollection-dropIndex.txt | 4 +- .../method/MongoDBCollection-dropIndexes.txt | 4 +- .../method/MongoDBCollection-explain.txt | 28 +++++---- .../method/MongoDBCollection-find.txt | 4 +- .../method/MongoDBCollection-findOne.txt | 4 +- .../MongoDBCollection-findOneAndDelete.txt | 4 +- .../MongoDBCollection-findOneAndReplace.txt | 4 +- .../MongoDBCollection-findOneAndUpdate.txt | 4 +- .../MongoDBCollection-getCollectionName.txt | 4 +- .../MongoDBCollection-getDatabaseName.txt | 4 +- .../method/MongoDBCollection-getNamespace.txt | 4 +- .../MongoDBCollection-getReadConcern.txt | 4 +- .../MongoDBCollection-getReadPreference.txt | 4 +- .../method/MongoDBCollection-getTypeMap.txt | 4 +- .../MongoDBCollection-getWriteConcern.txt | 4 +- .../method/MongoDBCollection-insertMany.txt | 4 +- .../method/MongoDBCollection-insertOne.txt | 4 +- .../method/MongoDBCollection-listIndexes.txt | 4 +- .../method/MongoDBCollection-mapReduce.txt | 4 +- .../method/MongoDBCollection-rename.txt | 4 +- .../method/MongoDBCollection-replaceOne.txt | 4 +- .../method/MongoDBCollection-updateMany.txt | 4 +- .../method/MongoDBCollection-updateOne.txt | 4 +- .../method/MongoDBDatabase-command.txt | 8 ++- .../MongoDBDatabase-createCollection.txt | 4 +- .../reference/method/MongoDBDatabase-drop.txt | 4 +- .../method/MongoDBDatabase-dropCollection.txt | 4 +- .../MongoDBDatabase-getDatabaseName.txt | 4 +- .../method/MongoDBDatabase-getReadConcern.txt | 4 +- .../MongoDBDatabase-getReadPreference.txt | 4 +- .../method/MongoDBDatabase-getTypeMap.txt | 4 +- .../MongoDBDatabase-getWriteConcern.txt | 4 +- .../MongoDBDatabase-listCollectionNames.txt | 8 ++- .../MongoDBDatabase-listCollections.txt | 8 ++- .../MongoDBDatabase-modifyCollection.txt | 4 +- .../MongoDBDatabase-renameCollection.txt | 4 +- .../reference/method/MongoDBDatabase__get.txt | 4 +- .../MongoDBGridFSBucket-downloadToStream.txt | 4 +- ...oDBGridFSBucket-downloadToStreamByName.txt | 4 +- .../method/MongoDBGridFSBucket-find.txt | 4 +- .../method/MongoDBGridFSBucket-findOne.txt | 4 +- .../MongoDBGridFSBucket-getBucketName.txt | 4 +- .../MongoDBGridFSBucket-getChunkSizeBytes.txt | 4 +- ...ongoDBGridFSBucket-getChunksCollection.txt | 4 +- .../MongoDBGridFSBucket-getDatabaseName.txt | 4 +- ...BGridFSBucket-getFileDocumentForStream.txt | 4 +- ...MongoDBGridFSBucket-getFileIdForStream.txt | 4 +- ...MongoDBGridFSBucket-getFilesCollection.txt | 4 +- .../MongoDBGridFSBucket-getReadConcern.txt | 4 +- .../MongoDBGridFSBucket-getReadPreference.txt | 4 +- .../method/MongoDBGridFSBucket-getTypeMap.txt | 4 +- .../MongoDBGridFSBucket-getWriteConcern.txt | 4 +- ...MongoDBGridFSBucket-openDownloadStream.txt | 4 +- ...BGridFSBucket-openDownloadStreamByName.txt | 4 +- .../MongoDBGridFSBucket-openUploadStream.txt | 4 +- .../method/MongoDBGridFSBucket-rename.txt | 4 +- .../MongoDBGridFSBucket-uploadFromStream.txt | 4 +- .../method/MongoDBGridFSBucket__construct.txt | 4 +- .../MongoDBMapReduceResult-getCounts.txt | 4 +- ...goDBMapReduceResult-getExecutionTimeMS.txt | 4 +- .../MongoDBMapReduceResult-getIterator.txt | 6 +- .../MongoDBMapReduceResult-getTiming.txt | 4 +- ...ongoDBModelCollectionInfo-getCappedMax.txt | 4 +- ...ngoDBModelCollectionInfo-getCappedSize.txt | 4 +- .../MongoDBModelCollectionInfo-getIdIndex.txt | 4 +- .../MongoDBModelCollectionInfo-getInfo.txt | 4 +- .../MongoDBModelCollectionInfo-getName.txt | 4 +- .../MongoDBModelCollectionInfo-getOptions.txt | 4 +- .../MongoDBModelCollectionInfo-getType.txt | 4 +- .../MongoDBModelCollectionInfo-isCapped.txt | 4 +- .../MongoDBModelDatabaseInfo-getName.txt | 4 +- ...MongoDBModelDatabaseInfo-getSizeOnDisk.txt | 4 +- .../MongoDBModelDatabaseInfo-isEmpty.txt | 4 +- .../method/MongoDBModelIndexInfo-getKey.txt | 4 +- .../method/MongoDBModelIndexInfo-getName.txt | 4 +- .../MongoDBModelIndexInfo-getNamespace.txt | 4 +- .../MongoDBModelIndexInfo-getVersion.txt | 4 +- .../MongoDBModelIndexInfo-is2dSphere.txt | 4 +- .../MongoDBModelIndexInfo-isGeoHaystack.txt | 4 +- .../method/MongoDBModelIndexInfo-isSparse.txt | 4 +- .../method/MongoDBModelIndexInfo-isText.txt | 4 +- .../method/MongoDBModelIndexInfo-isTtl.txt | 4 +- .../method/MongoDBModelIndexInfo-isUnique.txt | 4 +- source/tutorial/collation.txt | 6 +- source/tutorial/commands.txt | 16 +++-- source/tutorial/crud.txt | 62 ++++++++++++++----- source/tutorial/custom-types.txt | 4 +- source/tutorial/decimal128.txt | 12 +++- source/tutorial/example-data.txt | 6 +- source/tutorial/gridfs.txt | 16 ++--- source/tutorial/indexes.txt | 14 +++-- source/tutorial/modeling-bson-data.txt | 2 +- source/upgrade.txt | 8 ++- 113 files changed, 446 insertions(+), 183 deletions(-) diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml index f95b406c..348be4b0 100644 --- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml +++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml @@ -143,8 +143,10 @@ description: | collection. The ``indexOptionDefaults`` option accepts a ``storageEngine`` document, - which should take the following form:: + which should take the following form: + .. code-block:: none + { : } Storage engine configurations specified when creating indexes are validated @@ -212,8 +214,10 @@ description: | Allows users to specify configuration to the storage engine on a per-collection basis when creating a collection. The value of the - ``storageEngine`` option should take the following form:: + ``storageEngine`` option should take the following form: + .. code-block:: none + { : } Storage engine configurations specified when creating collections are diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt index 57625ed0..9c9aa313 100644 --- a/source/reference/class/MongoDBCollection.txt +++ b/source/reference/class/MongoDBCollection.txt @@ -23,7 +23,7 @@ Definition select a collection from the library's :phpclass:`MongoDB\\Client` or :phpclass:`MongoDB\\Database` classes. A collection may also be cloned from an existing :phpclass:`MongoDB\\Collection` object via the - :phpmethod:`withOptions() ` method. + :phpmethod:`withOptions() ` method. :phpclass:`MongoDB\\Collection` supports the :php:`readConcern `, :php:`readPreference @@ -41,17 +41,16 @@ Definition Type Map Limitations -------------------- - The :manual:`aggregate ` (when not using a - cursor), :manual:`distinct `, and - :manual:`findAndModify ` helpers do not - support a ``typeMap`` option due to a driver limitation. The - :phpmethod:`aggregate() `, - :phpmethod:`distinct() `, - :phpmethod:`findOneAndReplace() `, - :phpmethod:`findOneAndUpdate() `, and - :phpmethod:`findOneAndDelete() ` - methods return BSON documents as `stdClass` objects and BSON arrays as - arrays. +The :manual:`aggregate ` (when not using a +cursor), :manual:`distinct `, and +:manual:`findAndModify ` helpers do not +support a ``typeMap`` option due to a driver limitation. The +:phpmethod:`aggregate() `, +:phpmethod:`distinct() `, +:phpmethod:`findOneAndReplace() `, +:phpmethod:`findOneAndUpdate() `, and +:phpmethod:`findOneAndDelete() ` +methods return BSON documents as ``stdClass`` objects and BSON arrays as arrays. Methods ------- diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt index 7e7cb73d..a4a7dd99 100644 --- a/source/reference/class/MongoDBDatabase.txt +++ b/source/reference/class/MongoDBDatabase.txt @@ -22,7 +22,7 @@ Definition :php:`MongoDB\\Driver\\Manager ` class or select a database from the library's :phpclass:`MongoDB\\Client` class. A database may also be cloned from an existing :phpclass:`MongoDB\\Database` - object via the :phpmethod:`withOptions() ` + object via the :phpmethod:`withOptions() ` method. :phpclass:`MongoDB\\Database` supports the :php:`readConcern diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt index cea877f4..0fdeb5cb 100644 --- a/source/reference/class/MongoDBGridFSBucket.txt +++ b/source/reference/class/MongoDBGridFSBucket.txt @@ -25,7 +25,7 @@ Definition You can construct a GridFS bucket using the driver's :php:`Manager ` class, or select a bucket from the library's :phpclass:`MongoDB\\Database` class via the - :phpmethod:`selectGridFSBucket() ` + :phpmethod:`selectGridFSBucket() ` method. Methods diff --git a/source/reference/method/MongoDBChangeStream-getCursorId.txt b/source/reference/method/MongoDBChangeStream-getCursorId.txt index 1938d3c0..e7004f44 100644 --- a/source/reference/method/MongoDBChangeStream-getCursorId.txt +++ b/source/reference/method/MongoDBChangeStream-getCursorId.txt @@ -43,7 +43,9 @@ This example reports the cursor ID for a change stream. var_dump($changeStream->getCursorId()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\CursorId)#5 (1) { ["id"]=> diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt index 4369d07f..3e963ee5 100644 --- a/source/reference/method/MongoDBClient-dropDatabase.txt +++ b/source/reference/method/MongoDBClient-dropDatabase.txt @@ -58,7 +58,9 @@ The following example drops the ``test`` database: var_dump($result); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#8 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBClient-getReadConcern.txt b/source/reference/method/MongoDBClient-getReadConcern.txt index b7c4c60b..64f2b3d4 100644 --- a/source/reference/method/MongoDBClient-getReadConcern.txt +++ b/source/reference/method/MongoDBClient-getReadConcern.txt @@ -41,7 +41,9 @@ Example var_dump($client->getReadConcern()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\ReadConcern)#5 (1) { ["level"]=> diff --git a/source/reference/method/MongoDBClient-getReadPreference.txt b/source/reference/method/MongoDBClient-getReadPreference.txt index 96d8eec5..cd00f206 100644 --- a/source/reference/method/MongoDBClient-getReadPreference.txt +++ b/source/reference/method/MongoDBClient-getReadPreference.txt @@ -42,7 +42,9 @@ Example var_dump($client->getReadPreference()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\ReadPreference)#5 (1) { ["mode"]=> diff --git a/source/reference/method/MongoDBClient-getTypeMap.txt b/source/reference/method/MongoDBClient-getTypeMap.txt index 04697f33..138444f0 100644 --- a/source/reference/method/MongoDBClient-getTypeMap.txt +++ b/source/reference/method/MongoDBClient-getTypeMap.txt @@ -45,7 +45,9 @@ Example var_dump($client->getTypeMap()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(3) { ["root"]=> diff --git a/source/reference/method/MongoDBClient-getWriteConcern.txt b/source/reference/method/MongoDBClient-getWriteConcern.txt index b779aae9..7a3e561c 100644 --- a/source/reference/method/MongoDBClient-getWriteConcern.txt +++ b/source/reference/method/MongoDBClient-getWriteConcern.txt @@ -42,7 +42,9 @@ Example var_dump($client->getWriteConcern()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\WriteConcern)#4 (1) { ["j"]=> diff --git a/source/reference/method/MongoDBClient-listDatabaseNames.txt b/source/reference/method/MongoDBClient-listDatabaseNames.txt index 5047b88d..bf4fb48f 100644 --- a/source/reference/method/MongoDBClient-listDatabaseNames.txt +++ b/source/reference/method/MongoDBClient-listDatabaseNames.txt @@ -59,7 +59,9 @@ The following example lists all databases on the server: var_dump($databaseName); } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(5) "local" string(4) "test" diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt index 7f27cee8..822f98d7 100644 --- a/source/reference/method/MongoDBClient-listDatabases.txt +++ b/source/reference/method/MongoDBClient-listDatabases.txt @@ -58,7 +58,9 @@ The following example lists all databases on the server: var_dump($databaseInfo); } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\DatabaseInfo)#4 (3) { ["name"]=> diff --git a/source/reference/method/MongoDBClient-startSession.txt b/source/reference/method/MongoDBClient-startSession.txt index c3fcce89..07a9b2b2 100644 --- a/source/reference/method/MongoDBClient-startSession.txt +++ b/source/reference/method/MongoDBClient-startSession.txt @@ -53,7 +53,9 @@ The following example starts a new session: var_dump($session); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\Session)#2043 (4) { ["logicalSessionId"]=> diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt index c0af748c..5e4097b2 100644 --- a/source/reference/method/MongoDBClient__get.txt +++ b/source/reference/method/MongoDBClient__get.txt @@ -17,7 +17,7 @@ Definition Selects a database on the server. This :php:`magic method ` is an alias for the :phpmethod:`selectDatabase() - ` method. + ` method. .. code-block:: php @@ -37,7 +37,7 @@ Behavior The selected database inherits options such as read preference and type mapping from the :phpclass:`Client ` object. If you wish to override -any options, use the :phpmethod:`MongoDB\\Client::selectDatabase` method. +any options, use the :phpmethod:`MongoDB\\Client::selectDatabase()` method. .. note:: diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt index bdae5712..344242e0 100644 --- a/source/reference/method/MongoDBCollection-createIndex.txt +++ b/source/reference/method/MongoDBCollection-createIndex.txt @@ -66,7 +66,9 @@ the ``test`` database. var_dump($indexName); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(19) "borough_1_cuisine_1" @@ -95,7 +97,9 @@ exists. var_dump($indexName); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(9) "borough_1" diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt index 05a3c0be..76705e9b 100644 --- a/source/reference/method/MongoDBCollection-createIndexes.txt +++ b/source/reference/method/MongoDBCollection-createIndexes.txt @@ -13,7 +13,7 @@ MongoDB\\Collection::createIndexes() Definition ---------- -.. phpmethod:: MongoDB\\Collection::createIndexes($indexes) +.. phpmethod:: MongoDB\\Collection::createIndexes() Create one or more indexes for the collection. @@ -53,7 +53,9 @@ fields that correspond to index options accepted by :phpmethod:`createIndex() For example, the following ``$indexes`` parameter creates two indexes. The first is an ascending unique index on the ``username`` field and the second is a -2dsphere index on the ``loc`` field with a custom name:: +2dsphere index on the ``loc`` field with a custom name: + +.. code-block:: none [ [ 'key' => [ 'username' => 1 ], 'unique' => true ], @@ -81,7 +83,9 @@ custom name. var_dump($indexNames); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(2) { [0]=> diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt index df1a1ac8..a9fc24c1 100644 --- a/source/reference/method/MongoDBCollection-deleteMany.txt +++ b/source/reference/method/MongoDBCollection-deleteMany.txt @@ -68,7 +68,9 @@ that have ``"ny"`` as the value for the ``state`` field: printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Deleted 2 document(s) diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt index 0c31bfb5..dcfb2628 100644 --- a/source/reference/method/MongoDBCollection-deleteOne.txt +++ b/source/reference/method/MongoDBCollection-deleteOne.txt @@ -70,7 +70,9 @@ has ``"ny"`` as the value for the ``state`` field: printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Deleted 1 document(s) diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt index bb0c94ca..7d5f7ee6 100644 --- a/source/reference/method/MongoDBCollection-distinct.txt +++ b/source/reference/method/MongoDBCollection-distinct.txt @@ -66,7 +66,9 @@ in the ``restaurants`` collection in the ``test`` database. var_dump($distinct); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(6) { [0]=> @@ -100,7 +102,9 @@ the ``borough`` is ``Queens``: var_dump($distinct); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(75) { [0]=> diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt index c1762871..a2cd9410 100644 --- a/source/reference/method/MongoDBCollection-drop.txt +++ b/source/reference/method/MongoDBCollection-drop.txt @@ -59,7 +59,9 @@ database: var_dump($result); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#9 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt index 880349bd..cefcf676 100644 --- a/source/reference/method/MongoDBCollection-dropIndex.txt +++ b/source/reference/method/MongoDBCollection-dropIndex.txt @@ -59,7 +59,9 @@ collection in the ``test`` database: var_dump($result); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#9 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt index 8cdf9e43..ee48d493 100644 --- a/source/reference/method/MongoDBCollection-dropIndexes.txt +++ b/source/reference/method/MongoDBCollection-dropIndexes.txt @@ -60,7 +60,9 @@ The following drops all indexes from the ``restaurants`` collection in the var_dump($result); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#9 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt index 5ae73c91..68a8965a 100644 --- a/source/reference/method/MongoDBCollection-explain.txt +++ b/source/reference/method/MongoDBCollection-explain.txt @@ -50,18 +50,18 @@ Explainable Commands Explainable commands include, but are not limited to: - - :phpclass:`MongoDB\\Operation\\Aggregate` - - :phpclass:`MongoDB\\Operation\\Count` - - :phpclass:`MongoDB\\Operation\\DeleteMany` - - :phpclass:`MongoDB\\Operation\\DeleteOne` - - :phpclass:`MongoDB\\Operation\\Distinct` - - :phpclass:`MongoDB\\Operation\\Find` - - :phpclass:`MongoDB\\Operation\\FindOne` - - :phpclass:`MongoDB\\Operation\\FindOneAndDelete` - - :phpclass:`MongoDB\\Operation\\FindOneAndReplace` - - :phpclass:`MongoDB\\Operation\\FindOneAndUpdate` - - :phpclass:`MongoDB\\Operation\\UpdateMany` - - :phpclass:`MongoDB\\Operation\\UpdateOne` +- ``MongoDB\Operation\Aggregate`` +- ``MongoDB\Operation\Count`` +- ``MongoDB\Operation\DeleteMany`` +- ``MongoDB\Operation\DeleteOne`` +- ``MongoDB\Operation\Distinct`` +- ``MongoDB\Operation\Find`` +- ``MongoDB\Operation\FindOne`` +- ``MongoDB\Operation\FindOneAndDelete`` +- ``MongoDB\Operation\FindOneAndReplace`` +- ``MongoDB\Operation\FindOneAndUpdate`` +- ``MongoDB\Operation\UpdateMany`` +- ``MongoDB\Operation\UpdateOne`` Examples -------- @@ -84,7 +84,9 @@ This example explains a count command. var_dump($result); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#29 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt index 34eed99a..2a5e2afb 100644 --- a/source/reference/method/MongoDBCollection-find.txt +++ b/source/reference/method/MongoDBCollection-find.txt @@ -77,7 +77,9 @@ returned. It also limits the results to 5 documents. var_dump($restaurant); }; -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#10 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt index 0bf95f64..3ebd2b53 100644 --- a/source/reference/method/MongoDBCollection-findOne.txt +++ b/source/reference/method/MongoDBCollection-findOne.txt @@ -98,7 +98,9 @@ returned. var_dump($restaurant); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#10 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt index 1253bad4..bdf20da9 100644 --- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt +++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt @@ -73,7 +73,9 @@ The following example finds and deletes the document with ``restaurant_id`` of var_dump($deletedRestaurant); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#17 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt index 6a96a30b..4b29d8ad 100644 --- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt +++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt @@ -115,7 +115,9 @@ The following operation replaces the document with ``restaurant_id`` of var_dump($replacedRestaurant); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#18 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt index 377d255e..65ea436d 100644 --- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt +++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt @@ -74,7 +74,9 @@ setting its building number to ``"761"``: var_dump($updatedRestaurant); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#20 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBCollection-getCollectionName.txt b/source/reference/method/MongoDBCollection-getCollectionName.txt index 86fe3e5e..70be8a8a 100644 --- a/source/reference/method/MongoDBCollection-getCollectionName.txt +++ b/source/reference/method/MongoDBCollection-getCollectionName.txt @@ -40,7 +40,9 @@ The following returns the collection name for the ``zips`` collection in the echo $collection->getCollectionName(); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none zips diff --git a/source/reference/method/MongoDBCollection-getDatabaseName.txt b/source/reference/method/MongoDBCollection-getDatabaseName.txt index 93500c80..f83632ba 100644 --- a/source/reference/method/MongoDBCollection-getDatabaseName.txt +++ b/source/reference/method/MongoDBCollection-getDatabaseName.txt @@ -40,7 +40,9 @@ The following returns the database name for the ``zips`` collection in the echo $collection->getDatabaseName(); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none test diff --git a/source/reference/method/MongoDBCollection-getNamespace.txt b/source/reference/method/MongoDBCollection-getNamespace.txt index 74f1b022..78e2484b 100644 --- a/source/reference/method/MongoDBCollection-getNamespace.txt +++ b/source/reference/method/MongoDBCollection-getNamespace.txt @@ -41,7 +41,9 @@ database. echo $collection->getNamespace(); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none test.zips diff --git a/source/reference/method/MongoDBCollection-getReadConcern.txt b/source/reference/method/MongoDBCollection-getReadConcern.txt index ff1cfeb0..2a40efed 100644 --- a/source/reference/method/MongoDBCollection-getReadConcern.txt +++ b/source/reference/method/MongoDBCollection-getReadConcern.txt @@ -41,7 +41,9 @@ Example var_dump($collection->getReadConcern()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\ReadConcern)#5 (1) { ["level"]=> diff --git a/source/reference/method/MongoDBCollection-getReadPreference.txt b/source/reference/method/MongoDBCollection-getReadPreference.txt index 4eac30d3..622701e5 100644 --- a/source/reference/method/MongoDBCollection-getReadPreference.txt +++ b/source/reference/method/MongoDBCollection-getReadPreference.txt @@ -42,7 +42,9 @@ Example var_dump($collection->getReadPreference()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\ReadPreference)#5 (1) { ["mode"]=> diff --git a/source/reference/method/MongoDBCollection-getTypeMap.txt b/source/reference/method/MongoDBCollection-getTypeMap.txt index 11e56426..50cd91da 100644 --- a/source/reference/method/MongoDBCollection-getTypeMap.txt +++ b/source/reference/method/MongoDBCollection-getTypeMap.txt @@ -45,7 +45,9 @@ Example var_dump($collection->getTypeMap()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(3) { ["root"]=> diff --git a/source/reference/method/MongoDBCollection-getWriteConcern.txt b/source/reference/method/MongoDBCollection-getWriteConcern.txt index 4fa26ee1..a7ad354d 100644 --- a/source/reference/method/MongoDBCollection-getWriteConcern.txt +++ b/source/reference/method/MongoDBCollection-getWriteConcern.txt @@ -42,7 +42,9 @@ Example var_dump($collection->getWriteConcern()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\WriteConcern)#5 (2) { ["w"]=> diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt index 8b7eb53b..62b0858e 100644 --- a/source/reference/method/MongoDBCollection-insertMany.txt +++ b/source/reference/method/MongoDBCollection-insertMany.txt @@ -79,7 +79,9 @@ in the ``test`` database: var_dump($insertManyResult->getInsertedIds()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Inserted 2 document(s) array(2) { diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt index 0d25f6d5..aa438050 100644 --- a/source/reference/method/MongoDBCollection-insertOne.txt +++ b/source/reference/method/MongoDBCollection-insertOne.txt @@ -71,7 +71,9 @@ The following operation inserts a document into the ``users`` collection in the var_dump($insertOneResult->getInsertedId()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Inserted 1 document(s) object(MongoDB\BSON\ObjectId)#11 (1) { diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt index e39a9bbb..2508b282 100644 --- a/source/reference/method/MongoDBCollection-listIndexes.txt +++ b/source/reference/method/MongoDBCollection-listIndexes.txt @@ -57,7 +57,9 @@ collection in the ``test`` database: var_dump($index); } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\IndexInfo)#8 (4) { ["v"]=> diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt index 1da9c4bd..dc3d3b09 100644 --- a/source/reference/method/MongoDBCollection-mapReduce.txt +++ b/source/reference/method/MongoDBCollection-mapReduce.txt @@ -92,7 +92,9 @@ each state. var_dump($pop); }; -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(stdClass)#2293 (2) { ["_id"]=> diff --git a/source/reference/method/MongoDBCollection-rename.txt b/source/reference/method/MongoDBCollection-rename.txt index 23a9290c..a40555f2 100644 --- a/source/reference/method/MongoDBCollection-rename.txt +++ b/source/reference/method/MongoDBCollection-rename.txt @@ -61,7 +61,9 @@ database to ``places``: var_dump($result); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#9 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt index ba43452b..9bb3d30c 100644 --- a/source/reference/method/MongoDBCollection-replaceOne.txt +++ b/source/reference/method/MongoDBCollection-replaceOne.txt @@ -77,7 +77,9 @@ The following example replaces the document with ``restaurant_id`` of printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Matched 1 document(s) Modified 1 document(s) diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt index bd72fdf9..65f1fb01 100644 --- a/source/reference/method/MongoDBCollection-updateMany.txt +++ b/source/reference/method/MongoDBCollection-updateMany.txt @@ -67,7 +67,9 @@ The following example updates all of the documents with the ``borough`` of printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Matched 5656 document(s) Modified 5656 document(s) diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt index bed657f9..d7fbd157 100644 --- a/source/reference/method/MongoDBCollection-updateOne.txt +++ b/source/reference/method/MongoDBCollection-updateOne.txt @@ -69,7 +69,9 @@ The following example updates one document with the ``restaurant_id`` of printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Matched 1 document(s) Modified 1 document(s) diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt index 63ddeeaa..84b58178 100644 --- a/source/reference/method/MongoDBDatabase-command.txt +++ b/source/reference/method/MongoDBDatabase-command.txt @@ -57,7 +57,9 @@ result document: var_dump($c->toArray()[0]); -The output would resemble:: +The output would resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#11 (1) { ["storage":"ArrayObject":private]=> @@ -81,7 +83,9 @@ multiple result documents: var_dump($c->toArray()); -The output would resemble:: +The output would resemble: + +.. code-block:: none array(3) { [0]=> diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt index a3e74ef5..d640f3d1 100644 --- a/source/reference/method/MongoDBDatabase-createCollection.txt +++ b/source/reference/method/MongoDBDatabase-createCollection.txt @@ -79,7 +79,9 @@ database with document validation criteria: var_dump($result); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#11 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt index bcf6ca88..eae1bb6b 100644 --- a/source/reference/method/MongoDBDatabase-drop.txt +++ b/source/reference/method/MongoDBDatabase-drop.txt @@ -58,7 +58,9 @@ The following example drops the ``test`` database: var_dump($result); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#8 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt index fbc005b8..2b58785a 100644 --- a/source/reference/method/MongoDBDatabase-dropCollection.txt +++ b/source/reference/method/MongoDBDatabase-dropCollection.txt @@ -58,7 +58,9 @@ The following example drops the ``users`` collection in the ``test`` database: var_dump($result); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#8 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBDatabase-getDatabaseName.txt b/source/reference/method/MongoDBDatabase-getDatabaseName.txt index 6ff9dcb9..6e3abd96 100644 --- a/source/reference/method/MongoDBDatabase-getDatabaseName.txt +++ b/source/reference/method/MongoDBDatabase-getDatabaseName.txt @@ -39,6 +39,8 @@ The following example prints the name of a database object: echo $db->getDatabaseName(); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none test diff --git a/source/reference/method/MongoDBDatabase-getReadConcern.txt b/source/reference/method/MongoDBDatabase-getReadConcern.txt index fa277d88..4b02a1dd 100644 --- a/source/reference/method/MongoDBDatabase-getReadConcern.txt +++ b/source/reference/method/MongoDBDatabase-getReadConcern.txt @@ -41,7 +41,9 @@ Example var_dump($database->getReadConcern()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\ReadConcern)#5 (1) { ["level"]=> diff --git a/source/reference/method/MongoDBDatabase-getReadPreference.txt b/source/reference/method/MongoDBDatabase-getReadPreference.txt index c70b4026..5001455c 100644 --- a/source/reference/method/MongoDBDatabase-getReadPreference.txt +++ b/source/reference/method/MongoDBDatabase-getReadPreference.txt @@ -42,7 +42,9 @@ Example var_dump($database->getReadPreference()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\ReadPreference)#5 (1) { ["mode"]=> diff --git a/source/reference/method/MongoDBDatabase-getTypeMap.txt b/source/reference/method/MongoDBDatabase-getTypeMap.txt index bc1688d6..d06c6777 100644 --- a/source/reference/method/MongoDBDatabase-getTypeMap.txt +++ b/source/reference/method/MongoDBDatabase-getTypeMap.txt @@ -45,7 +45,9 @@ Example var_dump($database->getTypeMap()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(3) { ["root"]=> diff --git a/source/reference/method/MongoDBDatabase-getWriteConcern.txt b/source/reference/method/MongoDBDatabase-getWriteConcern.txt index 31b0ded5..55ea09f4 100644 --- a/source/reference/method/MongoDBDatabase-getWriteConcern.txt +++ b/source/reference/method/MongoDBDatabase-getWriteConcern.txt @@ -42,7 +42,9 @@ Example var_dump($database->getWriteConcern()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\WriteConcern)#5 (2) { ["w"]=> diff --git a/source/reference/method/MongoDBDatabase-listCollectionNames.txt b/source/reference/method/MongoDBDatabase-listCollectionNames.txt index 86872bbb..b6eaa4ce 100644 --- a/source/reference/method/MongoDBDatabase-listCollectionNames.txt +++ b/source/reference/method/MongoDBDatabase-listCollectionNames.txt @@ -52,7 +52,9 @@ The following example lists all of the collections in the ``test`` database: var_dump($collectionName); } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(11) "restaurants" string(5) "users" @@ -77,7 +79,9 @@ in the ``test`` database: var_dump($collectionName); } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(11) "restaurants" string(6) "restos" diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt index cfaff6c3..421b6cab 100644 --- a/source/reference/method/MongoDBDatabase-listCollections.txt +++ b/source/reference/method/MongoDBDatabase-listCollections.txt @@ -51,7 +51,9 @@ The following example lists all of the collections in the ``test`` database: var_dump($collectionInfo); } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\CollectionInfo)#3 (2) { ["name"]=> @@ -94,7 +96,9 @@ in the ``test`` database: var_dump($collectionInfo); } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\CollectionInfo)#3 (2) { ["name"]=> diff --git a/source/reference/method/MongoDBDatabase-modifyCollection.txt b/source/reference/method/MongoDBDatabase-modifyCollection.txt index 43eb2d25..8fe9245c 100644 --- a/source/reference/method/MongoDBDatabase-modifyCollection.txt +++ b/source/reference/method/MongoDBDatabase-modifyCollection.txt @@ -63,7 +63,9 @@ The following example changes the expiration time of a TTL collection in the var_dump($result); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(stdClass)#2779 { ["expireAfterSeconds_old"]=> diff --git a/source/reference/method/MongoDBDatabase-renameCollection.txt b/source/reference/method/MongoDBDatabase-renameCollection.txt index 55844319..8bbe5b8e 100644 --- a/source/reference/method/MongoDBDatabase-renameCollection.txt +++ b/source/reference/method/MongoDBDatabase-renameCollection.txt @@ -61,7 +61,9 @@ database to ``places``: var_dump($result); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#8 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt index c41e3981..280e931d 100644 --- a/source/reference/method/MongoDBDatabase__get.txt +++ b/source/reference/method/MongoDBDatabase__get.txt @@ -35,7 +35,7 @@ Behavior The selected collection inherits options such as read preference and type mapping from the :phpclass:`Database ` object. If you wish to -override any options, use the :phpmethod:`MongoDB\\Database::selectCollection` +override any options, use the :phpmethod:`MongoDB\\Database::selectCollection()` method. .. note:: @@ -43,7 +43,7 @@ method. To select collections whose names contain special characters, such as ``.``, use complex syntax, as in ``$database->{'that.database'}``. - Alternatively, :phpmethod:`MongoDB\\Database::selectCollection` supports + Alternatively, :phpmethod:`MongoDB\\Database::selectCollection()` supports selecting collections whose names contain special characters. Examples diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt index 3d8e6ebc..2f2aa5da 100644 --- a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt +++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt @@ -54,7 +54,9 @@ Examples var_dump(stream_get_contents($destination, -1, 0)); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(6) "foobar" diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt index a505e115..a37134a4 100644 --- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt +++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt @@ -58,7 +58,9 @@ Examples var_dump(stream_get_contents($destination, -1, 0)); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(6) "foobar" diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt index c7418ced..6b3c7728 100644 --- a/source/reference/method/MongoDBGridFSBucket-find.txt +++ b/source/reference/method/MongoDBGridFSBucket-find.txt @@ -75,7 +75,9 @@ Examples var_dump($cursor->toArray()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(1) { [0]=> diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt index 7b6fcc8f..a72de457 100644 --- a/source/reference/method/MongoDBGridFSBucket-findOne.txt +++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt @@ -78,7 +78,9 @@ Examples var_dump($fileDocument); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#3004 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt index 0452de0a..52ea9249 100644 --- a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt +++ b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt @@ -37,6 +37,8 @@ Examples var_dump($bucket->getBucketName()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(2) "fs" diff --git a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt index f592030a..16116e56 100644 --- a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt +++ b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt @@ -39,6 +39,8 @@ Examples var_dump($bucket->getChunkSizeBytes()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none int(261120) diff --git a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt index fa5be832..36dbd8a5 100644 --- a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt +++ b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt @@ -39,6 +39,8 @@ Examples var_dump((string) $bucket->getChunksCollection()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(14) "test.fs.chunks" diff --git a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt index b270b7b5..0b6dd8e0 100644 --- a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt +++ b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt @@ -37,7 +37,9 @@ Examples var_dump($bucket->getDatabaseName()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(4) "test" diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt index 052bc79c..b9dca55a 100644 --- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt +++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt @@ -54,7 +54,9 @@ Examples fclose($stream); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#4956 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt index 976843b4..4e1c68b4 100644 --- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt +++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt @@ -55,7 +55,9 @@ Examples fclose($stream); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\BSON\ObjectId)#3005 (1) { ["oid"]=> diff --git a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt index de4196b2..57813ad6 100644 --- a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt +++ b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt @@ -41,7 +41,9 @@ Examples var_dump($filesCollection->getCollectionName()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(8) "fs.files" diff --git a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt index 00517d22..d9c0a8e2 100644 --- a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt +++ b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt @@ -42,7 +42,9 @@ Example var_dump($bucket->getReadConcern()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\ReadConcern)#3 (1) { ["level"]=> diff --git a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt index 94003eea..532a6e23 100644 --- a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt +++ b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt @@ -43,7 +43,9 @@ Example var_dump($bucket->getReadPreference()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\ReadPreference)#3 (1) { ["mode"]=> diff --git a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt index cd9c4a1b..7d9a309a 100644 --- a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt +++ b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt @@ -46,7 +46,9 @@ Example var_dump($bucket->getTypeMap()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(3) { ["root"]=> diff --git a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt index 1b5577e6..b77f1f00 100644 --- a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt +++ b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt @@ -43,7 +43,9 @@ Example var_dump($bucket->getWriteConcern()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Driver\WriteConcern)#3 (2) { ["w"]=> diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt index 663a69c9..85f2150a 100644 --- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt +++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt @@ -55,7 +55,9 @@ Examples var_dump(stream_get_contents($downloadStream)); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(6) "foobar" diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt index f796fee0..cb3a336e 100644 --- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt +++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt @@ -57,7 +57,9 @@ Examples var_dump(stream_get_contents($bucket->openDownloadStreamByName('filename'))); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(6) "foobar" diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt index b27420f2..348b325f 100644 --- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt +++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt @@ -56,7 +56,9 @@ Examples $downloadStream = $bucket->openDownloadStreamByName('filename'); var_dump(stream_get_contents($downloadStream)); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(6) "foobar" diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt index a2fbfe32..888d1ae3 100644 --- a/source/reference/method/MongoDBGridFSBucket-rename.txt +++ b/source/reference/method/MongoDBGridFSBucket-rename.txt @@ -50,6 +50,8 @@ Examples var_dump(stream_get_contents($bucket->openDownloadStreamByName('b'))); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none string(6) "foobar" diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt index fd2eceee..2487554d 100644 --- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt +++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt @@ -60,7 +60,9 @@ Examples var_dump($id); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\BSON\ObjectId)#3009 (1) { ["oid"]=> diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt index 5eeee5fc..c6c309bb 100644 --- a/source/reference/method/MongoDBGridFSBucket__construct.txt +++ b/source/reference/method/MongoDBGridFSBucket__construct.txt @@ -53,7 +53,9 @@ Examples var_dump($bucket); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\GridFS\Bucket)#3053 (2) { ["bucketName"]=> diff --git a/source/reference/method/MongoDBMapReduceResult-getCounts.txt b/source/reference/method/MongoDBMapReduceResult-getCounts.txt index c2feab0c..35c738dd 100644 --- a/source/reference/method/MongoDBMapReduceResult-getCounts.txt +++ b/source/reference/method/MongoDBMapReduceResult-getCounts.txt @@ -45,7 +45,9 @@ This example reports the count statistics for a map-reduce operation. var_dump($result->getCounts()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(4) { ["input"]=> diff --git a/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt b/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt index 06c5b012..05b6bbc1 100644 --- a/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt +++ b/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt @@ -46,7 +46,9 @@ This example reports the execution time for a map-reduce operation. var_dump($result->getExecutionTimeMS()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none int(244) diff --git a/source/reference/method/MongoDBMapReduceResult-getIterator.txt b/source/reference/method/MongoDBMapReduceResult-getIterator.txt index b5804028..cb459cde 100644 --- a/source/reference/method/MongoDBMapReduceResult-getIterator.txt +++ b/source/reference/method/MongoDBMapReduceResult-getIterator.txt @@ -15,7 +15,7 @@ Definition .. phpmethod:: MongoDB\\MapReduceResult::getIterator() - Returns a php:`Traversable `, which may be used to iterate + Returns a :php:`Traversable `, which may be used to iterate through the results of the map-reduce operation. .. code-block:: php @@ -49,7 +49,9 @@ This example iterates through the results of a map-reduce operation. var_dump($population); }; -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(stdClass)#2293 (2) { ["_id"]=> diff --git a/source/reference/method/MongoDBMapReduceResult-getTiming.txt b/source/reference/method/MongoDBMapReduceResult-getTiming.txt index 75ab5393..0492b3be 100644 --- a/source/reference/method/MongoDBMapReduceResult-getTiming.txt +++ b/source/reference/method/MongoDBMapReduceResult-getTiming.txt @@ -51,7 +51,9 @@ for a map-reduce operation. var_dump($result->getTiming()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(5) { ["mapTime"]=> diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt index 99a7d082..dcd8e703 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt @@ -52,7 +52,9 @@ Examples var_dump($info->getCappedMax()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none int(100) diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt index 1d94a404..62732aa4 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt @@ -52,7 +52,9 @@ Examples var_dump($info->getCappedSize()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none int(1048576) diff --git a/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt b/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt index 4c0e4aa3..4fa22dc0 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt @@ -49,7 +49,9 @@ Examples var_dump($info->getIdIndex()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(4) { ["v"]=> diff --git a/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt b/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt index 40068e3b..4d4f19ff 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt @@ -44,7 +44,9 @@ Examples var_dump($info->getInfo()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(1) { ["readOnly"]=> diff --git a/source/reference/method/MongoDBModelCollectionInfo-getName.txt b/source/reference/method/MongoDBModelCollectionInfo-getName.txt index 76af1fa9..d3104af8 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-getName.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-getName.txt @@ -38,7 +38,9 @@ Examples echo $info->getName(); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none foo diff --git a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt index 4c7fabe5..3ffac1db 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt @@ -46,7 +46,9 @@ Examples var_dump($info->getOptions()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(2) { ["capped"]=> diff --git a/source/reference/method/MongoDBModelCollectionInfo-getType.txt b/source/reference/method/MongoDBModelCollectionInfo-getType.txt index b900efed..9fdf5c99 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-getType.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-getType.txt @@ -40,7 +40,9 @@ Examples echo $info->getType(); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none collection diff --git a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt index 15957ae8..a6067e0a 100644 --- a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt +++ b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt @@ -50,7 +50,9 @@ Examples var_dump($info->isCapped()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none bool(true) diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt index a2524a4b..6f82a77a 100644 --- a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt +++ b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt @@ -37,7 +37,9 @@ Examples echo $info->getName(); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none foo diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt index d42f23ff..8c3a0b0b 100644 --- a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt +++ b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt @@ -37,7 +37,9 @@ Examples var_dump($info->getSizeOnDisk()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none int(1048576) diff --git a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt index ae25e67f..1c68299e 100644 --- a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt +++ b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt @@ -37,7 +37,9 @@ Examples var_dump($info->isEmpty()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none bool(true) diff --git a/source/reference/method/MongoDBModelIndexInfo-getKey.txt b/source/reference/method/MongoDBModelIndexInfo-getKey.txt index 1a115f9c..ff416f91 100644 --- a/source/reference/method/MongoDBModelIndexInfo-getKey.txt +++ b/source/reference/method/MongoDBModelIndexInfo-getKey.txt @@ -41,7 +41,9 @@ Examples var_dump($info->getKey()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none array(1) { ["x"]=> diff --git a/source/reference/method/MongoDBModelIndexInfo-getName.txt b/source/reference/method/MongoDBModelIndexInfo-getName.txt index 97ad45fa..ba4fa55e 100644 --- a/source/reference/method/MongoDBModelIndexInfo-getName.txt +++ b/source/reference/method/MongoDBModelIndexInfo-getName.txt @@ -42,7 +42,9 @@ Examples echo $info->getName(); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none x_1 diff --git a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt index f4a64bb6..f4bb7a59 100644 --- a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt +++ b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt @@ -40,7 +40,9 @@ Examples echo $info->getNamespace(); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none foo.bar diff --git a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt index 728f3885..96a22770 100644 --- a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt +++ b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt @@ -39,7 +39,9 @@ Examples var_dump($info->getVersion()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none int(1) diff --git a/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt b/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt index a6bb398b..017e6e7b 100644 --- a/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt +++ b/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt @@ -46,7 +46,9 @@ Examples } } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none pos_2dsphere has 2dsphereIndexVersion: 3 diff --git a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt index a2d9a028..a2ee99e5 100644 --- a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt +++ b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt @@ -46,7 +46,9 @@ Examples } } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none pos_geoHaystack_x_1 has bucketSize: 5 diff --git a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt index 5bbe4dea..533793c9 100644 --- a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt +++ b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt @@ -41,7 +41,9 @@ Examples var_dump($info->isSparse()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none bool(true) diff --git a/source/reference/method/MongoDBModelIndexInfo-isText.txt b/source/reference/method/MongoDBModelIndexInfo-isText.txt index 08333596..7e0488f5 100644 --- a/source/reference/method/MongoDBModelIndexInfo-isText.txt +++ b/source/reference/method/MongoDBModelIndexInfo-isText.txt @@ -45,7 +45,9 @@ Examples } } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none name_text has default language: english diff --git a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt index a3e70d03..a33a22b9 100644 --- a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt +++ b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt @@ -41,7 +41,9 @@ Examples var_dump($info->isTtl()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none bool(true) diff --git a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt index 30cf1ece..ef61e7c3 100644 --- a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt +++ b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt @@ -41,7 +41,9 @@ Examples var_dump($info->isUnique()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none bool(true) diff --git a/source/tutorial/collation.txt b/source/tutorial/collation.txt index 76df18fe..28225db0 100644 --- a/source/tutorial/collation.txt +++ b/source/tutorial/collation.txt @@ -196,7 +196,7 @@ A collection called ``names`` contains the following documents: { "_id" : 4, "first_name" : "Jürgen" } The following :phpmethod:`findOneAndUpdate() -` operation on the collection does not +` operation on the collection does not specify a collation. .. code-block:: php @@ -214,7 +214,7 @@ Because ``Gunter`` is lexically first in the collection, the above operation returns no results and updates no documents. Consider the same :phpmethod:`findOneAndUpdate() -` operation but with a collation +` operation but with a collation specified, which uses the locale ``de@collation=phonebook``. .. note:: @@ -349,7 +349,7 @@ Aggregation ~~~~~~~~~~~ To use collation with an :phpmethod:`aggregate() -` operation, specify a collation in the +` operation, specify a collation in the aggregation options. The following aggregation example uses a collection called ``names`` and groups diff --git a/source/tutorial/commands.txt b/source/tutorial/commands.txt index 88ce5ec9..68a5ec26 100644 --- a/source/tutorial/commands.txt +++ b/source/tutorial/commands.txt @@ -52,7 +52,9 @@ in the ``restos`` collection in the ``test`` database: var_dump($results); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#27 (1) { ["storage":"ArrayObject":private]=> @@ -240,7 +242,9 @@ custom read preference: var_dump($cursor->toArray()[0]); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#8 (1) { ["storage":"ArrayObject":private]=> @@ -273,7 +277,9 @@ document, or access the first result in the array, as in the following: var_dump($cursor->toArray()[0]); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#2 (1) { ["storage":"ArrayObject":private]=> @@ -307,7 +313,9 @@ iterating through the cursor returned by the ``listCollections`` command using a } The output would then be a list of the values for the ``name`` key, for -instance:: +instance: + +.. code-block:: none persons posts diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt index 1e9f95e2..a5c0d431 100644 --- a/source/tutorial/crud.txt +++ b/source/tutorial/crud.txt @@ -61,7 +61,9 @@ The following example inserts a document while specifying the value for the var_dump($insertOneResult->getInsertedId()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Inserted 1 document(s) int(1) @@ -113,7 +115,9 @@ The following example searches for the document with ``_id`` of ``"94301"``: var_dump($document); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#13 (1) { ["storage":"ArrayObject":private]=> @@ -175,7 +179,9 @@ specified city and state values: echo $document['_id'], "\n"; } -The output would resemble:: +The output would resemble: + +.. code-block:: none 07302 07304 @@ -231,7 +237,9 @@ returned. It also limits the results to 5 documents. var_dump($restaurant); }; -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#10 (1) { ["storage":"ArrayObject":private]=> @@ -325,7 +333,9 @@ five most populous zip codes in the United States: printf("%s: %s, %s\n", $document['_id'], $document['city'], $document['state']); } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none 60623: CHICAGO, IL 11226: BROOKLYN, NY @@ -358,7 +368,9 @@ name starts with "garden" and the state is Texas: printf("%s: %s, %s\n", $document['_id'], $document['city'], $document['state']); } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none 78266: GARDEN RIDGE, TX 79739: GARDEN CITY, TX @@ -422,7 +434,9 @@ with them: printf("%s has %d zip codes\n", $state['_id'], $state['count']); } -The output would then resemble:: +The output would then resemble: + +.. code-block:: none TX has 1671 zip codes NY has 1595 zip codes @@ -472,7 +486,9 @@ is ``"ny"`` to include a ``country`` field set to ``"us"``: Since the update operation uses the :phpmethod:`MongoDB\\Collection::updateOne()` method, which updates the first -document to match the filter criteria, the results would then resemble:: +document to match the filter criteria, the results would then resemble: + +.. code-block:: none Matched 1 document(s) Modified 1 document(s) @@ -498,7 +514,9 @@ value, as in this example: printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); The number of matched documents and the number of *modified* documents would -therefore not be equal, and the output from the operation would resemble:: +therefore not be equal, and the output from the operation would resemble: + +.. code-block:: none Matched 1 document(s) Modified 0 document(s) @@ -521,7 +539,7 @@ updates to perform. The :phpmethod:`MongoDB\\Collection::updateMany()` reference describes each parameter in detail. The following example inserts three documents into an empty ``users`` collection -in the ``test`` database and then uses the :query:`$set` operator to update the +in the ``test`` database and then uses the :update:`$set` operator to update the documents matching the filter criteria to include the ``country`` field with value ``"us"``: @@ -547,7 +565,9 @@ If an update operation results in no change to a document, such as setting the value of the field to its current value, the number of modified documents can be less than the number of *matched* documents. Since the update document with ``name`` of ``"Bob"`` results in no changes to the document, the output of the -operation therefore resembles:: +operation therefore resembles: + +.. code-block:: none Matched 3 document(s) Modified 2 document(s) @@ -573,7 +593,7 @@ replacement document that will replace the original document in MongoDB. The :phpmethod:`MongoDB\\Collection::replaceOne()` reference describes each parameter in detail. -.. important:: +.. important:: Replacement operations replace all of the fields in a document except the ``_id`` value. To avoid accidentally overwriting or deleting desired fields, @@ -600,12 +620,14 @@ the ``test`` database, and then replaces that document with a new one: printf("Matched %d document(s)\n", $updateResult->getMatchedCount()); printf("Modified %d document(s)\n", $updateResult->getModifiedCount()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Matched 1 document(s) Modified 1 document(s) -.. seealso:: +.. seealso:: - :phpmethod:`MongoDB\\Collection::replaceOne()` - :phpmethod:`MongoDB\\Collection::findOneAndReplace()` @@ -649,7 +671,9 @@ the ``upsert`` option set to ``true`` and an empty ``users`` collection in the var_dump($upsertedDocument); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Matched 0 document(s) Modified 0 document(s) @@ -705,7 +729,9 @@ value is ``"ny"``: printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Deleted 1 document(s) @@ -739,7 +765,9 @@ value is ``"ny"``: printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Deleted 2 document(s) diff --git a/source/tutorial/custom-types.txt b/source/tutorial/custom-types.txt index 57460430..3c1dd123 100644 --- a/source/tutorial/custom-types.txt +++ b/source/tutorial/custom-types.txt @@ -152,7 +152,9 @@ back to ``LocalDateTime``. var_dump($document->date->toDateTime()); ?> -Which outputs:: +Which outputs: + +.. code-block:: none object(stdClass)#1 (1) { ["date"]=> diff --git a/source/tutorial/decimal128.txt b/source/tutorial/decimal128.txt index a94d0ea5..3bdab8f1 100644 --- a/source/tutorial/decimal128.txt +++ b/source/tutorial/decimal128.txt @@ -48,7 +48,9 @@ field of a collection named ``inventory``: var_dump($item); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#9 (1) { ["storage":"ArrayObject":private]=> @@ -86,7 +88,9 @@ The following example adds two ``Decimal128`` values and creates a new var_dump($sum); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\BSON\Decimal128)#4 (1) { ["dec"]=> @@ -111,7 +115,9 @@ obtain the expected result: var_dump($sum); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none object(MongoDB\BSON\Decimal128)#4 (1) { ["dec"]=> diff --git a/source/tutorial/example-data.txt b/source/tutorial/example-data.txt index cf323095..920de587 100644 --- a/source/tutorial/example-data.txt +++ b/source/tutorial/example-data.txt @@ -9,7 +9,7 @@ Some examples in this documentation use example data fixtures from `primer-dataset.json `_. Importing the dataset into MongoDB can be done in several ways. The following -example imports the `zips.json` file into a `test.zips` collection: +example imports the ``zips.json`` file into a ``test.zips`` collection: :php:`driver ` directly: .. code-block:: php @@ -32,7 +32,9 @@ example imports the `zips.json` file into a `test.zips` collection: $result = $manager->executeBulkWrite('test.zips', $bulk); printf("Inserted %d documents\n", $result->getInsertedCount()); -The output would then resemble:: +The output would then resemble: + +.. code-block:: none Inserted 29353 documents diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt index 81f6d263..4eb7e156 100644 --- a/source/tutorial/gridfs.txt +++ b/source/tutorial/gridfs.txt @@ -23,7 +23,7 @@ Creating a GridFS Bucket You can construct a GridFS bucket using the PHP extension's :php:`MongoDB\\Driver\\Manager ` class, or select a bucket from the |php-library|'s :phpclass:`MongoDB\\Database` class via the -:phpmethod:`selectGridFSBucket() ` +:phpmethod:`selectGridFSBucket() ` method. The bucket can be constructed with various options: @@ -112,9 +112,9 @@ number. Revision numbers are used to distinguish between files sharing the same ``filename`` metadata field, ordered by date of upload (i.e. the ``uploadDate`` metadata field). The ``revision`` option accepted by :phpmethod:`openDownloadStreamByName() -` and +` and :phpmethod:`downloadToStreamByName() -` can be positive or negative. +` can be positive or negative. A positive ``revision`` number may be used to select files in order of the oldest upload date. A revision of ``0`` would denote the file with the oldest @@ -157,7 +157,7 @@ You can delete a GridFS file by its ``_id``. Finding File Metadata --------------------- -The :phpmethod:`find() ` method allows you to +The :phpmethod:`find() ` method allows you to retrieve documents from the GridFS files collection, which contain metadata about the GridFS files. @@ -173,7 +173,7 @@ Accessing File Metadata for an Existing Stream ---------------------------------------------- The :phpmethod:`getFileDocumentForStream() -` method may be used to get +` method may be used to get the file document for an existing readable or writable GridFS stream. .. code-block:: php @@ -193,16 +193,16 @@ the file document for an existing readable or writable GridFS stream. Since the file document for a writable stream is not committed to MongoDB until the stream is closed, :phpmethod:`getFileDocumentForStream() - ` can only return an + ` can only return an in-memory document, which will be missing some fields (e.g. ``length``, ``md5``). The :phpmethod:`getFileIdForStream() -` method may be used to get the +` method may be used to get the ``_id`` for an existing readable or writable GridFS stream. This is a convenience for accessing the ``_id`` property of the object returned by :phpmethod:`getFileDocumentForStream() -`. +`. .. code-block:: php diff --git a/source/tutorial/indexes.txt b/source/tutorial/indexes.txt index 0ffe7bdb..e04d4365 100644 --- a/source/tutorial/indexes.txt +++ b/source/tutorial/indexes.txt @@ -31,7 +31,7 @@ Create indexes with the :phpmethod:`MongoDB\\Collection::createIndex()` or reference for more details about each method. The following example creates an ascending index on the ``state`` field using -the :phpmethod:`createIndex() ` method: +the :phpmethod:`createIndex() ` method: .. code-block:: php @@ -45,7 +45,9 @@ the :phpmethod:`createIndex() ` method: When you create an index, the method returns its name, which is automatically generated from its specification. The above example would output something -similar to:: +similar to: + +.. code-block:: none string(7) "state_1" @@ -71,7 +73,9 @@ The following example lists all indexes in the ``zips`` collection in the var_dump($indexInfo); } -The output would resemble:: +The output would resemble: + +.. code-block:: none object(MongoDB\Model\IndexInfo)#10 (4) { ["v"]=> @@ -120,7 +124,9 @@ The following example drops a single index by its name, ``state_1``: var_dump($result); -The operation's output would resemble:: +The operation's output would resemble: + +.. code-block:: none object(MongoDB\Model\BSONDocument)#11 (1) { ["storage":"ArrayObject":private]=> diff --git a/source/tutorial/modeling-bson-data.txt b/source/tutorial/modeling-bson-data.txt index 38f44769..24486d1e 100644 --- a/source/tutorial/modeling-bson-data.txt +++ b/source/tutorial/modeling-bson-data.txt @@ -167,7 +167,7 @@ directly serialized. This is similar to how enums are handled by :php:`json_encode() `. Round-tripping a backed enum through BSON requires special handling. In the -following example, the `bsonUnserialize()` method in the class containing the +following example, the ``bsonUnserialize()`` method in the class containing the enum is responsible for converting the value back to an enum case: .. code-block:: php diff --git a/source/upgrade.txt b/source/upgrade.txt index 4a67b7fb..ff1bc90e 100644 --- a/source/upgrade.txt +++ b/source/upgrade.txt @@ -263,7 +263,7 @@ equivalent method(s) in the new driver. * - ``MongoCollection::group()`` - Not implemented. Use :phpmethod:`MongoDB\\Database::command()`. See - `Group Command Helper`_ for an example. + :ref:`Group Command Helper ` for an example. * - ``MongoCollection::insert()`` - :phpmethod:`MongoDB\\Collection::insertOne()` @@ -332,8 +332,8 @@ MongoCollection::save() Removed ``MongoCollection::save()``, which was syntactic sugar for an insert or upsert operation, has been removed in favor of explicitly using -:phpmethod:`MongoDB\\Collection::insertOne` or -:phpmethod:`MongoDB\\Collection::replaceOne` (with the ``upsert`` option). +:phpmethod:`MongoDB\\Collection::insertOne()` or +:phpmethod:`MongoDB\\Collection::replaceOne()` (with the ``upsert`` option). While the ``save`` method does have its uses for interactive environments, such as the ``mongo`` shell, it was intentionally excluded from the @@ -345,6 +345,8 @@ handle the returned :phpclass:`MongoDB\\InsertOneResult` or inadvertent and potentially dangerous :manual:`full-document replacements `. +.. _group-command-helper: + Group Command Helper ~~~~~~~~~~~~~~~~~~~~ From 42ea4e76573cbf2270491583161ef508b7592902 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 19 Dec 2022 17:37:11 +0800 Subject: [PATCH 266/321] Refer Windows users to GitHub releases instead of PECL for DLLs (#1016) As of ext-mongodb 1.15.0 (PHPC-2143), DLLs are attached to GitHub release notes. --- source/faq.txt | 9 ++++++--- source/tutorial/install-php-library.txt | 17 +++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/source/faq.txt b/source/faq.txt index ff9acc02..72801e16 100644 --- a/source/faq.txt +++ b/source/faq.txt @@ -75,8 +75,8 @@ wrap the script in ``
`` tags to properly format its output:
 Loading an Incompatible DLL on Windows
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-PECL builds Windows binaries for various combinations of PHP version,
-thread-safety (TS or NTS), and architecture (x86 or x64). Failure to select the
+Windows binaries are available for various combinations of PHP version,
+thread safety (TS or NTS), and architecture (x86 or x64). Failure to select the
 correct binary will result in an error when attempting to load the extension DLL
 at runtime:
 
@@ -88,7 +88,7 @@ Ensure that you have downloaded a DLL that corresponds to the following PHP
 runtime properties:
 
 - PHP version (``PHP_VERSION``)
-- Thread-safety (``PHP_ZTS``)
+- Thread safety (``PHP_ZTS``)
 - Architecture (``PHP_INT_SIZE``)
 
 In addition to the aforementioned constants, these properties can also be
@@ -96,6 +96,9 @@ inferred from :php:`phpinfo() `. If your system has multiple PHP
 runtimes installed, double-check that you are examining the ``phpinfo()`` output
 for the correct environment.
 
+The aforementioned ``detect-extension`` script can also be used to determine the
+appropriate DLL for your PHP environment.
+
 Server Selection Failures
 -------------------------
 
diff --git a/source/tutorial/install-php-library.txt b/source/tutorial/install-php-library.txt
index f4087cba..af409c36 100644
--- a/source/tutorial/install-php-library.txt
+++ b/source/tutorial/install-php-library.txt
@@ -41,17 +41,18 @@ file:
 
    extension=mongodb.so
 
-Windows users can download precompiled binaries of the extension from
-`PECL `_. After extracting the
-``php_mongodb.dll`` file to PHP's extension directory, add the following line to
-your ``php.ini`` file:
+Windows users can download precompiled binaries of the extension from its
+`GitHub releases `__.
+After downloading the appropriate archive for your PHP environment, extract the
+``php_mongodb.dll`` file to PHP's extension directory and add the following line
+to your ``php.ini`` file:
 
 .. code-block:: ini
 
    extension=php_mongodb.dll
 
-Additional considerations for Windows are discussed in the
-:php:`Windows installation documentation `.
+See :php:`Installing the MongoDB PHP Driver on Windows `
+for additional information.
 
 Installing the Library
 ----------------------
@@ -85,8 +86,8 @@ Manual Installation Without Composer
 
 While not recommended, you may also manually install the library using a source
 archive attached to the
-`GitHub releases `_. When
-installing the library without Composer, you must ensure that all library
+`GitHub releases `__.
+When installing the library without Composer, you must ensure that all library
 classes *and* functions are loaded for your application:
 
 #. If you are using a `PSR-4 `_ autoloader,

From 2b4695910a0c18d1c4ffb7a359efe45e9d67fc45 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 9 Jan 2023 16:52:09 +0800
Subject: [PATCH 267/321] PHPLIB-1055: Various small documentation fixes
 (#1024)

* Use literals instead of RC/RP/WC constants for conciseness

* PHPLIB-1057: Note that geoHaystack was removed in MongoDB 5.0+

* Use correct boolean type in updateMany() example code

* Better clarify Database::command() purpose and examples

Also fixes two long-standing syntax errors in the example code

* Revise command tutorial and sync with command() docs

Remove the geoNear example since the command itself was removed in MongoDB 4.2.
---
 .../method/MongoDBClient-selectCollection.txt |   2 +-
 .../method/MongoDBClient-selectDatabase.txt   |   2 +-
 .../MongoDBCollection-getReadConcern.txt      |   2 +-
 .../method/MongoDBCollection-updateMany.txt   |   2 +-
 .../method/MongoDBCollection-withOptions.txt  |   2 +-
 .../method/MongoDBDatabase-command.txt        |  23 +-
 .../method/MongoDBDatabase-getReadConcern.txt |   2 +-
 .../MongoDBDatabase-selectCollection.txt      |   2 +-
 .../MongoDBDatabase-selectGridFSBucket.txt    |   2 +-
 .../method/MongoDBDatabase-withOptions.txt    |   2 +-
 .../MongoDBGridFSBucket-getReadConcern.txt    |   2 +-
 .../MongoDBModelIndexInfo-isGeoHaystack.txt   |   8 +-
 source/tutorial/commands.txt                  | 329 ++++--------------
 13 files changed, 103 insertions(+), 277 deletions(-)

diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 34a25198..88828c29 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -72,7 +72,7 @@ with a custom read preference:
        'test',
        'users',
        [
-           'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+           'readPreference' => new MongoDB\Driver\ReadPreference('primaryPreferred'),
        ]
    );
 
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index 73ecc2b9..a556a06a 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -71,7 +71,7 @@ preference:
    $db = $client->selectDatabase(
        'test',
        [
-           'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+           'readPreference' => new MongoDB\Driver\ReadPreference('primaryPreferred'),
        ]
    );
 
diff --git a/source/reference/method/MongoDBCollection-getReadConcern.txt b/source/reference/method/MongoDBCollection-getReadConcern.txt
index 2a40efed..37873d0f 100644
--- a/source/reference/method/MongoDBCollection-getReadConcern.txt
+++ b/source/reference/method/MongoDBCollection-getReadConcern.txt
@@ -36,7 +36,7 @@ Example
    selectCollection('test', 'users', [
-      'readConcern' => new MongoDB\Driver\ReadConcern(MongoDB\Driver\ReadConcern::MAJORITY),
+      'readConcern' => new MongoDB\Driver\ReadConcern('majority'),
    ]);
 
    var_dump($collection->getReadConcern());
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 65f1fb01..73092e78 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -61,7 +61,7 @@ The following example updates all of the documents with the ``borough`` of
 
    $updateResult = $collection->updateMany(
        [ 'borough' => 'Queens' ],
-       [ '$set' => [ 'active' => 'True' ]]
+       [ '$set' => [ 'active' => true ]]
    );
 
    printf("Matched %d document(s)\n", $updateResult->getMatchedCount());
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index 92e09f6e..a68a5fec 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -52,7 +52,7 @@ preference:
    $collection = (new MongoDB\Client)->selectCollection('test', 'restaurants');
 
    $newCollection = $sourceCollection->withOptions([
-       'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+       'readPreference' => new MongoDB\Driver\ReadPreference('primaryPreferred'),
    ]);
 
 See Also
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index 84b58178..d442541c 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -15,7 +15,9 @@ Definition
 
 .. phpmethod:: MongoDB\\Database::command()
 
-   Execute a :manual:`command ` on the database.
+   Execute a :manual:`command ` on the database. This is
+   generally used to execute commands that do not have a corresponding helper
+   method within the library.
 
    .. code-block:: php
 
@@ -43,9 +45,10 @@ Errors/Exceptions
 Example
 -------
 
-The following example executes a :manual:`ping
-` command, which returns a cursor with a single
-result document:
+Most database commands return a single result document, which can be obtained by
+converting the returned cursor to an array and accessing its first element. The
+following example executes a :manual:`ping ` command
+and prints its result document:
 
 .. code-block:: php
 
@@ -55,7 +58,7 @@ result document:
 
    $cursor = $database->command(['ping' => 1]);
 
-   var_dump($c->toArray()[0]);
+   var_dump($cursor->toArray()[0]);
 
 The output would resemble:
 
@@ -69,9 +72,11 @@ The output would resemble:
      }
    }
 
-The following example executes a :manual:`listCollections
-` command, which returns a cursor with
-multiple result documents:
+Some database commands return a cursor with multiple results. The following
+example executes :manual:`listCollections `,
+which returns a cursor containing a result document for each collection in the
+``test`` database. Note that this example is illustrative; applications would
+generally use :phpmethod:`MongoDB\\Database::listCollections()` in practice.
 
 .. code-block:: php
 
@@ -81,7 +86,7 @@ multiple result documents:
 
    $cursor = $database->command(['listCollections' => 1]);
 
-   var_dump($c->toArray());
+   var_dump($cursor->toArray());
 
 The output would resemble:
 
diff --git a/source/reference/method/MongoDBDatabase-getReadConcern.txt b/source/reference/method/MongoDBDatabase-getReadConcern.txt
index 4b02a1dd..56568aa4 100644
--- a/source/reference/method/MongoDBDatabase-getReadConcern.txt
+++ b/source/reference/method/MongoDBDatabase-getReadConcern.txt
@@ -36,7 +36,7 @@ Example
    selectDatabase('test', [
-      'readConcern' => new MongoDB\Driver\ReadConcern(MongoDB\Driver\ReadConcern::MAJORITY),
+      'readConcern' => new MongoDB\Driver\ReadConcern('majority'),
    ]);
 
    var_dump($database->getReadConcern());
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 6294e1a7..fb17687b 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -71,7 +71,7 @@ database with a custom read preference:
    $users = $db->selectCollection(
        'users',
        [
-           'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+           'readPreference' => new MongoDB\Driver\ReadPreference('primaryPreferred'),
        ]
    );
 
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index 9c63fdf7..f9390627 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -71,7 +71,7 @@ database with a custom read preference:
 
    $imagesBucket = $db->selectGridFSBucket([
        'bucketName' => 'images',
-       'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+       'readPreference' => new MongoDB\Driver\ReadPreference('primaryPreferred'),
    ]);
 
 See Also
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index 9bc0a82e..6f732eac 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -52,7 +52,7 @@ preference:
    $db = (new MongoDB\Client)->test;
 
    $newDb = $db->withOptions([
-       'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
+       'readPreference' => new MongoDB\Driver\ReadPreference('primaryPreferred'),
    ]);
 
 See Also
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
index d9c0a8e2..7b12c051 100644
--- a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
@@ -37,7 +37,7 @@ Example
 
    $database = (new MongoDB\Client)->selectDatabase('test');
    $bucket = $database->selectGridFSBucket([
-      'readConcern' => new MongoDB\Driver\ReadConcern(MongoDB\Driver\ReadConcern::MAJORITY),
+      'readConcern' => new MongoDB\Driver\ReadConcern('majority'),
    ]);
 
    var_dump($bucket->getReadConcern());
diff --git a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
index a2ee99e5..97f844f1 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
@@ -17,13 +17,17 @@ Definition
 
 .. phpmethod:: MongoDB\\Model\\IndexInfo::isGeoHaystack()
 
-   Return whether the index is a :manual:`geoHaystack
-   ` index.
+   Return whether the index is a :manual:`geoHaystack `
+   index.
 
    .. code-block:: php
 
       function isGeoHaystack(): boolean
 
+   .. note::
+
+      MongoDB 5.0 and later no longer supports geoHaystack indexes.
+
 Return Values
 -------------
 
diff --git a/source/tutorial/commands.txt b/source/tutorial/commands.txt
index 68a5ec26..bccf7462 100644
--- a/source/tutorial/commands.txt
+++ b/source/tutorial/commands.txt
@@ -20,17 +20,18 @@ The |php-library| provides helper methods across the :phpclass:`Client
 :phpmethod:`MongoDB\\Database::command()` method may be used to run database
 commands that do not have a helper method.
 
-Execute Database Commands
--------------------------
+The :phpmethod:`MongoDB\\Database::command()` method always returns a
+:php:`MongoDB\\Driver\\Cursor ` object, since it must
+support execution of commands that return single result documents *and* multiple
+results via a command cursor.
 
-Basic Command
-~~~~~~~~~~~~~
+Commands That Return a Single Result Document
+---------------------------------------------
 
-To execute a command on a :program:`mongod` instance, use the
-:phpmethod:`MongoDB\\Database::command()` method. For instance, the following
-operation uses the :manual:`geoNear ` command to
-search for the three closest documents to longitude ``-74`` and latitude ``40``
-in the ``restos`` collection in the ``test`` database:
+Most database commands return a single result document, which can be obtained by
+converting the returned cursor to an array and accessing its first element. The
+following example executes a :manual:`ping ` command
+and prints its result document:
 
 .. code-block:: php
 
@@ -38,196 +39,90 @@ in the ``restos`` collection in the ``test`` database:
 
    $database = (new MongoDB\Client)->test;
 
-   $cursor = $database->command([
-       'geoNear' => 'restos',
-       'near' => [
-           'type' => 'Point',
-           'coordinates' => [-74.0, 40.0],
-       ],
-       'spherical' => 'true',
-       'num' => 3,
-   ]);
-
-   $results = $cursor->toArray()[0];
+   $cursor = $database->command(['ping' => 1]);
 
-   var_dump($results);
+   var_dump($cursor->toArray()[0]);
 
-The output would then resemble:
+The output would resemble:
 
 .. code-block:: none
 
-   object(MongoDB\Model\BSONDocument)#27 (1) {
+   object(MongoDB\Model\BSONDocument)#11 (1) {
      ["storage":"ArrayObject":private]=>
-     array(4) {
-       ["waitedMS"]=>
-       int(0)
-       ["results"]=>
-       object(MongoDB\Model\BSONArray)#25 (1) {
-         ["storage":"ArrayObject":private]=>
-         array(3) {
-           [0]=>
-           object(MongoDB\Model\BSONDocument)#14 (1) {
-             ["storage":"ArrayObject":private]=>
-             array(2) {
-               ["dis"]=>
-               float(39463.618389163)
-               ["obj"]=>
-               object(MongoDB\Model\BSONDocument)#13 (1) {
-                 ["storage":"ArrayObject":private]=>
-                 array(3) {
-                   ["_id"]=>
-                   object(MongoDB\BSON\ObjectId)#3 (1) {
-                     ["oid"]=>
-                     string(24) "55cba2486c522cafdb059bed"
-                   }
-                   ["location"]=>
-                   object(MongoDB\Model\BSONDocument)#12 (1) {
-                     ["storage":"ArrayObject":private]=>
-                     array(2) {
-                       ["coordinates"]=>
-                       object(MongoDB\Model\BSONArray)#11 (1) {
-                         ["storage":"ArrayObject":private]=>
-                         array(2) {
-                           [0]=>
-                           float(-74.1641319)
-                           [1]=>
-                           float(39.6686512)
-                         }
-                       }
-                       ["type"]=>
-                       string(5) "Point"
-                     }
-                   }
-                   ["name"]=>
-                   string(32) "Soul Food Kitchen Seafood Heaven"
-                 }
-               }
-             }
-           }
-           [1]=>
-           object(MongoDB\Model\BSONDocument)#19 (1) {
-             ["storage":"ArrayObject":private]=>
-             array(2) {
-               ["dis"]=>
-               float(50686.851650416)
-               ["obj"]=>
-               object(MongoDB\Model\BSONDocument)#18 (1) {
-                 ["storage":"ArrayObject":private]=>
-                 array(3) {
-                   ["_id"]=>
-                   object(MongoDB\BSON\ObjectId)#15 (1) {
-                     ["oid"]=>
-                     string(24) "55cba2476c522cafdb0544df"
-                   }
-                   ["location"]=>
-                   object(MongoDB\Model\BSONDocument)#17 (1) {
-                     ["storage":"ArrayObject":private]=>
-                     array(2) {
-                       ["coordinates"]=>
-                       object(MongoDB\Model\BSONArray)#16 (1) {
-                         ["storage":"ArrayObject":private]=>
-                         array(2) {
-                           [0]=>
-                           float(-74.2566332)
-                           [1]=>
-                           float(40.4109872)
-                         }
-                       }
-                       ["type"]=>
-                       string(5) "Point"
-                     }
-                   }
-                   ["name"]=>
-                   string(20) "Seguine Bagel Bakery"
-                 }
-               }
-             }
-           }
-           [2]=>
-           object(MongoDB\Model\BSONDocument)#24 (1) {
-             ["storage":"ArrayObject":private]=>
-             array(2) {
-               ["dis"]=>
-               float(58398.379630263)
-               ["obj"]=>
-               object(MongoDB\Model\BSONDocument)#23 (1) {
-                 ["storage":"ArrayObject":private]=>
-                 array(3) {
-                   ["_id"]=>
-                   object(MongoDB\BSON\ObjectId)#20 (1) {
-                     ["oid"]=>
-                     string(24) "55cba2476c522cafdb053c92"
-                   }
-                   ["location"]=>
-                   object(MongoDB\Model\BSONDocument)#22 (1) {
-                     ["storage":"ArrayObject":private]=>
-                     array(2) {
-                       ["coordinates"]=>
-                       object(MongoDB\Model\BSONArray)#21 (1) {
-                         ["storage":"ArrayObject":private]=>
-                         array(2) {
-                           [0]=>
-                           float(-74.3731727)
-                           [1]=>
-                           float(40.4404759)
-                         }
-                       }
-                       ["type"]=>
-                       string(5) "Point"
-                     }
-                   }
-                   ["name"]=>
-                   string(17) "Water'S Edge Club"
-                 }
-               }
-             }
-           }
-         }
-       }
-       ["stats"]=>
-       object(MongoDB\Model\BSONDocument)#26 (1) {
-         ["storage":"ArrayObject":private]=>
-         array(5) {
-           ["nscanned"]=>
-           int(25139)
-           ["objectsLoaded"]=>
-           int(25134)
-           ["avgDistance"]=>
-           float(49516.283223281)
-           ["maxDistance"]=>
-           float(58398.379630263)
-           ["time"]=>
-           int(126)
-         }
-       }
+     array(1) {
        ["ok"]=>
        float(1)
      }
    }
 
-Commands with Custom Read Preference
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Commands That Yield Multiple Results
+------------------------------------
+
+Some database commands return a cursor with multiple results. The following
+example executes :manual:`listCollections `,
+which returns a cursor containing a result document for each collection in the
+``test`` database, and iterates through the results using a ``foreach`` loop.
+Note that this example is illustrative; applications would generally use
+:phpmethod:`MongoDB\\Database::listCollections()` in practice.
+
+.. code-block:: php
+
+   test;
+
+   $cursor = $database->command(['listCollections' => 1]);
+
+   foreach ($cursor as $collection) {
+       echo $collection['name'], "\n";
+   }
+
+The output might resemble the following:
+
+.. code-block:: none
+
+   persons
+   posts
+   zips
 
-Some commands, such as :manual:`createUser `, may
-only be executed on a :term:`primary` replica set member or a
-:term:`standalone`.
+.. note::
 
-The command helper methods in the |php-library|, such as
+   At the *protocol* level, commands that yield multiple results via a cursor
+   will return a single result document with the essential ingredients for
+   constructing the cursor (i.e. the cursor's ID, namespace, and an optional
+   first batch of results). If the :php:`MongoDB\Driver\Manager::executeCommand()
+   ` method in the PHP driver detects
+   such a response, it will construct an iterable command cursor and return it
+   instead of the raw result document. If necessary, raw result documents can
+   still be observed using `command monitoring
+   `_.
+
+Specifying a Custom Read Preference
+-----------------------------------
+
+Write commands, such as :manual:`createUser `,
+can only be executed on a writable server (e.g. :term:`primary` replica set
+member). Command helper methods in the |php-library|, such as
 :phpmethod:`MongoDB\\Database::drop()`, know to apply their own :term:`read
 preference` if necessary. However, the :phpmethod:`MongoDB\\Database::command()`
 method is a generic method and defaults to the read preference of the Database
-object on which it is invoked. To execute commands that require a specific read
-preference, specify the read preference in the ``$options`` parameter of the
-method.
+object on which it is invoked. When necessary, the ``readPreference`` option may
+be used to override the default read preference.
 
-The following example adds a user to the ``test`` database and specifies a
-custom read preference:
+The following example connects to a cluster and specifies ``secondaryPreferred``
+as the Client's default read preference. It then specifies a ``primary`` read
+preference when executing the ``createUser`` command on the ``test`` database:
 
 .. code-block:: php
 
    test;
+   $client = new MongoDB\Client(
+      'mongodb+srv://cluster0.example.com',
+      ['readPreference' => 'secondaryPreferred']
+   );
+
+   $client->test;
 
    $cursor = $db->command(
        [
@@ -236,7 +131,7 @@ custom read preference:
            'roles' => ['readWrite'],
        ],
        [
-           'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY),
+           'readPreference' => new MongoDB\Driver\ReadPreference('primary'),
        ]
    );
 
@@ -253,81 +148,3 @@ The output would then resemble:
        float(1)
      }
    }
-
-View Command Results
---------------------
-
-View Single Result Documents
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The :phpmethod:`MongoDB\\Database::command()` method returns a
-:php:`MongoDB\\Driver\\Cursor ` object.
-
-Many MongoDB commands return their responses as a single document. To read the
-command response, you may either iterate on the cursor and access the first
-document, or access the first result in the array, as in the following:
-
-.. code-block:: php
-
-   test;
-
-   $cursor = $database->command(['ping' => 1]);
-
-   var_dump($cursor->toArray()[0]);
-
-The output would then resemble:
-
-.. code-block:: none
-
-   object(MongoDB\Model\BSONDocument)#2 (1) {
-     ["storage":"ArrayObject":private]=>
-     array(1) {
-       ["ok"]=>
-       float(1)
-     }
-   }
-
-Iterate Results from a Cursor
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Some commands, such as :manual:`listCollections
-`, return their results via an iterable
-cursor. To view the results, iterate through the cursor.
-
-The following example lists the collections in the ``test`` database by
-iterating through the cursor returned by the ``listCollections`` command using a
-``foreach`` loop:
-
-.. code-block:: php
-
-   test;
-
-   $cursor = $database->command(['listCollections' => 1]);
-
-   foreach ($cursor as $collection) {
-       echo $collection['name'], "\n";
-   }
-
-The output would then be a list of the values for the ``name`` key, for
-instance:
-
-.. code-block:: none
-
-   persons
-   posts
-   zips
-
-.. note::
-
-   At the *protocol* level, commands that support a cursor return a single
-   result document with the essential ingredients for constructing the command
-   cursor (i.e. the cursor's ID, namespace, and the first batch of results). In
-   the PHP driver implementation, the
-   :php:`MongoDB\Driver\Manager::executeCommand()
-   ` method detects such a result and
-   constructs the iterable command cursor, which is returned rather than the
-   base result document.

From 4172b6fd179c99858b2d768f0c021fb90946a506 Mon Sep 17 00:00:00 2001
From: Oskar Stark 
Date: Wed, 11 Jan 2023 09:34:04 +0200
Subject: [PATCH 268/321] Remove British English spelling in docs (#1031)

Behavior/behavior is used across the whole docs
---
 source/tutorial/custom-types.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/tutorial/custom-types.txt b/source/tutorial/custom-types.txt
index 3c1dd123..5fa5880f 100644
--- a/source/tutorial/custom-types.txt
+++ b/source/tutorial/custom-types.txt
@@ -14,7 +14,7 @@ The driver serializes PHP variables, including objects, into BSON when it
 communicates to the server, and deserializes BSON back into PHP variables when
 it receives data from the server.
 
-It is possible to influence the behaviour by implementing the
+It is possible to influence the behavior by implementing the
 :php:`MongoDB\\BSON\\Persistable ` interface.
 If a class implements this interface, then upon serialization the
 :php:`bsonSerialize ` method is

From 8d2f8dc2c5538b8e7746ae83ba28e4de72b05e3b Mon Sep 17 00:00:00 2001
From: Oskar Stark 
Date: Tue, 17 Jan 2023 10:49:36 +0100
Subject: [PATCH 269/321] Add PHP open tag to examples (#1037)

* [Documentation] Add PHP open tag to examples

* Update docs/faq.txt

Co-authored-by: Andreas Braun 

Co-authored-by: Andreas Braun 
---
 source/reference/method/MongoDBCollection-find.txt       | 2 ++
 source/reference/method/MongoDBCollection-findOne.txt    | 4 ++++
 source/reference/method/MongoDBCollection-updateMany.txt | 2 ++
 source/reference/method/MongoDBCollection-updateOne.txt  | 2 ++
 source/tutorial/crud.txt                                 | 2 ++
 5 files changed, 12 insertions(+)

diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 2a5e2afb..303b7042 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -56,6 +56,8 @@ returned. It also limits the results to 5 documents.
 
 .. code-block:: php
 
+   test->restaurants;
 
    $cursor = $collection->find(
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index 3ebd2b53..5e4c32f3 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -62,6 +62,8 @@ special BSON type, the query criteria for selecting a restaurant must use the
 
 .. code-block:: php
 
+   test;
 
    $zip = $database->zips->findOne(['_id' => '10036']);
@@ -80,6 +82,8 @@ returned.
 
 .. code-block:: php
 
+   test->restaurants;
 
    $restaurant = $collection->findOne(
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 73092e78..c3097882 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -57,6 +57,8 @@ The following example updates all of the documents with the ``borough`` of
 
 .. code-block:: php
 
+   test->restaurants;
 
    $updateResult = $collection->updateMany(
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index d7fbd157..5fe29405 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -59,6 +59,8 @@ The following example updates one document with the ``restaurant_id`` of
 
 .. code-block:: php
 
+   test->restaurants;
 
    $updateResult = $collection->updateOne(
diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index a5c0d431..b5588acb 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -380,6 +380,8 @@ An equivalent filter could be constructed using the :query:`$regex` operator:
 
 .. code-block:: php
 
+    ['$regex' => '^garden', '$options' => 'i'],
        'state' => 'TX',

From c4f3e667fdb16882268cae771f824376382cebe3 Mon Sep 17 00:00:00 2001
From: Oskar Stark 
Date: Wed, 18 Jan 2023 08:30:18 +0100
Subject: [PATCH 270/321] [Documentation] Remove the words `easily` and
 `simply` (#1041)

---
 source/tutorial/tailable-cursor.txt | 8 ++++----
 source/upgrade.txt                  | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/source/tutorial/tailable-cursor.txt b/source/tutorial/tailable-cursor.txt
index 2c84b080..370a642a 100644
--- a/source/tutorial/tailable-cursor.txt
+++ b/source/tutorial/tailable-cursor.txt
@@ -98,10 +98,10 @@ preceding example to use the Iterator methods directly:
    Calling ``$cursor->next()`` after the ``while`` loop naturally ends would
    throw an exception, since all results on the cursor have been exhausted.
 
-The purpose of this example is simply to demonstrate the functional equivalence
-between ``foreach`` and manual iteration with PHP's :php:`Iterator `
-API. For normal cursors, there is little reason to manually iterate results
-instead of a concise ``foreach`` loop.
+The purpose of this example is to demonstrate the functional equivalence between
+``foreach`` and manual iteration with PHP's :php:`Iterator `API.
+For normal cursors, there is little reason to manually iterate results instead
+of a concise ``foreach`` loop.
 
 Iterating a Tailable Cursor
 ---------------------------
diff --git a/source/upgrade.txt b/source/upgrade.txt
index ff1bc90e..d73d57e6 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -118,8 +118,8 @@ problematic:
   original BSON type.
 
 - Numerically-indexed PHP arrays would be serialized as BSON documents if there
-  was a gap in their key sequence. Such gaps were easily caused by unsetting a
-  key to remove an element and forgetting to numerically reindex the array.
+  was a gap in their key sequence. Such gaps were caused by unsetting a key to
+  remove an element and forgetting to numerically reindex the array.
 
 The |php-library|'s :phpclass:`BSONDocument ` and
 :phpclass:`BSONArray ` classes address these concerns

From 6c2e5c3fdaed5307c51d162daafef8cb0f5f22cb Mon Sep 17 00:00:00 2001
From: Oskar Stark 
Date: Wed, 18 Jan 2023 08:30:49 +0100
Subject: [PATCH 271/321] [Documentation] Remove duplicate word (#1040)

---
 source/reference/method/MongoDBModelIndexInfo-getName.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/source/reference/method/MongoDBModelIndexInfo-getName.txt b/source/reference/method/MongoDBModelIndexInfo-getName.txt
index ba4fa55e..b37c6621 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getName.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getName.txt
@@ -17,8 +17,7 @@ Definition
 
    Return the index name. This correlates with the return value of
    :phpmethod:`MongoDB\\Collection::createIndex()`. An index name may be derived
-   from the ``$key`` parameter or or explicitly specified via the ``name``
-   option.
+   from the ``$key`` parameter or explicitly specified via the ``name`` option.
 
    .. code-block:: php
 

From c4318d46985ecbfc1d63e14db66978d3733f7314 Mon Sep 17 00:00:00 2001
From: Oskar Stark 
Date: Wed, 18 Jan 2023 08:41:42 +0100
Subject: [PATCH 272/321] [Documentation] Spelling (#1042)

---
 source/faq.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/faq.txt b/source/faq.txt
index 72801e16..9cdd9a25 100644
--- a/source/faq.txt
+++ b/source/faq.txt
@@ -152,7 +152,7 @@ failure:
 - "connection timeout" could indicate a routing or firewall issue, or perhaps
   a timeout due to latency.
 - "socket timeout" suggests that a connection *was* established at some point
-  but was dropped or otherwise timeout out due to latency.
+  but was dropped or otherwise timed out due to latency.
 - "TLS handshake failed" suggests something related to TLS or OCSP verification
   and is sometimes indicative of misconfigured TLS certificates.
 

From 0e9ae96b2949a2b15f8fde6f4b5ba2832898fee5 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 21 Mar 2023 09:42:28 -0400
Subject: [PATCH 273/321] Remove extra slashes in method signature

---
 source/reference/method/MongoDBCollection-explain.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt
index 68a8965a..600f203b 100644
--- a/source/reference/method/MongoDBCollection-explain.txt
+++ b/source/reference/method/MongoDBCollection-explain.txt
@@ -21,7 +21,7 @@ Definition
 
    .. code-block:: php
 
-      function explain(MongoDB\\Operation\\Explainable $explainable, array $options = []): array|object
+      function explain(MongoDB\Operation\Explainable $explainable, array $options = []): array|object
 
    This method has the following parameters:
 

From d7045c13173c945aff57f40c3e15ca314bb8f4a9 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 11 Apr 2023 15:12:44 +0800
Subject: [PATCH 274/321] PHPLIB-1095: Queryable Encryption is "Public
 Technical Preview" (#1053)

This note was originally missed when introducing QE-related APIs in PHPLIB 1.13.
---
 ...gs-MongoDBDatabase-method-createCollection-option.yaml | 8 ++++++++
 source/includes/apiargs-dropCollection-option.yaml        | 8 ++++++++
 source/tutorial/client-side-encryption.txt                | 6 +++++-
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
index f95b406c..a970a398 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
@@ -89,6 +89,14 @@ description: |
   This option is available in MongoDB 6.0+ and will result in an exception at
   execution time if specified for an older server version.
 
+  .. note::
+
+     Queryable Encryption is in public preview and available for evaluation
+     purposes. It is not yet recommended for production deployments as breaking
+     changes may be introduced. See the
+     `Queryable Encryption Preview `_
+     blog post for more information.
+
   .. versionadded:: 1.13
 interface: phpmethod
 operation: ~
diff --git a/source/includes/apiargs-dropCollection-option.yaml b/source/includes/apiargs-dropCollection-option.yaml
index 018effa9..29c945e6 100644
--- a/source/includes/apiargs-dropCollection-option.yaml
+++ b/source/includes/apiargs-dropCollection-option.yaml
@@ -9,6 +9,14 @@ description: |
   server-side value for ``encryptedFields``. See the
   `Client Side Encryption specification `_
   for more information.
+
+  .. note::
+
+     Queryable Encryption is in public preview and available for evaluation
+     purposes. It is not yet recommended for production deployments as breaking
+     changes may be introduced. See the
+     `Queryable Encryption Preview `_
+     blog post for more information.
 interface: phpmethod
 operation: ~
 optional: true
diff --git a/source/tutorial/client-side-encryption.txt b/source/tutorial/client-side-encryption.txt
index 6ed2e00d..bd1d7ebd 100644
--- a/source/tutorial/client-side-encryption.txt
+++ b/source/tutorial/client-side-encryption.txt
@@ -248,7 +248,11 @@ Automatic Queryable Encryption
 .. note::
 
    Automatic queryable encryption is an enterprise only feature and requires
-   MongoDB 6.0+.
+   MongoDB 6.0+. Queryable Encryption is in public preview and available for
+   evaluation purposes. It is not yet recommended for production deployments as
+   breaking changes may be introduced. See the
+   `Queryable Encryption Preview `_
+   blog post for more information.
 
 The following example uses a local key; however, other key providers such as AWS
 are also an option. The data in the ``encryptedIndexed`` and

From c1d32ac7f249c0a042fcccdf8ecd0e9ab5e3a356 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 11 Apr 2023 15:31:01 +0800
Subject: [PATCH 275/321] Update docs for encryptedFields create/drop
 collection option (#1054)

The MongoDB manual reference is more helpful than the CSFLE specification. Additionally, clarify how the option is used by the drop collection helpers.
---
 ...ngoDBDatabase-method-createCollection-option.yaml |  6 +++---
 source/includes/apiargs-dropCollection-option.yaml   | 12 +++++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
index 063b84c4..f40cbf94 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
@@ -82,9 +82,9 @@ type: document
 description: |
   A document describing encrypted fields for queryable encryption. If omitted,
   the ``encryptedFieldsMap`` option within the ``autoEncryption`` driver option
-  will be consulted. See the
-  `Client Side Encryption specification `_
-  for more information.
+  will be consulted. See
+  `Field Encryption and Queryability `_
+  in the MongoDB manual for more information.
 
   This option is available in MongoDB 6.0+ and will result in an exception at
   execution time if specified for an older server version.
diff --git a/source/includes/apiargs-dropCollection-option.yaml b/source/includes/apiargs-dropCollection-option.yaml
index 29c945e6..46ad6607 100644
--- a/source/includes/apiargs-dropCollection-option.yaml
+++ b/source/includes/apiargs-dropCollection-option.yaml
@@ -6,9 +6,15 @@ description: |
   the ``encryptedFieldsMap`` option within the ``autoEncryption`` driver option
   will be consulted. If ``encryptedFieldsMap`` was defined but does not specify
   this collection, the library will make a final attempt to consult the
-  server-side value for ``encryptedFields``. See the
-  `Client Side Encryption specification `_
-  for more information.
+  server-side value for ``encryptedFields``. See
+  `Field Encryption and Queryability `_
+  in the MongoDB manual for more information.
+
+  .. note::
+
+     This option is not passed to the :manual:`drop `
+     command. The library uses it to determine related metadata collections that
+     should be dropped in addition to an encrypted collection.
 
   .. note::
 

From acf59eaa75564be7ffa17ccfda0d9d945c7805bd Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 12 Apr 2023 12:03:32 +0800
Subject: [PATCH 276/321] PHPLIB-913: Database::createEncryptedCollection()
 helper (#1050)

* Docs for Database::createEncryptedCollection()

* Revise docs and require $options since encryptedFields is required

* Add example for creating new Client with auto encryption

* Permit coding standard deviations in CSFLE prose tests

* Extract Database methods to CreateEncryptedCollection operation

* Functional tests for CreateEncryptedCollection::createDataKeys()

* Test that createDataKey() doesn't modify encryptedFields object option

* Require replica sets for CreateEncryptedCollectionFunctionalTest

* Add reference links to CreateCollection operation docs

Co-authored-by: Andreas Braun 
---
 ...ethod-createEncryptedCollection-param.yaml |  47 ++++++
 source/reference/class/MongoDBDatabase.txt    |   1 +
 source/reference/exception-classes.txt        |  15 ++
 ...goDBDatabase-createEncryptedCollection.txt | 144 ++++++++++++++++++
 4 files changed, 207 insertions(+)
 create mode 100644 source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
 create mode 100644 source/reference/method/MongoDBDatabase-createEncryptedCollection.txt

diff --git a/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
new file mode 100644
index 00000000..6d56d678
--- /dev/null
+++ b/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
@@ -0,0 +1,47 @@
+source:
+  file: apiargs-common-param.yaml
+  ref: $collectionName
+replacement:
+  subject: "encrypted collection"
+  action: " to create"
+---
+arg_name: param
+name: $clientEncryption
+type: :php:`MongoDB\\Driver\\ClientEncryption `
+description: |
+  The ClientEncryption object used to create data keys.
+interface: phpmethod
+operation: ~
+optional: false
+---
+arg_name: param
+name: $kmsProvider
+type: string
+description: |
+  KMS provider (e.g. "local", "aws") that will be used to encrypt new data keys.
+  This corresponds to the ``$kmsProvider`` parameter for
+  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+interface: phpmethod
+operation: ~
+optional: false
+---
+arg_name: param
+name: $masterKey
+type: array|null
+description: |
+  KMS-specific key options that will be used to encrypt new data keys. This
+  corresponds to the ``masterKey`` option for
+  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+
+  If ``$kmsProvider`` is "local", this should be ``null``.
+interface: phpmethod
+operation: ~
+optional: false
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+optional: false
+post: |
+  The ``encryptedFields`` option is required.
+...
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index a4a7dd99..ac0e0d16 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -48,6 +48,7 @@ Methods
    /reference/method/MongoDBDatabase-aggregate
    /reference/method/MongoDBDatabase-command
    /reference/method/MongoDBDatabase-createCollection
+   /reference/method/MongoDBDatabase-createEncryptedCollection
    /reference/method/MongoDBDatabase-drop
    /reference/method/MongoDBDatabase-dropCollection
    /reference/method/MongoDBDatabase-getDatabaseName
diff --git a/source/reference/exception-classes.txt b/source/reference/exception-classes.txt
index b5f9fb0b..20ae7067 100644
--- a/source/reference/exception-classes.txt
+++ b/source/reference/exception-classes.txt
@@ -30,6 +30,21 @@ MongoDB\\Exception\\BadMethodCallException
 
 ----
 
+MongoDB\\Exception\\CreateEncryptedCollectionException
+------------------------------------------------------
+
+.. phpclass:: MongoDB\\Exception\\CreateEncryptedCollectionException
+
+   Thrown by :phpmethod:`MongoDB\\Database::createEncryptedCollection()` if any
+   error is encountered while creating data keys or creating the collection. The
+   original exception and modified ``encryptedFields`` option can be accessed
+   via the ``getPrevious()`` and ``getEncryptedFields()`` methods, respectively.
+
+   This class extends the library's :phpclass:`RuntimeException
+   ` class.
+
+----
+
 MongoDB\\Exception\\InvalidArgumentException
 --------------------------------------------
 
diff --git a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
new file mode 100644
index 00000000..07dc082c
--- /dev/null
+++ b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
@@ -0,0 +1,144 @@
+==============================================
+MongoDB\\Database::createEncryptedCollection()
+==============================================
+
+.. versionadded:: 1.16
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+.. note::
+
+   Queryable Encryption is in public preview and available for evaluation
+   purposes. It is not yet recommended for production deployments as breaking
+   changes may be introduced. See the
+   `Queryable Encryption Preview `_
+   blog post for more information.
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Database::createEncryptedCollection()
+
+   Explicitly creates an encrypted collection.
+
+   .. code-block:: php
+
+      function createEncryptedCollection(string $collectionName, MongoDB\Driver\ClientEncryption $clientEncryption, string $kmsProvider, ?array $masterKey, array $options): array
+
+   This method will automatically create data keys for any encrypted fields
+   where ``keyId`` is ``null``. Data keys will be created using
+   :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `
+   and the provided ``$kmsProvider`` and ``$masterKey`` parameters. A copy of
+   the modified ``encryptedFields`` option will be returned in addition to the
+   result from creating the collection.
+
+   This method does not affect any auto encryption settings on existing
+   :phpclass:`MongoDB\\Client` objects. Users must configure auto encryption
+   after creating the encrypted collection with ``createEncryptedCollection()``.
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBDatabase-method-createEncryptedCollection-param.rst
+
+   The ``$options`` parameter supports the same options as
+   :phpmethod:`MongoDB\\Database::createCollection()`. The ``encryptedFields``
+   option is required.
+
+Return Values
+-------------
+
+A tuple (i.e. two-element array) containing the result document from the
+:manual:`create ` command (an array or object
+according to the ``typeMap`` option) and the modified ``encryptedFields``
+option.
+
+Errors/Exceptions
+-----------------
+
+:phpclass:`MongoDB\\Exception\\CreateEncryptedCollectionException` if any error
+is encountered creating data keys or the collection. The original exception and
+modified ``encryptedFields`` option can be accessed via the ``getPrevious()``
+and ``getEncryptedFields()`` methods, respectively.
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
+Example
+-------
+
+The following example creates an encrypted ``users`` collection in the ``test``
+database. The ``ssn`` field within the ``users`` collection will be defined as
+an encrypted string field.
+
+.. code-block:: php
+
+   createClientEncryption([
+       'keyVaultNamespace' => 'keyvault.datakeys',
+       'kmsProviders' => [
+           'local' => ['key' => new MongoDB\BSON\Binary(base64_decode(LOCAL_MASTERKEY), 0)],
+        ],
+   );
+
+   [$result, $encryptedFields] = $client->test->createEncryptedCollection(
+       'users',
+       $clientEncryption,
+       'local',
+       null,
+       [
+           'encryptedFields' => [
+               'fields' => [
+                   ['path' => 'ssn', 'bsonType' => 'string', 'keyId' => null],
+               ],
+           ],
+       ]
+   );
+
+If the encrypted collection was successfully created, ``$result`` will contain
+the response document from the ``create`` command and
+``$encryptedFields['fields'][0]['keyId']`` will contain a
+:php:`MongoDB\\BSON\\Binary ` object with subtype 4
+(i.e. UUID).
+
+The modified ``encryptedFields`` option can then be used to construct a new
+:phpclass:`MongoDB\\Client` with auto encryption enabled.
+
+.. code-block:: php
+
+    [
+               'keyVaultNamespace' => 'keyvault.datakeys',
+               'kmsProviders' => [
+                   'local' => ['key' => new MongoDB\BSON\Binary(base64_decode(LOCAL_MASTERKEY), 0)],
+                ],
+                'encryptedFieldsMap' => [
+                    'test.users' => $encryptedFields,
+                ],
+           ],
+       ]
+   );
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\\Client::createClientEncryption()`
+- :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `
+- :manual:`create ` command reference in the MongoDB
+  manual

From a72c25be05a85fae114947ef91f34f879aef0864 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= 
Date: Thu, 25 May 2023 06:06:36 +0200
Subject: [PATCH 277/321] PHPLIB-1056: Add missing types in reference doc
 (#1076)

Co-authored-by: Jeremy Mikola 
---
 source/reference/method/MongoDBCollection-count.txt             | 2 +-
 source/reference/method/MongoDBCollection-countDocuments.txt    | 2 +-
 source/reference/method/MongoDBCollection-createIndex.txt       | 2 +-
 source/reference/method/MongoDBCollection-deleteMany.txt        | 2 +-
 source/reference/method/MongoDBCollection-deleteOne.txt         | 2 +-
 source/reference/method/MongoDBCollection-distinct.txt          | 2 +-
 source/reference/method/MongoDBCollection-dropIndex.txt         | 2 +-
 source/reference/method/MongoDBCollection-find.txt              | 2 +-
 source/reference/method/MongoDBCollection-findOne.txt           | 2 +-
 source/reference/method/MongoDBCollection-findOneAndDelete.txt  | 2 +-
 source/reference/method/MongoDBCollection-findOneAndReplace.txt | 2 +-
 source/reference/method/MongoDBCollection-findOneAndUpdate.txt  | 2 +-
 source/reference/method/MongoDBCollection-insertOne.txt         | 2 +-
 source/reference/method/MongoDBCollection-mapReduce.txt         | 2 +-
 source/reference/method/MongoDBCollection-replaceOne.txt        | 2 +-
 source/reference/method/MongoDBCollection-updateMany.txt        | 2 +-
 source/reference/method/MongoDBCollection-updateOne.txt         | 2 +-
 source/reference/method/MongoDBDatabase-command.txt             | 2 +-
 source/reference/method/MongoDBDatabase-createCollection.txt    | 2 +-
 source/reference/method/MongoDBDatabase-dropCollection.txt      | 2 +-
 source/reference/method/MongoDBDatabase-modifyCollection.txt    | 2 +-
 source/reference/method/MongoDBDatabase-selectCollection.txt    | 2 +-
 source/reference/method/MongoDBDatabase__get.txt                | 2 +-
 .../method/MongoDBGridFSBucket-downloadToStreamByName.txt       | 2 +-
 source/reference/method/MongoDBGridFSBucket-find.txt            | 2 +-
 source/reference/method/MongoDBGridFSBucket-findOne.txt         | 2 +-
 .../method/MongoDBGridFSBucket-getFileDocumentForStream.txt     | 2 +-
 .../reference/method/MongoDBGridFSBucket-getFileIdForStream.txt | 2 +-
 .../reference/method/MongoDBGridFSBucket-uploadFromStream.txt   | 2 +-
 29 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 012b3cb6..1673ed91 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -21,7 +21,7 @@ Definition
 
    .. code-block:: php
 
-      function count($filter = [], array $options = []): integer
+      function count(array|object $filter = [], array $options = []): integer
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt
index 0b150361..44b16c8e 100644
--- a/source/reference/method/MongoDBCollection-countDocuments.txt
+++ b/source/reference/method/MongoDBCollection-countDocuments.txt
@@ -21,7 +21,7 @@ Definition
 
    .. code-block:: php
 
-      function countDocuments($filter = [], array $options = []): integer
+      function countDocuments(array|object $filter = [], array $options = []): integer
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index 344242e0..ceef2e7b 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function createIndex($key, array $options = []): string
+      function createIndex(array|object $key, array $options = []): string
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index a9fc24c1..29ad2e83 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function deleteMany($filter, array $options = []): MongoDB\DeleteResult
+      function deleteMany(array|object $filter, array $options = []): MongoDB\DeleteResult
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index dcfb2628..6c888a96 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -21,7 +21,7 @@ Definition
 
    .. code-block:: php
 
-      function deleteOne($filter, array $options = []): MongoDB\DeleteResult
+      function deleteOne(array|object $filter, array $options = []): MongoDB\DeleteResult
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index 7d5f7ee6..24fd6761 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function distinct(string $fieldName, $filter = [], array $options = []): mixed[]
+      function distinct(string $fieldName, array|object $filter = [], array $options = []): mixed[]
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index cefcf676..0a7fbb53 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function dropIndex($indexName, array $options = []): array|object
+      function dropIndex(string|MongoDB\Model\IndexInfo $indexName, array $options = []): array|object
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 303b7042..4fe92389 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function find($filter = [], array $options = []): MongoDB\Driver\Cursor
+      function find(array|object $filter = [], array $options = []): MongoDB\Driver\Cursor
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index 5e4c32f3..44829db3 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function findOne($filter = [], array $options = []): array|object|null
+      function findOne(array|object $filter = [], array $options = []): array|object|null
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index bdf20da9..e5531f41 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndDelete($filter = [], array $options = []): object|null
+      function findOneAndDelete(array|object $filter = [], array $options = []): object|null
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 4b29d8ad..66bd7f12 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndReplace($filter, $replacement, array $options = []): object|null
+      function findOneAndReplace(array|object $filter, array|object $replacement, array $options = []): object|null
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index 65ea436d..c903698b 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndUpdate($filter, $update, array $options = []): object|null
+      function findOneAndUpdate(array|object $filter, array|object $update, array $options = []): object|null
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index aa438050..dd6e2f22 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function insertOne($document, array $options = []): MongoDB\InsertOneResult
+      function insertOne(array|object $document, array $options = []): MongoDB\InsertOneResult
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
index dc3d3b09..a38872bd 100644
--- a/source/reference/method/MongoDBCollection-mapReduce.txt
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -24,7 +24,7 @@ Definition
 
    .. code-block:: php
 
-      function mapReduce($map, $reduce, $out, array $options = []): MongoDB\MapReduceResult
+      function mapReduce(MongoDB\BSON\JavascriptInterface $map, MongoDB\BSON\JavascriptInterface $reduce, string|array|object $out, array $options = []): MongoDB\MapReduceResult
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index 9bb3d30c..e42f993e 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -21,7 +21,7 @@ Definition
 
    .. code-block:: php
 
-      function replaceOne($filter, $replacement, array $options = []): MongoDB\UpdateResult
+      function replaceOne(array|object $filter, array|object $replacement, array $options = []): MongoDB\UpdateResult
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index c3097882..0e5f22b9 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function updateMany($filter, $update, array $options = []): MongoDB\UpdateResult
+      function updateMany(array|object $filter, array|object $update, array $options = []): MongoDB\UpdateResult
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index 5fe29405..2b930e23 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -21,7 +21,7 @@ Definition
 
    .. code-block:: php
 
-      function updateOne($filter, $update, array $options = []): MongoDB\UpdateResult
+      function updateOne(array|object $filter, array|object $update, array $options = []): MongoDB\UpdateResult
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index d442541c..6853daad 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -21,7 +21,7 @@ Definition
 
    .. code-block:: php
 
-      function command($command, array $options = []): MongoDB\Driver\Cursor
+      function command(array|object $command, array $options = []): MongoDB\Driver\Cursor
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index d640f3d1..758ad6c2 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function createCollection($collectionName, array $options = []): array|object
+      function createCollection(string $collectionName, array $options = []): array|object
 
    MongoDB creates collections implicitly when you first reference the
    collection in a command, such as when inserting a document into a new
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 2b58785a..028e63f0 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function dropCollection($collectionName, array $options = []): array|object
+      function dropCollection(string $collectionName, array $options = []): array|object
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBDatabase-modifyCollection.txt b/source/reference/method/MongoDBDatabase-modifyCollection.txt
index 8fe9245c..86c1ff52 100644
--- a/source/reference/method/MongoDBDatabase-modifyCollection.txt
+++ b/source/reference/method/MongoDBDatabase-modifyCollection.txt
@@ -22,7 +22,7 @@ Definition
 
    .. code-block:: php
 
-      function modifyCollection($collectionName, array $collectionOptions, array $options = []): array|object
+      function modifyCollection(string $collectionName, array $collectionOptions, array $options = []): array|object
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index fb17687b..14885410 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function selectCollection($collectionName, array $options = []): MongoDB\Collection
+      function selectCollection(string $collectionName, array $options = []): MongoDB\Collection
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index 280e931d..53cef6f9 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function __get($collectionName): MongoDB\Collection
+      function __get(string $collectionName): MongoDB\Collection
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index a37134a4..acc236f5 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -20,7 +20,7 @@ Definition
 
    .. code-block:: php
 
-      function downloadToStreamByName(string $filename, $destination, array $options = []): void
+      function downloadToStreamByName(string $filename, resource $destination, array $options = []): void
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index 6b3c7728..e0a4e662 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function find($filter = [], array $options = []): MongoDB\Driver\Cursor
+      function find(array|object $filter = [], array $options = []): MongoDB\Driver\Cursor
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
index a72de457..f126448d 100644
--- a/source/reference/method/MongoDBGridFSBucket-findOne.txt
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -20,7 +20,7 @@ Definition
 
    .. code-block:: php
 
-      function findOne($filter = [], array $options = []): array|object|null
+      function findOne(array|object $filter = [], array $options = []): array|object|null
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index b9dca55a..f8d633ed 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function getFileDocumentForStream($stream): array|object
+      function getFileDocumentForStream(resource $stream): array|object
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index 4e1c68b4..f88dc885 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function getFileIdForStream($stream): mixed
+      function getFileIdForStream(resource $stream): mixed
 
    This method has the following parameters:
 
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index 2487554d..18e5944b 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -19,7 +19,7 @@ Definition
 
    .. code-block:: php
 
-      function uploadFromStream(string $filename, $source, array $options = []): mixed
+      function uploadFromStream(string $filename, resource $source, array $options = []): mixed
 
    This method has the following parameters:
 

From 3dad291535637300cef91af5f70435539bd14024 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?=
 
Date: Tue, 13 Jun 2023 17:14:20 +0200
Subject: [PATCH 278/321] PHPLIB-1057: Deprecate method
 IndexInfo::isGeoHaystack() (#1085)

MongoDB 5.0 removes support for "geoHaystack" indexes, the method "IndexInfo::isGeoHaystack()" will be removed in a future release
---
 .../method/MongoDBModelIndexInfo-isGeoHaystack.txt         | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
index 97f844f1..f6c2007d 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
@@ -4,6 +4,9 @@ MongoDB\\Model\\IndexInfo::isGeoHaystack()
 
 .. versionadded:: 1.4
 
+.. deprecated:: 1.16
+   MongoDB 5.0 and later no longer supports geoHaystack indexes.
+
 .. default-domain:: mongodb
 
 .. contents:: On this page
@@ -24,10 +27,6 @@ Definition
 
       function isGeoHaystack(): boolean
 
-   .. note::
-
-      MongoDB 5.0 and later no longer supports geoHaystack indexes.
-
 Return Values
 -------------
 

From 04f41df4710cf5445dce734ef4b6181e7ccf5149 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?=
 
Date: Thu, 15 Jun 2023 09:52:57 +0200
Subject: [PATCH 279/321] PHPLIB-1149: Use consistent terminology when
 referring to the MongoDB shell in docs (#1106)

---
 source/reference/method/MongoDBDatabase-createCollection.txt | 2 +-
 source/upgrade.txt                                           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 758ad6c2..56129b97 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -26,7 +26,7 @@ Definition
    collection. You may also explicitly create a collection with specific options
    using the :phpmethod:`MongoDB\\Database::createCollection()` method, or using
    :manual:`db.createCollection() ` in
-   the :program:`mongo` shell.
+   the MongoDB shell.
 
    Explicitly creating collections enables you to create
    :manual:`capped collections `, specify
diff --git a/source/upgrade.txt b/source/upgrade.txt
index d73d57e6..50da6f2f 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -336,7 +336,7 @@ operation, has been removed in favor of explicitly using
 :phpmethod:`MongoDB\\Collection::replaceOne()` (with the ``upsert`` option).
 
 While the ``save`` method does have its uses for interactive environments, such
-as the ``mongo`` shell, it was intentionally excluded from the
+as the MongoDB shell, it was intentionally excluded from the
 `CRUD specification `_
 for language drivers. Generally, application code should know if the document
 has an identifier and be able to explicitly insert or replace the document and

From 3e60e8d02b3bab389c115bc54dc8499956199f58 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 15 Jun 2023 14:06:47 -0400
Subject: [PATCH 280/321] PHPLIB-1130: Remove preview notice for CSFLE
 Queryable Encryption (#1108)

---
 ...MongoDBDatabase-method-createCollection-option.yaml | 10 +---------
 source/includes/apiargs-dropCollection-option.yaml     |  8 --------
 .../MongoDBDatabase-createEncryptedCollection.txt      |  8 --------
 source/tutorial/client-side-encryption.txt             |  6 +-----
 4 files changed, 2 insertions(+), 30 deletions(-)

diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
index f40cbf94..ceb7dd07 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
@@ -86,17 +86,9 @@ description: |
   `Field Encryption and Queryability `_
   in the MongoDB manual for more information.
 
-  This option is available in MongoDB 6.0+ and will result in an exception at
+  This option is available in MongoDB 7.0+ and will result in an exception at
   execution time if specified for an older server version.
 
-  .. note::
-
-     Queryable Encryption is in public preview and available for evaluation
-     purposes. It is not yet recommended for production deployments as breaking
-     changes may be introduced. See the
-     `Queryable Encryption Preview `_
-     blog post for more information.
-
   .. versionadded:: 1.13
 interface: phpmethod
 operation: ~
diff --git a/source/includes/apiargs-dropCollection-option.yaml b/source/includes/apiargs-dropCollection-option.yaml
index 46ad6607..158c4a43 100644
--- a/source/includes/apiargs-dropCollection-option.yaml
+++ b/source/includes/apiargs-dropCollection-option.yaml
@@ -15,14 +15,6 @@ description: |
      This option is not passed to the :manual:`drop `
      command. The library uses it to determine related metadata collections that
      should be dropped in addition to an encrypted collection.
-
-  .. note::
-
-     Queryable Encryption is in public preview and available for evaluation
-     purposes. It is not yet recommended for production deployments as breaking
-     changes may be introduced. See the
-     `Queryable Encryption Preview `_
-     blog post for more information.
 interface: phpmethod
 operation: ~
 optional: true
diff --git a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
index 07dc082c..64c643f0 100644
--- a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
@@ -12,14 +12,6 @@ MongoDB\\Database::createEncryptedCollection()
    :depth: 1
    :class: singlecol
 
-.. note::
-
-   Queryable Encryption is in public preview and available for evaluation
-   purposes. It is not yet recommended for production deployments as breaking
-   changes may be introduced. See the
-   `Queryable Encryption Preview `_
-   blog post for more information.
-
 Definition
 ----------
 
diff --git a/source/tutorial/client-side-encryption.txt b/source/tutorial/client-side-encryption.txt
index bbb8196d..efff2e7d 100644
--- a/source/tutorial/client-side-encryption.txt
+++ b/source/tutorial/client-side-encryption.txt
@@ -285,11 +285,7 @@ Automatic Queryable Encryption
 .. note::
 
    Automatic queryable encryption is an enterprise only feature and requires
-   MongoDB 6.0+. Queryable Encryption is in public preview and available for
-   evaluation purposes. It is not yet recommended for production deployments as
-   breaking changes may be introduced. See the
-   `Queryable Encryption Preview `_
-   blog post for more information.
+   MongoDB 7.0+.
 
 The following example uses a local key; however, other key providers such as AWS
 are also an option. The data in the ``encryptedIndexed`` and

From 30e8378905f7222f71e50e4622537d9490784d27 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 30 Jun 2023 11:50:47 -0400
Subject: [PATCH 281/321] PHPLIB-1174: Rely on Binary constructor default type
 (#1121)

Update psalm-baseline.xml to suppress the TooFewArguments error since Psalm is not aware of the Binary constructor's default type.
---
 source/tutorial/client-side-encryption.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/source/tutorial/client-side-encryption.txt b/source/tutorial/client-side-encryption.txt
index efff2e7d..a8c02699 100644
--- a/source/tutorial/client-side-encryption.txt
+++ b/source/tutorial/client-side-encryption.txt
@@ -39,7 +39,7 @@ more than one encryption key or create them dynamically.
    use MongoDB\Client;
    use MongoDB\Driver\ClientEncryption;
 
-   $localKey = new Binary('', Binary::TYPE_GENERIC);
+   $localKey = new Binary('');
 
    $clientEncryptionOpts = [
        'keyVaultNamespace' => 'encryption.__keyVault',
@@ -78,7 +78,7 @@ side.
    use MongoDB\Client;
    use MongoDB\Driver\ClientEncryption;
 
-   $localKey = new Binary('', Binary::TYPE_GENERIC);
+   $localKey = new Binary('');
    $encryptionOpts = [
        'keyVaultNamespace' => 'encryption.__keyVault',
        'kmsProviders' => [
@@ -142,7 +142,7 @@ encrypted fields.
    use MongoDB\Client;
    use MongoDB\Driver\ClientEncryption;
 
-   $localKey = new Binary('', Binary::TYPE_GENERIC);
+   $localKey = new Binary('');
 
    $client = new Client();
 
@@ -197,7 +197,7 @@ encrypts and decrypts values in the document.
    use MongoDB\Client;
    use MongoDB\Driver\ClientEncryption;
 
-   $localKey = new Binary('', Binary::TYPE_GENERIC);
+   $localKey = new Binary('');
 
    $clientEncryptionOpts = [
        'keyVaultNamespace' => 'encryption.__keyVault',
@@ -250,7 +250,7 @@ To use an alternate name when referencing an encryption key, use the
    use MongoDB\Client;
    use MongoDB\Driver\ClientEncryption;
 
-   $localKey = new Binary('', Binary::TYPE_GENERIC);
+   $localKey = new Binary('');
 
    $clientEncryptionOpts = [
        'keyVaultNamespace' => 'encryption.__keyVault',
@@ -300,7 +300,7 @@ query on the ``encryptedIndexed`` field.
    use MongoDB\BSON\Binary;
    use MongoDB\Client;
 
-   $localKey = new Binary('', Binary::TYPE_GENERIC);
+   $localKey = new Binary('');
 
    $encryptionOpts = [
        'keyVaultNamespace' => 'encryption.__keyVault',

From ffb89462bf02eeb76dc1b5c90daf32a927275e8b Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 10 Jul 2023 19:27:32 -0400
Subject: [PATCH 282/321] PHPLIB-1176: Various improvements for In-Use
 Encryption tutorial (#1122)

Adds additional non-enterprise examples from the PyMongo tutorial: "Explicit Encryption with Automatic Decryption" and "Explicit Queryable Encryption".

Examples are now broken out into separate files, which are tested in ExamplesTest.

Renames "Client-Side Encryption" to "In-Use Encryption" (PHPLIB-997). This will warrant adding a redirect from "/tutorial/client-side-encryption/" to "/tutorial/encryption/" in the related docs-php-library project (DOCSP-31241).

Adds docs for crypt_shared and mongocryptd (PHPLIB-985).

Demonstrates schema validation errors in example scripts, and clarify that local schemas should be used in conjunction with server-side schemas (not instead of).

Create key vault index in key management scripts and remove setup code elsewhere. This replaces the setup code with a top-of-script comment to avoid repetition. ExamplesTest now prepares the cleans up the necessary collections.

Add a documentation note about creating the partial, unique index on keyAltNames.
---
 source/examples/create_data_key.php           |  46 +++
 ...sfle-automatic_encryption-local_schema.php |  87 +++++
 ...utomatic_encryption-server_side_schema.php |  79 ++++
 source/examples/csfle-explicit_encryption.php |  49 +++
 ...plicit_encryption_automatic_decryption.php |  52 +++
 source/examples/key_alt_name.php              |  52 +++
 .../queryable_encryption-automatic.php        |  79 ++++
 .../queryable_encryption-explicit.php         |  94 +++++
 source/tutorial.txt                           |   2 +-
 source/tutorial/client-side-encryption.txt    | 368 ------------------
 source/tutorial/encryption.txt                | 274 +++++++++++++
 11 files changed, 813 insertions(+), 369 deletions(-)
 create mode 100644 source/examples/create_data_key.php
 create mode 100644 source/examples/csfle-automatic_encryption-local_schema.php
 create mode 100644 source/examples/csfle-automatic_encryption-server_side_schema.php
 create mode 100644 source/examples/csfle-explicit_encryption.php
 create mode 100644 source/examples/csfle-explicit_encryption_automatic_decryption.php
 create mode 100644 source/examples/key_alt_name.php
 create mode 100644 source/examples/queryable_encryption-automatic.php
 create mode 100644 source/examples/queryable_encryption-explicit.php
 delete mode 100644 source/tutorial/client-side-encryption.txt
 create mode 100644 source/tutorial/encryption.txt

diff --git a/source/examples/create_data_key.php b/source/examples/create_data_key.php
new file mode 100644
index 00000000..dbb89bf1
--- /dev/null
+++ b/source/examples/create_data_key.php
@@ -0,0 +1,46 @@
+selectCollection('encryption', '__keyVault')->drop();
+$client->selectCollection('encryption', '__keyVault')->createIndex(['keyAltNames' => 1], [
+    'unique' => true,
+    'partialFilterExpression' => ['keyAltNames' => ['$exists' => true]],
+]);
+
+// Create a ClientEncryption object to manage data encryption keys
+$clientEncryption = $client->createClientEncryption([
+    'keyVaultNamespace' => 'encryption.__keyVault',
+    'kmsProviders' => [
+        'local' => ['key' => $localKey],
+    ],
+]);
+
+/* Create a data encryption key. To store the key ID for later use, you can use
+ * serialize(), var_export(), etc. */
+$keyId = $clientEncryption->createDataKey('local');
+
+print_r($keyId);
+
+// Encrypt a value using the key that was just created
+$encryptedValue = $clientEncryption->encrypt('mySecret', [
+    'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC,
+    'keyId' => $keyId,
+]);
+
+print_r($encryptedValue);
diff --git a/source/examples/csfle-automatic_encryption-local_schema.php b/source/examples/csfle-automatic_encryption-local_schema.php
new file mode 100644
index 00000000..249d341b
--- /dev/null
+++ b/source/examples/csfle-automatic_encryption-local_schema.php
@@ -0,0 +1,87 @@
+createClientEncryption([
+    'keyVaultNamespace' => 'encryption.__keyVault',
+    'kmsProviders' => [
+        'local' => ['key' => $localKey],
+    ],
+]);
+
+/* Create a data encryption key. Alternatively, this key ID could be read from a
+ * configuration file. */
+$keyId = $clientEncryption->createDataKey('local');
+
+/* Define a JSON schema for the encrypted collection. Since this only utilizes
+ * encryption schema syntax, it can be used for both the server-side and local
+ * schema. */
+$schema = [
+    'bsonType' => 'object',
+    'properties' => [
+        'encryptedField' => [
+            'encrypt' => [
+                'keyId' => [$keyId],
+                'bsonType' => 'string',
+                'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC,
+            ],
+        ],
+    ],
+];
+
+/* Create another client with automatic encryption enabled. Configure a local
+ * schema for the encrypted collection using the "schemaMap" option. */
+$encryptedClient = new Client($uri, [], [
+    'autoEncryption' => [
+        'keyVaultNamespace' => 'encryption.__keyVault',
+        'kmsProviders' => ['local' => ['key' => $localKey]],
+        'schemaMap' => ['test.coll' => $schema],
+    ],
+]);
+
+/* Create a new collection for this script. Configure a server-side schema by
+ * explicitly creating the collection with a "validator" option.
+ *
+ * Note: without a server-side schema, another client could potentially insert
+ * unencrypted data into the collection. Therefore, a local schema should always
+ * be used in conjunction with a server-side schema. */
+$encryptedClient->selectDatabase('test')->createCollection('coll', ['validator' => ['$jsonSchema' => $schema]]);
+$encryptedCollection = $encryptedClient->selectCollection('test', 'coll');
+
+/* Using the encrypted client, insert and find a document to demonstrate that
+ * the encrypted field is automatically encrypted and decrypted. */
+$encryptedCollection->insertOne(['_id' => 1, 'encryptedField' => 'mySecret']);
+
+print_r($encryptedCollection->findOne(['_id' => 1]));
+
+/* Using the client configured without encryption, find the same document and
+ * observe that the field is not automatically decrypted. */
+$unencryptedCollection = $client->selectCollection('test', 'coll');
+
+print_r($unencryptedCollection->findOne(['_id' => 1]));
+
+/* Attempt to insert another document with an unencrypted field value to
+ * demonstrate that the server-side schema is enforced. */
+try {
+    $unencryptedCollection->insertOne(['_id' => 2, 'encryptedField' => 'myOtherSecret']);
+} catch (ServerException $e) {
+    printf("Error inserting document: %s\n", $e->getMessage());
+}
diff --git a/source/examples/csfle-automatic_encryption-server_side_schema.php b/source/examples/csfle-automatic_encryption-server_side_schema.php
new file mode 100644
index 00000000..a42ed6fb
--- /dev/null
+++ b/source/examples/csfle-automatic_encryption-server_side_schema.php
@@ -0,0 +1,79 @@
+createClientEncryption([
+    'keyVaultNamespace' => 'encryption.__keyVault',
+    'kmsProviders' => [
+        'local' => ['key' => $localKey],
+    ],
+]);
+
+/* Create a data encryption key. Alternatively, this key ID could be read from a
+ * configuration file. */
+$keyId = $clientEncryption->createDataKey('local');
+
+// Create another client with automatic encryption enabled
+$encryptedClient = new Client($uri, [], [
+    'autoEncryption' => [
+        'keyVaultNamespace' => 'encryption.__keyVault',
+        'kmsProviders' => ['local' => ['key' => $localKey]],
+    ],
+]);
+
+// Define a JSON schema for the encrypted collection
+$schema = [
+    'bsonType' => 'object',
+    'properties' => [
+        'encryptedField' => [
+            'encrypt' => [
+                'keyId' => [$keyId],
+                'bsonType' => 'string',
+                'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC,
+            ],
+        ],
+    ],
+];
+
+/* Create a new collection for this script. Configure a server-side schema by
+ * explicitly creating the collection with a "validator" option. */
+$encryptedClient->selectDatabase('test')->createCollection('coll', ['validator' => ['$jsonSchema' => $schema]]);
+$encryptedCollection = $encryptedClient->selectCollection('test', 'coll');
+
+/* Using the encrypted client, insert and find a document to demonstrate that
+ * the encrypted field is automatically encrypted and decrypted. */
+$encryptedCollection->insertOne(['_id' => 1, 'encryptedField' => 'mySecret']);
+
+print_r($encryptedCollection->findOne(['_id' => 1]));
+
+/* Using the client configured without encryption, find the same document and
+ * observe that the field is not automatically decrypted. */
+$unencryptedCollection = $client->selectCollection('test', 'coll');
+
+print_r($unencryptedCollection->findOne(['_id' => 1]));
+
+/* Attempt to insert another document with an unencrypted field value to
+ * demonstrate that the server-side schema is enforced. */
+try {
+    $unencryptedCollection->insertOne(['_id' => 2, 'encryptedField' => 'myOtherSecret']);
+} catch (ServerException $e) {
+    printf("Error inserting document: %s\n", $e->getMessage());
+}
diff --git a/source/examples/csfle-explicit_encryption.php b/source/examples/csfle-explicit_encryption.php
new file mode 100644
index 00000000..ce5ccf15
--- /dev/null
+++ b/source/examples/csfle-explicit_encryption.php
@@ -0,0 +1,49 @@
+createClientEncryption([
+    'keyVaultNamespace' => 'encryption.__keyVault',
+    'kmsProviders' => [
+        'local' => ['key' => $localKey],
+    ],
+]);
+
+/* Create a data encryption key. Alternatively, this key ID could be read from a
+ * configuration file. */
+$keyId = $clientEncryption->createDataKey('local');
+
+// Insert a document with a manually encrypted field
+$encryptedValue = $clientEncryption->encrypt('mySecret', [
+    'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC,
+    'keyId' => $keyId,
+]);
+
+$collection = $client->selectCollection('test', 'coll');
+$collection->insertOne(['_id' => 1, 'encryptedField' => $encryptedValue]);
+
+/* Using the client configured without encryption, find the document and observe
+ * that the field is not automatically decrypted. */
+$document = $collection->findOne();
+
+print_r($document);
+
+// Manually decrypt the field
+printf("Decrypted: %s\n", $clientEncryption->decrypt($document->encryptedField));
diff --git a/source/examples/csfle-explicit_encryption_automatic_decryption.php b/source/examples/csfle-explicit_encryption_automatic_decryption.php
new file mode 100644
index 00000000..4b98f95a
--- /dev/null
+++ b/source/examples/csfle-explicit_encryption_automatic_decryption.php
@@ -0,0 +1,52 @@
+ [
+        'keyVaultNamespace' => 'encryption.__keyVault',
+        'kmsProviders' => ['local' => ['key' => $localKey]],
+        'bypassAutoEncryption' => true,
+    ],
+]);
+
+// Create a ClientEncryption object to manage data encryption keys
+$clientEncryption = $client->createClientEncryption([
+    'keyVaultNamespace' => 'encryption.__keyVault',
+    'kmsProviders' => [
+        'local' => ['key' => $localKey],
+    ],
+]);
+
+/* Create a data encryption key. Alternatively, this key ID could be read from a
+ * configuration file. */
+$keyId = $clientEncryption->createDataKey('local');
+
+// Insert a document with a manually encrypted field
+$encryptedValue = $clientEncryption->encrypt('mySecret', [
+    'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC,
+    'keyId' => $keyId,
+]);
+
+$collection = $client->selectCollection('test', 'coll');
+$collection->insertOne(['_id' => 1, 'encryptedField' => $encryptedValue]);
+
+/* Using the client configured with encryption (but not automatic encryption),
+ * find the document and observe that the field is automatically decrypted. */
+$document = $collection->findOne();
+
+print_r($document);
diff --git a/source/examples/key_alt_name.php b/source/examples/key_alt_name.php
new file mode 100644
index 00000000..ea04cc20
--- /dev/null
+++ b/source/examples/key_alt_name.php
@@ -0,0 +1,52 @@
+selectCollection('encryption', '__keyVault')->drop();
+$client->selectCollection('encryption', '__keyVault')->createIndex(['keyAltNames' => 1], [
+    'unique' => true,
+    'partialFilterExpression' => ['keyAltNames' => ['$exists' => true]],
+]);
+
+// Create a ClientEncryption object to manage data encryption keys
+$clientEncryption = $client->createClientEncryption([
+    'keyVaultNamespace' => 'encryption.__keyVault',
+    'kmsProviders' => [
+        'local' => ['key' => $localKey],
+    ],
+]);
+
+// Create a data encryption key with an alternate name
+$clientEncryption->createDataKey('local', ['keyAltNames' => ['myDataKey']]);
+
+/* Attempt to create a second key with the same name to demonstrate that the
+ * unique index is enforced. */
+try {
+    $clientEncryption->createDataKey('local', ['keyAltNames' => ['myDataKey']]);
+} catch (ServerException $e) {
+    printf("Error creating key: %s\n", $e->getMessage());
+}
+
+// Encrypt a value, using the "keyAltName" option instead of "keyId"
+$encryptedValue = $clientEncryption->encrypt('mySecret', [
+    'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC,
+    'keyAltName' => 'myDataKey',
+]);
+
+print_r($encryptedValue);
diff --git a/source/examples/queryable_encryption-automatic.php b/source/examples/queryable_encryption-automatic.php
new file mode 100644
index 00000000..80bb770b
--- /dev/null
+++ b/source/examples/queryable_encryption-automatic.php
@@ -0,0 +1,79 @@
+createClientEncryption([
+    'keyVaultNamespace' => 'encryption.__keyVault',
+    'kmsProviders' => ['local' => ['key' => $localKey]],
+]);
+
+/* Create the data encryption keys for this script. Alternatively, the key IDs
+ * could be read from a configuration file. */
+$keyId1 = $clientEncryption->createDataKey('local');
+$keyId2 = $clientEncryption->createDataKey('local');
+
+/* Create another client with automatic encryption enabled. Configure the
+ * encrypted collection using the "encryptedFields" option. */
+$encryptedClient = new Client($uri, [], [
+    'autoEncryption' => [
+        'keyVaultNamespace' => 'encryption.__keyVault',
+        'kmsProviders' => ['local' => ['key' => $localKey]],
+        'encryptedFieldsMap' => [
+            'test.coll' => [
+                'fields' => [
+                    [
+                        'path' => 'encryptedIndexed',
+                        'bsonType' => 'string',
+                        'keyId' => $keyId1,
+                        'queries' => ['queryType' => ClientEncryption::QUERY_TYPE_EQUALITY],
+                    ],
+                    [
+                        'path' => 'encryptedUnindexed',
+                        'bsonType' => 'string',
+                        'keyId' => $keyId2,
+                    ],
+                ],
+            ],
+        ],
+    ],
+]);
+
+/* Create the data collection for this script. The create and drop helpers will
+ * infer encryptedFields from the client configuration and manage internal
+ * encryption collections automatically. Alternatively, the "encryptedFields"
+ * option can also be passed explicitly. */
+$encryptedClient->selectDatabase('test')->createCollection('coll');
+$encryptedCollection = $encryptedClient->selectCollection('test', 'coll');
+
+/* Using the encrypted client, insert a document and find it by querying on the
+ * encrypted field. Fields will be automatically encrypted and decrypted. */
+$encryptedCollection->insertOne([
+    '_id' => 1,
+    'encryptedIndexed' => 'indexedValue',
+    'encryptedUnindexed' => 'unindexedValue',
+]);
+
+print_r($encryptedCollection->findOne(['encryptedIndexed' => 'indexedValue']));
+
+/* Using the client configured without encryption, find the same document and
+ * observe that fields are not automatically decrypted. */
+$unencryptedCollection = $client->selectCollection('test', 'coll');
+
+print_r($unencryptedCollection->findOne(['_id' => 1]));
diff --git a/source/examples/queryable_encryption-explicit.php b/source/examples/queryable_encryption-explicit.php
new file mode 100644
index 00000000..67855964
--- /dev/null
+++ b/source/examples/queryable_encryption-explicit.php
@@ -0,0 +1,94 @@
+createClientEncryption([
+    'keyVaultNamespace' => 'encryption.__keyVault',
+    'kmsProviders' => ['local' => ['key' => $localKey]],
+]);
+
+/* Create the data encryption keys. Alternatively, the key IDs could be read
+ * from a configuration file. */
+$keyId1 = $clientEncryption->createDataKey('local');
+$keyId2 = $clientEncryption->createDataKey('local');
+
+// Create another client with automatic encryption disabled
+$encryptedClient = new Client($uri, [], [
+    'autoEncryption' => [
+        'keyVaultNamespace' => 'encryption.__keyVault',
+        'kmsProviders' => ['local' => ['key' => $localKey]],
+        'bypassQueryAnalysis' => true,
+    ],
+]);
+
+// Define encrypted fields for the collection
+$encryptedFields = [
+    'fields' => [
+        [
+            'path' => 'encryptedIndexed',
+            'bsonType' => 'string',
+            'keyId' => $keyId1,
+            'queries' => ['queryType' => ClientEncryption::QUERY_TYPE_EQUALITY],
+        ],
+        [
+            'path' => 'encryptedUnindexed',
+            'bsonType' => 'string',
+            'keyId' => $keyId2,
+        ],
+    ],
+];
+
+/* Create the data collection for this script. Specify the "encryptedFields"
+ * option to ensure that internal encryption collections are also created. The
+ * "encryptedFields" option should also be specified when dropping the
+ * collection to ensure that internal encryption collections are dropped. */
+$encryptedClient->selectDatabase('test')->createCollection('coll', ['encryptedFields' => $encryptedFields]);
+$encryptedCollection = $encryptedClient->selectCollection('test', 'coll');
+
+// Insert a document with manually encrypted fields
+$indexedInsertPayload = $clientEncryption->encrypt('indexedValue', [
+    'algorithm' => ClientEncryption::ALGORITHM_INDEXED,
+    'contentionFactor' => 1,
+    'keyId' => $keyId1,
+]);
+
+$unindexedInsertPayload = $clientEncryption->encrypt('unindexedValue', [
+    'algorithm' => ClientEncryption::ALGORITHM_UNINDEXED,
+    'keyId' => $keyId2,
+]);
+
+$encryptedCollection->insertOne([
+    '_id' => 1,
+    'encryptedIndexed' => $indexedInsertPayload,
+    'encryptedUnindexed' => $unindexedInsertPayload,
+]);
+
+/* Encrypt the payload for an "equality" query using the same key that was used
+ * to encrypt the corresponding insert payload. */
+$indexedFindPayload = $clientEncryption->encrypt('indexedValue', [
+    'algorithm' => ClientEncryption::ALGORITHM_INDEXED,
+    'queryType' => ClientEncryption::QUERY_TYPE_EQUALITY,
+    'contentionFactor' => 1,
+    'keyId' => $keyId1,
+]);
+
+/* Using the client configured with encryption (but not automatic encryption),
+ * find the document and observe that the fields are automatically decrypted. */
+print_r($encryptedCollection->findOne(['encryptedIndexed' => $indexedFindPayload]));
diff --git a/source/tutorial.txt b/source/tutorial.txt
index 91333fb4..bfb44b84 100644
--- a/source/tutorial.txt
+++ b/source/tutorial.txt
@@ -12,7 +12,7 @@ Tutorials
    /tutorial/commands
    /tutorial/custom-types
    /tutorial/decimal128
-   /tutorial/client-side-encryption
+   /tutorial/encryption
    /tutorial/gridfs
    /tutorial/indexes
    /tutorial/tailable-cursor
diff --git a/source/tutorial/client-side-encryption.txt b/source/tutorial/client-side-encryption.txt
deleted file mode 100644
index a8c02699..00000000
--- a/source/tutorial/client-side-encryption.txt
+++ /dev/null
@@ -1,368 +0,0 @@
-======================
-Client-Side Encryption
-======================
-
-.. default-domain:: mongodb
-
-.. contents:: On this page
-   :local:
-   :backlinks: none
-   :depth: 1
-   :class: singlecol
-
-Client-Side Field Level Encryption allows administrators and developers to
-encrypt specific data fields in addition to other MongoDB encryption features.
-
-
-Creating an Encryption Key
---------------------------
-
-.. note::
-
-   The following examples use a local master key; however, other key providers
-   such as AWS KMS are also an option. This master key is used to encrypt data
-   keys that are stored locally. It is important that you keep this key secure.
-
-To create an encryption key, create a :php:`MongoDB\\Driver\\ClientEncryption `
-instance with encryption options and create a new data key. The method will
-return the key ID which can be used to reference the key later. You can also
-pass multiple alternate names for this key and reference the key by these names
-instead of the key ID. Creating a new data encryption key would typically be
-done on initial deployment, but depending on your use case you may want to use
-more than one encryption key or create them dynamically.
-
-.. code-block:: php
-
-   ');
-
-   $clientEncryptionOpts = [
-       'keyVaultNamespace' => 'encryption.__keyVault',
-       'kmsProviders' => [
-           'local' => ['key' => $localKey],
-       ],
-   ];
-
-   $client = new Client();
-   $clientEncryption = $client->createClientEncryption($clientEncryptionOpts);
-
-   // Create an encryption key with an alternate name
-   // To store the key ID for later use, you can use serialize or var_export
-   $keyId = $clientEncryption->createDataKey('local', ['keyAltNames' => ['my-encryption-key']]);
-
-.. seealso:: :manual:`Encryption Key Management ` in the MongoDB manual
-
-
-Automatic Encryption and Decryption
------------------------------------
-
-.. note::
-
-   Auto encryption is an enterprise only feature.
-
-The following example sets up a collection with automatic encryption based on a
-``$jsonSchema`` validator. The data in the ``encryptedField`` field is
-automatically encrypted on insertion and decrypted when reading on the client
-side.
-
-.. code-block:: php
-
-   ');
-   $encryptionOpts = [
-       'keyVaultNamespace' => 'encryption.__keyVault',
-       'kmsProviders' => [
-           'local' => ['key' => $localKey],
-       ],
-   ];
-
-   $client = new Client();
-
-   $database = $client->selectDatabase('test');
-   $database->dropCollection('coll'); // remove old data
-
-   // This uses the key ID from the first example. The key ID could be read from
-   // a configuration file.
-   $keyId = readDataKey();
-
-   $database->createCollection('coll', [
-       'validator' => [
-           '$jsonSchema' => [
-               'bsonType' => 'object',
-               'properties' => [
-                   'encryptedField' => [
-                       'encrypt' => [
-                           'keyId' => [$keyId],
-                           'bsonType' => 'string',
-                           'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC,
-                       ],
-                   ],
-               ],
-           ],
-       ],
-   ]);
-
-   $encryptedClient = new Client('mongodb://127.0.0.1', [], ['autoEncryption' => $encryptionOpts]);
-
-   $collection = $encryptedClient->selectCollection('test', 'coll');
-
-   $collection->insertOne(['encryptedField' => '123456789']);
-
-   var_dump($collection->findOne([]));
-
-
-Specifying an Explicit Schema for Encryption
---------------------------------------------
-
-The following example uses the ``schemaMap`` encryption option to define
-encrypted fields.
-
-.. note::
-
-   Supplying a ``schemaMap`` provides more security than relying on JSON schemas
-   obtained from the server. It protects against a malicious server advertising
-   a false JSON schema, which could trick the client into sending unencrypted
-   data that should be encrypted.
-
-.. code-block:: php
-
-   ');
-
-   $client = new Client();
-
-   // This uses the key ID from the first example. The key ID could be read from
-   // a configuration file.
-   $keyId = readDataKey();
-
-   $autoEncryptionOpts = [
-       'keyVaultNamespace' => 'encryption.__keyVault',
-       'kmsProviders' => [
-           'local' => ['key' => $localKey],
-       ],
-       'schemaMap' => [
-           'test.coll' => [
-               'bsonType' => 'object',
-               'properties' => [
-                   'encryptedField' => [
-                       'encrypt' => [
-                           'keyId' => [$keyId],
-                           'bsonType' => 'string',
-                           'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC,
-                       ],
-                   ],
-               ],
-           ],
-       ],
-   ];
-
-   $encryptedClient = new Client(null, [], ['autoEncryption' => $autoEncryptionOpts]);
-
-   $collection = $encryptedClient->selectCollection('test', 'coll');
-   $collection->drop(); // clear old data
-
-   $collection->insertOne(['encryptedField' => '123456789']);
-
-   var_dump($collection->findOne([]));
-
-
-Manually Encrypting and Decrypting Values
------------------------------------------
-
-In the MongoDB Community Edition, you will have to manually encrypt values
-before storing them in the database. The following example assumes that you have
-already created an encryption key in the key vault collection and explicitly
-encrypts and decrypts values in the document.
-
-.. code-block:: php
-
-   ');
-
-   $clientEncryptionOpts = [
-       'keyVaultNamespace' => 'encryption.__keyVault',
-       'kmsProviders' => [
-           'local' => ['key' => $localKey],
-       ],
-   ];
-
-   $client = new Client();
-   $clientEncryption = $client->createClientEncryption($clientEncryptionOpts);
-
-   // This uses the key ID from the first example. The key ID could be read from
-   // a configuration file.
-   $keyId = readDataKey();
-
-   $collection = $client->selectCollection('test', 'coll');
-   $collection->drop(); // clear old data
-
-   $encryptionOpts = [
-       'keyId' => $keyId,
-       'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC,
-   ];
-   $encryptedValue = $clientEncryption->encrypt('123456789', $encryptionOpts);
-
-   $collection->insertOne(['encryptedField' => $encryptedValue]);
-
-   $document = $collection->findOne();
-   var_dump($clientEncryption->decrypt($document->encryptedField));
-
-
-Referencing Encryption Keys by an Alternative Name
---------------------------------------------------
-
-While it is possible to create an encryption key every time data is encrypted,
-this is not the recommended approach. Instead, you should create your encryption
-keys depending on your use case, e.g. by creating a user-specific encryption
-key. To reference keys in your software, you can use the keyAltName attribute
-specified when creating the key. The following example creates an encryption key
-with an alternative name, which could be done when deploying the application.
-The software then encrypts data by referencing the key by its alternative name.
-
-To use an alternate name when referencing an encryption key, use the
-``keyAltName`` option instead of ``keyId``.
-
-.. code-block:: php
-
-   ');
-
-   $clientEncryptionOpts = [
-       'keyVaultNamespace' => 'encryption.__keyVault',
-       'kmsProviders' => [
-           'local' => ['key' => $localKey],
-       ],
-   ];
-
-   $client = new Client();
-   $clientEncryption = $client->createClientEncryption($clientEncryptionOpts);
-
-   $collection = $client->selectCollection('test', 'coll');
-   $collection->drop(); // clear old data
-
-   // Reference the encryption key created in the first example by its
-   // alternative name
-   $encryptionOpts = [
-       'keyAltName' => 'my-encryption-key',
-       'algorithm' => ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC,
-   ];
-   $encryptedValue = $clientEncryption->encrypt('123456789', $encryptionOpts);
-
-   $collection->insertOne(['encryptedField' => $encryptedValue]);
-
-   $document = $collection->findOne();
-   var_dump($clientEncryption->decrypt($document->encryptedField));
-
-
-Automatic Queryable Encryption
-------------------------------
-
-.. note::
-
-   Automatic queryable encryption is an enterprise only feature and requires
-   MongoDB 7.0+.
-
-The following example uses a local key; however, other key providers such as AWS
-are also an option. The data in the ``encryptedIndexed`` and
-``encryptedUnindexed`` fields will be automatically encrypted on insertion and
-decrypted when querying on the client side. Additionally, it is possible to
-query on the ``encryptedIndexed`` field.
-
-.. code-block:: php
-
-   ');
-
-   $encryptionOpts = [
-       'keyVaultNamespace' => 'encryption.__keyVault',
-       'kmsProviders' => ['local' => ['key' => $localKey]],
-   ];
-
-   $client = new Client();
-   $clientEncryption = $client->createClientEncryption($encryptionOpts);
-
-   // Create two data keys, one for each encrypted field
-   $dataKeyId1 = $clientEncryption->createDataKey('local');
-   $dataKeyId2 = $clientEncryption->createDataKey('local');
-
-   $autoEncryptionOpts = [
-       'keyVaultNamespace' => 'encryption.__keyVault',
-       'kmsProviders' => ['local' => ['key' => $localKey]],
-       'encryptedFieldsMap' => [
-           'test.coll' => [
-               'fields' => [
-                   [
-                       'path' => 'encryptedIndexed',
-                       'bsonType' => 'string',
-                       'keyId' => $dataKeyId1,
-                       'queries' => ['queryType' => 'equality'],
-                   ],
-                   [
-                       'path' => 'encryptedUnindexed',
-                       'bsonType' => 'string',
-                       'keyId' => $dataKeyId2,
-                   ],
-               ],
-           ],
-       ],
-   ];
-
-   $encryptedClient = new Client(null, [], ['autoEncryption' => $autoEncryptionOpts]);
-
-   /* Drop and create the collection under test. The createCollection() helper
-    * will reference the client's encryptedFieldsMap and create additional,
-    * internal collections automatically. */
-   $encryptedClient->selectDatabase('test')->dropCollection('coll');
-   $encryptedClient->selectDatabase('test')->createCollection('coll');
-   $encryptedCollection = $encryptedClient->selectCollection('test', 'coll');
-
-   /* Using a client with auto encryption, insert a document with encrypted
-    * fields and assert that those fields are automatically decrypted when
-    * querying. The encryptedIndexed and encryptedUnindexed fields should both
-    * be strings. */
-   $indexedValue = 'indexedValue';
-   $unindexedValue = 'unindexedValue';
-
-   $encryptedCollection->insertOne([
-       '_id' => 1,
-       'encryptedIndexed' => $indexedValue,
-       'encryptedUnindexed' => $unindexedValue,
-   ]);
-
-   var_dump($encryptedCollection->findOne(['encryptedIndexed' => $indexedValue]));
-
-   /* Using a client without auto encryption, query for the same document and
-    * assert that encrypted data is returned. The encryptedIndexed and
-    * encryptedUnindexed fields should both be Binary objects. */
-   $unencryptedCollection = $client->selectCollection('test', 'coll');
-
-   var_dump($unencryptedCollection->findOne(['_id' => 1]));
diff --git a/source/tutorial/encryption.txt b/source/tutorial/encryption.txt
new file mode 100644
index 00000000..2773eab8
--- /dev/null
+++ b/source/tutorial/encryption.txt
@@ -0,0 +1,274 @@
+=================
+In-Use Encryption
+=================
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 3
+   :class: singlecol
+
+
+Dependencies
+------------
+
+To get started using in-use encryption in your project, the
+`PHP driver `_ (i.e. ``mongodb`` extension) will need
+to be compiled with `libmongocrypt `_
+(enabled by default).
+
+Additionally, either `crypt_shared`_ or `mongocryptd`_ are required in order to
+use *automatic* client-side encryption. Neither is required for *explicit*
+encryption.
+
+
+crypt_shared
+~~~~~~~~~~~~
+
+The :manual:`Automatic Encryption Shared Library `
+(crypt_shared) provides the same functionality as mongocryptd_, but does not
+require you to spawn another process to perform automatic encryption.
+
+By default, the PHP driver attempts to load crypt_shared from the system path(s)
+and uses it automatically if found. To load crypt_shared from another location,
+use the ``cryptSharedLibPath`` auto encryption
+:php:`driver option `
+when constructing a client. If the driver cannot load crypt_shared it will
+attempt to fallback to using mongocryptd by default. The
+``cryptSharedLibRequired`` option may be used to always require crypt_shared and
+fail if it cannot be loaded.
+
+For detailed installation instructions see the MongoDB documentation for the
+:manual:`Automatic Encryption Shared Library `.
+
+
+mongocryptd
+~~~~~~~~~~~
+
+The mongocryptd binary is an alternative requirement for automatic client-side
+encryption and is included as a component in the
+:manual:`MongoDB Enterprise Server package `.
+For detailed installation instructions see the
+:manual:`MongoDB documentation on mongocryptd `.
+
+mongocryptd performs the following:
+
+- Parses the automatic encryption rules specified in the client configuration.
+  If the ``schemaMap`` auto encryption driver option contains invalid syntax,
+  mongocryptd returns an error.
+
+- Uses the specified automatic encryption rules to mark fields in read and write
+  operations for encryption.
+
+- Rejects read/write operations that may return unexpected or incorrect results
+  when applied to an encrypted field. For supported and unsupported operations,
+  see :manual:`Supported Operations for Automatic Encryption `.
+
+A client configured with auto encryption will automatically spawn the
+mongocryptd process from the application's ``PATH``. Applications can control
+the spawning behavior via various auto encryption
+:php:`driver options `.
+
+mongocryptd is only responsible for supporting automatic client-side encryption
+and does not itself perform any encryption or decryption.
+
+
+Managing Encryption Keys
+------------------------
+
+.. seealso:: :manual:`Encryption Key Management ` in the MongoDB manual
+
+Creating an Encryption Key
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. note::
+
+   The following examples use a local master key. While this is suitable for
+   development, a production application should use a supported cloud provider
+   (e.g. AWS KMS). The master key is used to encrypt locally stored data keys
+   and thus it is very important that you keep this key secure.
+
+To create an encryption key, create a
+:php:`MongoDB\\Driver\\ClientEncryption `
+instance with encryption options and use the
+:php:`createDataKey() `
+method. The method will return the key ID which can be used to reference the key
+later. You can also pass multiple :ref:`alternate names ` for this key
+and reference the key by these names instead of the key ID.
+
+Creating a new data encryption key would typically be done on initial
+deployment, but depending on your use case you may want to use more than one
+encryption key (e.g. user-specific encryption keys) or create them dynamically.
+
+.. literalinclude:: /examples/create_data_key.php
+   :language: php
+
+
+.. _alt_name:
+
+Referencing Encryption Keys by an Alternative Name
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To reference keys in your application, you can use the ``keyAltName``
+attribute specified when creating the key. The following example creates an
+encryption key with an alternative name, which could be done when deploying the
+application. The script then encrypts data by referencing the key by its
+alternative name using the ``keyAltName`` option instead of ``keyId``.
+
+.. note::
+
+   Prior to adding a new key alternate name, you must create a partial, unique
+   index on the ``keyAltNames`` field. Client-Side Field Level Encryption
+   depends on server-enforced uniqueness of key alternate names.
+
+.. literalinclude:: /examples/key_alt_name.php
+   :language: php
+
+
+Client-Side Field Level Encryption
+----------------------------------
+
+Introduced in MongoDB 4.2,
+:manual:`Client-Side Field Level Encryption ` allows an
+application to encrypt specific data fields in addition to pre-existing MongoDB
+encryption features such as
+:manual:`Encryption at Rest ` and
+:manual:`TLS/SSL (Transport Encryption) `.
+
+With field level encryption, applications can encrypt fields in documents prior
+to transmitting data over the wire to the server. Client-side field level
+encryption supports workloads where applications must guarantee that
+unauthorized parties, including server administrators, cannot read the encrypted
+data.
+
+
+Automatic Client-Side Field Level Encryption
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. note::
+
+   Automatic client-side field level encryption requires MongoDB 4.2+ Enterprise
+   or a MongoDB 4.2+ Atlas cluster.
+
+Automatic client-side field level encryption is enabled by creating a client and
+specifying the ``autoEncryption``
+:php:`driver option `.
+The following examples demonstrate how to setup automatic client-side field
+level encryption and use a
+:php:`MongoDB\\Driver\\ClientEncryption `
+object to create a new encryption key.
+
+
+.. _server-side:
+
+Server-Side Field Level Encryption Enforcement
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The MongoDB 4.2+ server supports using schema validation to enforce encryption
+of specific fields in a collection. This schema validation will prevent an
+application from inserting unencrypted values for any fields marked with the
+:manual:`"encrypt" schema keyword `.
+
+The following example sets up a collection with automatic encryption using a
+``$jsonSchema`` validator and
+:manual:`Encryption Schema syntax `.
+Data in the ``encryptedField`` field is automatically encrypted on insertion and
+decrypted when reading on the client side.
+
+.. literalinclude:: /examples/csfle-automatic_encryption-server_side_schema.php
+   :language: php
+
+
+Providing Local Automatic Encryption Rules
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The following example uses the ``schemaMap`` auto encryption driver option to
+define encrypted fields using a
+:manual:`strict subset of the JSON schema syntax `.
+
+Using ``schemaMap`` in conjunction with a :ref:`server-side schema `
+provides more security than relying entirely on a schema obtained from the
+server. It protects against a malicious server advertising a false schema, which
+could trick the client into sending unencrypted data that should be encrypted.
+
+.. note::
+
+   Only :manual:`Encryption Schema syntax `
+   can be used with the ``schemaMap`` option. Do not specify document validation
+   keywords in the automatic encryption rules. To define document validation
+   rules, configure :manual:`schema validation `.
+
+.. literalinclude:: /examples/csfle-automatic_encryption-local_schema.php
+   :language: php
+
+
+Explicit Encryption
+~~~~~~~~~~~~~~~~~~~
+
+Explicit encryption is a MongoDB community feature and does not use
+crypt_shared_ or mongocryptd_. Explicit encryption is provided by the
+:php:`MongoDB\\Driver\\ClientEncryption ` class.
+
+.. literalinclude:: /examples/csfle-explicit_encryption.php
+   :language: php
+
+
+Explicit Encryption with Automatic Decryption
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Although automatic encryption requires MongoDB 4.2+ enterprise or a MongoDB 4.2+
+Atlas cluster, automatic *decryption* is supported for all users. To configure
+automatic decryption without automatic encryption set the
+``bypassAutoEncryption`` auto encryption
+:php:`driver option `
+when constructing a client.
+
+.. literalinclude:: /examples/csfle-explicit_encryption_automatic_decryption.php
+   :language: php
+
+
+Queryable Encryption
+--------------------
+
+Introduced in MongoDB 7.0,
+:manual:`Queryable Encryption ` is another
+form of in-use encryption. Data is encrypted client-side. Queryable Encryption
+supports indexed encrypted fields, which are further processed server-side.
+
+
+Automatic Queryable Encryption
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. note::
+
+   Automatic queryable encryption requires MongoDB 7.0+ Enterprise or a MongoDB
+   7.0+ Atlas cluster.
+
+Automatic encryption in Queryable Encryption utilizes ``crypt_shared`` or
+``mongocryptd`` to automatically encrypt and decrypt data client-side. The data
+in the ``encryptedIndexed`` and ``encryptedUnindexed`` fields will be
+automatically encrypted on insertion and decrypted when querying on the client
+side. Additionally, it is possible to query on the ``encryptedIndexed`` field.
+
+.. literalinclude:: /examples/queryable_encryption-automatic.php
+   :language: php
+
+
+Explicit Queryable Encryption
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. note::
+
+   Explicit queryable encryption requires MongoDB 7.0+.
+
+Explicit encryption in Queryable Encryption is performed using the
+:php:`MongoDB\Driver\ClientEncryption::encrypt() `
+and :php:`decrypt() ` methods. Although
+values must be explicitly encrypted (e.g. insertions, query criteria), automatic
+*decryption* for queries is possible by configuring ``encryptedFields`` on the
+collection, as demonstrated in the following example:
+
+.. literalinclude:: /examples/queryable_encryption-explicit.php
+   :language: php

From 1c6f7305388c2bfb071cbaab0ab840bcddcd80ec Mon Sep 17 00:00:00 2001
From: Andreas Braun 
Date: Mon, 17 Jul 2023 17:05:14 +0200
Subject: [PATCH 283/321] PHPLIB-1192: Remove useCursor option in aggregate
 (#1130)

* PHPLIB-1192: Remove useCursor option in aggregate

* Remove unnecessary property for isExplain
---
 ...ongoDBCollection-method-aggregate-option.yaml | 16 ----------------
 .../method/MongoDBCollection-aggregate.txt       |  9 ++-------
 2 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index b3d19c3e..9a3d6a4a 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -59,22 +59,6 @@ source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: typeMap
 ---
-arg_name: option
-name: useCursor
-type: boolean
-description: |
-  Indicates whether the command will request that the server provide results
-  using a cursor. The default is ``true``.
-
-  .. note::
-
-     MongoDB 3.6+ no longer supports returning results without a cursor (excluding
-     when the explain option is used) and specifying false for this option will
-     result in a server error.
-interface: phpmethod
-operation: ~
-optional: true
----
 source:
   file: apiargs-MongoDBCollection-common-option.yaml
   ref: writeConcern
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index d26d8c8e..6975098d 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -50,13 +50,8 @@ Errors/Exceptions
 Behavior
 --------
 
-:phpmethod:`MongoDB\\Collection::aggregate()`'s return value depends on the
-MongoDB server version and whether the ``useCursor`` option is specified. If
-``useCursor`` is ``true``, a :php:`MongoDB\\Driver\\Cursor
-` object is returned. If ``useCursor`` is
-``false``, an :php:`ArrayIterator ` is returned that wraps the
-``result`` array from the command response document. In both cases, the return
-value will be :php:`Traversable `.
+:phpmethod:`MongoDB\\Collection::aggregate()`'s returns a
+:php:`MongoDB\\Driver\\Cursor ` object.
 
 Examples
 --------

From 3c246a6a3d5795c9bce10264a495dfd2ba0d1831 Mon Sep 17 00:00:00 2001
From: Andreas Braun 
Date: Tue, 18 Jul 2023 12:14:08 +0200
Subject: [PATCH 284/321] PHPLIB-1119: Update to Psalm 5 (#1131)

* Update to psalm 5

* Enable reporting about unused baseline entries

* Remove dangerous instantiation

Instantiating static in non-final classes makes assumptions about child class constructors, which is unsafe.

* Fix missing return types

* Fix more psalm errors
---
 source/examples/csfle-explicit_encryption.php | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/source/examples/csfle-explicit_encryption.php b/source/examples/csfle-explicit_encryption.php
index ce5ccf15..b089d72b 100644
--- a/source/examples/csfle-explicit_encryption.php
+++ b/source/examples/csfle-explicit_encryption.php
@@ -41,6 +41,8 @@
 
 /* Using the client configured without encryption, find the document and observe
  * that the field is not automatically decrypted. */
+
+/** @var object{encryptedField: Binary} $document */
 $document = $collection->findOne();
 
 print_r($document);

From 51d1b253866b471bb5fa2e2a3f03fbd25d781356 Mon Sep 17 00:00:00 2001
From: Andreas Braun 
Date: Fri, 15 Sep 2023 10:57:22 +0200
Subject: [PATCH 285/321] PHPLIB-1209: Add tutorial to show working with Codecs
 (#1154)

* PHPLIB-1209: Add tutorial to show working with Codecs

* Fix code review issues

* Add section on handling embedded documents

* Handle code review

* Add example on how to disable codec

* Address code review

* Add note linking to codec tutorial in custom-types

* Move encryption examples to subfolder

* Use literalinclude for examples in docs

* Remove library sections

* Reformat disabling codec examples

* Refactor UTCDateTimeCodec example

* Fix phpcs in codec examples

* Add psalm template annotations for codec examples

We still exclude psalm from these examples to avoid littering the code with assertions and annotations

* Link to data type section in custom types tutorial

* Explain type map overriding codecs

* Simplify block comment

* Fix code review issues
---
 .../handling-data-types/DateTimeCodec.php     |  60 ++++++++++
 .../codecs/handling-data-types/Person.php     |  13 ++
 .../handling-data-types/PersonCodec.php       |  55 +++++++++
 .../codecs/handling-documents/Person.php      |  12 ++
 .../codecs/handling-documents/PersonCodec.php |  49 ++++++++
 .../handling-documents/disabling-codec.php    |   7 ++
 .../codecs/handling-documents/using-codec.php |  13 ++
 .../handling-embedded-documents/Address.php   |  12 ++
 .../AddressCodec.php                          |  56 +++++++++
 .../handling-embedded-documents/Person.php    |  14 +++
 .../PersonCodec.php                           |  67 +++++++++++
 .../{ => encryption}/create_data_key.php      |   2 +-
 ...sfle-automatic_encryption-local_schema.php |   2 +-
 ...utomatic_encryption-server_side_schema.php |   2 +-
 .../csfle-explicit_encryption.php             |   2 +-
 ...plicit_encryption_automatic_decryption.php |   2 +-
 .../{ => encryption}/key_alt_name.php         |   2 +-
 .../queryable_encryption-automatic.php        |   2 +-
 .../queryable_encryption-explicit.php         |   2 +-
 source/tutorial.txt                           |   1 +
 source/tutorial/codecs.txt                    | 112 ++++++++++++++++++
 source/tutorial/custom-types.txt              |   6 +
 source/tutorial/encryption.txt                |  16 +--
 23 files changed, 493 insertions(+), 16 deletions(-)
 create mode 100644 source/examples/codecs/handling-data-types/DateTimeCodec.php
 create mode 100644 source/examples/codecs/handling-data-types/Person.php
 create mode 100644 source/examples/codecs/handling-data-types/PersonCodec.php
 create mode 100644 source/examples/codecs/handling-documents/Person.php
 create mode 100644 source/examples/codecs/handling-documents/PersonCodec.php
 create mode 100644 source/examples/codecs/handling-documents/disabling-codec.php
 create mode 100644 source/examples/codecs/handling-documents/using-codec.php
 create mode 100644 source/examples/codecs/handling-embedded-documents/Address.php
 create mode 100644 source/examples/codecs/handling-embedded-documents/AddressCodec.php
 create mode 100644 source/examples/codecs/handling-embedded-documents/Person.php
 create mode 100644 source/examples/codecs/handling-embedded-documents/PersonCodec.php
 rename source/examples/{ => encryption}/create_data_key.php (96%)
 rename source/examples/{ => encryption}/csfle-automatic_encryption-local_schema.php (98%)
 rename source/examples/{ => encryption}/csfle-automatic_encryption-server_side_schema.php (98%)
 rename source/examples/{ => encryption}/csfle-explicit_encryption.php (97%)
 rename source/examples/{ => encryption}/csfle-explicit_encryption_automatic_decryption.php (97%)
 rename source/examples/{ => encryption}/key_alt_name.php (97%)
 rename source/examples/{ => encryption}/queryable_encryption-automatic.php (98%)
 rename source/examples/{ => encryption}/queryable_encryption-explicit.php (98%)
 create mode 100644 source/tutorial/codecs.txt

diff --git a/source/examples/codecs/handling-data-types/DateTimeCodec.php b/source/examples/codecs/handling-data-types/DateTimeCodec.php
new file mode 100644
index 00000000..31aba37e
--- /dev/null
+++ b/source/examples/codecs/handling-data-types/DateTimeCodec.php
@@ -0,0 +1,60 @@
+ */
+final class DateTimeCodec implements Codec
+{
+    use DecodeIfSupported;
+    use EncodeIfSupported;
+
+    public function canDecode(mixed $value): bool
+    {
+        /* This codec inspects the BSON document to ensure it has the fields it expects, and that those fields are of
+         * the correct type. This is a robust approach to avoid decoding document that are not supported and would cause
+         * exceptions.
+         *
+         * For large documents, this can be inefficient as we're inspecting the entire document four times (once for
+         * each call to has() and get()). For small documents, this is not a problem.
+         */
+        return $value instanceof Document
+            && $value->has('utc') && $value->get('utc') instanceof UTCDateTime
+            && $value->has('tz') && is_string($value->get('tz'));
+    }
+
+    public function canEncode(mixed $value): bool
+    {
+        return $value instanceof DateTimeInterface;
+    }
+
+    public function decode(mixed $value): DateTimeImmutable
+    {
+        if (! $this->canDecode($value)) {
+            throw UnsupportedValueException::invalidDecodableValue($value);
+        }
+
+        $timeZone = new DateTimeZone($value->get('tz'));
+        $dateTime = $value->get('utc')
+            ->toDateTime()
+            ->setTimeZone($timeZone);
+
+        return DateTimeImmutable::createFromMutable($dateTime);
+    }
+
+    public function encode(mixed $value): Document
+    {
+        if (! $this->canEncode($value)) {
+            throw UnsupportedValueException::invalidEncodableValue($value);
+        }
+
+        return Document::fromPHP([
+            'utc' => new UTCDateTime($value),
+            'tz' => $value->getTimezone()->getName(),
+        ]);
+    }
+}
diff --git a/source/examples/codecs/handling-data-types/Person.php b/source/examples/codecs/handling-data-types/Person.php
new file mode 100644
index 00000000..e99b3c4c
--- /dev/null
+++ b/source/examples/codecs/handling-data-types/Person.php
@@ -0,0 +1,13 @@
+ */
+final class PersonCodec implements DocumentCodec
+{
+    use DecodeIfSupported;
+    use EncodeIfSupported;
+
+    public function __construct(
+        private readonly DateTimeCodec $dateTimeCodec = new DateTimeCodec(),
+    ) {
+    }
+
+    public function canDecode(mixed $value): bool
+    {
+        return $value instanceof Document && $value->has('name');
+    }
+
+    public function canEncode(mixed $value): bool
+    {
+        return $value instanceof Person;
+    }
+
+    public function decode(mixed $value): Person
+    {
+        if (! $this->canDecode($value)) {
+            throw UnsupportedValueException::invalidDecodableValue($value);
+        }
+
+        return new Person(
+            $value->get('name'),
+            $this->dateTimeCodec->decode($value->get('createdAt')),
+            $value->get('_id'),
+        );
+    }
+
+    public function encode(mixed $value): Document
+    {
+        if (! $this->canEncode($value)) {
+            throw UnsupportedValueException::invalidEncodableValue($value);
+        }
+
+        return Document::fromPHP([
+            '_id' => $value->id,
+            'name' => $value->name,
+            'createdAt' => $this->dateTimeCodec->encode($value->createdAt),
+        ]);
+    }
+}
diff --git a/source/examples/codecs/handling-documents/Person.php b/source/examples/codecs/handling-documents/Person.php
new file mode 100644
index 00000000..d3c9b4bf
--- /dev/null
+++ b/source/examples/codecs/handling-documents/Person.php
@@ -0,0 +1,12 @@
+ */
+final class PersonCodec implements DocumentCodec
+{
+    // These traits define commonly used functionality to avoid duplication
+    use DecodeIfSupported;
+    use EncodeIfSupported;
+
+    public function canDecode(mixed $value): bool
+    {
+        return $value instanceof Document && $value->has('name');
+    }
+
+    public function canEncode(mixed $value): bool
+    {
+        return $value instanceof Person;
+    }
+
+    public function decode(mixed $value): Person
+    {
+        if (! $this->canDecode($value)) {
+            throw UnsupportedValueException::invalidDecodableValue($value);
+        }
+
+        return new Person(
+            $value->get('name'),
+            $value->get('_id'),
+        );
+    }
+
+    public function encode(mixed $value): Document
+    {
+        if (! $this->canEncode($value)) {
+            throw UnsupportedValueException::invalidEncodableValue($value);
+        }
+
+        return Document::fromPHP([
+            '_id' => $value->id,
+            'name' => $value->name,
+        ]);
+    }
+}
diff --git a/source/examples/codecs/handling-documents/disabling-codec.php b/source/examples/codecs/handling-documents/disabling-codec.php
new file mode 100644
index 00000000..c3769fd7
--- /dev/null
+++ b/source/examples/codecs/handling-documents/disabling-codec.php
@@ -0,0 +1,7 @@
+aggregate($pipeline, ['codec' => null]);
+
+// Overrides the collection codec, using the specified type map
+$collection->findOne($filter, ['typeMap' => ['root' => 'stdClass']]);
diff --git a/source/examples/codecs/handling-documents/using-codec.php b/source/examples/codecs/handling-documents/using-codec.php
new file mode 100644
index 00000000..4d05ac29
--- /dev/null
+++ b/source/examples/codecs/handling-documents/using-codec.php
@@ -0,0 +1,13 @@
+selectCollection('test', 'person', [
+    'codec' => new PersonCodec(),
+]);
+
+$person = new Person('Jane Doe');
+$collection->insertOne($person);
+
+$person = $collection->findOne();
diff --git a/source/examples/codecs/handling-embedded-documents/Address.php b/source/examples/codecs/handling-embedded-documents/Address.php
new file mode 100644
index 00000000..b9b67838
--- /dev/null
+++ b/source/examples/codecs/handling-embedded-documents/Address.php
@@ -0,0 +1,12 @@
+ */
+final class AddressCodec implements DocumentCodec
+{
+    use DecodeIfSupported;
+    use EncodeIfSupported;
+
+    public function canDecode(mixed $value): bool
+    {
+        return $value instanceof Document
+            && $value->has('street')
+            && $value->has('postCode')
+            && $value->has('city')
+            && $value->has('country');
+    }
+
+    public function canEncode(mixed $value): bool
+    {
+        return $value instanceof Address;
+    }
+
+    public function decode(mixed $value): Address
+    {
+        if (! $this->canDecode($value)) {
+            throw UnsupportedValueException::invalidDecodableValue($value);
+        }
+
+        return new Address(
+            $value->get('street'),
+            $value->get('postCode'),
+            $value->get('city'),
+            $value->get('country'),
+        );
+    }
+
+    public function encode(mixed $value): Document
+    {
+        if (! $this->canEncode($value)) {
+            throw UnsupportedValueException::invalidEncodableValue($value);
+        }
+
+        return Document::fromPHP([
+            'street' => $value->street,
+            'postCode' => $value->postCode,
+            'city' => $value->city,
+            'country' => $value->country,
+        ]);
+    }
+}
diff --git a/source/examples/codecs/handling-embedded-documents/Person.php b/source/examples/codecs/handling-embedded-documents/Person.php
new file mode 100644
index 00000000..a2440d54
--- /dev/null
+++ b/source/examples/codecs/handling-embedded-documents/Person.php
@@ -0,0 +1,14 @@
+ */
+final class PersonCodec implements DocumentCodec
+{
+    use DecodeIfSupported;
+    use EncodeIfSupported;
+
+    public function __construct(
+        private readonly AddressCodec $addressCodec = new AddressCodec(),
+    ) {
+    }
+
+    public function canDecode(mixed $value): bool
+    {
+        return $value instanceof Document && $value->has('name');
+    }
+
+    public function canEncode(mixed $value): bool
+    {
+        return $value instanceof Person;
+    }
+
+    public function decode(mixed $value): Person
+    {
+        if (! $this->canDecode($value)) {
+            throw UnsupportedValueException::invalidDecodableValue($value);
+        }
+
+        $person = new Person(
+            $value->get('name'),
+            $value->get('_id'),
+        );
+
+        // Address is optional, so only decode if it exists
+        if ($value->has('address')) {
+            $person->address = $this->addressCodec->decode($value->get('address'));
+        }
+
+        return $person;
+    }
+
+    public function encode(mixed $value): Document
+    {
+        if (! $this->canEncode($value)) {
+            throw UnsupportedValueException::invalidEncodableValue($value);
+        }
+
+        $data = [
+            '_id' => $value->id,
+            'name' => $value->name,
+        ];
+
+        // Don't add a null value to the document if address is not set
+        if ($value->address) {
+            $data['address'] = $this->addressCodec->encode($value->address);
+        }
+
+        return Document::fromPHP($data);
+    }
+}
diff --git a/source/examples/create_data_key.php b/source/examples/encryption/create_data_key.php
similarity index 96%
rename from source/examples/create_data_key.php
rename to source/examples/encryption/create_data_key.php
index dbb89bf1..9dd27d72 100644
--- a/source/examples/create_data_key.php
+++ b/source/examples/encryption/create_data_key.php
@@ -4,7 +4,7 @@
 use MongoDB\Client;
 use MongoDB\Driver\ClientEncryption;
 
-require __DIR__ . '/../../vendor/autoload.php';
+require __DIR__ . '/../../../vendor/autoload.php';
 
 $uri = getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1/';
 
diff --git a/source/examples/csfle-automatic_encryption-local_schema.php b/source/examples/encryption/csfle-automatic_encryption-local_schema.php
similarity index 98%
rename from source/examples/csfle-automatic_encryption-local_schema.php
rename to source/examples/encryption/csfle-automatic_encryption-local_schema.php
index 249d341b..42557447 100644
--- a/source/examples/csfle-automatic_encryption-local_schema.php
+++ b/source/examples/encryption/csfle-automatic_encryption-local_schema.php
@@ -5,7 +5,7 @@
 use MongoDB\Driver\ClientEncryption;
 use MongoDB\Driver\Exception\ServerException;
 
-require __DIR__ . '/../../vendor/autoload.php';
+require __DIR__ . '/../../../vendor/autoload.php';
 
 $uri = getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1/';
 
diff --git a/source/examples/csfle-automatic_encryption-server_side_schema.php b/source/examples/encryption/csfle-automatic_encryption-server_side_schema.php
similarity index 98%
rename from source/examples/csfle-automatic_encryption-server_side_schema.php
rename to source/examples/encryption/csfle-automatic_encryption-server_side_schema.php
index a42ed6fb..44531522 100644
--- a/source/examples/csfle-automatic_encryption-server_side_schema.php
+++ b/source/examples/encryption/csfle-automatic_encryption-server_side_schema.php
@@ -5,7 +5,7 @@
 use MongoDB\Driver\ClientEncryption;
 use MongoDB\Driver\Exception\ServerException;
 
-require __DIR__ . '/../../vendor/autoload.php';
+require __DIR__ . '/../../../vendor/autoload.php';
 
 $uri = getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1/';
 
diff --git a/source/examples/csfle-explicit_encryption.php b/source/examples/encryption/csfle-explicit_encryption.php
similarity index 97%
rename from source/examples/csfle-explicit_encryption.php
rename to source/examples/encryption/csfle-explicit_encryption.php
index b089d72b..d36b4b32 100644
--- a/source/examples/csfle-explicit_encryption.php
+++ b/source/examples/encryption/csfle-explicit_encryption.php
@@ -4,7 +4,7 @@
 use MongoDB\Client;
 use MongoDB\Driver\ClientEncryption;
 
-require __DIR__ . '/../../vendor/autoload.php';
+require __DIR__ . '/../../../vendor/autoload.php';
 
 $uri = getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1/';
 
diff --git a/source/examples/csfle-explicit_encryption_automatic_decryption.php b/source/examples/encryption/csfle-explicit_encryption_automatic_decryption.php
similarity index 97%
rename from source/examples/csfle-explicit_encryption_automatic_decryption.php
rename to source/examples/encryption/csfle-explicit_encryption_automatic_decryption.php
index 4b98f95a..072b273a 100644
--- a/source/examples/csfle-explicit_encryption_automatic_decryption.php
+++ b/source/examples/encryption/csfle-explicit_encryption_automatic_decryption.php
@@ -4,7 +4,7 @@
 use MongoDB\Client;
 use MongoDB\Driver\ClientEncryption;
 
-require __DIR__ . '/../../vendor/autoload.php';
+require __DIR__ . '/../../../vendor/autoload.php';
 
 $uri = getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1/';
 
diff --git a/source/examples/key_alt_name.php b/source/examples/encryption/key_alt_name.php
similarity index 97%
rename from source/examples/key_alt_name.php
rename to source/examples/encryption/key_alt_name.php
index ea04cc20..03100aaf 100644
--- a/source/examples/key_alt_name.php
+++ b/source/examples/encryption/key_alt_name.php
@@ -5,7 +5,7 @@
 use MongoDB\Driver\ClientEncryption;
 use MongoDB\Driver\Exception\ServerException;
 
-require __DIR__ . '/../../vendor/autoload.php';
+require __DIR__ . '/../../../vendor/autoload.php';
 
 $uri = getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1/';
 
diff --git a/source/examples/queryable_encryption-automatic.php b/source/examples/encryption/queryable_encryption-automatic.php
similarity index 98%
rename from source/examples/queryable_encryption-automatic.php
rename to source/examples/encryption/queryable_encryption-automatic.php
index 80bb770b..024afe95 100644
--- a/source/examples/queryable_encryption-automatic.php
+++ b/source/examples/encryption/queryable_encryption-automatic.php
@@ -4,7 +4,7 @@
 use MongoDB\Client;
 use MongoDB\Driver\ClientEncryption;
 
-require __DIR__ . '/../../vendor/autoload.php';
+require __DIR__ . '/../../../vendor/autoload.php';
 
 $uri = getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1/';
 
diff --git a/source/examples/queryable_encryption-explicit.php b/source/examples/encryption/queryable_encryption-explicit.php
similarity index 98%
rename from source/examples/queryable_encryption-explicit.php
rename to source/examples/encryption/queryable_encryption-explicit.php
index 67855964..a07d88d1 100644
--- a/source/examples/queryable_encryption-explicit.php
+++ b/source/examples/encryption/queryable_encryption-explicit.php
@@ -4,7 +4,7 @@
 use MongoDB\Client;
 use MongoDB\Driver\ClientEncryption;
 
-require __DIR__ . '/../../vendor/autoload.php';
+require __DIR__ . '/../../../vendor/autoload.php';
 
 $uri = getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1/';
 
diff --git a/source/tutorial.txt b/source/tutorial.txt
index bfb44b84..31595bdc 100644
--- a/source/tutorial.txt
+++ b/source/tutorial.txt
@@ -8,6 +8,7 @@ Tutorials
    /tutorial/connecting
    /tutorial/server-selection
    /tutorial/crud
+   /tutorial/codecs
    /tutorial/collation
    /tutorial/commands
    /tutorial/custom-types
diff --git a/source/tutorial/codecs.txt b/source/tutorial/codecs.txt
new file mode 100644
index 00000000..67523f11
--- /dev/null
+++ b/source/tutorial/codecs.txt
@@ -0,0 +1,112 @@
+======
+Codecs
+======
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 2
+   :class: singlecol
+
+.. versionadded:: 1.17
+
+Overview
+--------
+
+Codecs are used to decode BSON documents into PHP objects, and encode PHP objects into BSON documents. In contrast to
+other methods (e.g. type maps), codecs allow for greater customization and handling of different data types. They
+separate logic for BSON encoding and decoding from the domain classes, which also enables BSON to be decoded into plain
+old PHP objects.
+
+Handling Documents
+------------------
+
+The main logic is contained in a document codec. This class implements the ``MongoDB\Codec\DocumentCodec`` interface and
+defines what data types can be encoded/decoded and how. The following example defines a ``Person`` class and a codec to
+transform it:
+
+.. literalinclude:: /examples/codecs/handling-documents/Person.php
+   :language: php
+
+.. literalinclude:: /examples/codecs/handling-documents/PersonCodec.php
+   :language: php
+
+To then use this codec with a collection, specify the ``codec`` option when selecting the collection:
+
+.. literalinclude:: /examples/codecs/handling-documents/using-codec.php
+   :language: php
+
+The example above selects a collection and instructs it to use the ``PersonCodec`` for encoding and decoding documents.
+When inserting data, the ``PersonCodec`` is used to encode the document. When retrieving data, the same ``PersonCodec``
+is used to decode BSON data into a ``Person`` instance. Note that while the ``PersonCodec`` could technically decode any
+BSON document that contains a name field, we wouldn't want to use it for any other documents. Document codecs are meant
+to be used with a :phpclass:`MongoDB\\Collection`, or when decoding embedded documents.
+
+When using a collection with a codec, the codec will only accept and return data of that type for certain operations.
+Insert and replace operations (e.g. ``insertOne``, ```findOneAndReplace``, and some ``bulkWrite`` operations) will
+attempt to encode the given data using the provided codec. Trying to insert or replace a document that cannot be encoded
+will result in an exception. Read operations (e.g. ``aggregate``, ``find``, and ``findOneAndUpdate``) will attempt to
+decode returned documents using the provided codec. If the codec does not support the data returned, an exception will
+be thrown.
+
+You can disable codec usage for a specific operation or use a different codec (e.g. to decode the result of an
+aggregation pipeline) by specifying ``null`` for the ``codec`` option for any operation. Alternatively, specifying a
+type map using the ``typeMap`` operation will also override the collection-level codec:
+
+.. literalinclude:: /examples/codecs/handling-documents/disabling-codec.php
+   :language: php
+
+.. _php-codec-handling-data-types:
+
+Handling Fields and Data Types
+------------------------------
+
+The previous example showed how to define a codec for a specific class. However, you may want to create a codec that
+handles a particular data type in any document. This can be achieved by implementing the ``MongoDB\Codec\Codec``
+interface.
+
+The following example defines a codec that stores ``DateTimeInterface`` instances as an embedded document containing a
+BSON date and accompanying timezone string. Those same embedded documents can then be translated back into a
+``DateTimeImmutable`` during BSON decoding.
+
+.. literalinclude:: /examples/codecs/handling-data-types/DateTimeCodec.php
+   :language: php
+
+This codec can now be leveraged by other codecs handle date fields.
+
+First, we add a ``createdAt`` field to the ``Person`` class:
+
+.. literalinclude:: /examples/codecs/handling-data-types/Person.php
+   :language: php
+
+Last but not least, we modify the codec to handle the new field:
+
+.. literalinclude:: /examples/codecs/handling-data-types/PersonCodec.php
+   :language: php
+
+Handling Embedded Documents
+---------------------------
+
+A previous example showed how to handle a single document. However, sometimes you want to handle fields that contain
+embedded documents. We will demonstrate this using an ``Address`` document, which we will embed within a ``Person``
+document. To ensure consistency, we're going to make this a read-only class:
+
+.. literalinclude:: /examples/codecs/handling-embedded-documents/Address.php
+   :language: php
+
+We can now create a document codec for this class:
+
+.. literalinclude:: /examples/codecs/handling-embedded-documents/AddressCodec.php
+   :language: php
+
+The ``Person`` class gets a new ``address`` field, but we'll leave this optional:
+
+.. literalinclude:: /examples/codecs/handling-embedded-documents/Person.php
+   :language: php
+
+The ``PersonCodec`` can now handle the optional ``address`` field when transforming data:
+
+.. literalinclude:: /examples/codecs/handling-embedded-documents/PersonCodec.php
+   :language: php
diff --git a/source/tutorial/custom-types.txt b/source/tutorial/custom-types.txt
index 5fa5880f..0b08172a 100644
--- a/source/tutorial/custom-types.txt
+++ b/source/tutorial/custom-types.txt
@@ -4,6 +4,12 @@ Custom Data-Types
 
 .. default-domain:: mongodb
 
+.. note::
+
+   This tutorial explains implementing custom data types using the :php:`MongoDB\\BSON\\Persistable `
+   interface found in the MongoDB extension. Consider using a codec instead to decouple the MongoDB persistence logic
+   from your business logic. See the :ref:`codec tutorial ` for an example.
+
 The MongoDB PHP extension and library support custom classes while
 serializing and deserializing. An example of where this might be useful is
 if you want to store date/time information retaining the time zone
diff --git a/source/tutorial/encryption.txt b/source/tutorial/encryption.txt
index 2773eab8..393fe820 100644
--- a/source/tutorial/encryption.txt
+++ b/source/tutorial/encryption.txt
@@ -102,7 +102,7 @@ Creating a new data encryption key would typically be done on initial
 deployment, but depending on your use case you may want to use more than one
 encryption key (e.g. user-specific encryption keys) or create them dynamically.
 
-.. literalinclude:: /examples/create_data_key.php
+.. literalinclude:: /examples/encryption/create_data_key.php
    :language: php
 
 
@@ -123,7 +123,7 @@ alternative name using the ``keyAltName`` option instead of ``keyId``.
    index on the ``keyAltNames`` field. Client-Side Field Level Encryption
    depends on server-enforced uniqueness of key alternate names.
 
-.. literalinclude:: /examples/key_alt_name.php
+.. literalinclude:: /examples/encryption/key_alt_name.php
    :language: php
 
 
@@ -177,7 +177,7 @@ The following example sets up a collection with automatic encryption using a
 Data in the ``encryptedField`` field is automatically encrypted on insertion and
 decrypted when reading on the client side.
 
-.. literalinclude:: /examples/csfle-automatic_encryption-server_side_schema.php
+.. literalinclude:: /examples/encryption/csfle-automatic_encryption-server_side_schema.php
    :language: php
 
 
@@ -200,7 +200,7 @@ could trick the client into sending unencrypted data that should be encrypted.
    keywords in the automatic encryption rules. To define document validation
    rules, configure :manual:`schema validation `.
 
-.. literalinclude:: /examples/csfle-automatic_encryption-local_schema.php
+.. literalinclude:: /examples/encryption/csfle-automatic_encryption-local_schema.php
    :language: php
 
 
@@ -211,7 +211,7 @@ Explicit encryption is a MongoDB community feature and does not use
 crypt_shared_ or mongocryptd_. Explicit encryption is provided by the
 :php:`MongoDB\\Driver\\ClientEncryption ` class.
 
-.. literalinclude:: /examples/csfle-explicit_encryption.php
+.. literalinclude:: /examples/encryption/csfle-explicit_encryption.php
    :language: php
 
 
@@ -225,7 +225,7 @@ automatic decryption without automatic encryption set the
 :php:`driver option `
 when constructing a client.
 
-.. literalinclude:: /examples/csfle-explicit_encryption_automatic_decryption.php
+.. literalinclude:: /examples/encryption/csfle-explicit_encryption_automatic_decryption.php
    :language: php
 
 
@@ -252,7 +252,7 @@ in the ``encryptedIndexed`` and ``encryptedUnindexed`` fields will be
 automatically encrypted on insertion and decrypted when querying on the client
 side. Additionally, it is possible to query on the ``encryptedIndexed`` field.
 
-.. literalinclude:: /examples/queryable_encryption-automatic.php
+.. literalinclude:: /examples/encryption/queryable_encryption-automatic.php
    :language: php
 
 
@@ -270,5 +270,5 @@ values must be explicitly encrypted (e.g. insertions, query criteria), automatic
 *decryption* for queries is possible by configuring ``encryptedFields`` on the
 collection, as demonstrated in the following example:
 
-.. literalinclude:: /examples/queryable_encryption-explicit.php
+.. literalinclude:: /examples/encryption/queryable_encryption-explicit.php
    :language: php

From c16f28495e4f2f72ddafd18990c1cea60ba8b006 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 31 Oct 2023 11:33:44 -0400
Subject: [PATCH 286/321] PHPLIB-1277: Rename "Reference" to "API
 Documentation" (#1188)

---
 source/reference.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source/reference.txt b/source/reference.txt
index 1d2c76db..8e2e0f1a 100644
--- a/source/reference.txt
+++ b/source/reference.txt
@@ -1,6 +1,6 @@
-=========
-Reference
-=========
+=================
+API Documentation
+=================
 
 .. default-domain:: mongodb
 

From 4e22f328c2d174fb58d22b32cf70091c31705b8a Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 9 Nov 2023 09:31:52 -0500
Subject: [PATCH 287/321] PHPLIB-1143: Document Atlas Search index helpers and
 fix aggregate "collation" docs (#1189)

* PHPLIB-1143: Docs for Atlas Search index helpers

* PHPLIB-1306: Add missing docs for aggregate "collation" option
---
 ...oDBCollection-method-aggregate-option.yaml |  4 +
 ...ction-method-createSearchIndex-option.yaml | 17 ++++
 ...ection-method-createSearchIndex-param.yaml | 14 +++
 ...ion-method-createSearchIndexes-option.yaml |  4 +
 ...tion-method-createSearchIndexes-param.yaml | 21 +++++
 ...lection-method-dropSearchIndex-option.yaml |  4 +
 ...llection-method-dropSearchIndex-param.yaml | 13 +++
 ...ction-method-listSearchIndexes-option.yaml | 44 ++++++++++
 ...ection-method-listSearchIndexes-param.yaml |  4 +
 ...ction-method-updateSearchIndex-option.yaml |  4 +
 ...ection-method-updateSearchIndex-param.yaml | 25 ++++++
 ...MongoDBCollection-method-watch-option.yaml |  2 +-
 ...ngoDBDatabase-method-aggregate-option.yaml |  4 +
 source/includes/extracts-note.yaml            | 20 +++++
 source/reference/class/MongoDBCollection.txt  |  5 ++
 .../MongoDBCollection-createSearchIndex.txt   | 88 +++++++++++++++++++
 .../MongoDBCollection-createSearchIndexes.txt | 88 +++++++++++++++++++
 .../MongoDBCollection-dropSearchIndex.txt     | 52 +++++++++++
 .../MongoDBCollection-listSearchIndexes.txt   | 60 +++++++++++++
 .../MongoDBCollection-updateSearchIndex.txt   | 53 +++++++++++
 20 files changed, 525 insertions(+), 1 deletion(-)
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml
 create mode 100644 source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml
 create mode 100644 source/reference/method/MongoDBCollection-createSearchIndex.txt
 create mode 100644 source/reference/method/MongoDBCollection-createSearchIndexes.txt
 create mode 100644 source/reference/method/MongoDBCollection-dropSearchIndex.txt
 create mode 100644 source/reference/method/MongoDBCollection-listSearchIndexes.txt
 create mode 100644 source/reference/method/MongoDBCollection-updateSearchIndex.txt

diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
index 9a3d6a4a..a299eefa 100644
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
@@ -10,6 +10,10 @@ source:
   file: apiargs-aggregate-option.yaml
   ref: bypassDocumentValidation
 ---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: collation
+---
 source:
   file: apiargs-common-option.yaml
   ref: comment
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml
new file mode 100644
index 00000000..c6adffe8
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml
@@ -0,0 +1,17 @@
+arg_name: option
+name: name
+type: string
+description: |
+  Name of the search index to create.
+
+  You cannot create multiple indexes with the same name on a single collection.
+
+  If you do not specify a name, the index is named "default".
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: comment
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml
new file mode 100644
index 00000000..bec75136
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml
@@ -0,0 +1,14 @@
+arg_name: param
+name: $definition
+type: array|object
+description: |
+  Document describing the index to create. For details on definition syntax, see 
+  :manual:`Search Index Definition Syntax `.
+interface: phpmethod
+operation: ~
+optional: false
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml
new file mode 100644
index 00000000..7661d09e
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml
@@ -0,0 +1,4 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: comment
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml
new file mode 100644
index 00000000..4003b24d
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml
@@ -0,0 +1,21 @@
+arg_name: param
+name: $indexes
+type: array
+description: |
+  Array of documents describing the indexes to create.
+
+  A required ``definition`` document field describes the index to create. For
+  details on definition syntax, see 
+  :manual:`Search Index Definition Syntax `.
+
+  An optional ``name`` string field specifies the name of the search index to
+  create. You cannot create multiple indexes with the same name on a single
+  collection. If you do not specify a name, the index is named "default".
+interface: phpmethod
+operation: ~
+optional: false
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml
new file mode 100644
index 00000000..7661d09e
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml
@@ -0,0 +1,4 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: comment
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml
new file mode 100644
index 00000000..9a57fc98
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml
@@ -0,0 +1,13 @@
+arg_name: param
+name: $name
+type: string
+description: |
+  Name of the index to drop.
+interface: phpmethod
+operation: ~
+optional: false
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml
new file mode 100644
index 00000000..910024ee
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml
@@ -0,0 +1,44 @@
+source:
+  file: apiargs-aggregate-option.yaml
+  ref: batchSize
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: collation
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: comment
+---
+arg_name: option
+name: name
+type: string
+description: |
+  Name of the index to return information about.
+
+  If name is not specified, information for all indexes on the collection will
+  be returned.
+interface: phpmethod
+operation: ~
+optional: true
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: maxTimeMS
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: readConcern
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: readPreference
+---
+source:
+  file: apiargs-common-option.yaml
+  ref: session
+---
+source:
+  file: apiargs-MongoDBCollection-common-option.yaml
+  ref: typeMap
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml
new file mode 100644
index 00000000..73ad04d0
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml
@@ -0,0 +1,4 @@
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml
new file mode 100644
index 00000000..7661d09e
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml
@@ -0,0 +1,4 @@
+source:
+  file: apiargs-common-option.yaml
+  ref: comment
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml
new file mode 100644
index 00000000..f5893878
--- /dev/null
+++ b/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml
@@ -0,0 +1,25 @@
+arg_name: param
+name: $name
+type: string
+description: |
+  Name of the index to update.
+interface: phpmethod
+operation: ~
+optional: false
+---
+arg_name: param
+name: $definition
+type: array|object
+description: |
+  Document describing the updated search index definition. The specified
+  definition replaces the prior definition in the search index. For details on
+  definition syntax, see 
+  :manual:`Search Index Definition Syntax `.
+interface: phpmethod
+operation: ~
+optional: false
+---
+source:
+  file: apiargs-common-param.yaml
+  ref: $options
+...
diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
index 0a47ae62..2b8ac8e4 100644
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
@@ -4,7 +4,7 @@ source:
   ref: batchSize
 ---
 source:
-  file: apiargs-common-option.yaml
+  file: apiargs-MongoDBCollection-common-option.yaml
   ref: collation
 ---
 source:
diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
index f59192a0..93bccd2f 100644
--- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
+++ b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
@@ -10,6 +10,10 @@ source:
   file: apiargs-aggregate-option.yaml
   ref: bypassDocumentValidation
 ---
+source:
+  file: apiargs-common-option.yaml
+  ref: collation
+---
 source:
   file: apiargs-common-option.yaml
   ref: comment
diff --git a/source/includes/extracts-note.yaml b/source/includes/extracts-note.yaml
index 7790f0c3..46dadfea 100644
--- a/source/includes/extracts-note.yaml
+++ b/source/includes/extracts-note.yaml
@@ -9,4 +9,24 @@ content: |
   ` in the driver (e.g. use
   :php:`MongoDB\\BSON\\ObjectId ` to match an
   :manual:`ObjectId `).
+---
+ref: note-atlas-search-requirement
+content: |
+  .. note::
+
+     This command can only be run on a deployment hosted on
+     :manual:`MongoDB Atlas ` and requires an Atlas cluster tier of at
+     least M10. A
+     `Local Atlas Deployment `__
+     can also be used for development.
+---
+ref: note-atlas-search-async
+content: |
+   .. note::
+
+      Atlas Search indexes are managed asynchronously. After creating or
+      updating an index, you can periodically execute
+      :phpmethod:`MongoDB\\Collection::listSearchIndexes()` and check the
+      ``queryable`` :manual:`output field  `
+      to determine whether it is ready to be used.
 ...
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index 9c9aa313..2d03b162 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -65,12 +65,15 @@ Methods
    /reference/method/MongoDBCollection-countDocuments
    /reference/method/MongoDBCollection-createIndex
    /reference/method/MongoDBCollection-createIndexes
+   /reference/method/MongoDBCollection-createSearchIndex
+   /reference/method/MongoDBCollection-createSearchIndexes
    /reference/method/MongoDBCollection-deleteMany
    /reference/method/MongoDBCollection-deleteOne
    /reference/method/MongoDBCollection-distinct
    /reference/method/MongoDBCollection-drop
    /reference/method/MongoDBCollection-dropIndex
    /reference/method/MongoDBCollection-dropIndexes
+   /reference/method/MongoDBCollection-dropSearchIndex
    /reference/method/MongoDBCollection-estimatedDocumentCount
    /reference/method/MongoDBCollection-explain
    /reference/method/MongoDBCollection-find
@@ -89,10 +92,12 @@ Methods
    /reference/method/MongoDBCollection-insertMany
    /reference/method/MongoDBCollection-insertOne
    /reference/method/MongoDBCollection-listIndexes
+   /reference/method/MongoDBCollection-listSearchIndexes
    /reference/method/MongoDBCollection-mapReduce
    /reference/method/MongoDBCollection-rename
    /reference/method/MongoDBCollection-replaceOne
    /reference/method/MongoDBCollection-updateMany
    /reference/method/MongoDBCollection-updateOne
+   /reference/method/MongoDBCollection-updateSearchIndex
    /reference/method/MongoDBCollection-watch
    /reference/method/MongoDBCollection-withOptions
diff --git a/source/reference/method/MongoDBCollection-createSearchIndex.txt b/source/reference/method/MongoDBCollection-createSearchIndex.txt
new file mode 100644
index 00000000..d3f63773
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-createSearchIndex.txt
@@ -0,0 +1,88 @@
+========================================
+MongoDB\\Collection::createSearchIndex()
+========================================
+
+.. versionadded:: 1.17
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::createSearchIndex()
+
+   Create an Atlas Search index for the collection.
+
+   .. code-block:: php
+
+      function createSearchIndex(array|object $definition, array $options = []): string
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndex-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndex-option.rst
+
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
+   .. include:: /includes/extracts/note-atlas-search-async.rst
+
+Return Values
+-------------
+
+The name of the created Atlas Search index as a string.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+Examples
+--------
+
+Create an Index with Dynamic Mappings
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following example creates an Atlas Search index using
+`dynamic mappings `__
+to index all document fields containing
+`supported data types `__.
+
+.. code-block:: php
+
+   selectCollection('test', 'articles');
+
+   $indexName = $collection->createSearchIndex(
+      ['mappings' => ['dynamic' => true]],
+      ['name' => 'test-search-index']
+   );
+
+   var_dump($indexName);
+
+The output would then resemble:
+
+.. code-block:: none
+
+   string(17) "test-search-index"
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :manual:`createSearchIndexes ` command
+  reference in the MongoDB manual
+- `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-createSearchIndexes.txt b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
new file mode 100644
index 00000000..176dbf6a
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
@@ -0,0 +1,88 @@
+==========================================
+MongoDB\\Collection::createSearchIndexes()
+==========================================
+
+.. versionadded:: 1.17
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::createSearchIndexes()
+
+   Create one or more Atlas Search indexes for the collection.
+
+   .. code-block:: php
+
+      function createSearchIndexes(array $indexes, array $options = []): string
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndexes-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndexes-option.rst
+
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
+   .. include:: /includes/extracts/note-atlas-search-async.rst
+
+Return Values
+-------------
+
+The names of the created Atlas Search indexes as an array of strings.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+Examples
+--------
+
+Create Indexes with Static and Dynamic Mappings
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following example creates an Atlas Search index using
+`dynamic mappings `__
+to index all document fields containing
+`supported data types `__.
+
+.. code-block:: php
+
+   selectCollection('test', 'articles');
+
+   $indexName = $collection->createSearchIndex(
+      ['mappings' => ['dynamic' => true]],
+      ['name' => 'test-search-index']
+   );
+
+   var_dump($indexName);
+
+The output would then resemble:
+
+.. code-block:: none
+
+   string(17) "test-search-index"
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :manual:`createSearchIndexes ` command
+  reference in the MongoDB manual
+- `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-dropSearchIndex.txt b/source/reference/method/MongoDBCollection-dropSearchIndex.txt
new file mode 100644
index 00000000..befd5bf0
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-dropSearchIndex.txt
@@ -0,0 +1,52 @@
+======================================
+MongoDB\\Collection::dropSearchIndex()
+======================================
+
+.. versionadded:: 1.17
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::dropSearchIndex()
+
+   Drop an Atlas Search index for the collection.
+
+   .. code-block:: php
+
+      function dropSearchIndex(string $name, array $options = []): void
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-dropSearchIndex-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-dropSearchIndex-option.rst
+
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :manual:`dropSearchIndex ` command
+  reference in the MongoDB manual
+- `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-listSearchIndexes.txt b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
new file mode 100644
index 00000000..8dc98600
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
@@ -0,0 +1,60 @@
+========================================
+MongoDB\\Collection::listSearchIndexes()
+========================================
+
+.. versionadded:: 1.17
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::listSearchIndexes()
+
+   Gets index information for one or more search indexes in the collection.
+
+   .. code-block:: php
+
+      function listSearchIndexes(array $options = []): Countable&Iterator
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-listSearchIndexes-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-listSearchIndexes-option.rst
+
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
+
+Return Values
+-------------
+
+A list of documents, each of which describes a search index on the collection.
+For details on the output fields, see
+:manual:`$listSearchIndexes: Output `
+in the MongoDB manual.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :manual:`$listSearchIndexes `
+  aggregation pipeline stage reference in the MongoDB manual
+- `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-updateSearchIndex.txt b/source/reference/method/MongoDBCollection-updateSearchIndex.txt
new file mode 100644
index 00000000..2633d379
--- /dev/null
+++ b/source/reference/method/MongoDBCollection-updateSearchIndex.txt
@@ -0,0 +1,53 @@
+========================================
+MongoDB\\Collection::updateSearchIndex()
+========================================
+
+.. versionadded:: 1.17
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Collection::updateSearchIndex()
+
+   Update an Atlas Search index for the collection.
+
+   .. code-block:: php
+
+      function updateSearchIndex(string $name, array|object $definition, array $options = []): void
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-updateSearchIndex-param.rst
+
+   The ``$options`` parameter supports the following options:
+
+   .. include:: /includes/apiargs/MongoDBCollection-method-updateSearchIndex-option.rst
+
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
+   .. include:: /includes/extracts/note-atlas-search-async.rst
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-unsupportedexception.rst
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+.. include:: /includes/extracts/error-driver-runtimeexception.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
+- :manual:`updateSearchIndex ` command
+  reference in the MongoDB manual
+- `Atlas Search `__ documentation in the MongoDB Manual

From 450240b25a63ee61694381f692e42c65a85455e4 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 9 Nov 2023 09:33:21 -0500
Subject: [PATCH 288/321] PHPLIB-1243: Document add/remove logger functions
 (#1191)

---
 .../apiargs-function-add_logger-param.yaml    | 11 ++++
 .../apiargs-function-remove_logger-param.yaml | 11 ++++
 source/reference/function/add_logger.txt      | 59 +++++++++++++++++++
 source/reference/function/remove_logger.txt   | 40 +++++++++++++
 source/reference/functions.txt                |  2 +
 5 files changed, 123 insertions(+)
 create mode 100644 source/includes/apiargs-function-add_logger-param.yaml
 create mode 100644 source/includes/apiargs-function-remove_logger-param.yaml
 create mode 100644 source/reference/function/add_logger.txt
 create mode 100644 source/reference/function/remove_logger.txt

diff --git a/source/includes/apiargs-function-add_logger-param.yaml b/source/includes/apiargs-function-add_logger-param.yaml
new file mode 100644
index 00000000..424b405f
--- /dev/null
+++ b/source/includes/apiargs-function-add_logger-param.yaml
@@ -0,0 +1,11 @@
+arg_name: param
+name: $logger
+type: Psr\\Log\\LoggerInterface
+description: |
+  A logger to register.
+
+  If the logger is already registered, the method will have no effect.
+interface: phpmethod
+operation: ~
+optional: false
+...
diff --git a/source/includes/apiargs-function-remove_logger-param.yaml b/source/includes/apiargs-function-remove_logger-param.yaml
new file mode 100644
index 00000000..7ee1be56
--- /dev/null
+++ b/source/includes/apiargs-function-remove_logger-param.yaml
@@ -0,0 +1,11 @@
+arg_name: param
+name: $logger
+type: Psr\\Log\\LoggerInterface
+description: |
+  A logger to unregister.
+
+  If the logger is not registered, the method will have no effect.
+interface: phpmethod
+operation: ~
+optional: false
+...
diff --git a/source/reference/function/add_logger.txt b/source/reference/function/add_logger.txt
new file mode 100644
index 00000000..ada7c9de
--- /dev/null
+++ b/source/reference/function/add_logger.txt
@@ -0,0 +1,59 @@
+=====================
+MongoDB\\add_logger()
+=====================
+
+.. versionadded:: 1.17
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\add_logger()
+
+   Registers a PSR logger to receive log messages from the driver.
+
+   .. code-block:: php
+
+      function add_logger(Psr\Log\LoggerInterface $logger): void
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/function-add_logger-param.rst
+
+Behavior
+--------
+
+This function allows the application to register one or more
+`Psr\\Log\\LoggerInterface `__
+objects to receive log messages from libmongoc and the driver. Each registered
+logger will receive messages for *all* clients.
+
+Messages originating from the extension will have their log level translated to
+an equivalent `PSR log level `__.
+For performance reasons, trace-level messages from the extension are *not*
+forwarded to PSR loggers. The extension's
+:php:`mongodb.debug ` INI
+configuration must be used to collect trace-level logs.
+
+Log messages also include a domain string that identifies the driver component
+that emitted the log message. This value is provided to the PSR logger via the
+{{domain}} key of the context array.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\remove_logger()`
+- `PSR-3: Logger Interface `__
+- `libmongoc: Logging `__
diff --git a/source/reference/function/remove_logger.txt b/source/reference/function/remove_logger.txt
new file mode 100644
index 00000000..d183f94b
--- /dev/null
+++ b/source/reference/function/remove_logger.txt
@@ -0,0 +1,40 @@
+========================
+MongoDB\\remove_logger()
+========================
+
+.. versionadded:: 1.17
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\remove_logger()
+
+   Unregisters a PSR logger to no longer receive log messages from the driver.
+
+   .. code-block:: php
+
+      function remove_logger(Psr\Log\LoggerInterface $logger): void
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/function-remove_logger-param.rst
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\add_logger()`
+- `PSR-3: Logger Interface `__
+- `libmongoc: Logging `__
diff --git a/source/reference/functions.txt b/source/reference/functions.txt
index 4ce49e3f..fb38d568 100644
--- a/source/reference/functions.txt
+++ b/source/reference/functions.txt
@@ -13,4 +13,6 @@ Functions
 .. toctree::
    :titlesonly:
 
+   /reference/function/add_logger
+   /reference/function/remove_logger
    /reference/function/with_transaction

From ad14704960121334d7d7c18a084f9cd298bf3a75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?=
 
Date: Thu, 23 Nov 2023 09:20:57 +0100
Subject: [PATCH 289/321] PHPLIB-1309 Add addSubscriber/removeSubscriber to
 Client class to ease configuration (#1195)

Co-authored-by: Jeremy Mikola 
---
 ...goDBClient-method-addSubscriber-param.yaml |   9 ++
 ...BClient-method-removeSubscriber-param.yaml |   9 ++
 source/reference/class/MongoDBClient.txt      |   2 +
 .../method/MongoDBClient-addSubscriber.txt    | 132 ++++++++++++++++++
 .../method/MongoDBClient-removeSubscriber.txt |  46 ++++++
 5 files changed, 198 insertions(+)
 create mode 100644 source/includes/apiargs-MongoDBClient-method-addSubscriber-param.yaml
 create mode 100644 source/includes/apiargs-MongoDBClient-method-removeSubscriber-param.yaml
 create mode 100644 source/reference/method/MongoDBClient-addSubscriber.txt
 create mode 100644 source/reference/method/MongoDBClient-removeSubscriber.txt

diff --git a/source/includes/apiargs-MongoDBClient-method-addSubscriber-param.yaml b/source/includes/apiargs-MongoDBClient-method-addSubscriber-param.yaml
new file mode 100644
index 00000000..27de6150
--- /dev/null
+++ b/source/includes/apiargs-MongoDBClient-method-addSubscriber-param.yaml
@@ -0,0 +1,9 @@
+arg_name: param
+name: $subscriber
+type: :php:`MongoDB\\Driver\\Monitoring\\Subscriber `
+description: |
+  A monitoring event subscriber to register with this Client.
+interface: phpmethod
+operation: ~
+optional: false
+...
diff --git a/source/includes/apiargs-MongoDBClient-method-removeSubscriber-param.yaml b/source/includes/apiargs-MongoDBClient-method-removeSubscriber-param.yaml
new file mode 100644
index 00000000..eaeec4fd
--- /dev/null
+++ b/source/includes/apiargs-MongoDBClient-method-removeSubscriber-param.yaml
@@ -0,0 +1,9 @@
+arg_name: param
+name: $subscriber
+type: :php:`MongoDB\\Driver\\Monitoring\\Subscriber `
+description: |
+  A monitoring event subscriber to unregister with this Client.
+interface: phpmethod
+operation: ~
+optional: false
+...
diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
index b677ebb1..654a474a 100644
--- a/source/reference/class/MongoDBClient.txt
+++ b/source/reference/class/MongoDBClient.txt
@@ -30,6 +30,7 @@ Methods
 
    /reference/method/MongoDBClient__construct
    /reference/method/MongoDBClient__get
+   /reference/method/MongoDBClient-addSubscriber
    /reference/method/MongoDBClient-createClientEncryption
    /reference/method/MongoDBClient-dropDatabase
    /reference/method/MongoDBClient-getManager
@@ -39,6 +40,7 @@ Methods
    /reference/method/MongoDBClient-getWriteConcern
    /reference/method/MongoDBClient-listDatabaseNames
    /reference/method/MongoDBClient-listDatabases
+   /reference/method/MongoDBClient-removeSubscriber
    /reference/method/MongoDBClient-selectCollection
    /reference/method/MongoDBClient-selectDatabase
    /reference/method/MongoDBClient-startSession
diff --git a/source/reference/method/MongoDBClient-addSubscriber.txt b/source/reference/method/MongoDBClient-addSubscriber.txt
new file mode 100644
index 00000000..e55a9484
--- /dev/null
+++ b/source/reference/method/MongoDBClient-addSubscriber.txt
@@ -0,0 +1,132 @@
+================================
+MongoDB\\Client::addSubscriber()
+================================
+
+.. versionadded:: 1.18
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::addSubscriber()
+
+    Registers a monitoring event subscriber with this Client. The subscriber
+    will be notified of all events for this Client.
+
+   .. code-block:: php
+
+      function addSubscriber(MongoDB\Driver\Monitoring\Subscriber $subscriber): void
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-addSubscriber-param.rst
+
+   .. note::
+
+         If ``$subscriber`` is already registered with this Client, this function
+         is a no-op. If ``$subscriber`` is also registered globally, it will still
+         only be notified once of each event for this Client.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
+:php:`MongoDB\\Driver\\Exception\\InvalidArgumentException `
+if subscriber is a :php:`MongoDB\\Driver\\Monitoring\\LogSubscriber `,
+since loggers can only be registered globally with
+:php:`MongoDB\\Driver\\Monitoring\\addSubscriber `.
+
+Example
+-------
+
+Create a :phpclass:`MongoDB\\Driver\\Monitoring\\CommandSubscriber` that
+logs all events:
+
+.. code-block:: php
+
+    stream = $stream;
+        }
+
+        public function commandStarted(CommandStartedEvent $event): void
+        {
+            fwrite($this->stream, sprintf(
+                'Started command #%d "%s": %s%s',
+                $event->getRequestId(),
+                $event->getCommandName(),
+                Document::fromPHP($event->getCommand())->toCanonicalExtendedJSON(),
+                PHP_EOL,
+            ));
+        }
+
+        public function commandSucceeded(CommandSucceededEvent $event): void
+        {
+            fwrite($this->stream, sprintf(
+                'Succeeded command #%d "%s" in %d microseconds: %s%s',
+                $event->getRequestId(),
+                $event->getCommandName(),
+                $event->getDurationMicros(),
+                json_encode($event->getReply()),
+                PHP_EOL,
+            ));
+        }
+
+        public function commandFailed(CommandFailedEvent $event): void
+        {
+            fwrite($this->stream, sprintf(
+                'Failed command #%d "%s" in %d microseconds: %s%s',
+                $event->getRequestId(),
+                $event->getCommandName(),
+                $event->getDurationMicros(),
+                $event->getError()->getMessage(),
+                PHP_EOL,
+            ));
+        }
+    }
+
+The subscriber can then be registered with a Client:
+
+.. code-block:: php
+
+    addSubscriber($subscriber);
+
+    $client->test->users->insertOne(['username' => 'alice']);
+
+The above code will write the following to stderr output:
+
+.. code-block:: text
+
+    Started command #1 "insert": { "insert" : "users", "ordered" : true, "$db" : "test", "lsid" : { "id" : { "$binary" : { "base64" : "dKTBhZD7Qvi0vUhvR58mCA==", "subType" : "04" } } }, "documents" : [ { "username" : "alice", "_id" : { "$oid" : "655d1fca12e81018340a4fc2" } } ] }
+    Succeeded command #1 "insert" in 876 microseconds: {"n":1,"ok":1}
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::removeSubscriber()`
+- :php:`Application Performance Monitoring (APM) `
+- :php:`MongoDB\\Driver\\Manager::addSubscriber() `
+- :php:`MongoDB\Driver\Monitoring\CommandSubscriber `
diff --git a/source/reference/method/MongoDBClient-removeSubscriber.txt b/source/reference/method/MongoDBClient-removeSubscriber.txt
new file mode 100644
index 00000000..28e7e6d9
--- /dev/null
+++ b/source/reference/method/MongoDBClient-removeSubscriber.txt
@@ -0,0 +1,46 @@
+================================
+MongoDB\\Client::removeSubscriber()
+================================
+
+.. versionadded:: 1.18
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\Client::removeSubscriber()
+
+    Unregisters a monitoring event subscriber with this Client.
+
+   .. code-block:: php
+
+      function removeSubscriber(MongoDB\Driver\Monitoring\Subscriber $subscriber): void
+
+   This method has the following parameters:
+
+   .. include:: /includes/apiargs/MongoDBClient-method-removeSubscriber-param.rst
+
+   .. note::
+
+         If ``$subscriber`` is not registered with this Client, this function
+         is a no-op.
+
+Errors/Exceptions
+-----------------
+
+.. include:: /includes/extracts/error-invalidargumentexception.rst
+
+See Also
+--------
+
+- :phpmethod:`MongoDB\\Client::addSubscriber()`
+- :php:`Application Performance Monitoring (APM) `
+- :php:`MongoDB\\Driver\\Manager::removeSubscriber() `
+- :php:`MongoDB\Driver\Monitoring\CommandSubscriber `

From 406c33b3b8574866ce277754675b6a1e8d3480cf Mon Sep 17 00:00:00 2001
From: Andreas Braun 
Date: Thu, 23 Nov 2023 11:37:07 +0100
Subject: [PATCH 290/321] Fix wrong data type in codec tutorial (#1194)

* Fix wrong data type in codec tutorial

* Add note about data types in DateTimeCodec
---
 source/examples/codecs/handling-data-types/Person.php | 2 +-
 source/tutorial/codecs.txt                            | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/source/examples/codecs/handling-data-types/Person.php b/source/examples/codecs/handling-data-types/Person.php
index e99b3c4c..4f1307d9 100644
--- a/source/examples/codecs/handling-data-types/Person.php
+++ b/source/examples/codecs/handling-data-types/Person.php
@@ -6,7 +6,7 @@ final class Person
 {
     public function __construct(
         public string $name,
-        public readonly DateTime $createdAt = new DateTime(),
+        public readonly DateTimeImmutable $createdAt = new DateTimeImmutable(),
         public readonly ObjectId $id = new ObjectId(),
     ) {
     }
diff --git a/source/tutorial/codecs.txt b/source/tutorial/codecs.txt
index 67523f11..32669cbf 100644
--- a/source/tutorial/codecs.txt
+++ b/source/tutorial/codecs.txt
@@ -74,7 +74,12 @@ BSON date and accompanying timezone string. Those same embedded documents can th
 .. literalinclude:: /examples/codecs/handling-data-types/DateTimeCodec.php
    :language: php
 
-This codec can now be leveraged by other codecs handle date fields.
+.. note::
+   When writing a codec, you should be as lenient as possible when it comes to handling data. In this case, the codec
+   handles any ``DateTimeInterface`` when encoding to BSON, as a ``UTCDateTime`` instance can be created from any such
+   object. When decoding data from BSON, it will always decode to a ``DateTimeImmutable`` instance.
+
+This codec can now be leveraged by other codecs that handle date fields.
 
 First, we add a ``createdAt`` field to the ``Person`` class:
 

From c79bd2dda8d37163459a0321c5105d00bdc3b962 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 28 Nov 2023 09:37:55 -0500
Subject: [PATCH 291/321] Fix title formatting in Client::removeSubscriber()
 docs (#1204)

This was missed in ad14704960121334d7d7c18a084f9cd298bf3a75
---
 source/reference/method/MongoDBClient-removeSubscriber.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source/reference/method/MongoDBClient-removeSubscriber.txt b/source/reference/method/MongoDBClient-removeSubscriber.txt
index 28e7e6d9..619fb70c 100644
--- a/source/reference/method/MongoDBClient-removeSubscriber.txt
+++ b/source/reference/method/MongoDBClient-removeSubscriber.txt
@@ -1,6 +1,6 @@
-================================
+===================================
 MongoDB\\Client::removeSubscriber()
-================================
+===================================
 
 .. versionadded:: 1.18
 

From c51f6fcd2bad36e9ab8e2ec25f38e95573004794 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Wed, 13 Dec 2023 09:12:27 -0500
Subject: [PATCH 292/321] PHPLIB-1275: Replace apiargs usage in docs with
 extracts (#1203)

Use extracts for option includes and repeated option notes. Order options alphabetically.

Split up index and command options into separate tables.

* Change RST syntax for function and method params

This adds a Parameters section and uses a definition list, which is more consistent with PHPC. It also allows group the options table under the options param.

* Fix BulkWriteResult::getModifiedCount() return type

* Fix position of type map anchor

This was inadvertently moved in b6bc50dad80d06291b8324f0ce4a6f49fe508dcd

* Use basic paragraphs for Atlas Search notes

* Move Atlas Search requirement note to Definition section
---
 .../apiargs-MongoDBClient-common-option.yaml  |  34 --
 ...goDBClient-method-addSubscriber-param.yaml |   9 -
 ...Client-method-construct-driverOptions.yaml | 189 ---------
 ...-MongoDBClient-method-construct-param.yaml |  51 ---
 ...t-method-createClientEncryption-param.yaml |   4 -
 ...goDBClient-method-dropDatabase-option.yaml |  25 --
 ...ngoDBClient-method-dropDatabase-param.yaml |  10 -
 ...piargs-MongoDBClient-method-get-param.yaml |   6 -
 ...oDBClient-method-listDatabases-option.yaml |  47 ---
 ...goDBClient-method-listDatabases-param.yaml |   4 -
 ...BClient-method-removeSubscriber-param.yaml |   9 -
 ...Client-method-selectCollection-option.yaml |  27 --
 ...BClient-method-selectCollection-param.yaml |  16 -
 ...DBClient-method-selectDatabase-option.yaml |  27 --
 ...oDBClient-method-selectDatabase-param.yaml |  10 -
 ...rgs-MongoDBClient-method-watch-option.yaml |  71 ----
 ...args-MongoDBClient-method-watch-param.yaml |   8 -
 ...iargs-MongoDBCollection-common-option.yaml |  86 -----
 ...piargs-MongoDBCollection-common-param.yaml |  33 --
 ...oDBCollection-method-aggregate-option.yaml |  72 ----
 ...goDBCollection-method-aggregate-param.yaml |  14 -
 ...oDBCollection-method-bulkWrite-option.yaml |  44 ---
 ...goDBCollection-method-bulkWrite-param.yaml |  37 --
 ...oDBCollection-method-construct-option.yaml |  25 --
 ...goDBCollection-method-construct-param.yaml |  16 -
 ...MongoDBCollection-method-count-option.yaml |  64 ---
 ...-MongoDBCollection-method-count-param.yaml |  11 -
 ...llection-method-countDocuments-option.yaml |  56 ---
 ...ollection-method-countDocuments-param.yaml |  11 -
 ...BCollection-method-createIndex-option.yaml | 117 ------
 ...DBCollection-method-createIndex-param.yaml |  20 -
 ...ollection-method-createIndexes-option.yaml |  29 --
 ...Collection-method-createIndexes-param.yaml |  23 --
 ...ction-method-createSearchIndex-option.yaml |  17 -
 ...ection-method-createSearchIndex-param.yaml |  14 -
 ...ion-method-createSearchIndexes-option.yaml |   4 -
 ...tion-method-createSearchIndexes-param.yaml |  21 -
 ...DBCollection-method-deleteMany-option.yaml |  38 --
 ...oDBCollection-method-deleteMany-param.yaml |  11 -
 ...oDBCollection-method-deleteOne-option.yaml |  38 --
 ...goDBCollection-method-deleteOne-param.yaml |  11 -
 ...goDBCollection-method-distinct-option.yaml |  37 --
 ...ngoDBCollection-method-distinct-param.yaml |  20 -
 ...-MongoDBCollection-method-drop-option.yaml |  31 --
 ...s-MongoDBCollection-method-drop-param.yaml |   4 -
 ...oDBCollection-method-dropIndex-option.yaml |  31 --
 ...goDBCollection-method-dropIndex-param.yaml |  15 -
 ...BCollection-method-dropIndexes-option.yaml |  29 --
 ...DBCollection-method-dropIndexes-param.yaml |   4 -
 ...lection-method-dropSearchIndex-option.yaml |   4 -
 ...llection-method-dropSearchIndex-param.yaml |  13 -
 ...n-method-estimateDocumentCount-option.yaml |  25 --
 ...on-method-estimateDocumentCount-param.yaml |   4 -
 ...ngoDBCollection-method-explain-option.yaml |  31 --
 ...ongoDBCollection-method-explain-param.yaml |  13 -
 ...-MongoDBCollection-method-find-option.yaml | 263 -------------
 ...s-MongoDBCollection-method-find-param.yaml |  11 -
 ...ngoDBCollection-method-findOne-option.yaml |  84 ----
 ...ongoDBCollection-method-findOne-param.yaml |  11 -
 ...ection-method-findOneAndDelete-option.yaml |  56 ---
 ...lection-method-findOneAndDelete-param.yaml |  11 -
 ...ction-method-findOneAndReplace-option.yaml |  77 ----
 ...ection-method-findOneAndReplace-param.yaml |  15 -
 ...ection-method-findOneAndUpdate-option.yaml |  83 ----
 ...lection-method-findOneAndUpdate-param.yaml |  15 -
 ...DBCollection-method-insertMany-option.yaml |  27 --
 ...oDBCollection-method-insertMany-param.yaml |  13 -
 ...oDBCollection-method-insertOne-option.yaml |  23 --
 ...goDBCollection-method-insertOne-param.yaml |  13 -
 ...BCollection-method-listIndexes-option.yaml |  19 -
 ...DBCollection-method-listIndexes-param.yaml |   4 -
 ...ction-method-listSearchIndexes-option.yaml |  44 ---
 ...ection-method-listSearchIndexes-param.yaml |   4 -
 ...oDBCollection-method-mapReduce-option.yaml | 113 ------
 ...goDBCollection-method-mapReduce-param.yaml |  46 ---
 ...ongoDBCollection-method-rename-option.yaml |  33 --
 ...MongoDBCollection-method-rename-param.yaml |  25 --
 ...DBCollection-method-replaceOne-option.yaml |  46 ---
 ...oDBCollection-method-replaceOne-param.yaml |  15 -
 ...DBCollection-method-updateMany-option.yaml |  52 ---
 ...oDBCollection-method-updateMany-param.yaml |  15 -
 ...oDBCollection-method-updateOne-option.yaml |  52 ---
 ...goDBCollection-method-updateOne-param.yaml |  15 -
 ...ction-method-updateSearchIndex-option.yaml |   4 -
 ...ection-method-updateSearchIndex-param.yaml |  25 --
 ...MongoDBCollection-method-watch-option.yaml |  73 ----
 ...-MongoDBCollection-method-watch-param.yaml |   8 -
 ...BCollection-method-withOptions-option.yaml |  27 --
 ...DBCollection-method-withOptions-param.yaml |   4 -
 ...apiargs-MongoDBDatabase-common-option.yaml |  36 --
 ...ngoDBDatabase-method-aggregate-option.yaml |  64 ---
 ...ongoDBDatabase-method-aggregate-param.yaml |  14 -
 ...MongoDBDatabase-method-command-option.yaml |  17 -
 ...-MongoDBDatabase-method-command-param.yaml |  13 -
 ...ngoDBDatabase-method-construct-option.yaml |  25 --
 ...ongoDBDatabase-method-construct-param.yaml |  12 -
 ...tabase-method-createCollection-option.yaml | 363 ------------------
 ...atabase-method-createCollection-param.yaml |  10 -
 ...ethod-createEncryptedCollection-param.yaml |  47 ---
 ...gs-MongoDBDatabase-method-drop-option.yaml |  25 --
 ...rgs-MongoDBDatabase-method-drop-param.yaml |   4 -
 ...Database-method-dropCollection-option.yaml |  31 --
 ...BDatabase-method-dropCollection-param.yaml |  10 -
 ...args-MongoDBDatabase-method-get-param.yaml |   6 -
 ...atabase-method-listCollections-option.yaml |  46 ---
 ...Database-method-listCollections-param.yaml |   4 -
 ...tabase-method-modifyCollection-option.yaml |  23 --
 ...atabase-method-modifyCollection-param.yaml |  20 -
 ...tabase-method-renameCollection-option.yaml |  33 --
 ...atabase-method-renameCollection-param.yaml |  34 --
 ...tabase-method-selectCollection-option.yaml |  27 --
 ...atabase-method-selectCollection-param.yaml |  10 -
 ...base-method-selectGridFSBucket-option.yaml |  52 ---
 ...abase-method-selectGridFSBucket-param.yaml |   4 -
 ...s-MongoDBDatabase-method-watch-option.yaml |  71 ----
 ...gs-MongoDBDatabase-method-watch-param.yaml |   8 -
 ...oDBDatabase-method-withOptions-option.yaml |  27 --
 ...goDBDatabase-method-withOptions-param.yaml |   4 -
 ...rgs-MongoDBGridFSBucket-common-option.yaml |  61 ---
 ...args-MongoDBGridFSBucket-common-param.yaml |  39 --
 ...BGridFSBucket-method-construct-option.yaml |  50 ---
 ...DBGridFSBucket-method-construct-param.yaml |  12 -
 ...ngoDBGridFSBucket-method-delete-param.yaml |   6 -
 ...SBucket-method-downloadToStream-param.yaml |  10 -
 ...-method-downloadToStreamByName-option.yaml |   4 -
 ...t-method-downloadToStreamByName-param.yaml |  14 -
 ...ongoDBGridFSBucket-method-find-option.yaml |  76 ----
 ...oDBGridFSBucket-method-findOne-option.yaml |  46 ---
 ...method-getFileDocumentForStream-param.yaml |   4 -
 ...ucket-method-getFileIdForStream-param.yaml |   4 -
 ...ucket-method-openDownloadStream-param.yaml |   6 -
 ...ethod-openDownloadStreamByName-option.yaml |   4 -
 ...method-openDownloadStreamByName-param.yaml |  10 -
 ...Bucket-method-openUploadStream-option.yaml |  18 -
 ...SBucket-method-openUploadStream-param.yaml |  10 -
 ...ngoDBGridFSBucket-method-rename-param.yaml |  15 -
 ...Bucket-method-uploadFromStream-option.yaml |  18 -
 ...SBucket-method-uploadFromStream-param.yaml |  19 -
 source/includes/apiargs-aggregate-option.yaml |  43 ---
 source/includes/apiargs-common-option.yaml    | 124 ------
 source/includes/apiargs-common-param.yaml     |  42 --
 .../apiargs-dropCollection-option.yaml        |  21 -
 .../apiargs-function-add_logger-param.yaml    |  11 -
 .../apiargs-function-remove_logger-param.yaml |  11 -
 ...iargs-function-with_transaction-param.yaml |  31 --
 .../includes/apiargs-method-watch-param.yaml  |  13 -
 source/includes/extracts-bucket-option.yaml   |  28 ++
 source/includes/extracts-client-option.yaml   |  28 ++
 .../includes/extracts-collection-option.yaml  |  38 ++
 source/includes/extracts-common-option.yaml   |  86 +++++
 source/includes/extracts-database-option.yaml |  28 ++
 source/includes/extracts-note.yaml            |  24 +-
 source/includes/extracts-option-requires.yaml |  48 +++
 ...option.yaml => extracts-watch-option.yaml} |  89 ++---
 source/reference/function/add_logger.txt      |   8 +-
 source/reference/function/remove_logger.txt   |   8 +-
 .../reference/function/with_transaction.txt   |  22 +-
 ...ongoDBBulkWriteResult-getModifiedCount.txt |   2 +-
 .../method/MongoDBClient-addSubscriber.txt    |  19 +-
 .../MongoDBClient-createClientEncryption.txt  |  17 +-
 .../method/MongoDBClient-dropDatabase.txt     |  41 +-
 .../MongoDBClient-listDatabaseNames.txt       |  51 ++-
 .../method/MongoDBClient-listDatabases.txt    |  53 ++-
 .../method/MongoDBClient-removeSubscriber.txt |  16 +-
 .../method/MongoDBClient-selectCollection.txt |  46 ++-
 .../method/MongoDBClient-selectDatabase.txt   |  42 +-
 .../method/MongoDBClient-startSession.txt     |  10 +-
 .../reference/method/MongoDBClient-watch.txt  |  85 +++-
 .../method/MongoDBClient__construct.txt       | 190 ++++++++-
 .../reference/method/MongoDBClient__get.txt   |   6 +-
 .../method/MongoDBCollection-aggregate.txt    | 115 +++++-
 .../method/MongoDBCollection-bulkWrite.txt    |  87 ++++-
 .../method/MongoDBCollection-count.txt        |  72 +++-
 .../MongoDBCollection-countDocuments.txt      |  57 ++-
 .../method/MongoDBCollection-createIndex.txt  | 112 +++++-
 .../MongoDBCollection-createIndexes.txt       |  83 +++-
 .../MongoDBCollection-createSearchIndex.txt   |  42 +-
 .../MongoDBCollection-createSearchIndexes.txt |  42 +-
 .../method/MongoDBCollection-deleteMany.txt   |  60 ++-
 .../method/MongoDBCollection-deleteOne.txt    |  60 ++-
 .../method/MongoDBCollection-distinct.txt     |  65 +++-
 .../method/MongoDBCollection-drop.txt         |  62 ++-
 .../method/MongoDBCollection-dropIndex.txt    |  56 ++-
 .../method/MongoDBCollection-dropIndexes.txt  |  51 ++-
 .../MongoDBCollection-dropSearchIndex.txt     |  23 +-
 ...ngoDBCollection-estimatedDocumentCount.txt |  40 +-
 .../method/MongoDBCollection-explain.txt      |  47 ++-
 .../method/MongoDBCollection-find.txt         | 200 +++++++++-
 .../method/MongoDBCollection-findOne.txt      | 151 +++++++-
 .../MongoDBCollection-findOneAndDelete.txt    |  82 +++-
 .../MongoDBCollection-findOneAndReplace.txt   | 105 ++++-
 .../MongoDBCollection-findOneAndUpdate.txt    | 116 +++++-
 .../method/MongoDBCollection-insertMany.txt   |  57 ++-
 .../method/MongoDBCollection-insertOne.txt    |  47 ++-
 .../method/MongoDBCollection-listIndexes.txt  |  32 +-
 .../MongoDBCollection-listSearchIndexes.txt   |  66 +++-
 .../method/MongoDBCollection-mapReduce.txt    | 134 ++++++-
 .../method/MongoDBCollection-rename.txt       |  58 ++-
 .../method/MongoDBCollection-replaceOne.txt   |  75 +++-
 .../method/MongoDBCollection-updateMany.txt   |  86 ++++-
 .../method/MongoDBCollection-updateOne.txt    |  86 ++++-
 .../MongoDBCollection-updateSearchIndex.txt   |  41 +-
 .../method/MongoDBCollection-watch.txt        |  89 ++++-
 .../method/MongoDBCollection-withOptions.txt  |  40 +-
 .../method/MongoDBCollection__construct.txt   |  58 ++-
 .../method/MongoDBDatabase-aggregate.txt      | 104 ++++-
 .../method/MongoDBDatabase-command.txt        |  36 +-
 .../MongoDBDatabase-createCollection.txt      | 296 +++++++++++++-
 ...goDBDatabase-createEncryptedCollection.txt |  38 +-
 .../reference/method/MongoDBDatabase-drop.txt |  38 +-
 .../method/MongoDBDatabase-dropCollection.txt |  66 +++-
 .../MongoDBDatabase-listCollectionNames.txt   |  48 ++-
 .../MongoDBDatabase-listCollections.txt       |  50 ++-
 .../MongoDBDatabase-modifyCollection.txt      |  48 ++-
 .../MongoDBDatabase-renameCollection.txt      |  60 ++-
 .../MongoDBDatabase-selectCollection.txt      |  42 +-
 .../MongoDBDatabase-selectGridFSBucket.txt    |  51 ++-
 .../method/MongoDBDatabase-watch.txt          |  85 +++-
 .../method/MongoDBDatabase-withOptions.txt    |  40 +-
 .../method/MongoDBDatabase__construct.txt     |  61 ++-
 .../reference/method/MongoDBDatabase__get.txt |   6 +-
 .../method/MongoDBGridFSBucket-delete.txt     |   6 +-
 .../MongoDBGridFSBucket-downloadToStream.txt  |   9 +-
 ...oDBGridFSBucket-downloadToStreamByName.txt |  42 +-
 .../method/MongoDBGridFSBucket-find.txt       | 200 +++++++++-
 .../method/MongoDBGridFSBucket-findOne.txt    | 151 +++++++-
 ...BGridFSBucket-getFileDocumentForStream.txt |   6 +-
 ...MongoDBGridFSBucket-getFileIdForStream.txt |   6 +-
 ...MongoDBGridFSBucket-openDownloadStream.txt |   6 +-
 ...BGridFSBucket-openDownloadStreamByName.txt |  38 +-
 .../MongoDBGridFSBucket-openUploadStream.txt  |  45 ++-
 .../method/MongoDBGridFSBucket-rename.txt     |   9 +-
 .../MongoDBGridFSBucket-uploadFromStream.txt  |  49 ++-
 .../method/MongoDBGridFSBucket__construct.txt |  74 +++-
 source/tutorial/modeling-bson-data.txt        |   2 +-
 235 files changed, 4839 insertions(+), 5163 deletions(-)
 delete mode 100644 source/includes/apiargs-MongoDBClient-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-addSubscriber-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-get-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-removeSubscriber-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-watch-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-watch-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-common-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-count-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-count-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-find-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-find-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-rename-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-rename-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
 delete mode 100644 source/includes/apiargs-aggregate-option.yaml
 delete mode 100644 source/includes/apiargs-common-option.yaml
 delete mode 100644 source/includes/apiargs-common-param.yaml
 delete mode 100644 source/includes/apiargs-dropCollection-option.yaml
 delete mode 100644 source/includes/apiargs-function-add_logger-param.yaml
 delete mode 100644 source/includes/apiargs-function-remove_logger-param.yaml
 delete mode 100644 source/includes/apiargs-function-with_transaction-param.yaml
 delete mode 100644 source/includes/apiargs-method-watch-param.yaml
 create mode 100644 source/includes/extracts-bucket-option.yaml
 create mode 100644 source/includes/extracts-client-option.yaml
 create mode 100644 source/includes/extracts-collection-option.yaml
 create mode 100644 source/includes/extracts-common-option.yaml
 create mode 100644 source/includes/extracts-database-option.yaml
 create mode 100644 source/includes/extracts-option-requires.yaml
 rename source/includes/{apiargs-method-watch-option.yaml => extracts-watch-option.yaml} (76%)

diff --git a/source/includes/apiargs-MongoDBClient-common-option.yaml b/source/includes/apiargs-MongoDBClient-common-option.yaml
deleted file mode 100644
index 4ffc52a9..00000000
--- a/source/includes/apiargs-MongoDBClient-common-option.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the client's read concern.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the client's read preference.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-   :manual:`Write concern ` to use for the operation.
-   Defaults to the client's write concern.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-addSubscriber-param.yaml b/source/includes/apiargs-MongoDBClient-method-addSubscriber-param.yaml
deleted file mode 100644
index 27de6150..00000000
--- a/source/includes/apiargs-MongoDBClient-method-addSubscriber-param.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-arg_name: param
-name: $subscriber
-type: :php:`MongoDB\\Driver\\Monitoring\\Subscriber `
-description: |
-  A monitoring event subscriber to register with this Client.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
deleted file mode 100644
index 8406bd09..00000000
--- a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
+++ /dev/null
@@ -1,189 +0,0 @@
-arg_name: option
-name: autoEncryption
-type: array
-description: |
-  Options to configure client-side field-level encryption in the driver. The
-  encryption options are documented in the :php:`extension documentation
-  `.
-  For the ``keyVaultClient`` option, you may pass a :phpclass:`MongoDB\\Client`
-  instance, which will be unwrapped to provide a :php:`MongoDB\\Driver\\Manager `
-  to the extension.
-
-  .. versionadded:: 1.6
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: driver
-type: array
-description: |
-  Additional driver metadata to be passed on to the server handshake. This is an
-  array containing ``name``, ``version``, and ``platform`` fields:
-
-  .. code-block:: php
-
-     [
-         'name' => 'my-driver',
-         'version' => '1.2.3-dev',
-         'platform' => 'some-platform',
-     ]
-
-  .. note::
-
-     This feature is primarily designed for custom drivers and ODMs, which may
-     want to identify themselves to the server for diagnostic purposes.
-     Applications should use the ``appName`` URI option instead of driver
-     metadata.
-
-  .. versionadded:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: serverApi
-type: :php:`MongoDB\\Driver\\ServerApi `
-description: |
-  Used to declare an API version on the client. See the
-  :manual:`Stable API tutorial ` for usage.
-
-  .. versionadded:: 1.9
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: typeMap
-type: array
-description: |
-  Default :php:`type map
-  `
-  to apply to cursors, which determines how BSON documents are converted to PHP
-  values. The |php-library| uses the following type map by default:
-
-  .. code-block:: php
-
-     [
-         'array' => 'MongoDB\Model\BSONArray',
-         'document' => 'MongoDB\Model\BSONDocument',
-         'root' => 'MongoDB\Model\BSONDocument',
-     ]
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: allow_invalid_hostname
-type: boolean
-description: |
-  Disables hostname validation if ``true``. Defaults to ``false``.
-
-  Allowing invalid hostnames may expose the driver to a `man-in-the-middle
-  attack `_.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsAllowInvalidHostnames`` URI
-     option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: ca_dir
-type: string
-description: |
-  Path to a correctly hashed certificate directory. The system certificate store
-  will be used by default.
-
-  Falls back to the deprecated ``capath`` SSL context option if not specified.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: ca_file
-type: string
-description: |
-  Path to a certificate authority file. The system certificate store will be
-  used by default.
-
-  Falls back to the deprecated ``cafile`` SSL context option if not specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsCAFile`` URI option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: crl_file
-type: string
-description: |
-  Path to a certificate revocation list file.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: pem_file
-type: string
-description: |
-  Path to a PEM encoded certificate to use for client authentication.
-
-  Falls back to the deprecated ``local_cert`` SSL context option if not
-  specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsCertificateKeyFile`` URI
-     option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: pem_pwd
-type: string
-description: |
-  Passphrase for the PEM encoded certificate (if applicable).
-
-  Falls back to the deprecated ``passphrase`` SSL context option if not
-  specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsCertificateKeyFilePassword``
-     URI option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: weak_cert_validation
-type: boolean
-description: |
-  Disables certificate validation ``true``. Defaults to ``false``.
-
-  Falls back to the deprecated ``allow_self_signed`` SSL context option if not
-  specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsAllowInvalidCertificates``
-     URI option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: context
-type: resource
-description: |
-  :php:`SSL context options ` to be used as fallbacks
-  for other driver options (as specified). Note that the driver does not consult
-  the default stream context.
-
-  This option is supported for backwards compatibility, but should be considered
-  deprecated.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
deleted file mode 100644
index 62998287..00000000
--- a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
-arg_name: param
-name: $uri
-type: string
-description: |
-  The URI of the standalone, replica set, or sharded cluster to which to
-  connect. Refer to :manual:`Connection String URI Format
-  ` in the MongoDB manual for more information.
-
-  Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified.
-
-  Any special characters in the URI components need to be encoded according to
-  `RFC 3986 `_. This is particularly
-  relevant to the username and password, which can often include special
-  characters such as ``@``, ``:``, or ``%``. When connecting via a Unix domain
-  socket, the socket path may contain special characters such as slashes and
-  must be encoded. The :php:`rawurlencode() ` function may be used
-  to encode constituent parts of the URI.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: param
-name: $uriOptions
-type: array
-description: |
-  Specifies additional URI options, such as authentication credentials or query
-  string parameters. The options specified in ``$uriOptions`` take precedence
-  over any analogous options present in the ``$uri`` string and do not need to
-  be encoded according to `RFC 3986 `_.
-
-  Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
-  ` extension reference and :manual:`MongoDB
-  connection string ` documentation for accepted
-  options.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: param
-name: $driverOptions
-type: array
-description: |
-  Specify driver-specific options, such as SSL options. In addition to any
-  options supported by the :php:`extension `, the
-  |php-library| allows you to specify a default :php:`type map
-  `
-  to apply to the cursors it creates.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml b/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
deleted file mode 100644
index be0a19aa..00000000
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
deleted file mode 100644
index 07b76834..00000000
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " to drop"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-get-param.yaml b/source/includes/apiargs-MongoDBClient-method-get-param.yaml
deleted file mode 100644
index e9d3ccc6..00000000
--- a/source/includes/apiargs-MongoDBClient-method-get-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " to select"
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
deleted file mode 100644
index 38baf93a..00000000
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-arg_name: option
-name: authorizedDatabases
-type: boolean
-description: |
-  A flag that determines which databases are returned based on the user
-  privileges when access control is enabled. For more information, see the
-  `listDatabases command documentation `_.
-
-  For servers < 4.0.5, this option is ignored.
-
-  .. versionadded:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: filter
-type: array|object
-description: |
-  A query expression to filter the list of databases.
-
-  You can specify a query expression for database fields (e.g. ``name``,
-  ``sizeOnDisk``, ``empty``).
-
-  .. versionadded:: 1.3
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-removeSubscriber-param.yaml b/source/includes/apiargs-MongoDBClient-method-removeSubscriber-param.yaml
deleted file mode 100644
index eaeec4fd..00000000
--- a/source/includes/apiargs-MongoDBClient-method-removeSubscriber-param.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-arg_name: param
-name: $subscriber
-type: :php:`MongoDB\\Driver\\Monitoring\\Subscriber `
-description: |
-  A monitoring event subscriber to unregister with this Client.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml b/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
deleted file mode 100644
index d81d3181..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "client"
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
deleted file mode 100644
index 99c76446..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " containing the collection to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
deleted file mode 100644
index e4ffd3c6..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "database"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "database"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "database"
-  parent: "client"
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
deleted file mode 100644
index 8e5f9d45..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml
deleted file mode 100644
index cad9c3f7..00000000
--- a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml
+++ /dev/null
@@ -1,71 +0,0 @@
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocument
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocumentBeforeChange
-post: |
-  .. versionadded: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: maxAwaitTimeMS
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: readPreference
-post: |
-  This is used for both the initial change stream aggregation and for
-  server selection during an automatic resume.
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: resumeAfter
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: showExpandedEvents
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAfter
-post: |
-  .. versionadded: 1.5
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAtOperationTime
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-watch-param.yaml b/source/includes/apiargs-MongoDBClient-method-watch-param.yaml
deleted file mode 100644
index b00e450c..00000000
--- a/source/includes/apiargs-MongoDBClient-method-watch-param.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $pipeline
----
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
deleted file mode 100644
index fb919ea4..00000000
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ /dev/null
@@ -1,86 +0,0 @@
-arg_name: option
-name: arrayFilters
-type: array
-description: |
-   An array of filter documents that determines which array elements to modify
-   for an update operation on an array field.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: bypassDocumentValidation
-type: boolean
-description: |
-   If ``true``, allows the write operation to circumvent document level
-   validation. Defaults to ``false``.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
-post: |
-   If the collation is unspecified but the collection has a default collation,
-   the operation uses the collation specified for the collection. If no
-   collation is specified for the collection or for the operation, MongoDB uses
-   the simple binary comparison used in prior versions for string comparisons.
----
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the collection's read concern.
-
-   It is not possible to specify a :manual:`read concern
-   ` for individual operations as part of a
-   transaction. Instead, set the ``readConcern`` option when starting the
-   transaction with :php:`startTransaction `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the collection's read preference.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "collection"
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-   :manual:`Write concern ` to use for the operation.
-   Defaults to the collection's write concern.
-
-   It is not possible to specify a :manual:`write concern
-   ` for individual operations as part of a
-   transaction. Instead, set the ``writeConcern`` option when starting the
-   transaction with :php:`startTransaction `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: upsert
-type: boolean
-description: |
-   If set to ``true``, creates a new document when no document matches the query
-   criteria. The default value is ``false``, which does not insert a new
-   document when no match is found.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-common-param.yaml b/source/includes/apiargs-MongoDBCollection-common-param.yaml
deleted file mode 100644
index 47100d19..00000000
--- a/source/includes/apiargs-MongoDBCollection-common-param.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-arg_name: param
-name: $filter
-type: array|object
-description: |
-  The filter criteria that specifies the documents{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $replacement
-type: array|object
-description: |
-  The replacement document.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $update
-type: array|object
-description: |
-  Specifies the field and value combinations to update and any relevant update
-  operators. ``$update`` uses MongoDB's :method:`update operators
-  `. Starting with MongoDB 4.2, an `aggregation
-  pipeline `_
-  can be passed as this parameter.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
deleted file mode 100644
index a299eefa..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ /dev/null
@@ -1,72 +0,0 @@
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: explain
-post: |
-  .. versionadded:: 1.4
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.9
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-post: |
-  This only applies when a :ref:`$out ` or :ref:`$merge `
-  stage is specified.
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
deleted file mode 100644
index cbad3b49..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-arg_name: param
-name: $pipeline
-type: array
-description: |
-  Specifies an :manual:`aggregation pipeline `
-  operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
deleted file mode 100644
index 25d8e24d..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-arg_name: option
-name: ordered
-type: boolean
-description: |
-  If ``true``: when a single write fails, the operation will stop without
-  performing the remaining writes and throw an exception.
-
-  If ``false``: when a single write fails, the operation will continue with the
-  remaining writes, if any, and throw an exception.
-
-  The default is ``true``.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
deleted file mode 100644
index 79423a63..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-arg_name: param
-name: $operations
-type: array
-description: |
-  An array containing the write operations to perform.
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` supports
-  :phpmethod:`deleteMany() `,
-  :phpmethod:`deleteOne() `,
-  :phpmethod:`insertOne() `,
-  :phpmethod:`replaceOne() `,
-  :phpmethod:`updateMany() `, and
-  :phpmethod:`updateOne() ` operations in the
-  following array structure:
-
-  .. code-block:: php
-
-     [
-         [ 'deleteMany' => [ $filter ] ],
-         [ 'deleteOne'  => [ $filter ] ],
-         [ 'insertOne'  => [ $document ] ],
-         [ 'replaceOne' => [ $filter, $replacement, $options ] ],
-         [ 'updateMany' => [ $filter, $update, $options ] ],
-         [ 'updateOne'  => [ $filter, $update, $options ] ],
-     ]
-
-  Arguments correspond to the respective operation methods. However, the
-  ``writeConcern`` option is specified as a top-level option to
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
-  operation.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
deleted file mode 100644
index 7d422ca0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "manager"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "manager"
----
-source:
-  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "manager"
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml b/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
deleted file mode 100644
index 0827800b..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $manager
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
deleted file mode 100644
index 3d839e04..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: hint
-type: string|array|object
-description: |
-  The index to use. Specify either the index name as a string or the index key
-  pattern as a document. If specified, then the query system will only consider
-  plans using the hinted index.
-
-  .. versionchanged:: 1.2
-     If a document is provided, it is passed to the command as-is. Previously,
-     the library would convert the key pattern to an index name.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  The maximum number of matching documents to return.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: skip
-type: integer
-description: |
-  The number of matching documents to skip before returning results.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-param.yaml b/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
deleted file mode 100644
index e18c616b..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to count"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml b/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
deleted file mode 100644
index da1f0113..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
+++ /dev/null
@@ -1,56 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
----
-arg_name: option
-name: hint
-type: string|array|object
-description: |
-  The index to use. Specify either the index name as a string or the index key
-  pattern as a document. If specified, then the query system will only consider
-  plans using the hinted index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  The maximum number of matching documents to return.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-arg_name: option
-name: skip
-type: integer
-description: |
-  The number of matching documents to skip before returning results.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml b/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
deleted file mode 100644
index e18c616b..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to count"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
deleted file mode 100644
index 18283767..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
+++ /dev/null
@@ -1,117 +0,0 @@
-arg_name: option
-name: commitQuorum
-type: string|integer
-description: |
-  Specifies how many data-bearing members of a replica set, including the
-  primary, must complete the index builds successfully before the primary marks
-  the indexes as ready.
-
-  This option accepts the same values for the ``w`` field in a write concern
-  plus ``"votingMembers"``, which indicates all voting data-bearing nodes.
-
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: unique
-type: boolean
-description: |
-  Creates a :manual:`unique ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
-pre: |
-  Specifies the :manual:`collation
-  ` for the index.
----
-arg_name: option
-name: partialFilterExpression
-type: array|object
-description: |
-  Creates a :manual:`partial ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: sparse
-type: boolean
-description: |
-  Creates a :manual:`sparse ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: expireAfterSeconds
-type: integer
-description: |
-  Creates a :manual:`TTL ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: name
-type: string
-description: |
-  A name that uniquely identifies the index. By default, MongoDB creates index
-  names based on the key.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: background
-type: string
-description: |
-  Instructs MongoDB to build the index :manual:`as a background
-  ` process.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: 2dsphereIndexVersion
-type: integer
-description: |
-  Overrides the server's default version for a :manual:`2dsphere
-  ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
deleted file mode 100644
index c2979d91..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-arg_name: param
-name: $key
-type: array|object
-description: |
-  Specifies the field or fields to index and the index order.
-
-  For example, the following specifies a descending index on the ``username``
-  field:
-
-  .. code-block:: php
-
-     [ 'username' => -1 ]
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
deleted file mode 100644
index 54c33bfa..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-method-createIndex-option.yaml
-  ref: commitQuorum
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
deleted file mode 100644
index e98d9aad..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-arg_name: param
-name: $indexes
-type: array
-description: |
-  The indexes to create on the collection.
-
-  For example, the following specifies a unique index on the ``username`` field
-  and a compound index on the ``email`` and ``createdAt`` fields:
-
-  .. code-block:: php
-
-     [
-         [ 'key' => [ 'username' => -1 ], 'unique' => true ],
-         [ 'key' => [ 'email' => 1, 'createdAt' => 1 ] ],
-     ]
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml
deleted file mode 100644
index c6adffe8..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-arg_name: option
-name: name
-type: string
-description: |
-  Name of the search index to create.
-
-  You cannot create multiple indexes with the same name on a single collection.
-
-  If you do not specify a name, the index is named "default".
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml
deleted file mode 100644
index bec75136..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-arg_name: param
-name: $definition
-type: array|object
-description: |
-  Document describing the index to create. For details on definition syntax, see 
-  :manual:`Search Index Definition Syntax `.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml
deleted file mode 100644
index 7661d09e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml
deleted file mode 100644
index 4003b24d..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-arg_name: param
-name: $indexes
-type: array
-description: |
-  Array of documents describing the indexes to create.
-
-  A required ``definition`` document field describes the index to create. For
-  details on definition syntax, see 
-  :manual:`Search Index Definition Syntax `.
-
-  An optional ``name`` string field specifies the name of the search index to
-  create. You cannot create multiple indexes with the same name on a single
-  collection. If you do not specify a name, the index is named "default".
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
deleted file mode 100644
index 110911f5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
deleted file mode 100644
index 92797eb5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to delete"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
deleted file mode 100644
index 110911f5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
deleted file mode 100644
index 92797eb5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to delete"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
deleted file mode 100644
index 05a1b285..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  .. versionadded:: 1.5
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
deleted file mode 100644
index 37cd9b50..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-arg_name: param
-name: $fieldName
-type: string
-description: |
-  The field for which to return distinct values.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " from which to retrieve the distinct values"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
deleted file mode 100644
index 5eb5efab..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-dropCollection-option.yaml
-  ref: encryptedFields
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
deleted file mode 100644
index b87e09b7..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
deleted file mode 100644
index 7cac6d1d..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-arg_name: param
-name: $indexName
-type: string| :phpclass:`MongoDB\\Model\\IndexInfo`
-description: |
-  The name or model object of the index to drop. View the existing indexes on
-  the collection using the :phpmethod:`listIndexes()
-  ` method.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
deleted file mode 100644
index aff9f4d7..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml
deleted file mode 100644
index 7661d09e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml
deleted file mode 100644
index 9a57fc98..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $name
-type: string
-description: |
-  Name of the index to drop.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
deleted file mode 100644
index 7289296e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml b/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
deleted file mode 100644
index 650633bc..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  Defaults to the ``comment`` of the explained operation (if any).
-
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-arg_name: option
-name: verbosity
-type: string
-description: |
-  The verbosity level at which to run the command. See the :manual:`explain
-  ` command for more information.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml b/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
deleted file mode 100644
index 59f15637..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $explainable
-type: :phpclass:`MongoDB\\Operation\\Explainable`
-description: |
-  The command to explain.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
deleted file mode 100644
index 1b01599e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ /dev/null
@@ -1,263 +0,0 @@
-arg_name: option
-name: projection
-type: array|object
-description: |
-  The :ref:`projection specification ` to determine which fields to
-  include in the returned documents. See :manual:`Project Fields to Return from
-  Query ` and
-  :manual:`Projection Operators ` in the MongoDB
-  manual.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: sort
-type: array|object
-description: |
-  The sort specification for the ordering of the results.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: skip
-type: integer
-description: |
-  Number of documents to skip. Defaults to ``0``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  The maximum number of documents to return. If unspecified, then defaults to no
-  limit. A limit of ``0`` is equivalent to setting no limit.
-
-  A negative limit is similar to a positive limit but closes the cursor after
-  returning a single batch of results. As such, with a negative limit, if the
-  limited result set does not fit into a single batch, the number of documents
-  received will be less than the specified limit. By passing a negative limit, the
-  client indicates to the server that it will not ask for a subsequent batch via
-  getMore.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: allowDiskUse
-type: boolean
-description: |
-  Enables writing to temporary files. When set to ``true``, queries can write
-  data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: batchSize
-type: integer
-description: |
-  The number of documents to return in the first batch. Defaults to ``101``. A
-  batchSize of ``0`` means that the cursor will be established, but no documents
-  will be returned in the first batch.
-
-  Unlike the previous wire protocol version, a batchSize of ``1`` for the
-  :dbcommand:`find` command does not close the cursor.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
----
-arg_name: option
-name: cursorType
-type: integer
-description: |
-  Indicates the type of cursor to use. ``cursorType`` supports the following
-  values:
-
-   - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
-   - ``MongoDB\Operation\Find::TAILABLE``
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  .. versionadded:: 1.2
----
-arg_name: option
-name: maxAwaitTimeMS
-type: integer
-description: |
-  Positive integer denoting the time limit in milliseconds for the server to
-  block a getMore operation if no data is available. This option should only be
-  used if cursorType is TAILABLE_AWAIT.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: max
-type: array|object
-description: |
-  The exclusive upper bound for a specific index.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: maxScan
-type: integer
-description: |
-  Maximum number of documents or index keys to scan when executing the query.
-
-  .. deprecated:: 1.4
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: min
-type: array|object
-description: |
-  The inclusive lower bound for a specific index.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: oplogReplay
-type: boolean
-description: |
-  Internal use for replica sets. To use ``oplogReplay``, you must include the
-  following condition in the filter:
-
-  .. code-block:: javascript
-
-     { ts: { $gte:  } }
-
-  The :php:`MongoDB\\BSON\\Timestamp ` class
-  reference describes how to represent MongoDB's BSON timestamp type with PHP.
-
-  .. deprecated:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: noCursorTimeout
-type: boolean
-description: |
-  Prevents the server from timing out idle cursors after an inactivity period
-  (10 minutes).
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: returnKey
-type: boolean
-description: |
-  If true, returns only the index keys in the resulting documents.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: showRecordId
-type: boolean
-description: |
-  Determines whether to return the record identifier for each document. If true,
-  adds a field $recordId to the returned documents.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: snapshot
-type: boolean
-description: |
-  Prevents the cursor from returning a document more than once because of an
-  intervening write operation.
-
-  .. deprecated:: 1.4
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: allowPartialResults
-type: boolean
-description: |
-  For queries against a sharded collection, returns partial results from the
-  :program:`mongos` if some shards are unavailable instead of throwing an error.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
----
-arg_name: option
-name: modifiers
-type: array|object
-description: |
-  :manual:`Meta operators ` that modify the
-  output or behavior of a query. Use of these operators is deprecated in favor
-  of named options.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-find-param.yaml b/source/includes/apiargs-MongoDBCollection-method-find-param.yaml
deleted file mode 100644
index 5683a7bb..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-find-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to query"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
deleted file mode 100644
index 139e700a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
+++ /dev/null
@@ -1,84 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: skip
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: comment
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  .. versionadded:: 1.2
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: max
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: maxScan
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: min
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: returnKey
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: showRecordId
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: modifiers
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
deleted file mode 100644
index 5683a7bb..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to query"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
deleted file mode 100644
index d8f2b3a4..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
+++ /dev/null
@@ -1,56 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
deleted file mode 100644
index 92797eb5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to delete"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
deleted file mode 100644
index b509ac94..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
+++ /dev/null
@@ -1,77 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-arg_name: option
-name: returnDocument
-type: integer
-description: |
-  Specifies whether to return the document before the replacement is applied, or
-  after. ``returnDocument`` supports the following values:
-
-  - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*)
-  - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
deleted file mode 100644
index 32ed6b35..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to replace"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $replacement
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
deleted file mode 100644
index a8f895f1..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+++ /dev/null
@@ -1,83 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: arrayFilters
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-arg_name: option
-name: returnDocument
-type: integer
-description: |
-  Specifies whether to return the document before the update is applied, or
-  after. ``returnDocument`` supports the following values:
-
-  - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*)
-  - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
deleted file mode 100644
index a335678a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to update"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $update
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
deleted file mode 100644
index 60f197d2..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-method-bulkWrite-option.yaml
-  ref: ordered
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
deleted file mode 100644
index 78246d30..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $documents
-type: array
-description: |
-  The documents to insert into the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
deleted file mode 100644
index adf17cb6..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
deleted file mode 100644
index 5dc231d3..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $document
-type: array|object
-description: |
-  The document to insert into the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
deleted file mode 100644
index aa939b95..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml
deleted file mode 100644
index 910024ee..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
----
-arg_name: option
-name: name
-type: string
-description: |
-  Name of the index to return information about.
-
-  If name is not specified, information for all indexes on the collection will
-  be returned.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
deleted file mode 100644
index 478d12dd..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
+++ /dev/null
@@ -1,113 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
-post: |
-  This only applies when results are output to a collection.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: finalize
-type: :php:`MongoDB\\BSON\\Javascript `
-description: |
-  Follows the reduce method and modifies the output.
-
-  .. note::
-
-     Passing a Javascript instance with a scope is deprecated. Put all scope
-     variables in the ``scope`` option of the MapReduce operation.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: jsMode
-type: boolean
-description: |
-  Specifies whether to convert intermediate data into BSON format between the
-  execution of the map and reduce functions.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  Specifies a maximum number of documents for the input into the map function.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-arg_name: option
-name: query
-type: array|object
-description: |
-  Specifies the selection criteria using query operators for determining the
-  documents input to the map function.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
-post: |
-  This option will be ignored when results are output to a collection.
----
-arg_name: option
-name: scope
-type: array|object
-description: |
-  Specifies global variables that are accessible in the map, reduce, and finalize
-  functions.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
----
-arg_name: option
-name: verbose
-type: boolean
-description: |
-  Specifies whether to include the timing information in the result information.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
deleted file mode 100644
index 6a76d636..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-arg_name: param
-name: $map
-type: :php:`MongoDB\\BSON\\Javascript `
-description: |
-  A JavaScript function that associates or "maps" a value with a key and emits
-  the key and value pair.
-
-  .. note::
-
-     Passing a Javascript instance with a scope is deprecated. Put all scope
-     variables in the ``scope`` option of the MapReduce operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $reduce
-type: :php:`MongoDB\\BSON\\Javascript `
-description: |
-  A JavaScript function that "reduces" to a single object all the values
-  associated with a particular key.
-
-  .. note::
-
-     Passing a Javascript instance with a scope is deprecated. Put all scope
-     variables in the ``scope`` option of the MapReduce operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $out
-type: string|array|object
-description: |
-  Specifies where to output the result of the map-reduce operation. You can
-  either output to a collection or return the result inline. On a primary member
-  of a replica set you can output either to a collection or inline, but on a
-  secondary, only inline output is possible.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml b/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml
deleted file mode 100644
index 0b0b0809..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
----
-arg_name: option
-name: dropTarget
-type: boolean
-description: |
-  If ``true``, MongoDB will drop the target before renaming the collection. The
-  default value is ``false``.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml b/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml
deleted file mode 100644
index 459b2789..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-arg_name: param
-name: $toCollectionName
-type: string
-description: |
-  The new name of the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $toDatabaseName
-type: string
-description: |
-  The new database name of the collection. If a new database name is not
-  specified, the database of the original collection will be used. If the new
-  name specifies a different database, the command copies the collection
-  to the new database and drops the source collection.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
deleted file mode 100644
index 676296d2..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.2+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.6
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
deleted file mode 100644
index 32ed6b35..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to replace"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $replacement
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
deleted file mode 100644
index 64eec34e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: arrayFilters
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.2+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.6
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
deleted file mode 100644
index a335678a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to update"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $update
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
deleted file mode 100644
index 64eec34e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: arrayFilters
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.2+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.6
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
deleted file mode 100644
index a335678a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to update"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $update
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml
deleted file mode 100644
index 7661d09e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml
deleted file mode 100644
index f5893878..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-arg_name: param
-name: $name
-type: string
-description: |
-  Name of the index to update.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $definition
-type: array|object
-description: |
-  Document describing the updated search index definition. The specified
-  definition replaces the prior definition in the search index. For details on
-  definition syntax, see 
-  :manual:`Search Index Definition Syntax `.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
deleted file mode 100644
index 2b8ac8e4..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ /dev/null
@@ -1,73 +0,0 @@
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocument
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocumentBeforeChange
-post: |
-  .. versionadded: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: maxAwaitTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
-post: |
-  This is used for both the initial change stream aggregation and for
-  server selection during an automatic resume.
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: resumeAfter
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: showExpandedEvents
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAfter
-post: |
-  .. versionadded: 1.5
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAtOperationTime
-post: |
-  .. versionadded:: 1.4
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
deleted file mode 100644
index b00e450c..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $pipeline
----
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
deleted file mode 100644
index 681144f3..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "original collection"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "original collection"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "original collection"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "original collection"
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml b/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-common-option.yaml b/source/includes/apiargs-MongoDBDatabase-common-option.yaml
deleted file mode 100644
index b03dac7a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-common-option.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the database's read concern.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the database's read preference.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "database"
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-   :manual:`Write concern ` to use for the operation.
-   Defaults to the database's write concern.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
deleted file mode 100644
index 93bccd2f..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: explain
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.9
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-post: |
-  This only applies when a :ref:`$out ` or :ref:`$merge `
-  stage is specified.
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
deleted file mode 100644
index cbad3b49..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-arg_name: param
-name: $pipeline
-type: array
-description: |
-  Specifies an :manual:`aggregation pipeline `
-  operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
deleted file mode 100644
index 934e325d..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the database's read preference.
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
deleted file mode 100644
index 5a4b03d7..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $command
-type: array|object
-description: |
-  The :manual:`database command ` document.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
deleted file mode 100644
index d398069a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "database"
-  parent: "manager"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "database"
-  parent: "manager"
----
-source:
-  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "database"
-  parent: "manager"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
deleted file mode 100644
index 5ef826c1..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $manager
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
deleted file mode 100644
index ceb7dd07..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ /dev/null
@@ -1,363 +0,0 @@
-arg_name: option
-name: autoIndexId
-type: boolean
-description: |
-  Specify ``false`` to disable the automatic creation of an index on the ``_id``
-  field.
-
-  .. important::
-
-     For replica sets, do not set ``autoIndexId`` to ``false``.
-
-  .. deprecated:: 1.4
-     This option has been deprecated since MongoDB 3.2. As of MongoDB 4.0, this
-     option cannot be ``false`` when creating a replicated collection (i.e. a
-     collection outside of the ``local`` database in any mongod mode).
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: capped
-type: boolean
-description: |
-  To create a capped collection, specify ``true``. If you specify ``true``, you
-  must also set a maximum size in the ``size`` option.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: changeStreamPreAndPostImages
-type: document
-description: |
-  Used to configure support for pre- and post-images in change streams. See the
-  :manual:`create ` command documentation for more
-  information.
-
-  This option is available in MongoDB 6.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: clusteredIndex
-type: document
-description: |
-  A clustered index specification. See
-  :manual:`Clustered Collections ` or the
-  :manual:`create ` command documentation for more
-  information.
-
-  This option is available in MongoDB 5.3+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
-pre: |
-  Specifies the :manual:`collation
-  ` for the collection.
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: encryptedFields
-type: document
-description: |
-  A document describing encrypted fields for queryable encryption. If omitted,
-  the ``encryptedFieldsMap`` option within the ``autoEncryption`` driver option
-  will be consulted. See
-  `Field Encryption and Queryability `_
-  in the MongoDB manual for more information.
-
-  This option is available in MongoDB 7.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: expireAfterSeconds
-type: integer
-description: |
-  Used to automatically delete documents in time series collections. See the
-  :manual:`create ` command documentation for more
-  information.
-
-  This option is available in MongoDB 5.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.9
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: flags
-type: integer
-description: |
-  Available for the MMAPv1 storage engine only to set the ``usePowerOf2Sizes``
-  and ``noPadding`` flags.
-
-  The |php-library| provides constants that you can combine with a :php:`bitwise
-  OR operator ` to set the flag values:
-
-  - ``MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES``: ``1``
-  - ``MongoDB\Operation\CreateCollection::NO_PADDING``: ``2``
-
-  Defaults to ``1``.
-
-  .. note::
-
-     MongoDB 3.0 and later ignores the ``usePowerOf2Sizes`` flag. See
-     :manual:`collMod ` and
-     :manual:`db.createCollection()
-     ` for more information.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: indexOptionDefaults
-type: array|object
-description: |
-  Allows users to specify a default configuration for indexes when creating a
-  collection.
-
-  The ``indexOptionDefaults`` option accepts a ``storageEngine`` document,
-  which should take the following form:
-
-  .. code-block:: none
-  
-     { :  }
-
-  Storage engine configurations specified when creating indexes are validated
-  and logged to the :term:`oplog` during replication to support replica sets
-  with members that use different storage engines.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: max
-type: integer
-description: |
-  The maximum number of documents allowed in the capped collection. The ``size``
-  option takes precedence over this limit. If a capped collection reaches the
-  ``size`` limit before it reaches the maximum number of documents, MongoDB
-  removes old documents. If you prefer to use the ``max`` limit, ensure that the
-  ``size`` limit, which is required for a capped collection, is sufficient to
-  contain the maximum number of documents.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-arg_name: option
-name: pipeline
-type: array
-description: |
-  An array that consists of the aggregation pipeline stage(s), which will be
-  applied to the collection or view specified by ``viewOn``. See the
-  :manual:`create ` command documentation for more
-  information.
-  
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: size
-type: integer
-description: |
-  Specify a maximum size in bytes for a capped collection. Once a capped
-  collection reaches its maximum size, MongoDB removes the older documents to
-  make space for the new documents. The ``size`` option is required for capped
-  collections and ignored for other collections.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: storageEngine
-type: array|object
-description: |
-  Available for the WiredTiger storage engine only.
-
-  Allows users to specify configuration to the storage engine on a
-  per-collection basis when creating a collection. The value of the
-  ``storageEngine`` option should take the following form:
-
-  .. code-block:: none
-  
-     { :  }
-
-  Storage engine configurations specified when creating collections are
-  validated and logged to the :term:`oplog` during replication to support
-  replica sets with members that use different storage engines.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: timeseries
-type: array|object
-description: |
-  An object containing options for creating time series collections. See the
-  :manual:`create ` command documentation for
-  supported options.
-
-  This option is available in MongoDB 5.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.9
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-arg_name: option
-name: validator
-type: array|object
-description: |
-  Allows users to specify :manual:`validation rules or expressions
-  ` for the collection. For more information, see
-  :manual:`Document Validation ` in the MongoDB
-  manual.
-
-  The ``validator`` option takes an array that specifies the validation rules or
-  expressions. You can specify the expressions using the same operators as
-  MongoDB's :manual:`query operators ` with the
-  exception of :query:`$geoNear`, :query:`$near`, :query:`$nearSphere`,
-  :query:`$text`, and :query:`$where`.
-
-  .. note::
-
-     - Validation occurs during updates and inserts. Existing documents do not
-       undergo validation checks until modification.
-
-     - You cannot specify a validator for collections in the ``admin``,
-       ``local``, and ``config`` databases.
-
-     - You cannot specify a validator for ``system.*`` collections.
-operation: ~
-interface: phpmethod
-optional: true
----
-arg_name: option
-name: validationAction
-type: string
-description: |
-   Determines whether to ``error`` on invalid documents or just ``warn`` about
-   the violations but allow invalid documents to be inserted.
-
-   .. important::
-
-      Validation of documents only applies to those documents as determined by
-      the ``validationLevel``.
-
-   .. list-table::
-      :header-rows: 1
-
-      * - ``validationAction``
-
-        - Description
-
-      * - ``"error"``
-
-        - **Default**. Documents must pass validation before the write occurs.
-          Otherwise, the write operation fails.
-
-      * - ``"warn"``
-
-        - Documents do not have to pass validation. If the document fails
-          validation, the write operation logs the validation failure.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: validationLevel
-type: string
-description: |
-   Determines how strictly MongoDB applies the validation rules to existing
-   documents during an update.
-
-   .. list-table::
-      :header-rows: 1
-
-      * - ``validationLevel``
-
-        - Description
-
-      * - ``"off"``
-
-        - No validation for inserts or updates.
-
-      * - ``"strict"``
-
-        - **Default**. Apply validation rules to all inserts and all updates.
-
-      * - ``"moderate"``
-
-        - Apply validation rules to inserts and to updates on existing *valid*
-          documents. Do not apply rules to updates on existing *invalid*
-          documents.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: viewOn
-type: string
-description: |
-  The name of the source collection or view from which to create the view.
-
-  .. note::
-
-     The name is not the full namespace of the collection or view (i.e. it does
-     not include the database name). Views must be created in the same databases
-     as the source collection or view.
-     
-     .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
deleted file mode 100644
index b6bb2dcc..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to create"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
deleted file mode 100644
index 6d56d678..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  subject: "encrypted collection"
-  action: " to create"
----
-arg_name: param
-name: $clientEncryption
-type: :php:`MongoDB\\Driver\\ClientEncryption `
-description: |
-  The ClientEncryption object used to create data keys.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $kmsProvider
-type: string
-description: |
-  KMS provider (e.g. "local", "aws") that will be used to encrypt new data keys.
-  This corresponds to the ``$kmsProvider`` parameter for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $masterKey
-type: array|null
-description: |
-  KMS-specific key options that will be used to encrypt new data keys. This
-  corresponds to the ``masterKey`` option for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
-
-  If ``$kmsProvider`` is "local", this should be ``null``.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-optional: false
-post: |
-  The ``encryptedFields`` option is required.
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
deleted file mode 100644
index e725fc1b..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
deleted file mode 100644
index 0034b5e8..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-dropCollection-option.yaml
-  ref: encryptedFields
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
deleted file mode 100644
index c8e0a614..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to drop"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
deleted file mode 100644
index 651c85f9..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to select"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
deleted file mode 100644
index bacf7280..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-arg_name: option
-name: authorizedCollections
-type: boolean
-description: |
-  A flag that determines which collections are returned based on the user
-  privileges when access control is enabled. For more information, see the
-  `listCollections command documentation `_.
-
-  For servers < 4.0, this option is ignored.
-
-  .. versionadded:: 1.12
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: filter
-type: array|object
-description: |
-  A query expression to filter the list of collections.
-
-  You can specify a query expression for collection fields (e.g. ``name``,
-  ``options``).
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
deleted file mode 100644
index b27c16cf..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
deleted file mode 100644
index 16597b3a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  subject: "collection or view"
-  action: " to modify"
----
-arg_name: param
-name: $collectionOptions
-type: array
-description: |
-  Collection or view options to assign.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml
deleted file mode 100644
index bb026bd9..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
----
-arg_name: option
-name: dropTarget
-type: boolean
-description: |
-  If ``true``, MongoDB will drop the target before renaming the collection. The
-  default value is ``false``.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml
deleted file mode 100644
index 3043f4dd..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-arg_name: param
-name: $fromCollectionName
-type: string
-description: |
-  The name of the collection to rename.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $toCollectionName
-type: string
-description: |
-  The new name of the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $toDatabaseName
-type: string
-description: |
-  The new database name of the collection. If a new database name is not
-  specified, the current database will be used. If the new name specifies a
-  different database, the command copies the collection to the new database
-  and drops the source collection.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
deleted file mode 100644
index 932c1b16..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "database"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
deleted file mode 100644
index 46d4e72a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
deleted file mode 100644
index 2039d114..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-arg_name: option
-name: bucketName
-type: string
-description: |
-  The bucket name, which will be used as a prefix for the files and chunks
-  collections. Defaults to ``"fs"``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: chunkSizeBytes
-type: integer
-description: |
-  The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
deleted file mode 100644
index b24efbec..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
+++ /dev/null
@@ -1,71 +0,0 @@
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocument
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocumentBeforeChange
-post: |
-  .. versionadded: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: maxAwaitTimeMS
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readPreference
-post: |
-  This is used for both the initial change stream aggregation and for
-  server selection during an automatic resume.
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: resumeAfter
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: showExpandedEvents
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAfter
-post: |
-  .. versionadded: 1.5
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAtOperationTime
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
deleted file mode 100644
index b00e450c..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $pipeline
----
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
deleted file mode 100644
index c048182c..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "database"
-  parent: "original database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "database"
-  parent: "original database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "original database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "database"
-  parent: "original database"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
deleted file mode 100644
index bf2de660..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
+++ /dev/null
@@ -1,61 +0,0 @@
-arg_name: option
-name: _id
-type: mixed
-description: |
-  Value to use as the file document identifier. Defaults to a new
-  :php:`MongoDB\\BSON\\ObjectId ` object.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: chunkSizeBytes
-type: integer
-description: |
-  The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: disableMD5
-type: boolean
-description: |
-  Whether to disable automatic MD5 generation when storing files.
-
-  Defaults to ``false``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: metadata
-type: array|object
-description: |
-  User data for the ``metadata`` field of the file document. If not specified,
-  the ``metadata`` field will not be set on the file document.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: revision
-type: integer
-description: |
-  The revision of the file to retrieve. Files with the name ``filename`` will be
-  differentiated by their ``uploadDate`` field.
-
-  Revision numbers are defined as follows:
-
-  - 0 = the original stored file
-  - 1 = the first revision
-  - 2 = the second revision
-  - etc...
-  - -2 = the second most recent revision
-  - -1 = the most recent revision
-
-   Defaults to -1 (i.e. the most recent revision).
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml
deleted file mode 100644
index f1d6b136..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
-arg_name: param
-name: $filename
-type: string
-description: |
-  The ``filename`` of the file{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $id
-type: mixed
-description: |
-  The ``_id`` of the file{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $stream
-type: resource
-description: |
-  The GridFS stream resource.
-interface: phpmethod
-operation: ~
----
-arg_name: param
-name: $destination
-type: resource
-description: |
-  Writable stream, to which the GridFS file's contents will be written.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
deleted file mode 100644
index c8a7eb79..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-arg_name: option
-name: bucketName
-type: string
-description: |
-  The bucket name, which will be used as a prefix for the files and chunks
-  collections. Defaults to ``"fs"``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: chunkSizeBytes
-type: integer
-description: |
-  The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
deleted file mode 100644
index 5ef826c1..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $manager
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
deleted file mode 100644
index 7e8baa21..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to delete"
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
deleted file mode 100644
index 39d48dc5..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to download"
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $destination
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
deleted file mode 100644
index 9dc941d9..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: revision
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
deleted file mode 100644
index 2704877b..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to download"
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $destination
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml
deleted file mode 100644
index 1f2e9d8e..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml
+++ /dev/null
@@ -1,76 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: skip
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: limit
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: comment
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: cursorType
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: readConcern
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the bucket's read concern.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: readPreference
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the bucket's read preference.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: oplogReplay
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: noCursorTimeout
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowPartialResults
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: typeMap
-replacement:
-  parent: "bucket"
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: modifiers
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
deleted file mode 100644
index 3d0d0ed8..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: skip
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: comment
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBGridFSBucket-method-find-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-MongoDBGridFSBucket-method-find-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: modifiers
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
deleted file mode 100644
index 0801cb21..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $stream
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
deleted file mode 100644
index 0801cb21..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $stream
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
deleted file mode 100644
index 54e7c8c2..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to download"
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
deleted file mode 100644
index 9dc941d9..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: revision
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
deleted file mode 100644
index eb8ec932..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to download"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
deleted file mode 100644
index 592040d6..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: _id
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: chunkSizeBytes
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: metadata
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
deleted file mode 100644
index 6b8efb34..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to create"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
deleted file mode 100644
index e1b140ae..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to rename"
----
-arg_name: param
-name: $newFilename
-type: string
-description: |
-  The new ``filename`` value.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
deleted file mode 100644
index 592040d6..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: _id
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: chunkSizeBytes
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: metadata
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
deleted file mode 100644
index 48fa2db4..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to create"
----
-arg_name: param
-name: $source
-type: resource
-description: |
-  Readable stream, from which the new GridFS file's contents will be read.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml
deleted file mode 100644
index e5b410c4..00000000
--- a/source/includes/apiargs-aggregate-option.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
-arg_name: option
-name: allowDiskUse
-type: boolean
-description: |
-  Enables writing to temporary files. When set to ``true``, aggregation stages
-  can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: batchSize
-type: integer
-description: |
-  Specifies the batch size for the cursor, which will apply to both the initial
-  ``aggregate`` command and any subsequent ``getMore`` commands. This determines
-  the maximum number of documents to return in each response from the server.
-
-  A batchSize of ``0`` is special in that and will only apply to the initial
-  ``aggregate`` command; subsequent ``getMore`` commands will use the server's
-  default batch size. This may be useful for quickly returning a cursor or
-  failure from ``aggregate`` without doing significant server-side work.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
-post: |
-  This only applies when using the :ref:`$out ` and
-  :ref:`$out ` stages.
----
-arg_name: option
-name: explain
-type: boolean
-description: |
-  Specifies whether or not to return the information on the processing of the
-  pipeline.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml
deleted file mode 100644
index cae14187..00000000
--- a/source/includes/apiargs-common-option.yaml
+++ /dev/null
@@ -1,124 +0,0 @@
-arg_name: option
-name: collation
-type: array|object
-description: |
-   :manual:`Collation ` allows users to specify
-   language-specific rules for string comparison, such as rules for lettercase
-   and accent marks. When specifying collation, the ``locale`` field is
-   mandatory; all other collation fields are optional. For descriptions of the
-   fields, see :manual:`Collation Document
-   `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: comment
-type: mixed
-description: |
-  Enables users to specify an arbitrary comment to help trace the operation
-  through the :manual:`database profiler `,
-  :manual:`currentOp ` output, and
-  :manual:`logs `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: hint
-type: string|array|object
-description: |
-  The index to use. Specify either the index name as a string or the index key
-  pattern as a document. If specified, then the query system will only consider
-  plans using the hinted index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: let
-type: array|object
-description: |
-  Map of parameter names and values. Values must be constant or closed
-  expressions that do not reference document fields. Parameters can then be
-  accessed as variables in an aggregate expression context (e.g. ``$$var``).
-
-  This is not supported for server versions prior to 5.0 and will result in an
-  exception at execution time if used.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: maxTimeMS
-type: integer
-description: |
-   The cumulative time limit in milliseconds for processing operations on the
-   cursor. MongoDB aborts the operation at the earliest following
-   :term:`interrupt point`.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-  The default read concern to use for {{resource}} operations. Defaults to the
-  {{parent}}'s read concern.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  resource: "collection"
-  parent: "client"
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-  The default read preference to use for {{resource}} operations. Defaults to
-  the {{parent}}'s read preference.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  resource: "collection"
-  parent: "client"
----
-arg_name: option
-name: session
-type: :php:`MongoDB\\Driver\\Session `
-description: |
-  Client session to associate with the operation.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: typeMap
-type: array
-description: |
-  The :php:`type map
-  `
-  to apply to cursors, which determines how BSON documents are converted to PHP
-  values. Defaults to the {{parent}}'s type map.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  parent: "client"
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-  The default write concern to use for {{resource}} operations. Defaults
-  to the {{parent}}'s write concern.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  resource: "collection"
-  parent: "client"
-...
diff --git a/source/includes/apiargs-common-param.yaml b/source/includes/apiargs-common-param.yaml
deleted file mode 100644
index a8d79082..00000000
--- a/source/includes/apiargs-common-param.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
-arg_name: param
-name: $manager
-type: :php:`MongoDB\\Driver\\Manager `
-description: |
-  The :php:`Manager ` instance from the driver. The
-  manager maintains connections between the driver and your MongoDB instances.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $databaseName
-type: string
-description: |
-  The name of the database{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $collectionName
-type: string
-description: |
-  The name of the {{subject}}{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  subject: "collection"
-  action: ""
----
-arg_name: param
-name: $options
-type: array
-description: |
-  An array specifying the desired options.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-dropCollection-option.yaml b/source/includes/apiargs-dropCollection-option.yaml
deleted file mode 100644
index 158c4a43..00000000
--- a/source/includes/apiargs-dropCollection-option.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-arg_name: option
-name: encryptedFields
-type: array|object
-description: |
-  A document describing encrypted fields for queryable encryption. If omitted,
-  the ``encryptedFieldsMap`` option within the ``autoEncryption`` driver option
-  will be consulted. If ``encryptedFieldsMap`` was defined but does not specify
-  this collection, the library will make a final attempt to consult the
-  server-side value for ``encryptedFields``. See
-  `Field Encryption and Queryability `_
-  in the MongoDB manual for more information.
-
-  .. note::
-
-     This option is not passed to the :manual:`drop `
-     command. The library uses it to determine related metadata collections that
-     should be dropped in addition to an encrypted collection.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-function-add_logger-param.yaml b/source/includes/apiargs-function-add_logger-param.yaml
deleted file mode 100644
index 424b405f..00000000
--- a/source/includes/apiargs-function-add_logger-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-arg_name: param
-name: $logger
-type: Psr\\Log\\LoggerInterface
-description: |
-  A logger to register.
-
-  If the logger is already registered, the method will have no effect.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-function-remove_logger-param.yaml b/source/includes/apiargs-function-remove_logger-param.yaml
deleted file mode 100644
index 7ee1be56..00000000
--- a/source/includes/apiargs-function-remove_logger-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-arg_name: param
-name: $logger
-type: Psr\\Log\\LoggerInterface
-description: |
-  A logger to unregister.
-
-  If the logger is not registered, the method will have no effect.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-function-with_transaction-param.yaml b/source/includes/apiargs-function-with_transaction-param.yaml
deleted file mode 100644
index 78875e91..00000000
--- a/source/includes/apiargs-function-with_transaction-param.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-arg_name: param
-name: $session
-type: :php:`MongoDB\\Driver\\Session `
-description: |
-  A client session used to execute the transaction.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $callback
-type: callback
-description: |
-  A callback that will be run inside the transaction. The callback must accept a
-  :php:`MongoDB\\Driver\\Session ` object as first
-  argument.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $transactionOptions
-type: array
-description: |
-  Transaction options, which will be passed to
-  :php:`MongoDB\\Driver\\Session::startTransaction `.
-  See the extension documentation for a list of supported options.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-method-watch-param.yaml b/source/includes/apiargs-method-watch-param.yaml
deleted file mode 100644
index e0da852c..00000000
--- a/source/includes/apiargs-method-watch-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $pipeline
-type: array|object
-description: |
-  The pipeline of stages to append to an initial ``$changeStream`` stage.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/extracts-bucket-option.yaml b/source/includes/extracts-bucket-option.yaml
new file mode 100644
index 00000000..0492ae9f
--- /dev/null
+++ b/source/includes/extracts-bucket-option.yaml
@@ -0,0 +1,28 @@
+ref: bucket-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+---
+ref: bucket-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+---
+ref: bucket-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+---
+ref: bucket-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+...
diff --git a/source/includes/extracts-client-option.yaml b/source/includes/extracts-client-option.yaml
new file mode 100644
index 00000000..9b9020bd
--- /dev/null
+++ b/source/includes/extracts-client-option.yaml
@@ -0,0 +1,28 @@
+ref: client-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+---
+ref: client-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+---
+ref: client-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+---
+ref: client-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+...
diff --git a/source/includes/extracts-collection-option.yaml b/source/includes/extracts-collection-option.yaml
new file mode 100644
index 00000000..94d9b9b0
--- /dev/null
+++ b/source/includes/extracts-collection-option.yaml
@@ -0,0 +1,38 @@
+ref: collection-option-collation
+source: 
+  ref: common-option-collation
+  file: extracts-common-option.yaml
+post: |
+  If the collation is unspecified but the collection has a default collation,
+  the operation uses the collation specified for the collection. If no
+  collation is specified for the collection or for the operation, MongoDB uses
+  the simple binary comparison used in prior versions for string comparisons.
+---
+ref: collection-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+---
+ref: collection-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+---
+ref: collection-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+---
+ref: collection-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+...
diff --git a/source/includes/extracts-common-option.yaml b/source/includes/extracts-common-option.yaml
new file mode 100644
index 00000000..65940b1c
--- /dev/null
+++ b/source/includes/extracts-common-option.yaml
@@ -0,0 +1,86 @@
+ref: common-option-collation
+content: |
+  :manual:`Collation ` allows users to specify
+  language-specific rules for string comparison, such as rules for lettercase
+  and accent marks. When specifying collation, the ``locale`` field is
+  mandatory; all other collation fields are optional. For descriptions of the
+  fields, see :manual:`Collation Document `.
+---
+ref: common-option-comment
+content: |
+  Enables users to specify an arbitrary comment to help trace the operation
+  through the :manual:`database profiler `,
+  :manual:`currentOp ` output, and
+  :manual:`logs `.
+---
+ref: common-option-comment-string-before-4.4
+content: |
+  The comment can be any valid BSON type since MongoDB 4.4. Earlier server
+  versions only support string values.
+---
+ref: common-option-hint
+content: |
+  The index to use. Specify either the index name as a string or the index key
+  pattern as a document. If specified, then the query system will only consider
+  plans using the hinted index.
+---
+ref: common-option-let
+content: |
+  Map of parameter names and values. Values must be constant or closed
+  expressions that do not reference document fields. Parameters can then be
+  accessed as variables in an aggregate expression context (e.g. ``$$var``).
+
+  This is not supported for server versions prior to 5.0 and will result in an
+  exception at execution time if used.
+---
+ref: common-option-maxTimeMS
+content: |
+  The cumulative time limit in milliseconds for processing operations on the
+  cursor. MongoDB aborts the operation at the earliest following
+  :term:`interrupt point`.
+---
+ref: common-option-readConcern
+content: |
+  :manual:`Read concern ` to use for the operation.
+  Defaults to the {{object}}'s read concern.
+replacement:
+  object: object
+---
+ref: common-option-readConcern-transaction
+content: |
+  It is not possible to specify a read concern for individual operations as part
+  of a transaction. Instead, set the ``readConcern`` option when
+  :php:`starting the transaction `.
+---
+ref: common-option-readPreference
+content: |
+  :manual:`Read preference ` to use for the
+  operation. Defaults to the {{object}}'s read preference.
+replacement:
+  object: object
+---
+ref: common-option-session
+content: |
+  Client session to associate with the operation.
+---
+ref: common-option-typeMap
+content: |
+  The :php:`type map `
+  to apply to cursors, which determines how BSON documents are converted to PHP
+  values. Defaults to the {{object}}'s type map.
+replacement:
+  object: object
+---
+ref: common-option-writeConcern
+content: |
+  :manual:`Write concern ` to use for the operation.
+  Defaults to the {{object}}'s write concern.
+replacement:
+  object: object
+---
+ref: common-option-writeConcern-transaction
+content: |
+  It is not possible to specify a write concern for individual operations as
+  part of a transaction. Instead, set the ``writeConcern`` option when
+  :php:`starting the transaction `.
+...
diff --git a/source/includes/extracts-database-option.yaml b/source/includes/extracts-database-option.yaml
new file mode 100644
index 00000000..e83c7abf
--- /dev/null
+++ b/source/includes/extracts-database-option.yaml
@@ -0,0 +1,28 @@
+ref: database-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+---
+ref: database-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+---
+ref: database-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+---
+ref: database-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+...
diff --git a/source/includes/extracts-note.yaml b/source/includes/extracts-note.yaml
index 46dadfea..4c41e191 100644
--- a/source/includes/extracts-note.yaml
+++ b/source/includes/extracts-note.yaml
@@ -12,21 +12,17 @@ content: |
 ---
 ref: note-atlas-search-requirement
 content: |
-  .. note::
-
-     This command can only be run on a deployment hosted on
-     :manual:`MongoDB Atlas ` and requires an Atlas cluster tier of at
-     least M10. A
-     `Local Atlas Deployment `__
-     can also be used for development.
+  This command can only be run on a deployment hosted on
+  :manual:`MongoDB Atlas ` and requires an Atlas cluster tier of at
+  least M10. A
+  `Local Atlas Deployment `__
+  can also be used for development.
 ---
 ref: note-atlas-search-async
 content: |
-   .. note::
-
-      Atlas Search indexes are managed asynchronously. After creating or
-      updating an index, you can periodically execute
-      :phpmethod:`MongoDB\\Collection::listSearchIndexes()` and check the
-      ``queryable`` :manual:`output field  `
-      to determine whether it is ready to be used.
+  Atlas Search indexes are managed asynchronously. After creating or updating an
+  index, you can periodically execute
+  :phpmethod:`MongoDB\\Collection::listSearchIndexes()` and check the
+  ``queryable`` :manual:`output field  `
+  to determine whether it is ready to be used.
 ...
diff --git a/source/includes/extracts-option-requires.yaml b/source/includes/extracts-option-requires.yaml
new file mode 100644
index 00000000..3b65fbba
--- /dev/null
+++ b/source/includes/extracts-option-requires.yaml
@@ -0,0 +1,48 @@
+---
+ref: option-requires-4.2
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "4.2"
+---
+ref: option-requires-4.4
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "4.4"
+---
+ref: option-requires-5.0
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "5.0"
+---
+ref: option-requires-5.3
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "5.3"
+---
+ref: option-requires-6.0
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "6.0"
+---
+ref: option-requires-7.0
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "7.0"
+---
+ref: option-requires-version
+content: |
+  This option is available since MongoDB {{version}} and will result in an
+  exception at execution time if specified for an older server version.
+...
diff --git a/source/includes/apiargs-method-watch-option.yaml b/source/includes/extracts-watch-option.yaml
similarity index 76%
rename from source/includes/apiargs-method-watch-option.yaml
rename to source/includes/extracts-watch-option.yaml
index d0927828..533e76ac 100644
--- a/source/includes/apiargs-method-watch-option.yaml
+++ b/source/includes/extracts-watch-option.yaml
@@ -1,8 +1,5 @@
----
-arg_name: option
-name: batchSize
-type: integer
-description: |
+ref: watch-option-batchSize
+content: |
   Specifies the batch size for the cursor, which will apply to both the initial
   ``aggregate`` command and any subsequent ``getMore`` commands. This determines
   the maximum number of change events to return in each response from the
@@ -14,20 +11,15 @@ description: |
      response for a change stream generally does not include any documents
      unless another option is used to configure its starting point (e.g.
      ``startAfter``).
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: fullDocument
-type: string
-description: |
-  Determines how the "fullDocument" response field will be populated for update
-  operations.
+ref: watch-option-fullDocument
+content: |
+  Determines how the ``fullDocument`` response field will be populated for
+  update operations.
 
   By default, change streams only return the delta of fields (via an
-  "updateDescription" field) for update operations and "fullDocument" is
-  omitted. Insert and replace operations always include the "fullDocument"
+  ``updateDescription`` field) for update operations and ``fullDocument`` is
+  omitted. Insert and replace operations always include the ``fullDocument``
   field. Delete operations omit the field as the document no longer exists.
 
   Specify "updateLookup" to return the current majority-committed version of the
@@ -48,15 +40,10 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: fullDocumentBeforeChange
-type: string
-description: |
-  Determines how the "fullDocumentBeforeChange" response field will be
+ref: watch-option-fullDocumentBeforeChange
+content: |
+  Determines how the ``fullDocumentBeforeChange`` response field will be
   populated. By default, the field is omitted.
 
   MongoDB 6.0+ allows returning the pre-image of the modified document if the
@@ -73,24 +60,16 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
+
+  .. versionadded: 1.13
 ---
-arg_name: option
-name: maxAwaitTimeMS
-type: integer
-description: |
+ref: watch-option-maxAwaitTimeMS
+content: |
   Positive integer denoting the time limit in milliseconds for the server to
   block a getMore operation if no data is available.
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: resumeAfter
-type: array|object
-description: |
+ref: watch-option-resumeAfter
+content: |
   Specifies the logical starting point for the new change stream. The ``_id``
   field in documents returned by the change stream may be used here.
 
@@ -101,14 +80,9 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: showExpandedEvents
-type: boolean
-description: |
+ref: watch-option-showExpandedEvents
+content: |
   If true, instructs the server to include additional DDL events in the change
   stream. The additional events that may be included are:
 
@@ -126,14 +100,11 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
+
+  .. versionadded:: 1.13
 ---
-arg_name: option
-name: startAfter
-type: array|object
-description: |
+ref: watch-option-startAfter
+content: |
   Specifies the logical starting point for the new change stream. The ``_id``
   field in documents returned by the change stream may be used here. Unlike
   ``resumeAfter``, this option can be used with a resume token from an
@@ -149,14 +120,11 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
+
+  .. versionadded: 1.5
 ---
-arg_name: option
-name: startAtOperationTime
-type: :php:`MongoDB\\BSON\\TimestampInterface `
-description: |
+ref: watch-option-startAtOperationTime
+content: |
   If specified, the change stream will only provide changes that occurred at or
   after the specified timestamp. Command responses from a MongoDB 4.0+ server
   include an ``operationTime`` that can be used here. By default, the
@@ -172,7 +140,4 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
 ...
diff --git a/source/reference/function/add_logger.txt b/source/reference/function/add_logger.txt
index ada7c9de..f00039df 100644
--- a/source/reference/function/add_logger.txt
+++ b/source/reference/function/add_logger.txt
@@ -23,9 +23,13 @@ Definition
 
       function add_logger(Psr\Log\LoggerInterface $logger): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$logger`` : Psr\\Log\\LoggerInterface
+  A logger to register.
 
-   .. include:: /includes/apiargs/function-add_logger-param.rst
+  If the logger is already registered, the method will have no effect.
 
 Behavior
 --------
diff --git a/source/reference/function/remove_logger.txt b/source/reference/function/remove_logger.txt
index d183f94b..5ced6f0a 100644
--- a/source/reference/function/remove_logger.txt
+++ b/source/reference/function/remove_logger.txt
@@ -23,9 +23,13 @@ Definition
 
       function remove_logger(Psr\Log\LoggerInterface $logger): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$logger`` : Psr\\Log\\LoggerInterface
+  A logger to unregister.
 
-   .. include:: /includes/apiargs/function-remove_logger-param.rst
+  If the logger is not registered, the method will have no effect.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/function/with_transaction.txt b/source/reference/function/with_transaction.txt
index f7b7b92d..438ea7a1 100644
--- a/source/reference/function/with_transaction.txt
+++ b/source/reference/function/with_transaction.txt
@@ -21,11 +21,27 @@ Definition
 
    .. code-block:: php
 
-      function with_transaction(MongoDB\Driver\Session $session, callable $callback, array $transactionOptions = []): void
+      function with_transaction(
+          MongoDB\Driver\Session $session,
+          callable $callback,
+          array $transactionOptions = []
+      ): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$session`` : :php:`MongoDB\\Driver\\Session `
+  A client session used to execute the transaction.
+
+``$callback`` : :php:`callable `
+  A callback that will be run inside the transaction. The callback must accept a
+  :php:`MongoDB\\Driver\\Session ` object as its first
+  argument.
 
-   .. include:: /includes/apiargs/function-with_transaction-param.rst
+``$transactionOptions`` : array
+  Transaction options, which will be passed to
+  :php:`MongoDB\\Driver\\Session::startTransaction `.
+  See the extension documentation for a list of supported options.
 
 Behavior
 --------
diff --git a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
index 2e8f708b..da115c5f 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
@@ -20,7 +20,7 @@ Definition
 
    .. code-block:: php
 
-      function getModifiedCount(): integer|null
+      function getModifiedCount(): integer
 
    This method should only be called if the write was acknowledged.
 
diff --git a/source/reference/method/MongoDBClient-addSubscriber.txt b/source/reference/method/MongoDBClient-addSubscriber.txt
index e55a9484..2bf16cd5 100644
--- a/source/reference/method/MongoDBClient-addSubscriber.txt
+++ b/source/reference/method/MongoDBClient-addSubscriber.txt
@@ -24,15 +24,11 @@ Definition
 
       function addSubscriber(MongoDB\Driver\Monitoring\Subscriber $subscriber): void
 
-   This method has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBClient-method-addSubscriber-param.rst
-
-   .. note::
+Parameters
+----------
 
-         If ``$subscriber`` is already registered with this Client, this function
-         is a no-op. If ``$subscriber`` is also registered globally, it will still
-         only be notified once of each event for this Client.
+``$subscriber`` : :php:`MongoDB\\Driver\\Monitoring\\Subscriber `
+  A monitoring event subscriber to register with this Client.
 
 Errors/Exceptions
 -----------------
@@ -44,6 +40,13 @@ if subscriber is a :php:`MongoDB\\Driver\\Monitoring\\LogSubscriber `.
 
+Behavior
+--------
+
+If ``$subscriber`` is already registered with this Client, this function is a
+no-op. If ``$subscriber`` is also registered globally, it will still only be
+notified once of each event for this Client.
+
 Example
 -------
 
diff --git a/source/reference/method/MongoDBClient-createClientEncryption.txt b/source/reference/method/MongoDBClient-createClientEncryption.txt
index 9b6f817e..0dd925cd 100644
--- a/source/reference/method/MongoDBClient-createClientEncryption.txt
+++ b/source/reference/method/MongoDBClient-createClientEncryption.txt
@@ -22,15 +22,18 @@ Definition
 
       function createClientEncryption(array $options): MongoDB\Driver\ClientEncryption
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBClient-method-createClientEncryption-param.rst
+``$options`` : array
+  An array specifying the desired options. Refer to the
+  :php:`MongoDB\\Driver\\Manager::createClientEncryption() `
+  extension documentation for a list of supported options.
 
-   The ``$options`` parameter supports all options documented in the
-   :php:`extension manual `.
-   For the ``keyVaultClient`` option, an instance of :phpclass:`MongoDB\\Client`
-   is automatically unwrapped and the :php:`MongoDB\\Driver\\Manager `
-   instance is passed to the extension.
+  If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+  option, it will be unwrapped into a
+  :php:`MongoDB\\Driver\\Manager ` for the
+  extension.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index 3e963ee5..5a268765 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -21,13 +21,46 @@ Definition
 
       function dropDatabase(string $databaseName, array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$databaseName`` : string
+  The name of the database to drop.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/client-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/client-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-listDatabaseNames.txt b/source/reference/method/MongoDBClient-listDatabaseNames.txt
index bf4fb48f..cac7d22c 100644
--- a/source/reference/method/MongoDBClient-listDatabaseNames.txt
+++ b/source/reference/method/MongoDBClient-listDatabaseNames.txt
@@ -23,13 +23,56 @@ Definition
 
       function listDatabaseNames(array $options = []): Iterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedDatabases
+       - boolean
+       - A flag that determines which databases are returned based on the user
+         privileges when access control is enabled. For more information, see the
+         `listDatabases command documentation `_.
+
+         For servers < 4.0.5, this option is ignored.
+
+         .. versionadded:: 1.7
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of databases.
+
+         You can specify a query expression for database fields (e.g. ``name``,
+         ``sizeOnDisk``, ``empty``).
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-param.rst
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-option.rst
+         .. versionadded:: 1.3
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index 822f98d7..dd6b2da8 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -21,13 +21,58 @@ Definition
 
       function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedDatabases
+       - boolean
+       - A flag that determines which databases are returned based on the user
+         privileges when access control is enabled. For more information, see the
+         `listDatabases command documentation `_.
+
+         For servers < 4.0.5, this option is ignored.
+
+         .. versionadded:: 1.7
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of databases.
+
+         You can specify a query expression for database fields (e.g. ``name``,
+         ``sizeOnDisk``, ``empty``).
+
+         .. versionadded:: 1.3
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-option.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-removeSubscriber.txt b/source/reference/method/MongoDBClient-removeSubscriber.txt
index 619fb70c..d0a6ac5d 100644
--- a/source/reference/method/MongoDBClient-removeSubscriber.txt
+++ b/source/reference/method/MongoDBClient-removeSubscriber.txt
@@ -23,20 +23,22 @@ Definition
 
       function removeSubscriber(MongoDB\Driver\Monitoring\Subscriber $subscriber): void
 
-   This method has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBClient-method-removeSubscriber-param.rst
-
-   .. note::
+Parameters
+----------
 
-         If ``$subscriber`` is not registered with this Client, this function
-         is a no-op.
+``$subscriber`` : :php:`MongoDB\\Driver\\Monitoring\\Subscriber `
+  A monitoring event subscriber to unregister with this Client.
 
 Errors/Exceptions
 -----------------
 
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 
+Behavior
+--------
+
+If ``$subscriber`` is not registered with this Client, this function is a no-op.
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 88828c29..6700f023 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -19,15 +19,51 @@ Definition
 
    .. code-block:: php
 
-      function selectCollection(string $databaseName, string $collectionName, array $options = []): MongoDB\Collection
+      function selectCollection(
+          string $databaseName,
+          string $collectionName,
+          array $options = []
+      ): MongoDB\Collection
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$databaseName`` : string
+  The name of the database containing the collection to select.
+
+``$collectionName`` : string
+  The name of the collection to select.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the client's read concern.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the client's read preference.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for collection operations. Defaults to the
+         client's type map.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults to
+         the client's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index a556a06a..b1814516 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -19,15 +19,47 @@ Definition
 
    .. code-block:: php
 
-      function selectDatabase(string $databaseName, array $options = []): MongoDB\Database
+      function selectDatabase(
+          string $databaseName,
+          array $options = []
+      ): MongoDB\Database
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$databaseName`` : string
+  The name of the database to select.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for database operations. Defaults to
+         the client's read concern.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for database operations. Defaults to
+         the client's read preference.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for database operations. Defaults to the
+         client's type map.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for database operations. Defaults to
+         the client's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-startSession.txt b/source/reference/method/MongoDBClient-startSession.txt
index 07a9b2b2..8de00ee0 100644
--- a/source/reference/method/MongoDBClient-startSession.txt
+++ b/source/reference/method/MongoDBClient-startSession.txt
@@ -23,9 +23,13 @@ Definition
 
       function startSession(array $options = []): MongoDB\Driver\Session
 
-   Refer to the :php:`MongoDB\\Driver\\Manager::startSession()
-   ` extension reference for accepted
-   options.
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options. Refer to the
+  :php:`MongoDB\\Driver\\Manager::startSession() `
+  extension documentation for a list of supported options.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-watch.txt b/source/reference/method/MongoDBClient-watch.txt
index 0e7aab34..2977475a 100644
--- a/source/reference/method/MongoDBClient-watch.txt
+++ b/source/reference/method/MongoDBClient-watch.txt
@@ -22,15 +22,90 @@ Definition
 
    .. code-block:: php
 
-      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+      function watch(
+          array $pipeline = [],
+          array $options = []
+      ): MongoDB\ChangeStream
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array|object
+  The pipeline of stages to append to an initial ``$changeStream`` stage.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - batchSize
+       - integer
+       - .. include:: /includes/extracts/watch-option-batchSize.rst
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+  
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - fullDocument
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocument.rst
+
+     * - fullDocumentBeforeChange
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocumentBeforeChange.rst
+
+     * - maxAwaitTimeMS
+       - integer
+       - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/client-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/client-option-readPreference.rst
+
+         This is used for both the initial change stream aggregation and for
+         server selection during an automatic resume.
+
+     * - resumeAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-resumeAfter.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - showExpandedEvents
+       - boolean
+       - .. include:: /includes/extracts/watch-option-showExpandedEvents.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-watch-param.rst
+     * - startAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-startAfter.rst
 
-   The ``$options`` parameter supports the following options:
+     * - startAtOperationTime
+       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-watch-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/client-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index 07694c91..1134df67 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -19,15 +19,195 @@ Definition
 
    .. code-block:: php
 
-      function __construct(?string $uri = null, array $uriOptions = [], array $driverOptions = [])
+      function __construct(
+          ?string $uri = null,
+          array $uriOptions = [],
+          array $driverOptions = []
+      )
 
-   This constructor has the following parameters:
+Parameters
+----------
+
+``$uri`` : string
+  The MongoDB connection string. Refer to
+  :manual:`Connection Strings ` in the MongoDB
+  manual for more information.
+
+  Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified.
+
+  Any special characters in the URI components need to be encoded according to
+  `RFC 3986 `_. This is particularly
+  relevant to the username and password, which can often include special
+  characters such as ``@``, ``:``, or ``%``. When connecting via a Unix domain
+  socket, the socket path may contain special characters such as slashes and
+  must be encoded. The :php:`rawurlencode() ` function may be used
+  to encode constituent parts of the URI.
+
+``$uriOptions`` : array
+  Specifies additional URI options, such as authentication credentials or query
+  string parameters. The options specified in ``$uriOptions`` take precedence
+  over any analogous options present in the ``$uri`` string and do not need to
+  be encoded according to `RFC 3986 `_.
+
+  Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
+  ` extension documentation for a list of
+  supported options.
+
+``$driverOptions`` : array
+  Specifies options specific to the PHP driver. In addition to driver options
+  supported by the :php:`extension `, the library
+  additionally supports specifying a default 
+  :php:`type map `
+  to apply to the cursors it creates.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - autoEncryption
+       - array
+       - Options to configure client-side field-level encryption in the driver.
+         Refer to the
+         :php:`extension documentation `
+         for a list of supported encryption options.
+
+         If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+         option, it will be unwrapped into a
+         :php:`MongoDB\\Driver\\Manager ` for the
+         extension.
+
+         .. versionadded:: 1.6
+
+     * - driver
+       - array
+       - Additional driver metadata to be passed on to the server handshake.
+         This is an array containing ``name``, ``version``, and ``platform``
+         string fields. For example:
+
+         .. code-block:: php
+
+            [
+                'name' => 'my-driver',
+                'version' => '1.2.3-dev',
+                'platform' => 'some-platform',
+            ]
+
+         .. note::
+
+            This feature is primarily designed for custom drivers and ODMs,
+            which may want to identify themselves to the server for diagnostic
+            purposes. Applications wishing to identify themselves should use the
+            ``appName`` URI option instead of this option.
+
+         .. versionadded:: 1.7
+
+     * - serverApi
+       - :php:`MongoDB\\Driver\\ServerApi `
+       - Used to declare an API version on the client. Refer to
+         :manual:`Stable API tutorial ` for additional
+         information.
+
+         .. versionadded:: 1.9
+
+     * - typeMap
+       - array
+       - Default :php:`type map `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
+
+         .. code-block:: php
+
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
+
+     * - allow_invalid_hostname
+       - boolean
+       - Disables hostname validation if ``true``. Defaults to ``false``.
+
+         Allowing invalid hostnames may expose the driver to a
+         `man-in-the-middle attack `__.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the
+            ``tlsAllowInvalidHostnames`` URI option instead.
+
+     * - ca_dir
+       - string
+       - Path to a correctly hashed certificate directory. The system
+         certificate store will be used by default.
+
+         Falls back to the deprecated ``capath`` SSL context option if not
+         specified.
+
+     * - ca_file
+       - string
+       - Path to a certificate authority file. The system certificate store will
+         be used by default.
+
+         Falls back to the deprecated ``cafile`` SSL context option if not
+         specified.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the ``tlsCAFile`` URI option
+            instead.
+
+     * - crl_file
+       - string
+       - Path to a certificate revocation list file.
+
+     * - pem_file
+       - string
+       - Path to a PEM encoded certificate to use for client authentication.
+
+         Falls back to the deprecated ``local_cert`` SSL context option if not
+         specified.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the ``tlsCertificateKeyFile``
+            URI option instead.
+
+     * - pem_pwd
+       - string
+       - Passphrase for the PEM encoded certificate (if applicable).
+
+         Falls back to the deprecated ``passphrase`` SSL context option if not
+         specified.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the
+            ``tlsCertificateKeyFilePassword`` URI option instead.
+
+     * - weak_cert_validation
+       - boolean
+       - Disables certificate validation ``true``. Defaults to ``false``.
+
+         Falls back to the deprecated ``allow_self_signed`` SSL context option
+         if not specified.
+
+         .. deprecated:: 1.6
 
-   .. include:: /includes/apiargs/MongoDBClient-method-construct-param.rst
+            This option has been deprecated. Use the
+            ``tlsAllowInvalidCertificates`` URI option instead.
 
-   The ``$driverOptions`` parameter supports the following options:
+     * - context
+       - resource
+       - :php:`SSL context options ` to be used as
+         fallbacks for other driver options (as specified). Note that the driver
+         does not consult the default stream context.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-construct-driverOptions.rst
+         This option is supported for backwards compatibility, but should be
+         considered deprecated.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
index 5e4097b2..88de4725 100644
--- a/source/reference/method/MongoDBClient__get.txt
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -23,9 +23,11 @@ Definition
 
       function __get(string $databaseName): MongoDB\Database
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBClient-method-get-param.rst
+``$databaseName`` : string
+  The name of the database to select.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index 6975098d..11f9d19b 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -20,15 +20,120 @@ Definition
 
    .. code-block:: php
 
-      function aggregate(array $pipeline, array $options = []): Traversable
+      function aggregate(
+          array $pipeline,
+          array $options = []
+      ): Traversable
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array
+  Specifies an :manual:`aggregation pipeline `
+  operation.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, aggregation
+         stages can write data to the ``_tmp`` sub-directory in the ``dbPath``
+         directory.
+
+     * - batchSize
+       - integer
+       - Specifies the batch size for the cursor, which will apply to both the
+         initial ``aggregate`` command and any subsequent ``getMore`` commands.
+         This determines the maximum number of documents to return in each
+         response from the server.
+
+         A batchSize of ``0`` is special in that and will only apply to the
+         initial ``aggregate`` command; subsequent ``getMore`` commands will use
+         the server's default batch size. This may be useful for quickly
+         returning a cursor or failure from ``aggregate`` without doing
+         significant server-side work.
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+         This only applies when using the :ref:`$out ` and
+         :ref:`$out ` stages.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         The comment can be any valid BSON type for server versions 4.4 and
+         above. Earlier server versions only support string values.
+
+         .. versionadded:: 1.3
+
+     * - explain
+       - boolean
+       - Specifies whether or not to return the information on the processing of
+         the pipeline.
+
+         .. versionadded:: 1.4
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.3
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.9
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-param.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   The ``$options`` parameter supports the following options:
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-option.rst
+         This only applies when a :ref:`$out ` or
+         :ref:`$merge ` stage is specified.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index e58688cb..a86e9cc6 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -19,15 +19,92 @@ Definition
 
    .. code-block:: php
 
-      function bulkWrite(array $operations, array $options = []): MongoDB\BulkWriteResult
+      function bulkWrite(
+          array $operations,
+          array $options = []
+      ): MongoDB\BulkWriteResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$operations`` : array
+  An array containing the write operations to perform.
+  :phpmethod:`MongoDB\\Collection::bulkWrite()` supports
+  :phpmethod:`deleteMany() `,
+  :phpmethod:`deleteOne() `,
+  :phpmethod:`insertOne() `,
+  :phpmethod:`replaceOne() `,
+  :phpmethod:`updateMany() `, and
+  :phpmethod:`updateOne() ` operations in the
+  following array structure:
+
+  .. code-block:: php
+
+     [
+         [ 'deleteMany' => [ $filter ] ],
+         [ 'deleteOne'  => [ $filter ] ],
+         [ 'insertOne'  => [ $document ] ],
+         [ 'replaceOne' => [ $filter, $replacement, $options ] ],
+         [ 'updateMany' => [ $filter, $update, $options ] ],
+         [ 'updateOne'  => [ $filter, $update, $options ] ],
+     ]
+
+  Arguments correspond to the respective operation methods. However, the
+  ``writeConcern`` option is specified as a top-level option to
+  :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
+  operation.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - ordered
+       - boolean
+       - If ``true``: when a single write fails, the operation will stop without
+         performing the remaining writes and throw an exception.
+
+         If ``false``: when a single write fails, the operation will continue
+         with the remaining writes, if any, and throw an exception.
+
+         The default is ``true``.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 1673ed91..0048703f 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -21,15 +21,77 @@ Definition
 
    .. code-block:: php
 
-      function count(array|object $filter = [], array $options = []): integer
+      function count(
+          array|object $filter = [],
+          array $options = []
+      ): integer
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to count.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionchanged:: 1.2
+
+            If a document is provided, it is passed to the command as-is.
+            Previously, the library would convert the key pattern to an index
+            name.
+
+     * - limit
+       - integer
+       - The maximum number of matching documents to return.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-count-param.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-count-option.rst
+     * - skip
+       - integer
+       - The number of matching documents to skip before returning results.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt
index 44b16c8e..dc62b1d6 100644
--- a/source/reference/method/MongoDBCollection-countDocuments.txt
+++ b/source/reference/method/MongoDBCollection-countDocuments.txt
@@ -23,13 +23,62 @@ Definition
 
       function countDocuments(array|object $filter = [], array $options = []): integer
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to count.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+     * - limit
+       - integer
+       - The maximum number of matching documents to return.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-countDocuments-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-countDocuments-option.rst
+     * - skip
+       - integer
+       - The number of matching documents to skip before returning results.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index ceef2e7b..7f8aca41 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -19,20 +19,114 @@ Definition
 
    .. code-block:: php
 
-      function createIndex(array|object $key, array $options = []): string
+      function createIndex(
+          array|object $key,
+          array $options = []
+      ): string
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$key`` : array|object
+  Specifies the field or fields to index and the index order.
+
+  For example, the following specifies a descending index on the ``username``
+  field:
+
+  .. code-block:: php
+
+     [ 'username' => -1 ]
+
+``$options`` : array
+  An array specifying the desired options.
+
+  The ``$options`` parameter accepts both index *and* command options. A
+  non-exhaustive list of index options follows. For a complete list of index
+  options, refer to the
+  :manual:`createIndexes ` command reference
+  in the MongoDB manual.
+
+  **Index Options** (non-exhaustive)
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - expireAfterSeconds
+       - integer
+       - Creates a :manual:`TTL ` index.
+
+     * - name
+       - string
+       - A name that uniquely identifies the index. By default, MongoDB creates
+         index names based on the key.
+
+     * - partialFilterExpression
+       - array|object
+       - Creates a :manual:`partial ` index.
+
+     * - sparse
+       - boolean
+       - Creates a :manual:`sparse ` index.
+
+     * - unique
+       - boolean
+       - Creates a :manual:`unique ` index.
+
+  **Command Options**
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - commitQuorum
+       - string|integer
+       - Specifies how many data-bearing members of a replica set, including the
+         primary, must complete the index builds successfully before the primary
+         marks the indexes as ready.
+
+         This option accepts the same values for the ``w`` field in a write
+         concern plus ``"votingMembers"``, which indicates all voting
+         data-bearing nodes.
+
+         This is not supported for server versions prior to 4.4 and will result
+         in an exception at execution time if used.
+
+         .. versionadded:: 1.7
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-param.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   The ``$options`` parameter accepts all index options that your MongoDB
-   version supports. MongoDB includes the following options:
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   For a full list of the supported index creation options, refer to the
-   :manual:`createIndexes ` command reference
-   in the MongoDB manual.
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index 76705e9b..efb740ea 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -19,15 +19,78 @@ Definition
 
    .. code-block:: php
 
-      function createIndexes(array $indexes, array $options = []): string[]
+      function createIndexes(
+          array $indexes,
+          array $options = []
+      ): string[]
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$indexes`` : array
+  The indexes to create on the collection.
+
+  For example, the following specifies a unique index on the ``username`` field
+  and a compound index on the ``email`` and ``createdAt`` fields:
+
+  .. code-block:: php
+
+     [
+         [ 'key' => [ 'username' => -1 ], 'unique' => true ],
+         [ 'key' => [ 'email' => 1, 'createdAt' => 1 ] ],
+     ]
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-param.rst
+         .. versionadded:: 1.13
 
-   The ``$options`` parameter supports the following options:
+     * - commitQuorum
+       - string|integer
+       - Specifies how many data-bearing members of a replica set, including the
+         primary, must complete the index builds successfully before the primary
+         marks the indexes as ready.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-option.rst
+         This option accepts the same values for the ``w`` field in a write
+         concern plus ``"votingMembers"``, which indicates all voting
+         data-bearing nodes.
+
+         This is not supported for server versions prior to 4.4 and will result
+         in an exception at execution time if used.
+
+         .. versionadded:: 1.7
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
+
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
@@ -41,15 +104,21 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
 ``$indexes`` parameter
-----------------------
+~~~~~~~~~~~~~~~~~~~~~~
 
 The ``$indexes`` parameter is an array of index specification documents. Each
 element in ``$indexes`` must itself be an array or object with a ``key`` field,
 which corresponds to the ``$key`` parameter of :phpmethod:`createIndex()
 `. The array or object may include other
 fields that correspond to index options accepted by :phpmethod:`createIndex()
-` (excluding ``writeConcern``).
+`. For a full list of the supported index
+creation options, refer to the
+:manual:`createIndexes ` command reference
+in the MongoDB manual.
 
 For example, the following ``$indexes`` parameter creates two indexes. The first
 is an ascending unique index on the ``username`` field and the second is a
diff --git a/source/reference/method/MongoDBCollection-createSearchIndex.txt b/source/reference/method/MongoDBCollection-createSearchIndex.txt
index d3f63773..df947463 100644
--- a/source/reference/method/MongoDBCollection-createSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-createSearchIndex.txt
@@ -21,18 +21,41 @@ Definition
 
    .. code-block:: php
 
-      function createSearchIndex(array|object $definition, array $options = []): string
+      function createSearchIndex(
+          array|object $definition,
+          array $options = []
+      ): string
 
-   This method has the following parameters:
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndex-param.rst
+Parameters
+----------
 
-   The ``$options`` parameter supports the following options:
+``$definition`` : array|object
+  Document describing the index to create. For details on definition syntax, see
+  :manual:`Search Index Definition Syntax `.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndex-option.rst
+``$options`` : array
+  An array specifying the desired options.
 
-   .. include:: /includes/extracts/note-atlas-search-requirement.rst
-   .. include:: /includes/extracts/note-atlas-search-async.rst
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+     * - name
+       - string
+       - Name of the search index to create.
+
+         You cannot create multiple indexes with the same name on a single
+         collection. If you do not specify a name, the index is named "default".
 
 Return Values
 -------------
@@ -46,6 +69,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-atlas-search-async.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-createSearchIndexes.txt b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
index 176dbf6a..584d94b3 100644
--- a/source/reference/method/MongoDBCollection-createSearchIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
@@ -21,18 +21,41 @@ Definition
 
    .. code-block:: php
 
-      function createSearchIndexes(array $indexes, array $options = []): string
+      function createSearchIndexes(
+          array $indexes,
+          array $options = []
+      ): string
 
-   This method has the following parameters:
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndexes-param.rst
+Parameters
+----------
 
-   The ``$options`` parameter supports the following options:
+``$indexes`` : array
+  Array of documents describing the indexes to create.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndexes-option.rst
+  A required ``definition`` document field describes the index to create. For
+  details on definition syntax, see
+  :manual:`Search Index Definition Syntax `.
 
-   .. include:: /includes/extracts/note-atlas-search-requirement.rst
-   .. include:: /includes/extracts/note-atlas-search-async.rst
+  An optional ``name`` string field specifies the name of the search index to
+  create. You cannot create multiple indexes with the same name on a single
+  collection. If you do not specify a name, the index is named "default".
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
 
 Return Values
 -------------
@@ -46,6 +69,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-atlas-search-async.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index 29ad2e83..ccb5e37d 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -19,15 +19,65 @@ Definition
 
    .. code-block:: php
 
-      function deleteMany(array|object $filter, array $options = []): MongoDB\DeleteResult
+      function deleteMany(
+          array|object $filter,
+          array $options = []
+      ): MongoDB\DeleteResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to delete.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index 6c888a96..0c659891 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -21,15 +21,65 @@ Definition
 
    .. code-block:: php
 
-      function deleteOne(array|object $filter, array $options = []): MongoDB\DeleteResult
+      function deleteOne(
+          array|object $filter,
+          array $options = []
+      ): MongoDB\DeleteResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to delete.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index 24fd6761..42eae068 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -19,15 +19,70 @@ Definition
 
    .. code-block:: php
 
-      function distinct(string $fieldName, array|object $filter = [], array $options = []): mixed[]
+      function distinct(
+          string $fieldName,
+          array|object $filter = [],
+          array $options = []
+      ): mixed[]
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$fieldName`` : string
+  The field for which to return distinct values.
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents from which to retrieve the
+  distinct values.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-distinct-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-distinct-option.rst
+         .. versionadded:: 1.5
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index a2cd9410..0704ff6a 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -21,13 +21,67 @@ Definition
 
       function drop(array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - encryptedFields
+       - array|object
+       - A document describing encrypted fields for queryable encryption. If
+         omitted, the ``encryptedFieldsMap`` option within the
+         ``autoEncryption`` driver option will be consulted. If
+         ``encryptedFieldsMap`` was defined but does not specify this
+         collection, the library will make a final attempt to consult the
+         server-side value for ``encryptedFields``. See
+         `Field Encryption and Queryability `_
+         in the MongoDB manual for more information.
+
+         .. note::
+
+            This option is not passed to the
+            :manual:`drop ` command. The library uses
+            it to determine related metadata collections that should be dropped
+            in addition to an encrypted collection.
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
+
+         This will be used for the returned command result document.
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-drop-param.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
-   The ``$options`` parameter supports the following options:
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-drop-option.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index 0a7fbb53..07a18145 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -19,15 +19,61 @@ Definition
 
    .. code-block:: php
 
-      function dropIndex(string|MongoDB\Model\IndexInfo $indexName, array $options = []): array|object
+      function dropIndex(
+          string|MongoDB\Model\IndexInfo $indexName,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+  The name or model object of the index to drop. View the existing indexes on
+  the collection using the :phpmethod:`listIndexes()
+  ` method.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
+         This will be used for the returned command result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index ee48d493..41fda6e4 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -22,13 +22,56 @@ Definition
 
       function dropIndexes(array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+  The name or model object of the index to drop. View the existing indexes on
+  the collection using the :phpmethod:`listIndexes()
+  ` method.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
+         This will be used for the returned command result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-dropSearchIndex.txt b/source/reference/method/MongoDBCollection-dropSearchIndex.txt
index befd5bf0..f3499273 100644
--- a/source/reference/method/MongoDBCollection-dropSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropSearchIndex.txt
@@ -23,15 +23,28 @@ Definition
 
       function dropSearchIndex(string $name, array $options = []): void
 
-   This method has the following parameters:
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropSearchIndex-param.rst
+Parameters
+----------
 
-   The ``$options`` parameter supports the following options:
+``$name`` : string
+  Name of the index to drop.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropSearchIndex-option.rst
+``$options`` : array
+  An array specifying the desired options.
 
-   .. include:: /includes/extracts/note-atlas-search-requirement.rst
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
index 1a831629..59a7b212 100644
--- a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
+++ b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
@@ -23,13 +23,45 @@ Definition
 
       function countDocuments(array $options = []): integer
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-estimateDocumentCount-param.rst
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
-   The ``$options`` parameter supports the following options:
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-estimateDocumentCount-option.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt
index 600f203b..ad63ec56 100644
--- a/source/reference/method/MongoDBCollection-explain.txt
+++ b/source/reference/method/MongoDBCollection-explain.txt
@@ -21,15 +21,52 @@ Definition
 
    .. code-block:: php
 
-      function explain(MongoDB\Operation\Explainable $explainable, array $options = []): array|object
+      function explain(
+          MongoDB\Operation\Explainable $explainable,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$explainable`` : :phpclass:`MongoDB\\Operation\\Explainable`
+  The command to explain.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         Defaults to the ``comment`` of the explained operation (if any).
+
+         .. versionadded:: 1.13
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-explain-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-explain-option.rst
+     * - verbosity
+       - string
+       - The verbosity level at which to run the command. See the :manual:`explain
+         ` command for more information.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 4fe92389..8c0ce7c2 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -19,15 +19,205 @@ Definition
 
    .. code-block:: php
 
-      function find(array|object $filter = [], array $options = []): MongoDB\Driver\Cursor
+      function find(
+          array|object $filter = [],
+          array $options = []
+      ): MongoDB\Driver\Cursor
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - batchSize
+       - integer
+       - The number of documents to return in the first batch. Defaults to
+         ``101``. A batchSize of ``0`` means that the cursor will be
+         established, but no documents will be returned in the first batch.
+
+         Unlike the previous wire protocol version, a batchSize of ``1`` for the
+         :dbcommand:`find` command does not close the cursor.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - cursorType
+       - integer
+       - Indicates the type of cursor to use. ``cursorType`` supports the
+         following values:
+
+         - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
+         - ``MongoDB\Operation\Find::TAILABLE``
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - limit
+       - integer
+       - The maximum number of documents to return. If unspecified, then
+         defaults to no limit. A limit of ``0`` is equivalent to setting no
+         limit.
+
+         A negative limit is similar to a positive limit but closes the cursor
+         after returning a single batch of results. As such, with a negative
+         limit, if the limited result set does not fit into a single batch, the
+         number of documents received will be less than the specified limit. By
+         passing a negative limit, the client indicates to the server that it
+         will not ask for a subsequent batch via getMore.
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxAwaitTimeMS
+       - integer
+       - Positive integer denoting the time limit in milliseconds for the server
+         to block a getMore operation if no data is available. This option
+         should only be used if cursorType is TAILABLE_AWAIT.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - noCursorTimeout
+       - boolean
+       - Prevents the server from timing out idle cursors after an inactivity
+         period (10 minutes).
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
+     * - snapshot
+       - boolean
+       - Prevents the cursor from returning a document more than once because of
+         an intervening write operation.
 
-   The ``$options`` parameter supports the following options:
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-find-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index 44829db3..c5230c6c 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -19,15 +19,156 @@ Definition
 
    .. code-block:: php
 
-      function findOne(array|object $filter = [], array $options = []): array|object|null
+      function findOne(
+          array|object $filter = [],
+          array $options = []
+      ): array|object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-option.rst
+         This will be used for the returned result document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index e5531f41..b34bd578 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -19,15 +19,87 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndDelete(array|object $filter = [], array $options = []): object|null
+      function findOneAndDelete(
+          array|object $filter = [],
+          array $options = []
+      ): object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to delete.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-param.rst
+         This will be used for the returned result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 66bd7f12..697e7371 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -19,15 +19,110 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndReplace(array|object $filter, array|object $replacement, array $options = []): object|null
+      function findOneAndReplace(
+          array|object $filter,
+          array|object $replacement,
+          array $options = []
+      ): object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to replace.
+
+``$replacement`` : array|object
+  The replacement document.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - returnDocument
+       - integer
+       - Specifies whether to return the document before the replacement is
+         applied, or after. ``returnDocument`` supports the following values:
+
+         - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*)
+         - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
+
+         This will be used for the returned result document.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index c903698b..cbfbad16 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -19,15 +19,121 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndUpdate(array|object $filter, array|object $update, array $options = []): object|null
+      function findOneAndUpdate(
+          array|object $filter,
+          array|object $update,
+          array $options = []
+      ): object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to update.
+
+``$update`` : array|object
+  Specifies the field and value combinations to update and any relevant update
+  operators. ``$update`` uses MongoDB's :method:`update operators
+  `. Starting with MongoDB 4.2, an `aggregation
+  pipeline `_
+  can be passed as this parameter.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - arrayFilters
+       - array
+       - An array of filter documents that determines which array elements to
+         modify for an update operation on an array field.
+
+         .. versionadded:: 1.3
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - returnDocument
+       - integer
+       - Specifies whether to return the document before the update is applied,
+         or after. ``returnDocument`` supports the following values:
+
+         - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*)
+         - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
+
+         This will be used for the returned result document.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 62b0858e..6ff516e7 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -19,15 +19,62 @@ Definition
 
    .. code-block:: php
 
-      function insertMany(array $documents, array $options = []): MongoDB\InsertManyResult
+      function insertMany(
+          array $documents,
+          array $options = []
+      ): MongoDB\InsertManyResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$documents`` : array
+  The documents to insert into the collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - ordered
+       - boolean
+       - If ``true``: when a single write fails, the operation will stop without
+         performing the remaining writes and throw an exception.
+
+         If ``false``: when a single write fails, the operation will continue
+         with the remaining writes, if any, and throw an exception.
+
+         The default is ``true``.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index dd6e2f22..ce6f0484 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -19,15 +19,52 @@ Definition
 
    .. code-block:: php
 
-      function insertOne(array|object $document, array $options = []): MongoDB\InsertOneResult
+      function insertOne(
+          array|object $document,
+          array $options = []
+      ): MongoDB\InsertOneResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$document`` : array|object
+  The document to insert into the collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index 2508b282..84ee74b3 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -21,13 +21,37 @@ Definition
 
       function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-param.rst
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-option.rst
+         .. versionadded:: 1.3
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-listSearchIndexes.txt b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
index 8dc98600..e8db9521 100644
--- a/source/reference/method/MongoDBCollection-listSearchIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
@@ -23,15 +23,71 @@ Definition
 
       function listSearchIndexes(array $options = []): Countable&Iterator
 
-   This method has the following parameters:
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
+
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-listSearchIndexes-param.rst
+``$options`` : array
+  An array specifying the desired options.
 
-   The ``$options`` parameter supports the following options:
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-listSearchIndexes-option.rst
+     * - Name
+       - Type
+       - Description
 
-   .. include:: /includes/extracts/note-atlas-search-requirement.rst
+     * - batchSize
+       - integer
+       - Specifies the batch size for the cursor, which will apply to both the
+         initial ``aggregate`` command and any subsequent ``getMore`` commands.
+         This determines the maximum number of documents to return in each
+         response from the server.
+
+         A batchSize of ``0`` is special in that and will only apply to the
+         initial ``aggregate`` command; subsequent ``getMore`` commands will use
+         the server's default batch size. This may be useful for quickly
+         returning a cursor or failure from ``aggregate`` without doing
+         significant server-side work.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - name
+       - string
+       - Name of the index to return information about.
+
+         If name is not specified, information for all indexes on the collection
+         will be returned.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
index a38872bd..1cb66f35 100644
--- a/source/reference/method/MongoDBCollection-mapReduce.txt
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -24,15 +24,139 @@ Definition
 
    .. code-block:: php
 
-      function mapReduce(MongoDB\BSON\JavascriptInterface $map, MongoDB\BSON\JavascriptInterface $reduce, string|array|object $out, array $options = []): MongoDB\MapReduceResult
+      function mapReduce(
+          MongoDB\BSON\JavascriptInterface $map,
+          MongoDB\BSON\JavascriptInterface $reduce,
+          string|array|object $out,
+          array $options = []
+      ): MongoDB\MapReduceResult
+
+Parameters
+----------
+
+``$map`` : :php:`MongoDB\\BSON\\Javascript `
+  A JavaScript function that associates or "maps" a value with a key and emits
+  the key and value pair.
+
+  .. note::
+
+     Passing a Javascript instance with a scope is deprecated. Put all scope
+     variables in the ``scope`` option of the MapReduce operation.
+
+``$reduce`` : :php:`MongoDB\\BSON\\Javascript `
+  A JavaScript function that "reduces" to a single object all the values
+  associated with a particular key.
+
+  .. note::
+
+     Passing a Javascript instance with a scope is deprecated. Put all scope
+     variables in the ``scope`` option of the MapReduce operation.
+
+``$out`` : string|array|object
+  Specifies where to output the result of the map-reduce operation. You can
+  either output to a collection or return the result inline. On a primary member
+  of a replica set you can output either to a collection or inline, but on a
+  secondary, only inline output is possible.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+         This only applies when results are output to a collection.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - finalize
+       - :php:`MongoDB\\BSON\\Javascript `
+       - Follows the reduce method and modifies the output.
+
+         .. note::
+
+            Passing a Javascript instance with a scope is deprecated. Put all
+            scope variables in the ``scope`` option of the MapReduce operation.
+
+     * - jsMode
+       - boolean
+       - Specifies whether to convert intermediate data into BSON format between
+         the execution of the map and reduce functions.
+
+     * - limit
+       - integer
+       - Specifies a maximum number of documents for the input into the map
+         function.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - query
+       - array|object
+       - Specifies the selection criteria using query operators for determining
+         the documents input to the map function.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+         This option will be ignored when results are output to a collection.
+
+     * - scope
+       - array|object
+       - Specifies global variables that are accessible in the map, reduce, and
+         finalize functions.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   This method has the following parameters:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-mapReduce-param.rst
+     * - verbose
+       - boolean
+       - Specifies whether to include the timing information in the result
+         information.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-mapReduce-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-rename.txt b/source/reference/method/MongoDBCollection-rename.txt
index a40555f2..2b617de9 100644
--- a/source/reference/method/MongoDBCollection-rename.txt
+++ b/source/reference/method/MongoDBCollection-rename.txt
@@ -21,15 +21,63 @@ Definition
 
    .. code-block:: php
 
-      function rename(string $toCollectionName, ?string $toDatabaseName = null, array $options = []): array|object
+      function rename(
+          string $toCollectionName,
+          ?string $toDatabaseName = null,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$toCollectionName`` : string
+  The new name of the collection.
+
+``$toDatabaseName`` : string
+  The new database name of the collection. If a new database name is not
+  specified, the database of the original collection will be used. If the new
+  name specifies a different database, the command copies the collection
+  to the new database and drops the source collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - dropTarget
+       - boolean
+       - If ``true``, MongoDB will drop the target before renaming the
+         collection. The default value is ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-rename-param.rst
+         This will be used for the returned command result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-rename-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index e42f993e..94395eff 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -21,15 +21,80 @@ Definition
 
    .. code-block:: php
 
-      function replaceOne(array|object $filter, array|object $replacement, array $options = []): MongoDB\UpdateResult
+      function replaceOne(
+          array|object $filter,
+          array|object $replacement,
+          array $options = []
+      ): MongoDB\UpdateResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to replace.
+
+``$replacement`` : array|object
+  The replacement document.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.2.rst
+
+         .. versionadded:: 1.6
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 0e5f22b9..07f29211 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -19,15 +19,91 @@ Definition
 
    .. code-block:: php
 
-      function updateMany(array|object $filter, array|object $update, array $options = []): MongoDB\UpdateResult
+      function updateMany(
+          array|object $filter,
+          array|object $update,
+          array $options = []
+      ): MongoDB\UpdateResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to update.
+
+``$update`` : array|object
+  Specifies the field and value combinations to update and any relevant update
+  operators. ``$update`` uses MongoDB's :method:`update operators
+  `. Starting with MongoDB 4.2, an `aggregation
+  pipeline `_
+  can be passed as this parameter.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - arrayFilters
+       - array
+       - An array of filter documents that determines which array elements to
+         modify for an update operation on an array field.
+
+         .. versionadded:: 1.3
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.2.rst
+
+         .. versionadded:: 1.6
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index 2b930e23..2a981cb2 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -21,15 +21,91 @@ Definition
 
    .. code-block:: php
 
-      function updateOne(array|object $filter, array|object $update, array $options = []): MongoDB\UpdateResult
+      function updateOne(
+          array|object $filter,
+          array|object $update,
+          array $options = []
+      ): MongoDB\UpdateResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to update.
+
+``$update`` : array|object
+  Specifies the field and value combinations to update and any relevant update
+  operators. ``$update`` uses MongoDB's :method:`update operators
+  `. Starting with MongoDB 4.2, an `aggregation
+  pipeline `_
+  can be passed as this parameter.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - arrayFilters
+       - array
+       - An array of filter documents that determines which array elements to modify
+         for an update operation on an array field.
+
+         .. versionadded:: 1.3
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.2.rst
+
+         .. versionadded:: 1.6
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-updateSearchIndex.txt b/source/reference/method/MongoDBCollection-updateSearchIndex.txt
index 2633d379..bf165910 100644
--- a/source/reference/method/MongoDBCollection-updateSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-updateSearchIndex.txt
@@ -21,18 +21,40 @@ Definition
 
    .. code-block:: php
 
-      function updateSearchIndex(string $name, array|object $definition, array $options = []): void
+      function updateSearchIndex(
+          string $name,
+          array|object $definition,
+          array $options = []
+      ): void
 
-   This method has the following parameters:
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateSearchIndex-param.rst
+Parameters
+----------
 
-   The ``$options`` parameter supports the following options:
+``$name`` : string
+  Name of the index to update.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateSearchIndex-option.rst
+``$definition`` : array|object
+  Document describing the updated search index definition. The specified
+  definition replaces the prior definition in the search index. For details on
+  definition syntax, see
+  :manual:`Search Index Definition Syntax `.
 
-   .. include:: /includes/extracts/note-atlas-search-requirement.rst
-   .. include:: /includes/extracts/note-atlas-search-async.rst
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
 
 Errors/Exceptions
 -----------------
@@ -41,6 +63,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-atlas-search-async.rst
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
index 50ef408d..c54123bd 100644
--- a/source/reference/method/MongoDBCollection-watch.txt
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -22,15 +22,94 @@ Definition
 
    .. code-block:: php
 
-      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+      function watch(
+          array $pipeline = [],
+          array $options = []
+      ): MongoDB\ChangeStream
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array|object
+  The pipeline of stages to append to an initial ``$changeStream`` stage.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - batchSize
+       - integer
+       - .. include:: /includes/extracts/watch-option-batchSize.rst
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+         Starting in MongoDB 4.2, defaults to simple binary comparison if
+         omitted. In earlier versions, change streams opened on a single
+         collection would inherit the collection's default collation.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+  
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - fullDocument
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocument.rst
+
+     * - fullDocumentBeforeChange
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocumentBeforeChange.rst
+
+     * - maxAwaitTimeMS
+       - integer
+       - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+         This is used for both the initial change stream aggregation and for
+         server selection during an automatic resume.
+
+     * - resumeAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-resumeAfter.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - showExpandedEvents
+       - boolean
+       - .. include:: /includes/extracts/watch-option-showExpandedEvents.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-watch-param.rst
+     * - startAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-startAfter.rst
 
-   The ``$options`` parameter supports the following options:
+     * - startAtOperationTime
+       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-watch-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index a68a5fec..293b093a 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -21,13 +21,41 @@ Definition
 
       function withOptions(array $options = []): MongoDB\Collection
 
-   This method has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-option.rst
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the original collection's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the original collection's read preference.
+
+     * - typeMap
+       - array
+       - The :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. Defaults to the original collection's type map.
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults to
+         the original collection's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
index e8077c73..09173500 100644
--- a/source/reference/method/MongoDBCollection__construct.txt
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -19,15 +19,65 @@ Definition
 
    .. code-block:: php
 
-      function __construct(MongoDB\Driver\Manager $manager, string $databaseName, string $collectionName, array $options = [])
+      function __construct(
+          MongoDB\Driver\Manager $manager,
+          string $databaseName,
+          string $collectionName,
+          array $options = []
+      )
 
    This constructor has the following parameters:
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-construct-param.rst
+``$manager`` : :php:`MongoDB\\Driver\\Manager `
+  The :php:`Manager ` instance from the driver. The
+  manager maintains connections between the driver and your MongoDB instances.
 
-   The ``$options`` parameter supports the following options:
+``$databaseName`` : string
+  The name of the database.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-construct-option.rst
+``$collectionName`` : string
+  The name of the collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the manager's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the manager's read preference.
+
+     * - typeMap
+       - array
+       - Default :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
+
+         .. code-block:: php
+
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults
+         to the manager's write concern.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBDatabase-aggregate.txt b/source/reference/method/MongoDBDatabase-aggregate.txt
index a7884bfe..96d409ae 100644
--- a/source/reference/method/MongoDBDatabase-aggregate.txt
+++ b/source/reference/method/MongoDBDatabase-aggregate.txt
@@ -24,15 +24,105 @@ Definition
 
    .. code-block:: php
 
-      function aggregate(array $pipeline, array $options = []): Traversable
+      function aggregate(
+          array $pipeline,
+          array $options = []
+      ): Traversable
 
-   This method has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBDatabase-method-aggregate-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-aggregate-option.rst
+``$pipeline`` : array
+  Specifies an :manual:`aggregation pipeline `
+  operation.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, aggregation
+         stages can write data to the ``_tmp`` sub-directory in the ``dbPath``
+         directory.
+
+     * - batchSize
+       - integer
+       - Specifies the batch size for the cursor, which will apply to both the
+         initial ``aggregate`` command and any subsequent ``getMore`` commands.
+         This determines the maximum number of documents to return in each
+         response from the server.
+
+         A batchSize of ``0`` is special in that and will only apply to the
+         initial ``aggregate`` command; subsequent ``getMore`` commands will use
+         the server's default batch size. This may be useful for quickly
+         returning a cursor or failure from ``aggregate`` without doing
+         significant server-side work.
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+         This only applies when using the :ref:`$out ` and
+         :ref:`$out ` stages.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         The comment can be any valid BSON type for server versions 4.4 and
+         above. Earlier server versions only support string values.
+
+     * - explain
+       - boolean
+       - Specifies whether or not to return the information on the processing of
+         the pipeline.
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.9
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/database-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/database-option-readPreference.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index 6853daad..50ebfe79 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -21,15 +21,41 @@ Definition
 
    .. code-block:: php
 
-      function command(array|object $command, array $options = []): MongoDB\Driver\Cursor
+      function command(
+          array|object $command,
+          array $options = []
+      ): MongoDB\Driver\Cursor
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$command`` : array|object
+  The :manual:`database command ` document.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/database-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-command-param.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-command-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 56129b97..2351f5d3 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -19,7 +19,10 @@ Definition
 
    .. code-block:: php
 
-      function createCollection(string $collectionName, array $options = []): array|object
+      function createCollection(
+          string $collectionName,
+          array $options = []
+      ): array|object
 
    MongoDB creates collections implicitly when you first reference the
    collection in a command, such as when inserting a document into a new
@@ -33,17 +36,294 @@ Definition
    :manual:`document validation criteria `,
    or configure your storage engine or indexing options.
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection to create.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. note::
+
+     Not all options are available on all versions of MongoDB. Refer to the
+     :manual:`create ` command reference in the
+     MongoDB manual for compatibility considerations.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - autoIndexId
+       - boolean
+       - Specify ``false`` to disable the automatic creation of an index on the
+         ``_id`` field.
+
+         .. important::
+
+            For replica sets, do not set ``autoIndexId`` to ``false``.
+
+         .. deprecated:: 1.4
+            This option has been deprecated since MongoDB 3.2. As of MongoDB
+            4.0, this option cannot be ``false`` when creating a replicated
+            collection (i.e. a collection outside of the ``local`` database in
+            any mongod mode).
+
+     * - capped
+       - boolean
+       - To create a capped collection, specify ``true``. If you specify
+         ``true``, you must also set a maximum size in the ``size`` option.
+
+     * - changeStreamPreAndPostImages
+       - document
+       - Used to configure support for pre- and post-images in change streams.
+         See the :manual:`create ` command
+         documentation for more information.
+
+         .. include:: /includes/extracts/option-requires-6.0.rst
+
+         .. versionadded:: 1.13
+
+     * - clusteredIndex
+       - document
+       - A clustered index specification. See
+         :manual:`Clustered Collections ` or the
+         :manual:`create ` command documentation for
+         more information.
+
+         .. include:: /includes/extracts/option-requires-5.3.rst
+
+         .. versionadded:: 1.13
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - encryptedFields
+       - document
+       - A document describing encrypted fields for queryable encryption. If
+         omitted, the ``encryptedFieldsMap`` option within the
+         ``autoEncryption`` driver option will be consulted. See
+         `Field Encryption and Queryability `_
+         in the MongoDB manual for more information.
+
+         .. include:: /includes/extracts/option-requires-7.0.rst
+
+         .. versionadded:: 1.13
+
+     * - expireAfterSeconds
+       - integer
+       - Used to automatically delete documents in time series collections. See
+         the :manual:`create ` command documentation
+         for more information.
+
+         .. include:: /includes/extracts/option-requires-5.0.rst
+
+         .. versionadded:: 1.9
+
+     * - flags
+       - integer
+       - Available for the MMAPv1 storage engine only to set the
+         ``usePowerOf2Sizes`` and ``noPadding`` flags.
+
+         The library provides constants that you can combine with a
+         :php:`bitwise OR operator ` to set the flag
+         values:
+
+         - ``MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES``: ``1``
+         - ``MongoDB\Operation\CreateCollection::NO_PADDING``: ``2``
+
+         Defaults to ``1``.
+
+         .. note::
+
+            MongoDB 3.0 and later ignores the ``usePowerOf2Sizes`` flag. See
+            :manual:`collMod ` and
+            :manual:`db.createCollection()
+            ` for more information.
+
+     * - indexOptionDefaults
+       - array|object
+       - Allows users to specify a default configuration for indexes when
+         creating a collection.
+
+         The ``indexOptionDefaults`` option accepts a ``storageEngine``
+         document, which should take the following form:
+
+         .. code-block:: none
+
+            { :  }
+
+         Storage engine configurations specified when creating indexes are
+         validated and logged to the :term:`oplog` during replication to support
+         replica sets with members that use different storage engines.
+
+     * - max
+       - integer
+       - The maximum number of documents allowed in the capped collection. The
+         ``size`` option takes precedence over this limit. If a capped
+         collection reaches the ``size`` limit before it reaches the maximum
+         number of documents, MongoDB removes old documents. If you prefer to
+         use the ``max`` limit, ensure that the ``size`` limit, which is
+         required for a capped collection, is sufficient to contain the maximum
+         number of documents.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - pipeline
+       - array
+       - An array that consists of the aggregation pipeline stage(s), which will
+         be applied to the collection or view specified by ``viewOn``. See the
+         :manual:`create ` command documentation for
+         more information.
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - size
+       - integer
+       - Specify a maximum size in bytes for a capped collection. Once a capped
+         collection reaches its maximum size, MongoDB removes the older
+         documents to make space for the new documents. The ``size`` option is
+         required for capped collections and ignored for other collections.
+
+     * - storageEngine
+       - array|object
+       - Available for the WiredTiger storage engine only.
+
+         Allows users to specify configuration to the storage engine on a
+         per-collection basis when creating a collection. The value of the
+         ``storageEngine`` option should take the following form:
+
+         .. code-block:: none
+
+            { :  }
+
+         Storage engine configurations specified when creating collections are
+         validated and logged to the :term:`oplog` during replication to support
+         replica sets with members that use different storage engines.
+
+     * - timeseries
+       - array|object
+       - An object containing options for creating time series collections. See
+         the :manual:`create ` command documentation
+         for supported options.
+
+         .. include:: /includes/extracts/option-requires-5.0.rst
+
+         .. versionadded:: 1.9
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
+
+         This will be used for the returned command result document.
+
+     * - validationAction
+       - string
+       - Determines whether to ``error`` on invalid documents or just ``warn``
+         about the violations but allow invalid documents to be inserted.
+
+         .. important::
+
+            Validation of documents only applies to those documents as
+            determined by the ``validationLevel``.
+
+         .. list-table::
+            :header-rows: 1
+
+            * - ``validationAction``
+              - Description
+
+            * - ``"error"``
+              - **Default**. Documents must pass validation before the write
+                occurs. Otherwise, the write operation fails.
+
+            * - ``"warn"``
+              - Documents do not have to pass validation. If the document fails
+                validation, the write operation logs the validation failure.
+
+     * - validationLevel
+       - string
+       - Determines how strictly MongoDB applies the validation rules to
+         existing documents during an update.
+
+         .. list-table::
+            :header-rows: 1
+
+            * - ``validationLevel``
+              - Description
+
+            * - ``"off"``
+              - No validation for inserts or updates.
+
+            * - ``"strict"``
+              - **Default**. Apply validation rules to all inserts and all updates.
+
+            * - ``"moderate"``
+              - Apply validation rules to inserts and to updates on existing
+                *valid* documents. Do not apply rules to updates on existing
+                *invalid* documents.
+
+     * - validator
+       - array|object
+       - Allows users to specify :manual:`validation rules or expressions
+         ` for the collection. For more information,
+         see :manual:`Document Validation ` in the
+         MongoDB manual.
+
+         The ``validator`` option takes an array that specifies the validation
+         rules or expressions. You can specify the expressions using the same
+         operators as MongoDB's
+         :manual:`query operators ` with the
+         exception of :query:`$geoNear`, :query:`$near`, :query:`$nearSphere`,
+         :query:`$text`, and :query:`$where`.
+
+         .. note::
+
+            - Validation occurs during updates and inserts. Existing documents
+              do not undergo validation checks until modification.
+
+            - You cannot specify a validator for collections in the ``admin``,
+              ``local``, and ``config`` databases.
+
+            - You cannot specify a validator for ``system.*`` collections.
+
+     * - viewOn
+       - string
+       - The name of the source collection or view from which to create the view.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-param.rst
+         .. note::
 
-   The ``$options`` parameter supports the following options:
+            The name is not the full namespace of the collection or view (i.e.
+            it does not include the database name). Views must be created in the
+            same databases as the source collection or view.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-option.rst
+            .. versionadded:: 1.13
 
-   Note that not all options are available on all versions of MongoDB. Refer to
-   the :manual:`create ` command reference in the
-   MongoDB manual for compatibility considerations.
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
index 64c643f0..390f99c6 100644
--- a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
@@ -21,7 +21,13 @@ Definition
 
    .. code-block:: php
 
-      function createEncryptedCollection(string $collectionName, MongoDB\Driver\ClientEncryption $clientEncryption, string $kmsProvider, ?array $masterKey, array $options): array
+      function createEncryptedCollection(
+          string $collectionName,
+          MongoDB\Driver\ClientEncryption $clientEncryption,
+          string $kmsProvider,
+          ?array $masterKey,
+          array $options
+      ): array
 
    This method will automatically create data keys for any encrypted fields
    where ``keyId`` is ``null``. Data keys will be created using
@@ -34,13 +40,33 @@ Definition
    :phpclass:`MongoDB\\Client` objects. Users must configure auto encryption
    after creating the encrypted collection with ``createEncryptedCollection()``.
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the encrypted collection to create.
+
+``$clientEncryption`` : :php:`MongoDB\\Driver\\ClientEncryption `
+  The ClientEncryption object used to create data keys.
+
+``$kmsProvider`` : string
+  KMS provider (e.g. "local", "aws") that will be used to encrypt new data keys.
+  This corresponds to the ``$kmsProvider`` parameter for
+  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+
+``$masterKey`` : array|null
+  KMS-specific key options that will be used to encrypt new data keys. This
+  corresponds to the ``masterKey`` option for
+  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+
+  If ``$kmsProvider`` is "local", this should be ``null``.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-createEncryptedCollection-param.rst
+``$options`` : array
+  An array specifying the desired options.
 
-   The ``$options`` parameter supports the same options as
-   :phpmethod:`MongoDB\\Database::createCollection()`. The ``encryptedFields``
-   option is required.
+  The ``$options`` parameter supports the same options as
+  :phpmethod:`MongoDB\\Database::createCollection()`. The ``encryptedFields``
+  option is required.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index eae1bb6b..457fad1a 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -21,13 +21,43 @@ Definition
 
       function drop(array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-drop-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-drop-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 028e63f0..018f3cca 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -19,15 +19,71 @@ Definition
 
    .. code-block:: php
 
-      function dropCollection(string $collectionName, array $options = []): array|object
+      function dropCollection(
+          string $collectionName,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection to drop.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - encryptedFields
+       - array|object
+       - A document describing encrypted fields for queryable encryption. If
+         omitted, the ``encryptedFieldsMap`` option within the
+         ``autoEncryption`` driver option will be consulted. If
+         ``encryptedFieldsMap`` was defined but does not specify this
+         collection, the library will make a final attempt to consult the
+         server-side value for ``encryptedFields``. See
+         `Field Encryption and Queryability `_
+         in the MongoDB manual for more information.
+
+         .. note::
+
+            This option is not passed to the
+            :manual:`drop ` command. The library uses
+            it to determine related metadata collections that should be dropped
+            in addition to an encrypted collection.
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-listCollectionNames.txt b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
index b6eaa4ce..53814f72 100644
--- a/source/reference/method/MongoDBDatabase-listCollectionNames.txt
+++ b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
@@ -23,13 +23,53 @@ Definition
 
       function listCollectionNames(array $options = []): Iterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedCollections
+       - boolean
+       - A flag that determines which collections are returned based on the user
+         privileges when access control is enabled. For more information, see
+         the :manual:`listCollections `
+         command documentation.
+
+         For servers < 4.0, this option is ignored.
+
+         .. versionadded:: 1.12
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of collections.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-param.rst
+         You can specify a query expression for collection fields (e.g.
+         ``name``, ``options``).
 
-   The ``$options`` parameter supports the following options:
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-option.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index 421b6cab..d66b6a5f 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -21,13 +21,55 @@ Definition
 
       function listCollections(array $options = []): MongoDB\Model\CollectionInfoIterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedCollections
+       - boolean
+       - A flag that determines which collections are returned based on the user
+         privileges when access control is enabled. For more information, see
+         the :manual:`listCollections `
+         command documentation.
+
+         For servers < 4.0, this option is ignored.
+
+         .. versionadded:: 1.12
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of collections.
+
+         You can specify a query expression for collection fields (e.g.
+         ``name``, ``options``).
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-param.rst
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-option.rst
+         .. versionadded:: 1.3
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-modifyCollection.txt b/source/reference/method/MongoDBDatabase-modifyCollection.txt
index 86c1ff52..0a756b01 100644
--- a/source/reference/method/MongoDBDatabase-modifyCollection.txt
+++ b/source/reference/method/MongoDBDatabase-modifyCollection.txt
@@ -22,15 +22,53 @@ Definition
 
    .. code-block:: php
 
-      function modifyCollection(string $collectionName, array $collectionOptions, array $options = []): array|object
+      function modifyCollection(
+          string $collectionName,
+          array $collectionOptions,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection or view to modify.
+
+``$collectionOptions`` : array
+  Collection or view options to assign.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-modifyCollection-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-modifyCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-renameCollection.txt b/source/reference/method/MongoDBDatabase-renameCollection.txt
index 8bbe5b8e..778dc10a 100644
--- a/source/reference/method/MongoDBDatabase-renameCollection.txt
+++ b/source/reference/method/MongoDBDatabase-renameCollection.txt
@@ -21,15 +21,65 @@ Definition
 
    .. code-block:: php
 
-      function renameCollection(string $fromCollectionName, string $toCollectionName, ?string $toDatabaseName = null, array $options = []): array|object
+      function renameCollection(
+          string $fromCollectionName,
+          string $toCollectionName,
+          ?string $toDatabaseName = null,
+          array $options = []
+      ): array|object
+
+Parameters
+----------
+
+``$fromCollectionName`` : string
+  The name of the collection to rename.
+
+``$toCollectionName`` : string
+  The new name of the collection.
+
+``$toDatabaseName`` : string
+  The new database name of the collection. If a new database name is not
+  specified, the current database will be used. If the new name specifies a
+  different database, the command copies the collection to the new database
+  and drops the source collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - dropTarget
+       - boolean
+       - If ``true``, MongoDB will drop the target before renaming the
+         collection. The default value is ``false``.
 
-   This method has the following parameters:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-renameCollection-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-renameCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 14885410..887d4a4d 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -19,15 +19,47 @@ Definition
 
    .. code-block:: php
 
-      function selectCollection(string $collectionName, array $options = []): MongoDB\Collection
+      function selectCollection(
+          string $collectionName,
+          array $options = []
+      ): MongoDB\Collection
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection to select.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the database's read concern.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the database's read preference.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for collection operations. Defaults to the
+         database's type map.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults to
+         the database's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index f9390627..0d115d9b 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -21,13 +21,56 @@ Definition
 
       function selectGridFSBucket(array $options = []): MongoDB\GridFS\Bucket
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bucketName
+       - string
+       - The bucket name, which will be used as a prefix for the files and
+         chunks collections. Defaults to ``"fs"``.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
+
+         Defaults to ``false``.
+
+         .. versionadded: 1.4
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for bucket operations. Defaults to the
+         database's read concern.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for bucket operations. Defaults to
+         the database's read concern.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for bucket operations. Defaults to the
+         database's type map.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for bucket operations. Defaults to the
+         database's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-watch.txt b/source/reference/method/MongoDBDatabase-watch.txt
index 7ff19b73..c79656ec 100644
--- a/source/reference/method/MongoDBDatabase-watch.txt
+++ b/source/reference/method/MongoDBDatabase-watch.txt
@@ -22,15 +22,90 @@ Definition
 
    .. code-block:: php
 
-      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+      function watch(
+          array $pipeline = [],
+          array $options = []
+      ): MongoDB\ChangeStream
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array|object
+  The pipeline of stages to append to an initial ``$changeStream`` stage.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - batchSize
+       - integer
+       - .. include:: /includes/extracts/watch-option-batchSize.rst
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+  
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - fullDocument
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocument.rst
+
+     * - fullDocumentBeforeChange
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocumentBeforeChange.rst
+
+     * - maxAwaitTimeMS
+       - integer
+       - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/database-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/database-option-readPreference.rst
+
+         This is used for both the initial change stream aggregation and for
+         server selection during an automatic resume.
+
+     * - resumeAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-resumeAfter.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - showExpandedEvents
+       - boolean
+       - .. include:: /includes/extracts/watch-option-showExpandedEvents.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-watch-param.rst
+     * - startAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-startAfter.rst
 
-   The ``$options`` parameter supports the following options:
+     * - startAtOperationTime
+       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-watch-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index 6f732eac..fc5d88ec 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -21,13 +21,41 @@ Definition
 
       function withOptions(array $options = []): MongoDB\Database
 
-   This method has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-option.rst
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for database operations. Defaults to
+         the original database's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for database operations. Defaults to
+         the original database's read preference.
+
+     * - typeMap
+       - array
+       - The :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. Defaults to the original database's type map.
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for database operations. Defaults to
+         the original database's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt
index 2d3e7f57..0a715e99 100644
--- a/source/reference/method/MongoDBDatabase__construct.txt
+++ b/source/reference/method/MongoDBDatabase__construct.txt
@@ -19,15 +19,62 @@ Definition
 
    .. code-block:: php
 
-      function __construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = [])
+      function __construct(
+          MongoDB\Driver\Manager $manager,
+          string $databaseName,
+          array $options = []
+      )
 
-   This constructor has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBDatabase-method-construct-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-construct-option.rst
+``$manager`` : :php:`MongoDB\\Driver\\Manager `
+  The :php:`Manager ` instance from the driver. The
+  manager maintains connections between the driver and your MongoDB instances.
+
+``$databaseName`` : string
+  The name of the database.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for database operations. Defaults to
+         the manager's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for database operations. Defaults to
+         the manager's read preference.
+
+     * - typeMap
+       - array
+       - Default :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
+
+         .. code-block:: php
+
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for database operations. Defaults to
+         the manager's write concern.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index 53cef6f9..c888a716 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -21,9 +21,11 @@ Definition
 
       function __get(string $collectionName): MongoDB\Collection
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-get-param.rst
+``$collectionName`` : string
+  The name of the database to select.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-delete.txt b/source/reference/method/MongoDBGridFSBucket-delete.txt
index b063337e..731fb4e4 100644
--- a/source/reference/method/MongoDBGridFSBucket-delete.txt
+++ b/source/reference/method/MongoDBGridFSBucket-delete.txt
@@ -21,9 +21,11 @@ Definition
 
       function delete($id): void
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-delete-param.rst
+``$id`` : mixed
+  The ``_id`` of the file to delete.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
index 2f2aa5da..917f03b5 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
@@ -22,9 +22,14 @@ Definition
 
       function downloadToStream($id, $destination): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$id`` : mixed
+  The ``_id`` of the file to download.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStream-param.rst
+``$destination`` : resource
+  Writable stream, to which the GridFS file's contents will be written.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index acc236f5..8bd4a1d6 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -20,15 +20,47 @@ Definition
 
    .. code-block:: php
 
-      function downloadToStreamByName(string $filename, resource $destination, array $options = []): void
+      function downloadToStreamByName(
+          string $filename,
+          resource $destination,
+          array $options = []
+      ): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to download.
+
+``$destination`` : resource
+  Writable stream, to which the GridFS file's contents will be written.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - revision
+       - integer
+       - The revision of the file to retrieve. Files with the same ``filename``
+         will be differentiated by their ``uploadDate`` field.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-param.rst
+         Revision numbers are defined as follows:
 
-   The ``$options`` parameter supports the following options:
+         - 0 = the original stored file
+         - 1 = the first revision
+         - 2 = the second revision
+         - etc...
+         - -2 = the second most recent revision
+         - -1 = the most recent revision
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-option.rst
+         Defaults to -1 (i.e. the most recent revision).
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index e0a4e662..d112dd66 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -19,15 +19,205 @@ Definition
 
    .. code-block:: php
 
-      function find(array|object $filter = [], array $options = []): MongoDB\Driver\Cursor
+      function find(
+          array|object $filter = [],
+          array $options = []
+      ): MongoDB\Driver\Cursor
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - batchSize
+       - integer
+       - The number of documents to return in the first batch. Defaults to
+         ``101``. A batchSize of ``0`` means that the cursor will be
+         established, but no documents will be returned in the first batch.
+
+         Unlike the previous wire protocol version, a batchSize of ``1`` for the
+         :dbcommand:`find` command does not close the cursor.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - cursorType
+       - integer
+       - Indicates the type of cursor to use. ``cursorType`` supports the
+         following values:
+
+         - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
+         - ``MongoDB\Operation\Find::TAILABLE``
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - limit
+       - integer
+       - The maximum number of documents to return. If unspecified, then
+         defaults to no limit. A limit of ``0`` is equivalent to setting no
+         limit.
+
+         A negative limit is similar to a positive limit but closes the cursor
+         after returning a single batch of results. As such, with a negative
+         limit, if the limited result set does not fit into a single batch, the
+         number of documents received will be less than the specified limit. By
+         passing a negative limit, the client indicates to the server that it
+         will not ask for a subsequent batch via getMore.
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxAwaitTimeMS
+       - integer
+       - Positive integer denoting the time limit in milliseconds for the server
+         to block a getMore operation if no data is available. This option
+         should only be used if cursorType is TAILABLE_AWAIT.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - noCursorTimeout
+       - boolean
+       - Prevents the server from timing out idle cursors after an inactivity
+         period (10 minutes).
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/bucket-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/bucket-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
+     * - snapshot
+       - boolean
+       - Prevents the cursor from returning a document more than once because of
+         an intervening write operation.
 
-   The ``$options`` parameter supports the following options:
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-find-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/bucket-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
index f126448d..1ff9f258 100644
--- a/source/reference/method/MongoDBGridFSBucket-findOne.txt
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -20,15 +20,156 @@ Definition
 
    .. code-block:: php
 
-      function findOne(array|object $filter = [], array $options = []): array|object|null
+      function findOne(
+          array|object $filter = [],
+          array $options = []
+      ): array|object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/bucket-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/bucket-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/bucket-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-findOne-option.rst
+         This will be used for the returned result document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index f8d633ed..fa8625f9 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -21,9 +21,11 @@ Definition
 
       function getFileDocumentForStream(resource $stream): array|object
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileDocumentForStream-param.rst
+``$stream`` : resource
+  The GridFS stream resource.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index f88dc885..b42ab19b 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -21,9 +21,11 @@ Definition
 
       function getFileIdForStream(resource $stream): mixed
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileIdForStream-param.rst
+``$stream`` : resource
+  The GridFS stream resource.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
index 85f2150a..9118cecc 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -21,9 +21,11 @@ Definition
 
       function openDownloadStream($id): resource
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStream-param.rst
+``$id`` : mixed
+  The ``_id`` of the file to download.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
index cb3a336e..4c0b525d 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -19,15 +19,43 @@ Definition
 
    .. code-block:: php
 
-      function openDownloadStreamByName(string $filename, array $options = []): resource
+      function openDownloadStreamByName(
+          string $filename,
+          array $options = []
+      ): resource
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to download.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - revision
+       - integer
+       - The revision of the file to retrieve. Files with the same ``filename``
+         will be differentiated by their ``uploadDate`` field.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-param.rst
+         Revision numbers are defined as follows:
 
-   The ``$options`` parameter supports the following options:
+         - 0 = the original stored file
+         - 1 = the first revision
+         - 2 = the second revision
+         - etc...
+         - -2 = the second most recent revision
+         - -1 = the most recent revision
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-option.rst
+         Defaults to -1 (i.e. the most recent revision).
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 348b325f..2870b544 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -19,15 +19,50 @@ Definition
 
    .. code-block:: php
 
-      function openUploadStream(string $filename, array $options = []): resource
+      function openUploadStream(
+          string $filename,
+          array $options = []
+      ): resource
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to create.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - _id
+       - mixed
+       - Value to use as the file document identifier. Defaults to a new
+         :php:`MongoDB\\BSON\\ObjectId ` object.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes``
+         option.
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-param.rst
+         Defaults to ``false``.
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded: 1.4
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-option.rst
+     * - metadata
+       - array|object
+       - User data for the ``metadata`` field of the file document. If not
+         specified, the ``metadata`` field will not be set on the file document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt
index 888d1ae3..20d9c1d7 100644
--- a/source/reference/method/MongoDBGridFSBucket-rename.txt
+++ b/source/reference/method/MongoDBGridFSBucket-rename.txt
@@ -21,9 +21,14 @@ Definition
 
       function rename($id, string $newFilename): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$id`` : mixed
+  The ``_id`` of the file to rename.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-rename-param.rst
+``$newFilename`` : string
+  The new ``filename`` value.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index 18e5944b..89cb8d2f 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -19,15 +19,54 @@ Definition
 
    .. code-block:: php
 
-      function uploadFromStream(string $filename, resource $source, array $options = []): mixed
+      function uploadFromStream(
+          string $filename,
+          resource $source,
+          array $options = []
+      ): mixed
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to create.
+
+``$source`` : resource
+  Readable stream, from which the new GridFS file's contents will be read.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - _id
+       - mixed
+       - Value to use as the file document identifier. Defaults to a new
+         :php:`MongoDB\\BSON\\ObjectId ` object.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes``
+         option.
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-param.rst
+         Defaults to ``false``.
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded: 1.4
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-option.rst
+     * - metadata
+       - array|object
+       - User data for the ``metadata`` field of the file document. If not
+         specified, the ``metadata`` field will not be set on the file document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index c6c309bb..25271e0c 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -19,15 +19,79 @@ Definition
 
    .. code-block:: php
 
-      function __construct(MongoDB\Driver\Manager $manager, string $databaseName, array $options = [])
+      function __construct(
+          MongoDB\Driver\Manager $manager,
+          string $databaseName,
+          array $options = []
+      )
 
-   This constructor has the following parameters:
+Parameters
+----------
+
+``$manager`` : :php:`MongoDB\\Driver\\Manager `
+  The :php:`Manager ` instance from the driver. The
+  manager maintains connections between the driver and your MongoDB instances.
+
+``$databaseName`` : string
+  The name of the database.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bucketName
+       - string
+       - The bucket name, which will be used as a prefix for the files and
+         chunks collections. Defaults to ``"fs"``.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
+
+         Defaults to ``false``.
+
+         .. versionadded: 1.4
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for bucket operations. Defaults to the
+         manager's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for bucket operations. Defaults to
+         the manager's read preference.
+
+     * - typeMap
+       - array
+       - Default :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-param.rst
+         .. code-block:: php
 
-   The ``$options`` parameter supports the following options:
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for bucket operations. Defaults to the
+         manager's write concern.
 
 Errors/Exceptions
 -----------------
diff --git a/source/tutorial/modeling-bson-data.txt b/source/tutorial/modeling-bson-data.txt
index 24486d1e..5cf09197 100644
--- a/source/tutorial/modeling-bson-data.txt
+++ b/source/tutorial/modeling-bson-data.txt
@@ -10,6 +10,7 @@ Modeling BSON Data
    :depth: 2
    :class: singlecol
 
+.. _php-type-map:
 
 Type Maps
 ---------
@@ -155,7 +156,6 @@ The same document in the MongoDB shell might display as:
 
    :php:`MongoDB\\BSON\\Persistable ` may only be used
    for root and embedded BSON documents. It may not be used for BSON arrays.
-.. _php-type-map:
 
 Working with Enums
 ------------------

From 971336a5c54101c73dc83872174ec613b3b8babf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?=
 
Date: Mon, 18 Dec 2023 11:01:55 +0100
Subject: [PATCH 293/321] PHPLIB-1206 Add bucket alises for context resolver
 using GridFS StreamWrapper (#1138)

---
 .../reference/class/MongoDBGridFSBucket.txt   |   1 +
 ...ucket-registerGlobalStreamWrapperAlias.txt | 132 ++++++++++++++++++
 2 files changed, 133 insertions(+)
 create mode 100644 source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt

diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 0fdeb5cb..7b4bb54c 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -55,5 +55,6 @@ Methods
    /reference/method/MongoDBGridFSBucket-openDownloadStream
    /reference/method/MongoDBGridFSBucket-openDownloadStreamByName
    /reference/method/MongoDBGridFSBucket-openUploadStream
+   /reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias
    /reference/method/MongoDBGridFSBucket-rename
    /reference/method/MongoDBGridFSBucket-uploadFromStream
diff --git a/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt b/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt
new file mode 100644
index 00000000..649915ee
--- /dev/null
+++ b/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt
@@ -0,0 +1,132 @@
+===========================================================
+MongoDB\\GridFS\\Bucket::registerGlobalStreamWrapperAlias()
+===========================================================
+
+.. versionadded:: 1.18
+
+.. default-domain:: mongodb
+
+.. contents:: On this page
+   :local:
+   :backlinks: none
+   :depth: 1
+   :class: singlecol
+
+Definition
+----------
+
+.. phpmethod:: MongoDB\\GridFS\\Bucket::registerGlobalStreamWrapperAlias()
+
+   Registers an alias for the bucket, which enables files within the bucket to
+   be accessed using a basic filename string (e.g.
+   `gridfs:///`).
+
+   .. code-block:: php
+
+      function registerGlobalStreamWrapperAlias(string $alias): void
+
+Parameters
+----------
+
+``$alias`` : array
+  A non-empty string used to identify the GridFS bucket when accessing files
+  using the ``gridfs://`` stream wrapper.
+
+Behavior
+--------
+
+After registering an alias for the bucket, the most recent revision of a file
+can be accessed using a filename string in the form ``gridfs:///``.
+
+Supported stream functions:
+
+- :php:`copy() `
+- :php:`file_exists() `
+- :php:`file_get_contents() `
+- :php:`file_put_contents() `
+- :php:`filemtime() `
+- :php:`filesize() `
+- :php:`file() `
+- :php:`fopen() ` (with "r", "rb", "w", and "wb" modes)
+
+In read mode, the stream context can contain the option ``gridfs['revision']``
+to specify the revision number of the file to read. If omitted, the most recent
+revision is read (revision ``-1``).
+
+In write mode, the stream context can contain the option ``gridfs['chunkSizeBytes']``.
+If omitted, the defaults are inherited from the ``Bucket`` instance option.
+
+Example
+-------
+
+Read and write to a GridFS bucket using the ``gridfs://`` stream wrapper
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following example demonstrates how to register an alias for a GridFS bucket
+and use the functions ``file_exists()``, ``file_get_contents()``, and
+``file_put_contents()`` to read and write to the bucket.
+
+Each call to these functions makes a request to the server.
+
+.. code-block:: php
+
+   selectDatabase('test');
+   $bucket = $database->selectGridFSBucket();
+
+   $bucket->registerGlobalStreamWrapperAlias('mybucket');
+
+   var_dump(file_exists('gridfs://mybucket/hello.txt'));
+
+   file_put_contents('gridfs://mybucket/hello.txt', 'Hello, GridFS!');
+
+   var_dump(file_exists('gridfs://mybucket/hello.txt'));
+
+   echo file_get_contents('gridfs://mybucket/hello.txt');
+
+The output would then resemble:
+
+.. code-block:: none
+
+   bool(false)
+   bool(true)
+   Hello, GridFS!
+
+Read a specific revision of a file
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Using a stream context, you can specify the revision number of the file to
+read. If omitted, the most recent revision is read.
+
+.. code-block:: php
+
+   selectDatabase('test');
+   $bucket = $database->selectGridFSBucket();
+
+   $bucket->registerGlobalStreamWrapperAlias('mybucket');
+
+   // Creating revision 0
+   $handle = fopen('gridfs://mybucket/hello.txt', 'w');
+   fwrite($handle, 'Hello, GridFS! (v0)');
+   fclose($handle);
+
+   // Creating revision 1
+   $handle = fopen('gridfs://mybucket/hello.txt', 'w');
+   fwrite($handle, 'Hello, GridFS! (v1)');
+   fclose($handle);
+
+   // Read revision 0
+   $context = stream_context_create([
+        'gridfs' => ['revision' => 0],
+   ]);
+   $handle = fopen('gridfs://mybucket/hello.txt', 'r', false, $context);
+   echo fread($handle, 1024);
+
+The output would then resemble:
+
+.. code-block:: none
+
+   Hello, GridFS! (v0)

From d1ed05aa962190c67923e75bed022a7f8621513a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?=
 
Date: Mon, 8 Jan 2024 09:46:39 +0100
Subject: [PATCH 294/321] Deprecate setting GridFS disableMD5 to false
 explicitly (#1205)

---
 source/reference/method/MongoDBDatabase-selectGridFSBucket.txt  | 2 +-
 .../reference/method/MongoDBGridFSBucket-openUploadStream.txt   | 2 +-
 .../reference/method/MongoDBGridFSBucket-uploadFromStream.txt   | 2 +-
 source/reference/method/MongoDBGridFSBucket__construct.txt      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index 0d115d9b..c2154a53 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -48,7 +48,7 @@ Parameters
        - boolean
        - Whether to disable automatic MD5 generation when storing files.
 
-         Defaults to ``false``.
+         Defaults to ``false``. Only ``true`` will be supported in 2.0.
 
          .. versionadded: 1.4
 
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 2870b544..18fb3361 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -55,7 +55,7 @@ Parameters
        - boolean
        - Whether to disable automatic MD5 generation when storing files.
 
-         Defaults to ``false``.
+         Defaults to ``false``. Only ``true`` will be supported in 2.0.
 
          .. versionadded: 1.4
 
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index 89cb8d2f..adcadaef 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -59,7 +59,7 @@ Parameters
        - boolean
        - Whether to disable automatic MD5 generation when storing files.
 
-         Defaults to ``false``.
+         Defaults to ``false``. Only ``true`` will be supported in 2.0.
 
          .. versionadded: 1.4
 
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index 25271e0c..40472f0c 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -59,7 +59,7 @@ Parameters
        - boolean
        - Whether to disable automatic MD5 generation when storing files.
 
-         Defaults to ``false``.
+         Defaults to ``false``. Only ``true`` will be supported in 2.0.
 
          .. versionadded: 1.4
 

From 63fb985fa84f176acdba42167adda0b99eacd8b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?=
 
Date: Tue, 9 Jan 2024 09:47:55 +0100
Subject: [PATCH 295/321] PHPLIB-1324 Implement `rename` for GridFS stream
 wrapper  (#1207)

Optimize rename using a single updateMany command instead of doing the implementation suggested in the spec
https://github.com/mongodb/specifications/blob/0b47194538aa817978fae0f77f684f6d5e62ebab/source/gridfs/gridfs-spec.rst#renaming-stored-files
---
 .../MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt b/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt
index 649915ee..4dcc79ce 100644
--- a/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt
+++ b/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt
@@ -47,7 +47,8 @@ Supported stream functions:
 - :php:`filemtime() `
 - :php:`filesize() `
 - :php:`file() `
-- :php:`fopen() ` (with "r", "rb", "w", and "wb" modes)
+- :php:`fopen() ` with "r", "rb", "w", and "wb" modes
+- :php:`rename() ` rename all revisions of a file in the same bucket
 
 In read mode, the stream context can contain the option ``gridfs['revision']``
 to specify the revision number of the file to read. If omitted, the most recent

From d2eba6efa856602659bd1421ed4c0308e712a96b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?=
 
Date: Fri, 12 Jan 2024 13:37:37 +0100
Subject: [PATCH 296/321] PHPLIB-1323 Implement `unlink` for GridFS stream
 wrapper (#1206)

* Delete all file revisions by bulk
* Thrown a FileNotFoundException in rename and unlink
* Fix rename with same file name
---
 ...ngoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt b/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt
index 4dcc79ce..59991e61 100644
--- a/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt
+++ b/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt
@@ -48,7 +48,8 @@ Supported stream functions:
 - :php:`filesize() `
 - :php:`file() `
 - :php:`fopen() ` with "r", "rb", "w", and "wb" modes
-- :php:`rename() ` rename all revisions of a file in the same bucket
+- :php:`rename() `
+- :php:`unlink() `
 
 In read mode, the stream context can contain the option ``gridfs['revision']``
 to specify the revision number of the file to read. If omitted, the most recent
@@ -57,6 +58,9 @@ revision is read (revision ``-1``).
 In write mode, the stream context can contain the option ``gridfs['chunkSizeBytes']``.
 If omitted, the defaults are inherited from the ``Bucket`` instance option.
 
+The functions `rename` and `unlink` will rename or remove all revisions of a
+filename. If the filename does not exist, these functions throw a ``FileNotFoundException``.
+
 Example
 -------
 
@@ -86,6 +90,8 @@ Each call to these functions makes a request to the server.
 
    echo file_get_contents('gridfs://mybucket/hello.txt');
 
+   unlink('gridfs://mybucket/hello.txt');
+
 The output would then resemble:
 
 .. code-block:: none

From 97fed35706eee654e204c18bbbd6be034fa628e7 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 22 Jan 2024 14:41:14 -0500
Subject: [PATCH 297/321] PHPLIB-1275: Replace apiargs usage in docs with
 extracts (#1220)

This backports 8f562a701c908b6b7e09e344062094d245050fd3 from master to v1.16
---
 .../apiargs-MongoDBClient-common-option.yaml  |  34 --
 ...Client-method-construct-driverOptions.yaml | 189 ---------
 ...-MongoDBClient-method-construct-param.yaml |  51 ---
 ...t-method-createClientEncryption-param.yaml |   4 -
 ...goDBClient-method-dropDatabase-option.yaml |  25 --
 ...ngoDBClient-method-dropDatabase-param.yaml |  10 -
 ...piargs-MongoDBClient-method-get-param.yaml |   6 -
 ...oDBClient-method-listDatabases-option.yaml |  47 ---
 ...goDBClient-method-listDatabases-param.yaml |   4 -
 ...Client-method-selectCollection-option.yaml |  27 --
 ...BClient-method-selectCollection-param.yaml |  16 -
 ...DBClient-method-selectDatabase-option.yaml |  27 --
 ...oDBClient-method-selectDatabase-param.yaml |  10 -
 ...rgs-MongoDBClient-method-watch-option.yaml |  71 ----
 ...args-MongoDBClient-method-watch-param.yaml |   8 -
 ...iargs-MongoDBCollection-common-option.yaml |  86 -----
 ...piargs-MongoDBCollection-common-param.yaml |  33 --
 ...oDBCollection-method-aggregate-option.yaml |  84 ----
 ...goDBCollection-method-aggregate-param.yaml |  14 -
 ...oDBCollection-method-bulkWrite-option.yaml |  44 ---
 ...goDBCollection-method-bulkWrite-param.yaml |  37 --
 ...oDBCollection-method-construct-option.yaml |  25 --
 ...goDBCollection-method-construct-param.yaml |  16 -
 ...MongoDBCollection-method-count-option.yaml |  64 ---
 ...-MongoDBCollection-method-count-param.yaml |  11 -
 ...llection-method-countDocuments-option.yaml |  56 ---
 ...ollection-method-countDocuments-param.yaml |  11 -
 ...BCollection-method-createIndex-option.yaml | 117 ------
 ...DBCollection-method-createIndex-param.yaml |  20 -
 ...ollection-method-createIndexes-option.yaml |  29 --
 ...Collection-method-createIndexes-param.yaml |  23 --
 ...DBCollection-method-deleteMany-option.yaml |  38 --
 ...oDBCollection-method-deleteMany-param.yaml |  11 -
 ...oDBCollection-method-deleteOne-option.yaml |  38 --
 ...goDBCollection-method-deleteOne-param.yaml |  11 -
 ...goDBCollection-method-distinct-option.yaml |  37 --
 ...ngoDBCollection-method-distinct-param.yaml |  20 -
 ...-MongoDBCollection-method-drop-option.yaml |  31 --
 ...s-MongoDBCollection-method-drop-param.yaml |   4 -
 ...oDBCollection-method-dropIndex-option.yaml |  31 --
 ...goDBCollection-method-dropIndex-param.yaml |  15 -
 ...BCollection-method-dropIndexes-option.yaml |  29 --
 ...DBCollection-method-dropIndexes-param.yaml |   4 -
 ...n-method-estimateDocumentCount-option.yaml |  25 --
 ...on-method-estimateDocumentCount-param.yaml |   4 -
 ...ngoDBCollection-method-explain-option.yaml |  31 --
 ...ongoDBCollection-method-explain-param.yaml |  13 -
 ...-MongoDBCollection-method-find-option.yaml | 263 -------------
 ...s-MongoDBCollection-method-find-param.yaml |  11 -
 ...ngoDBCollection-method-findOne-option.yaml |  84 ----
 ...ongoDBCollection-method-findOne-param.yaml |  11 -
 ...ection-method-findOneAndDelete-option.yaml |  56 ---
 ...lection-method-findOneAndDelete-param.yaml |  11 -
 ...ction-method-findOneAndReplace-option.yaml |  77 ----
 ...ection-method-findOneAndReplace-param.yaml |  15 -
 ...ection-method-findOneAndUpdate-option.yaml |  83 ----
 ...lection-method-findOneAndUpdate-param.yaml |  15 -
 ...DBCollection-method-insertMany-option.yaml |  27 --
 ...oDBCollection-method-insertMany-param.yaml |  13 -
 ...oDBCollection-method-insertOne-option.yaml |  23 --
 ...goDBCollection-method-insertOne-param.yaml |  13 -
 ...BCollection-method-listIndexes-option.yaml |  19 -
 ...DBCollection-method-listIndexes-param.yaml |   4 -
 ...oDBCollection-method-mapReduce-option.yaml | 113 ------
 ...goDBCollection-method-mapReduce-param.yaml |  46 ---
 ...ongoDBCollection-method-rename-option.yaml |  33 --
 ...MongoDBCollection-method-rename-param.yaml |  25 --
 ...DBCollection-method-replaceOne-option.yaml |  46 ---
 ...oDBCollection-method-replaceOne-param.yaml |  15 -
 ...DBCollection-method-updateMany-option.yaml |  52 ---
 ...oDBCollection-method-updateMany-param.yaml |  15 -
 ...oDBCollection-method-updateOne-option.yaml |  52 ---
 ...goDBCollection-method-updateOne-param.yaml |  15 -
 ...MongoDBCollection-method-watch-option.yaml |  73 ----
 ...-MongoDBCollection-method-watch-param.yaml |   8 -
 ...BCollection-method-withOptions-option.yaml |  27 --
 ...DBCollection-method-withOptions-param.yaml |   4 -
 ...apiargs-MongoDBDatabase-common-option.yaml |  36 --
 ...ngoDBDatabase-method-aggregate-option.yaml |  60 ---
 ...ongoDBDatabase-method-aggregate-param.yaml |  14 -
 ...MongoDBDatabase-method-command-option.yaml |  17 -
 ...-MongoDBDatabase-method-command-param.yaml |  13 -
 ...ngoDBDatabase-method-construct-option.yaml |  25 --
 ...ongoDBDatabase-method-construct-param.yaml |  12 -
 ...tabase-method-createCollection-option.yaml | 363 ------------------
 ...atabase-method-createCollection-param.yaml |  10 -
 ...ethod-createEncryptedCollection-param.yaml |  47 ---
 ...gs-MongoDBDatabase-method-drop-option.yaml |  25 --
 ...rgs-MongoDBDatabase-method-drop-param.yaml |   4 -
 ...Database-method-dropCollection-option.yaml |  31 --
 ...BDatabase-method-dropCollection-param.yaml |  10 -
 ...args-MongoDBDatabase-method-get-param.yaml |   6 -
 ...atabase-method-listCollections-option.yaml |  46 ---
 ...Database-method-listCollections-param.yaml |   4 -
 ...tabase-method-modifyCollection-option.yaml |  23 --
 ...atabase-method-modifyCollection-param.yaml |  20 -
 ...tabase-method-renameCollection-option.yaml |  33 --
 ...atabase-method-renameCollection-param.yaml |  34 --
 ...tabase-method-selectCollection-option.yaml |  27 --
 ...atabase-method-selectCollection-param.yaml |  10 -
 ...base-method-selectGridFSBucket-option.yaml |  52 ---
 ...abase-method-selectGridFSBucket-param.yaml |   4 -
 ...s-MongoDBDatabase-method-watch-option.yaml |  71 ----
 ...gs-MongoDBDatabase-method-watch-param.yaml |   8 -
 ...oDBDatabase-method-withOptions-option.yaml |  27 --
 ...goDBDatabase-method-withOptions-param.yaml |   4 -
 ...rgs-MongoDBGridFSBucket-common-option.yaml |  61 ---
 ...args-MongoDBGridFSBucket-common-param.yaml |  39 --
 ...BGridFSBucket-method-construct-option.yaml |  50 ---
 ...DBGridFSBucket-method-construct-param.yaml |  12 -
 ...ngoDBGridFSBucket-method-delete-param.yaml |   6 -
 ...SBucket-method-downloadToStream-param.yaml |  10 -
 ...-method-downloadToStreamByName-option.yaml |   4 -
 ...t-method-downloadToStreamByName-param.yaml |  14 -
 ...ongoDBGridFSBucket-method-find-option.yaml |  76 ----
 ...oDBGridFSBucket-method-findOne-option.yaml |  46 ---
 ...method-getFileDocumentForStream-param.yaml |   4 -
 ...ucket-method-getFileIdForStream-param.yaml |   4 -
 ...ucket-method-openDownloadStream-param.yaml |   6 -
 ...ethod-openDownloadStreamByName-option.yaml |   4 -
 ...method-openDownloadStreamByName-param.yaml |  10 -
 ...Bucket-method-openUploadStream-option.yaml |  18 -
 ...SBucket-method-openUploadStream-param.yaml |  10 -
 ...ngoDBGridFSBucket-method-rename-param.yaml |  15 -
 ...Bucket-method-uploadFromStream-option.yaml |  18 -
 ...SBucket-method-uploadFromStream-param.yaml |  19 -
 source/includes/apiargs-aggregate-option.yaml |  43 ---
 source/includes/apiargs-common-option.yaml    | 124 ------
 source/includes/apiargs-common-param.yaml     |  42 --
 .../apiargs-dropCollection-option.yaml        |  21 -
 ...iargs-function-with_transaction-param.yaml |  31 --
 .../includes/apiargs-method-watch-param.yaml  |  13 -
 source/includes/extracts-bucket-option.yaml   |  28 ++
 source/includes/extracts-client-option.yaml   |  28 ++
 .../includes/extracts-collection-option.yaml  |  38 ++
 source/includes/extracts-common-option.yaml   |  86 +++++
 source/includes/extracts-database-option.yaml |  28 ++
 source/includes/extracts-option-requires.yaml |  48 +++
 ...option.yaml => extracts-watch-option.yaml} |  89 ++---
 .../reference/function/with_transaction.txt   |  22 +-
 ...ongoDBBulkWriteResult-getModifiedCount.txt |   2 +-
 .../MongoDBClient-createClientEncryption.txt  |  17 +-
 .../method/MongoDBClient-dropDatabase.txt     |  41 +-
 .../MongoDBClient-listDatabaseNames.txt       |  51 ++-
 .../method/MongoDBClient-listDatabases.txt    |  53 ++-
 .../method/MongoDBClient-selectCollection.txt |  46 ++-
 .../method/MongoDBClient-selectDatabase.txt   |  42 +-
 .../method/MongoDBClient-startSession.txt     |  10 +-
 .../reference/method/MongoDBClient-watch.txt  |  85 +++-
 .../method/MongoDBClient__construct.txt       | 190 ++++++++-
 .../reference/method/MongoDBClient__get.txt   |   6 +-
 .../method/MongoDBCollection-aggregate.txt    | 115 +++++-
 .../method/MongoDBCollection-bulkWrite.txt    |  87 ++++-
 .../method/MongoDBCollection-count.txt        |  72 +++-
 .../MongoDBCollection-countDocuments.txt      |  57 ++-
 .../method/MongoDBCollection-createIndex.txt  | 112 +++++-
 .../MongoDBCollection-createIndexes.txt       |  83 +++-
 .../method/MongoDBCollection-deleteMany.txt   |  60 ++-
 .../method/MongoDBCollection-deleteOne.txt    |  60 ++-
 .../method/MongoDBCollection-distinct.txt     |  65 +++-
 .../method/MongoDBCollection-drop.txt         |  62 ++-
 .../method/MongoDBCollection-dropIndex.txt    |  56 ++-
 .../method/MongoDBCollection-dropIndexes.txt  |  51 ++-
 ...ngoDBCollection-estimatedDocumentCount.txt |  40 +-
 .../method/MongoDBCollection-explain.txt      |  47 ++-
 .../method/MongoDBCollection-find.txt         | 200 +++++++++-
 .../method/MongoDBCollection-findOne.txt      | 151 +++++++-
 .../MongoDBCollection-findOneAndDelete.txt    |  82 +++-
 .../MongoDBCollection-findOneAndReplace.txt   | 105 ++++-
 .../MongoDBCollection-findOneAndUpdate.txt    | 116 +++++-
 .../method/MongoDBCollection-insertMany.txt   |  57 ++-
 .../method/MongoDBCollection-insertOne.txt    |  47 ++-
 .../method/MongoDBCollection-listIndexes.txt  |  32 +-
 .../method/MongoDBCollection-mapReduce.txt    | 134 ++++++-
 .../method/MongoDBCollection-rename.txt       |  58 ++-
 .../method/MongoDBCollection-replaceOne.txt   |  75 +++-
 .../method/MongoDBCollection-updateMany.txt   |  86 ++++-
 .../method/MongoDBCollection-updateOne.txt    |  86 ++++-
 .../method/MongoDBCollection-watch.txt        |  89 ++++-
 .../method/MongoDBCollection-withOptions.txt  |  40 +-
 .../method/MongoDBCollection__construct.txt   |  58 ++-
 .../method/MongoDBDatabase-aggregate.txt      | 104 ++++-
 .../method/MongoDBDatabase-command.txt        |  36 +-
 .../MongoDBDatabase-createCollection.txt      | 296 +++++++++++++-
 ...goDBDatabase-createEncryptedCollection.txt |  38 +-
 .../reference/method/MongoDBDatabase-drop.txt |  38 +-
 .../method/MongoDBDatabase-dropCollection.txt |  66 +++-
 .../MongoDBDatabase-listCollectionNames.txt   |  48 ++-
 .../MongoDBDatabase-listCollections.txt       |  50 ++-
 .../MongoDBDatabase-modifyCollection.txt      |  48 ++-
 .../MongoDBDatabase-renameCollection.txt      |  60 ++-
 .../MongoDBDatabase-selectCollection.txt      |  42 +-
 .../MongoDBDatabase-selectGridFSBucket.txt    |  51 ++-
 .../method/MongoDBDatabase-watch.txt          |  85 +++-
 .../method/MongoDBDatabase-withOptions.txt    |  40 +-
 .../method/MongoDBDatabase__construct.txt     |  61 ++-
 .../reference/method/MongoDBDatabase__get.txt |   6 +-
 .../method/MongoDBGridFSBucket-delete.txt     |   6 +-
 .../MongoDBGridFSBucket-downloadToStream.txt  |   9 +-
 ...oDBGridFSBucket-downloadToStreamByName.txt |  42 +-
 .../method/MongoDBGridFSBucket-find.txt       | 200 +++++++++-
 .../method/MongoDBGridFSBucket-findOne.txt    | 151 +++++++-
 ...BGridFSBucket-getFileDocumentForStream.txt |   6 +-
 ...MongoDBGridFSBucket-getFileIdForStream.txt |   6 +-
 ...MongoDBGridFSBucket-openDownloadStream.txt |   6 +-
 ...BGridFSBucket-openDownloadStreamByName.txt |  38 +-
 .../MongoDBGridFSBucket-openUploadStream.txt  |  45 ++-
 .../method/MongoDBGridFSBucket-rename.txt     |   9 +-
 .../MongoDBGridFSBucket-uploadFromStream.txt  |  49 ++-
 .../method/MongoDBGridFSBucket__construct.txt |  74 +++-
 source/tutorial/modeling-bson-data.txt        |   2 +-
 211 files changed, 4614 insertions(+), 4917 deletions(-)
 delete mode 100644 source/includes/apiargs-MongoDBClient-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-get-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-watch-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-watch-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-common-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-count-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-count-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-find-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-find-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-rename-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-rename-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
 delete mode 100644 source/includes/apiargs-aggregate-option.yaml
 delete mode 100644 source/includes/apiargs-common-option.yaml
 delete mode 100644 source/includes/apiargs-common-param.yaml
 delete mode 100644 source/includes/apiargs-dropCollection-option.yaml
 delete mode 100644 source/includes/apiargs-function-with_transaction-param.yaml
 delete mode 100644 source/includes/apiargs-method-watch-param.yaml
 create mode 100644 source/includes/extracts-bucket-option.yaml
 create mode 100644 source/includes/extracts-client-option.yaml
 create mode 100644 source/includes/extracts-collection-option.yaml
 create mode 100644 source/includes/extracts-common-option.yaml
 create mode 100644 source/includes/extracts-database-option.yaml
 create mode 100644 source/includes/extracts-option-requires.yaml
 rename source/includes/{apiargs-method-watch-option.yaml => extracts-watch-option.yaml} (76%)

diff --git a/source/includes/apiargs-MongoDBClient-common-option.yaml b/source/includes/apiargs-MongoDBClient-common-option.yaml
deleted file mode 100644
index 4ffc52a9..00000000
--- a/source/includes/apiargs-MongoDBClient-common-option.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the client's read concern.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the client's read preference.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-   :manual:`Write concern ` to use for the operation.
-   Defaults to the client's write concern.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
deleted file mode 100644
index 8406bd09..00000000
--- a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
+++ /dev/null
@@ -1,189 +0,0 @@
-arg_name: option
-name: autoEncryption
-type: array
-description: |
-  Options to configure client-side field-level encryption in the driver. The
-  encryption options are documented in the :php:`extension documentation
-  `.
-  For the ``keyVaultClient`` option, you may pass a :phpclass:`MongoDB\\Client`
-  instance, which will be unwrapped to provide a :php:`MongoDB\\Driver\\Manager `
-  to the extension.
-
-  .. versionadded:: 1.6
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: driver
-type: array
-description: |
-  Additional driver metadata to be passed on to the server handshake. This is an
-  array containing ``name``, ``version``, and ``platform`` fields:
-
-  .. code-block:: php
-
-     [
-         'name' => 'my-driver',
-         'version' => '1.2.3-dev',
-         'platform' => 'some-platform',
-     ]
-
-  .. note::
-
-     This feature is primarily designed for custom drivers and ODMs, which may
-     want to identify themselves to the server for diagnostic purposes.
-     Applications should use the ``appName`` URI option instead of driver
-     metadata.
-
-  .. versionadded:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: serverApi
-type: :php:`MongoDB\\Driver\\ServerApi `
-description: |
-  Used to declare an API version on the client. See the
-  :manual:`Stable API tutorial ` for usage.
-
-  .. versionadded:: 1.9
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: typeMap
-type: array
-description: |
-  Default :php:`type map
-  `
-  to apply to cursors, which determines how BSON documents are converted to PHP
-  values. The |php-library| uses the following type map by default:
-
-  .. code-block:: php
-
-     [
-         'array' => 'MongoDB\Model\BSONArray',
-         'document' => 'MongoDB\Model\BSONDocument',
-         'root' => 'MongoDB\Model\BSONDocument',
-     ]
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: allow_invalid_hostname
-type: boolean
-description: |
-  Disables hostname validation if ``true``. Defaults to ``false``.
-
-  Allowing invalid hostnames may expose the driver to a `man-in-the-middle
-  attack `_.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsAllowInvalidHostnames`` URI
-     option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: ca_dir
-type: string
-description: |
-  Path to a correctly hashed certificate directory. The system certificate store
-  will be used by default.
-
-  Falls back to the deprecated ``capath`` SSL context option if not specified.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: ca_file
-type: string
-description: |
-  Path to a certificate authority file. The system certificate store will be
-  used by default.
-
-  Falls back to the deprecated ``cafile`` SSL context option if not specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsCAFile`` URI option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: crl_file
-type: string
-description: |
-  Path to a certificate revocation list file.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: pem_file
-type: string
-description: |
-  Path to a PEM encoded certificate to use for client authentication.
-
-  Falls back to the deprecated ``local_cert`` SSL context option if not
-  specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsCertificateKeyFile`` URI
-     option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: pem_pwd
-type: string
-description: |
-  Passphrase for the PEM encoded certificate (if applicable).
-
-  Falls back to the deprecated ``passphrase`` SSL context option if not
-  specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsCertificateKeyFilePassword``
-     URI option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: weak_cert_validation
-type: boolean
-description: |
-  Disables certificate validation ``true``. Defaults to ``false``.
-
-  Falls back to the deprecated ``allow_self_signed`` SSL context option if not
-  specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsAllowInvalidCertificates``
-     URI option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: context
-type: resource
-description: |
-  :php:`SSL context options ` to be used as fallbacks
-  for other driver options (as specified). Note that the driver does not consult
-  the default stream context.
-
-  This option is supported for backwards compatibility, but should be considered
-  deprecated.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
deleted file mode 100644
index 62998287..00000000
--- a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
-arg_name: param
-name: $uri
-type: string
-description: |
-  The URI of the standalone, replica set, or sharded cluster to which to
-  connect. Refer to :manual:`Connection String URI Format
-  ` in the MongoDB manual for more information.
-
-  Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified.
-
-  Any special characters in the URI components need to be encoded according to
-  `RFC 3986 `_. This is particularly
-  relevant to the username and password, which can often include special
-  characters such as ``@``, ``:``, or ``%``. When connecting via a Unix domain
-  socket, the socket path may contain special characters such as slashes and
-  must be encoded. The :php:`rawurlencode() ` function may be used
-  to encode constituent parts of the URI.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: param
-name: $uriOptions
-type: array
-description: |
-  Specifies additional URI options, such as authentication credentials or query
-  string parameters. The options specified in ``$uriOptions`` take precedence
-  over any analogous options present in the ``$uri`` string and do not need to
-  be encoded according to `RFC 3986 `_.
-
-  Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
-  ` extension reference and :manual:`MongoDB
-  connection string ` documentation for accepted
-  options.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: param
-name: $driverOptions
-type: array
-description: |
-  Specify driver-specific options, such as SSL options. In addition to any
-  options supported by the :php:`extension `, the
-  |php-library| allows you to specify a default :php:`type map
-  `
-  to apply to the cursors it creates.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml b/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
deleted file mode 100644
index be0a19aa..00000000
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
deleted file mode 100644
index 07b76834..00000000
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " to drop"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-get-param.yaml b/source/includes/apiargs-MongoDBClient-method-get-param.yaml
deleted file mode 100644
index e9d3ccc6..00000000
--- a/source/includes/apiargs-MongoDBClient-method-get-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " to select"
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
deleted file mode 100644
index 38baf93a..00000000
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-arg_name: option
-name: authorizedDatabases
-type: boolean
-description: |
-  A flag that determines which databases are returned based on the user
-  privileges when access control is enabled. For more information, see the
-  `listDatabases command documentation `_.
-
-  For servers < 4.0.5, this option is ignored.
-
-  .. versionadded:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: filter
-type: array|object
-description: |
-  A query expression to filter the list of databases.
-
-  You can specify a query expression for database fields (e.g. ``name``,
-  ``sizeOnDisk``, ``empty``).
-
-  .. versionadded:: 1.3
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml b/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
deleted file mode 100644
index d81d3181..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "client"
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
deleted file mode 100644
index 99c76446..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " containing the collection to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
deleted file mode 100644
index e4ffd3c6..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "database"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "database"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "database"
-  parent: "client"
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
deleted file mode 100644
index 8e5f9d45..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml
deleted file mode 100644
index cad9c3f7..00000000
--- a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml
+++ /dev/null
@@ -1,71 +0,0 @@
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocument
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocumentBeforeChange
-post: |
-  .. versionadded: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: maxAwaitTimeMS
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: readPreference
-post: |
-  This is used for both the initial change stream aggregation and for
-  server selection during an automatic resume.
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: resumeAfter
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: showExpandedEvents
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAfter
-post: |
-  .. versionadded: 1.5
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAtOperationTime
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-watch-param.yaml b/source/includes/apiargs-MongoDBClient-method-watch-param.yaml
deleted file mode 100644
index b00e450c..00000000
--- a/source/includes/apiargs-MongoDBClient-method-watch-param.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $pipeline
----
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
deleted file mode 100644
index fb919ea4..00000000
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ /dev/null
@@ -1,86 +0,0 @@
-arg_name: option
-name: arrayFilters
-type: array
-description: |
-   An array of filter documents that determines which array elements to modify
-   for an update operation on an array field.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: bypassDocumentValidation
-type: boolean
-description: |
-   If ``true``, allows the write operation to circumvent document level
-   validation. Defaults to ``false``.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
-post: |
-   If the collation is unspecified but the collection has a default collation,
-   the operation uses the collation specified for the collection. If no
-   collation is specified for the collection or for the operation, MongoDB uses
-   the simple binary comparison used in prior versions for string comparisons.
----
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the collection's read concern.
-
-   It is not possible to specify a :manual:`read concern
-   ` for individual operations as part of a
-   transaction. Instead, set the ``readConcern`` option when starting the
-   transaction with :php:`startTransaction `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the collection's read preference.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "collection"
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-   :manual:`Write concern ` to use for the operation.
-   Defaults to the collection's write concern.
-
-   It is not possible to specify a :manual:`write concern
-   ` for individual operations as part of a
-   transaction. Instead, set the ``writeConcern`` option when starting the
-   transaction with :php:`startTransaction `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: upsert
-type: boolean
-description: |
-   If set to ``true``, creates a new document when no document matches the query
-   criteria. The default value is ``false``, which does not insert a new
-   document when no match is found.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-common-param.yaml b/source/includes/apiargs-MongoDBCollection-common-param.yaml
deleted file mode 100644
index 47100d19..00000000
--- a/source/includes/apiargs-MongoDBCollection-common-param.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-arg_name: param
-name: $filter
-type: array|object
-description: |
-  The filter criteria that specifies the documents{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $replacement
-type: array|object
-description: |
-  The replacement document.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $update
-type: array|object
-description: |
-  Specifies the field and value combinations to update and any relevant update
-  operators. ``$update`` uses MongoDB's :method:`update operators
-  `. Starting with MongoDB 4.2, an `aggregation
-  pipeline `_
-  can be passed as this parameter.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
deleted file mode 100644
index b3d19c3e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ /dev/null
@@ -1,84 +0,0 @@
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: explain
-post: |
-  .. versionadded:: 1.4
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.9
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
----
-arg_name: option
-name: useCursor
-type: boolean
-description: |
-  Indicates whether the command will request that the server provide results
-  using a cursor. The default is ``true``.
-
-  .. note::
-
-     MongoDB 3.6+ no longer supports returning results without a cursor (excluding
-     when the explain option is used) and specifying false for this option will
-     result in a server error.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-post: |
-  This only applies when a :ref:`$out ` or :ref:`$merge `
-  stage is specified.
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
deleted file mode 100644
index cbad3b49..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-arg_name: param
-name: $pipeline
-type: array
-description: |
-  Specifies an :manual:`aggregation pipeline `
-  operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
deleted file mode 100644
index 25d8e24d..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-arg_name: option
-name: ordered
-type: boolean
-description: |
-  If ``true``: when a single write fails, the operation will stop without
-  performing the remaining writes and throw an exception.
-
-  If ``false``: when a single write fails, the operation will continue with the
-  remaining writes, if any, and throw an exception.
-
-  The default is ``true``.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
deleted file mode 100644
index 79423a63..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-arg_name: param
-name: $operations
-type: array
-description: |
-  An array containing the write operations to perform.
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` supports
-  :phpmethod:`deleteMany() `,
-  :phpmethod:`deleteOne() `,
-  :phpmethod:`insertOne() `,
-  :phpmethod:`replaceOne() `,
-  :phpmethod:`updateMany() `, and
-  :phpmethod:`updateOne() ` operations in the
-  following array structure:
-
-  .. code-block:: php
-
-     [
-         [ 'deleteMany' => [ $filter ] ],
-         [ 'deleteOne'  => [ $filter ] ],
-         [ 'insertOne'  => [ $document ] ],
-         [ 'replaceOne' => [ $filter, $replacement, $options ] ],
-         [ 'updateMany' => [ $filter, $update, $options ] ],
-         [ 'updateOne'  => [ $filter, $update, $options ] ],
-     ]
-
-  Arguments correspond to the respective operation methods. However, the
-  ``writeConcern`` option is specified as a top-level option to
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
-  operation.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
deleted file mode 100644
index 7d422ca0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "manager"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "manager"
----
-source:
-  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "manager"
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml b/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
deleted file mode 100644
index 0827800b..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $manager
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
deleted file mode 100644
index 3d839e04..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: hint
-type: string|array|object
-description: |
-  The index to use. Specify either the index name as a string or the index key
-  pattern as a document. If specified, then the query system will only consider
-  plans using the hinted index.
-
-  .. versionchanged:: 1.2
-     If a document is provided, it is passed to the command as-is. Previously,
-     the library would convert the key pattern to an index name.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  The maximum number of matching documents to return.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: skip
-type: integer
-description: |
-  The number of matching documents to skip before returning results.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-param.yaml b/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
deleted file mode 100644
index e18c616b..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to count"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml b/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
deleted file mode 100644
index da1f0113..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
+++ /dev/null
@@ -1,56 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
----
-arg_name: option
-name: hint
-type: string|array|object
-description: |
-  The index to use. Specify either the index name as a string or the index key
-  pattern as a document. If specified, then the query system will only consider
-  plans using the hinted index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  The maximum number of matching documents to return.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-arg_name: option
-name: skip
-type: integer
-description: |
-  The number of matching documents to skip before returning results.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml b/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
deleted file mode 100644
index e18c616b..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to count"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
deleted file mode 100644
index 18283767..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
+++ /dev/null
@@ -1,117 +0,0 @@
-arg_name: option
-name: commitQuorum
-type: string|integer
-description: |
-  Specifies how many data-bearing members of a replica set, including the
-  primary, must complete the index builds successfully before the primary marks
-  the indexes as ready.
-
-  This option accepts the same values for the ``w`` field in a write concern
-  plus ``"votingMembers"``, which indicates all voting data-bearing nodes.
-
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: unique
-type: boolean
-description: |
-  Creates a :manual:`unique ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
-pre: |
-  Specifies the :manual:`collation
-  ` for the index.
----
-arg_name: option
-name: partialFilterExpression
-type: array|object
-description: |
-  Creates a :manual:`partial ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: sparse
-type: boolean
-description: |
-  Creates a :manual:`sparse ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: expireAfterSeconds
-type: integer
-description: |
-  Creates a :manual:`TTL ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: name
-type: string
-description: |
-  A name that uniquely identifies the index. By default, MongoDB creates index
-  names based on the key.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: background
-type: string
-description: |
-  Instructs MongoDB to build the index :manual:`as a background
-  ` process.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: 2dsphereIndexVersion
-type: integer
-description: |
-  Overrides the server's default version for a :manual:`2dsphere
-  ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
deleted file mode 100644
index c2979d91..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-arg_name: param
-name: $key
-type: array|object
-description: |
-  Specifies the field or fields to index and the index order.
-
-  For example, the following specifies a descending index on the ``username``
-  field:
-
-  .. code-block:: php
-
-     [ 'username' => -1 ]
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
deleted file mode 100644
index 54c33bfa..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-method-createIndex-option.yaml
-  ref: commitQuorum
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
deleted file mode 100644
index e98d9aad..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-arg_name: param
-name: $indexes
-type: array
-description: |
-  The indexes to create on the collection.
-
-  For example, the following specifies a unique index on the ``username`` field
-  and a compound index on the ``email`` and ``createdAt`` fields:
-
-  .. code-block:: php
-
-     [
-         [ 'key' => [ 'username' => -1 ], 'unique' => true ],
-         [ 'key' => [ 'email' => 1, 'createdAt' => 1 ] ],
-     ]
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
deleted file mode 100644
index 110911f5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
deleted file mode 100644
index 92797eb5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to delete"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
deleted file mode 100644
index 110911f5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
deleted file mode 100644
index 92797eb5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to delete"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
deleted file mode 100644
index 05a1b285..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  .. versionadded:: 1.5
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
deleted file mode 100644
index 37cd9b50..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-arg_name: param
-name: $fieldName
-type: string
-description: |
-  The field for which to return distinct values.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " from which to retrieve the distinct values"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
deleted file mode 100644
index 5eb5efab..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-dropCollection-option.yaml
-  ref: encryptedFields
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
deleted file mode 100644
index b87e09b7..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
deleted file mode 100644
index 7cac6d1d..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-arg_name: param
-name: $indexName
-type: string| :phpclass:`MongoDB\\Model\\IndexInfo`
-description: |
-  The name or model object of the index to drop. View the existing indexes on
-  the collection using the :phpmethod:`listIndexes()
-  ` method.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
deleted file mode 100644
index aff9f4d7..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
deleted file mode 100644
index 7289296e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml b/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
deleted file mode 100644
index 650633bc..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  Defaults to the ``comment`` of the explained operation (if any).
-
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-arg_name: option
-name: verbosity
-type: string
-description: |
-  The verbosity level at which to run the command. See the :manual:`explain
-  ` command for more information.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml b/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
deleted file mode 100644
index 59f15637..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $explainable
-type: :phpclass:`MongoDB\\Operation\\Explainable`
-description: |
-  The command to explain.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
deleted file mode 100644
index 1b01599e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ /dev/null
@@ -1,263 +0,0 @@
-arg_name: option
-name: projection
-type: array|object
-description: |
-  The :ref:`projection specification ` to determine which fields to
-  include in the returned documents. See :manual:`Project Fields to Return from
-  Query ` and
-  :manual:`Projection Operators ` in the MongoDB
-  manual.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: sort
-type: array|object
-description: |
-  The sort specification for the ordering of the results.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: skip
-type: integer
-description: |
-  Number of documents to skip. Defaults to ``0``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  The maximum number of documents to return. If unspecified, then defaults to no
-  limit. A limit of ``0`` is equivalent to setting no limit.
-
-  A negative limit is similar to a positive limit but closes the cursor after
-  returning a single batch of results. As such, with a negative limit, if the
-  limited result set does not fit into a single batch, the number of documents
-  received will be less than the specified limit. By passing a negative limit, the
-  client indicates to the server that it will not ask for a subsequent batch via
-  getMore.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: allowDiskUse
-type: boolean
-description: |
-  Enables writing to temporary files. When set to ``true``, queries can write
-  data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: batchSize
-type: integer
-description: |
-  The number of documents to return in the first batch. Defaults to ``101``. A
-  batchSize of ``0`` means that the cursor will be established, but no documents
-  will be returned in the first batch.
-
-  Unlike the previous wire protocol version, a batchSize of ``1`` for the
-  :dbcommand:`find` command does not close the cursor.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
----
-arg_name: option
-name: cursorType
-type: integer
-description: |
-  Indicates the type of cursor to use. ``cursorType`` supports the following
-  values:
-
-   - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
-   - ``MongoDB\Operation\Find::TAILABLE``
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  .. versionadded:: 1.2
----
-arg_name: option
-name: maxAwaitTimeMS
-type: integer
-description: |
-  Positive integer denoting the time limit in milliseconds for the server to
-  block a getMore operation if no data is available. This option should only be
-  used if cursorType is TAILABLE_AWAIT.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: max
-type: array|object
-description: |
-  The exclusive upper bound for a specific index.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: maxScan
-type: integer
-description: |
-  Maximum number of documents or index keys to scan when executing the query.
-
-  .. deprecated:: 1.4
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: min
-type: array|object
-description: |
-  The inclusive lower bound for a specific index.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: oplogReplay
-type: boolean
-description: |
-  Internal use for replica sets. To use ``oplogReplay``, you must include the
-  following condition in the filter:
-
-  .. code-block:: javascript
-
-     { ts: { $gte:  } }
-
-  The :php:`MongoDB\\BSON\\Timestamp ` class
-  reference describes how to represent MongoDB's BSON timestamp type with PHP.
-
-  .. deprecated:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: noCursorTimeout
-type: boolean
-description: |
-  Prevents the server from timing out idle cursors after an inactivity period
-  (10 minutes).
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: returnKey
-type: boolean
-description: |
-  If true, returns only the index keys in the resulting documents.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: showRecordId
-type: boolean
-description: |
-  Determines whether to return the record identifier for each document. If true,
-  adds a field $recordId to the returned documents.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: snapshot
-type: boolean
-description: |
-  Prevents the cursor from returning a document more than once because of an
-  intervening write operation.
-
-  .. deprecated:: 1.4
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: allowPartialResults
-type: boolean
-description: |
-  For queries against a sharded collection, returns partial results from the
-  :program:`mongos` if some shards are unavailable instead of throwing an error.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
----
-arg_name: option
-name: modifiers
-type: array|object
-description: |
-  :manual:`Meta operators ` that modify the
-  output or behavior of a query. Use of these operators is deprecated in favor
-  of named options.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-find-param.yaml b/source/includes/apiargs-MongoDBCollection-method-find-param.yaml
deleted file mode 100644
index 5683a7bb..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-find-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to query"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
deleted file mode 100644
index 139e700a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
+++ /dev/null
@@ -1,84 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: skip
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: comment
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  .. versionadded:: 1.2
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: max
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: maxScan
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: min
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: returnKey
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: showRecordId
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: modifiers
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
deleted file mode 100644
index 5683a7bb..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to query"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
deleted file mode 100644
index d8f2b3a4..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
+++ /dev/null
@@ -1,56 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
deleted file mode 100644
index 92797eb5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to delete"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
deleted file mode 100644
index b509ac94..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
+++ /dev/null
@@ -1,77 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-arg_name: option
-name: returnDocument
-type: integer
-description: |
-  Specifies whether to return the document before the replacement is applied, or
-  after. ``returnDocument`` supports the following values:
-
-  - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*)
-  - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
deleted file mode 100644
index 32ed6b35..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to replace"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $replacement
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
deleted file mode 100644
index a8f895f1..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+++ /dev/null
@@ -1,83 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: arrayFilters
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-arg_name: option
-name: returnDocument
-type: integer
-description: |
-  Specifies whether to return the document before the update is applied, or
-  after. ``returnDocument`` supports the following values:
-
-  - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*)
-  - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
deleted file mode 100644
index a335678a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to update"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $update
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
deleted file mode 100644
index 60f197d2..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-method-bulkWrite-option.yaml
-  ref: ordered
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
deleted file mode 100644
index 78246d30..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $documents
-type: array
-description: |
-  The documents to insert into the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
deleted file mode 100644
index adf17cb6..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
deleted file mode 100644
index 5dc231d3..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $document
-type: array|object
-description: |
-  The document to insert into the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
deleted file mode 100644
index aa939b95..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
deleted file mode 100644
index 478d12dd..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
+++ /dev/null
@@ -1,113 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
-post: |
-  This only applies when results are output to a collection.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: finalize
-type: :php:`MongoDB\\BSON\\Javascript `
-description: |
-  Follows the reduce method and modifies the output.
-
-  .. note::
-
-     Passing a Javascript instance with a scope is deprecated. Put all scope
-     variables in the ``scope`` option of the MapReduce operation.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: jsMode
-type: boolean
-description: |
-  Specifies whether to convert intermediate data into BSON format between the
-  execution of the map and reduce functions.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  Specifies a maximum number of documents for the input into the map function.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-arg_name: option
-name: query
-type: array|object
-description: |
-  Specifies the selection criteria using query operators for determining the
-  documents input to the map function.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
-post: |
-  This option will be ignored when results are output to a collection.
----
-arg_name: option
-name: scope
-type: array|object
-description: |
-  Specifies global variables that are accessible in the map, reduce, and finalize
-  functions.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
----
-arg_name: option
-name: verbose
-type: boolean
-description: |
-  Specifies whether to include the timing information in the result information.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
deleted file mode 100644
index 6a76d636..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-arg_name: param
-name: $map
-type: :php:`MongoDB\\BSON\\Javascript `
-description: |
-  A JavaScript function that associates or "maps" a value with a key and emits
-  the key and value pair.
-
-  .. note::
-
-     Passing a Javascript instance with a scope is deprecated. Put all scope
-     variables in the ``scope`` option of the MapReduce operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $reduce
-type: :php:`MongoDB\\BSON\\Javascript `
-description: |
-  A JavaScript function that "reduces" to a single object all the values
-  associated with a particular key.
-
-  .. note::
-
-     Passing a Javascript instance with a scope is deprecated. Put all scope
-     variables in the ``scope`` option of the MapReduce operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $out
-type: string|array|object
-description: |
-  Specifies where to output the result of the map-reduce operation. You can
-  either output to a collection or return the result inline. On a primary member
-  of a replica set you can output either to a collection or inline, but on a
-  secondary, only inline output is possible.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml b/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml
deleted file mode 100644
index 0b0b0809..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
----
-arg_name: option
-name: dropTarget
-type: boolean
-description: |
-  If ``true``, MongoDB will drop the target before renaming the collection. The
-  default value is ``false``.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml b/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml
deleted file mode 100644
index 459b2789..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-arg_name: param
-name: $toCollectionName
-type: string
-description: |
-  The new name of the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $toDatabaseName
-type: string
-description: |
-  The new database name of the collection. If a new database name is not
-  specified, the database of the original collection will be used. If the new
-  name specifies a different database, the command copies the collection
-  to the new database and drops the source collection.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
deleted file mode 100644
index 676296d2..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.2+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.6
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
deleted file mode 100644
index 32ed6b35..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to replace"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $replacement
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
deleted file mode 100644
index 64eec34e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: arrayFilters
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.2+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.6
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
deleted file mode 100644
index a335678a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to update"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $update
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
deleted file mode 100644
index 64eec34e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: arrayFilters
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.2+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.6
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
deleted file mode 100644
index a335678a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to update"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $update
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
deleted file mode 100644
index 0a47ae62..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ /dev/null
@@ -1,73 +0,0 @@
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocument
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocumentBeforeChange
-post: |
-  .. versionadded: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: maxAwaitTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
-post: |
-  This is used for both the initial change stream aggregation and for
-  server selection during an automatic resume.
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: resumeAfter
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: showExpandedEvents
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAfter
-post: |
-  .. versionadded: 1.5
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAtOperationTime
-post: |
-  .. versionadded:: 1.4
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
deleted file mode 100644
index b00e450c..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $pipeline
----
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
deleted file mode 100644
index 681144f3..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "original collection"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "original collection"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "original collection"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "original collection"
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml b/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-common-option.yaml b/source/includes/apiargs-MongoDBDatabase-common-option.yaml
deleted file mode 100644
index b03dac7a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-common-option.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the database's read concern.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the database's read preference.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "database"
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-   :manual:`Write concern ` to use for the operation.
-   Defaults to the database's write concern.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
deleted file mode 100644
index f59192a0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
+++ /dev/null
@@ -1,60 +0,0 @@
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: explain
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.9
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-post: |
-  This only applies when a :ref:`$out ` or :ref:`$merge `
-  stage is specified.
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
deleted file mode 100644
index cbad3b49..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-arg_name: param
-name: $pipeline
-type: array
-description: |
-  Specifies an :manual:`aggregation pipeline `
-  operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
deleted file mode 100644
index 934e325d..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the database's read preference.
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
deleted file mode 100644
index 5a4b03d7..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $command
-type: array|object
-description: |
-  The :manual:`database command ` document.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
deleted file mode 100644
index d398069a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "database"
-  parent: "manager"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "database"
-  parent: "manager"
----
-source:
-  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "database"
-  parent: "manager"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
deleted file mode 100644
index 5ef826c1..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $manager
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
deleted file mode 100644
index ceb7dd07..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ /dev/null
@@ -1,363 +0,0 @@
-arg_name: option
-name: autoIndexId
-type: boolean
-description: |
-  Specify ``false`` to disable the automatic creation of an index on the ``_id``
-  field.
-
-  .. important::
-
-     For replica sets, do not set ``autoIndexId`` to ``false``.
-
-  .. deprecated:: 1.4
-     This option has been deprecated since MongoDB 3.2. As of MongoDB 4.0, this
-     option cannot be ``false`` when creating a replicated collection (i.e. a
-     collection outside of the ``local`` database in any mongod mode).
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: capped
-type: boolean
-description: |
-  To create a capped collection, specify ``true``. If you specify ``true``, you
-  must also set a maximum size in the ``size`` option.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: changeStreamPreAndPostImages
-type: document
-description: |
-  Used to configure support for pre- and post-images in change streams. See the
-  :manual:`create ` command documentation for more
-  information.
-
-  This option is available in MongoDB 6.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: clusteredIndex
-type: document
-description: |
-  A clustered index specification. See
-  :manual:`Clustered Collections ` or the
-  :manual:`create ` command documentation for more
-  information.
-
-  This option is available in MongoDB 5.3+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
-pre: |
-  Specifies the :manual:`collation
-  ` for the collection.
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: encryptedFields
-type: document
-description: |
-  A document describing encrypted fields for queryable encryption. If omitted,
-  the ``encryptedFieldsMap`` option within the ``autoEncryption`` driver option
-  will be consulted. See
-  `Field Encryption and Queryability `_
-  in the MongoDB manual for more information.
-
-  This option is available in MongoDB 7.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: expireAfterSeconds
-type: integer
-description: |
-  Used to automatically delete documents in time series collections. See the
-  :manual:`create ` command documentation for more
-  information.
-
-  This option is available in MongoDB 5.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.9
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: flags
-type: integer
-description: |
-  Available for the MMAPv1 storage engine only to set the ``usePowerOf2Sizes``
-  and ``noPadding`` flags.
-
-  The |php-library| provides constants that you can combine with a :php:`bitwise
-  OR operator ` to set the flag values:
-
-  - ``MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES``: ``1``
-  - ``MongoDB\Operation\CreateCollection::NO_PADDING``: ``2``
-
-  Defaults to ``1``.
-
-  .. note::
-
-     MongoDB 3.0 and later ignores the ``usePowerOf2Sizes`` flag. See
-     :manual:`collMod ` and
-     :manual:`db.createCollection()
-     ` for more information.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: indexOptionDefaults
-type: array|object
-description: |
-  Allows users to specify a default configuration for indexes when creating a
-  collection.
-
-  The ``indexOptionDefaults`` option accepts a ``storageEngine`` document,
-  which should take the following form:
-
-  .. code-block:: none
-  
-     { :  }
-
-  Storage engine configurations specified when creating indexes are validated
-  and logged to the :term:`oplog` during replication to support replica sets
-  with members that use different storage engines.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: max
-type: integer
-description: |
-  The maximum number of documents allowed in the capped collection. The ``size``
-  option takes precedence over this limit. If a capped collection reaches the
-  ``size`` limit before it reaches the maximum number of documents, MongoDB
-  removes old documents. If you prefer to use the ``max`` limit, ensure that the
-  ``size`` limit, which is required for a capped collection, is sufficient to
-  contain the maximum number of documents.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-arg_name: option
-name: pipeline
-type: array
-description: |
-  An array that consists of the aggregation pipeline stage(s), which will be
-  applied to the collection or view specified by ``viewOn``. See the
-  :manual:`create ` command documentation for more
-  information.
-  
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: size
-type: integer
-description: |
-  Specify a maximum size in bytes for a capped collection. Once a capped
-  collection reaches its maximum size, MongoDB removes the older documents to
-  make space for the new documents. The ``size`` option is required for capped
-  collections and ignored for other collections.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: storageEngine
-type: array|object
-description: |
-  Available for the WiredTiger storage engine only.
-
-  Allows users to specify configuration to the storage engine on a
-  per-collection basis when creating a collection. The value of the
-  ``storageEngine`` option should take the following form:
-
-  .. code-block:: none
-  
-     { :  }
-
-  Storage engine configurations specified when creating collections are
-  validated and logged to the :term:`oplog` during replication to support
-  replica sets with members that use different storage engines.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: timeseries
-type: array|object
-description: |
-  An object containing options for creating time series collections. See the
-  :manual:`create ` command documentation for
-  supported options.
-
-  This option is available in MongoDB 5.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.9
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-arg_name: option
-name: validator
-type: array|object
-description: |
-  Allows users to specify :manual:`validation rules or expressions
-  ` for the collection. For more information, see
-  :manual:`Document Validation ` in the MongoDB
-  manual.
-
-  The ``validator`` option takes an array that specifies the validation rules or
-  expressions. You can specify the expressions using the same operators as
-  MongoDB's :manual:`query operators ` with the
-  exception of :query:`$geoNear`, :query:`$near`, :query:`$nearSphere`,
-  :query:`$text`, and :query:`$where`.
-
-  .. note::
-
-     - Validation occurs during updates and inserts. Existing documents do not
-       undergo validation checks until modification.
-
-     - You cannot specify a validator for collections in the ``admin``,
-       ``local``, and ``config`` databases.
-
-     - You cannot specify a validator for ``system.*`` collections.
-operation: ~
-interface: phpmethod
-optional: true
----
-arg_name: option
-name: validationAction
-type: string
-description: |
-   Determines whether to ``error`` on invalid documents or just ``warn`` about
-   the violations but allow invalid documents to be inserted.
-
-   .. important::
-
-      Validation of documents only applies to those documents as determined by
-      the ``validationLevel``.
-
-   .. list-table::
-      :header-rows: 1
-
-      * - ``validationAction``
-
-        - Description
-
-      * - ``"error"``
-
-        - **Default**. Documents must pass validation before the write occurs.
-          Otherwise, the write operation fails.
-
-      * - ``"warn"``
-
-        - Documents do not have to pass validation. If the document fails
-          validation, the write operation logs the validation failure.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: validationLevel
-type: string
-description: |
-   Determines how strictly MongoDB applies the validation rules to existing
-   documents during an update.
-
-   .. list-table::
-      :header-rows: 1
-
-      * - ``validationLevel``
-
-        - Description
-
-      * - ``"off"``
-
-        - No validation for inserts or updates.
-
-      * - ``"strict"``
-
-        - **Default**. Apply validation rules to all inserts and all updates.
-
-      * - ``"moderate"``
-
-        - Apply validation rules to inserts and to updates on existing *valid*
-          documents. Do not apply rules to updates on existing *invalid*
-          documents.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: viewOn
-type: string
-description: |
-  The name of the source collection or view from which to create the view.
-
-  .. note::
-
-     The name is not the full namespace of the collection or view (i.e. it does
-     not include the database name). Views must be created in the same databases
-     as the source collection or view.
-     
-     .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
deleted file mode 100644
index b6bb2dcc..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to create"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
deleted file mode 100644
index 6d56d678..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  subject: "encrypted collection"
-  action: " to create"
----
-arg_name: param
-name: $clientEncryption
-type: :php:`MongoDB\\Driver\\ClientEncryption `
-description: |
-  The ClientEncryption object used to create data keys.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $kmsProvider
-type: string
-description: |
-  KMS provider (e.g. "local", "aws") that will be used to encrypt new data keys.
-  This corresponds to the ``$kmsProvider`` parameter for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $masterKey
-type: array|null
-description: |
-  KMS-specific key options that will be used to encrypt new data keys. This
-  corresponds to the ``masterKey`` option for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
-
-  If ``$kmsProvider`` is "local", this should be ``null``.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-optional: false
-post: |
-  The ``encryptedFields`` option is required.
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
deleted file mode 100644
index e725fc1b..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
deleted file mode 100644
index 0034b5e8..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-dropCollection-option.yaml
-  ref: encryptedFields
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
deleted file mode 100644
index c8e0a614..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to drop"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
deleted file mode 100644
index 651c85f9..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to select"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
deleted file mode 100644
index bacf7280..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-arg_name: option
-name: authorizedCollections
-type: boolean
-description: |
-  A flag that determines which collections are returned based on the user
-  privileges when access control is enabled. For more information, see the
-  `listCollections command documentation `_.
-
-  For servers < 4.0, this option is ignored.
-
-  .. versionadded:: 1.12
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: filter
-type: array|object
-description: |
-  A query expression to filter the list of collections.
-
-  You can specify a query expression for collection fields (e.g. ``name``,
-  ``options``).
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
deleted file mode 100644
index b27c16cf..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
deleted file mode 100644
index 16597b3a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  subject: "collection or view"
-  action: " to modify"
----
-arg_name: param
-name: $collectionOptions
-type: array
-description: |
-  Collection or view options to assign.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml
deleted file mode 100644
index bb026bd9..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
----
-arg_name: option
-name: dropTarget
-type: boolean
-description: |
-  If ``true``, MongoDB will drop the target before renaming the collection. The
-  default value is ``false``.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml
deleted file mode 100644
index 3043f4dd..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-arg_name: param
-name: $fromCollectionName
-type: string
-description: |
-  The name of the collection to rename.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $toCollectionName
-type: string
-description: |
-  The new name of the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $toDatabaseName
-type: string
-description: |
-  The new database name of the collection. If a new database name is not
-  specified, the current database will be used. If the new name specifies a
-  different database, the command copies the collection to the new database
-  and drops the source collection.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
deleted file mode 100644
index 932c1b16..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "database"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
deleted file mode 100644
index 46d4e72a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
deleted file mode 100644
index 2039d114..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-arg_name: option
-name: bucketName
-type: string
-description: |
-  The bucket name, which will be used as a prefix for the files and chunks
-  collections. Defaults to ``"fs"``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: chunkSizeBytes
-type: integer
-description: |
-  The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
deleted file mode 100644
index b24efbec..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
+++ /dev/null
@@ -1,71 +0,0 @@
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocument
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocumentBeforeChange
-post: |
-  .. versionadded: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: maxAwaitTimeMS
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readPreference
-post: |
-  This is used for both the initial change stream aggregation and for
-  server selection during an automatic resume.
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: resumeAfter
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: showExpandedEvents
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAfter
-post: |
-  .. versionadded: 1.5
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAtOperationTime
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
deleted file mode 100644
index b00e450c..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $pipeline
----
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
deleted file mode 100644
index c048182c..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "database"
-  parent: "original database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "database"
-  parent: "original database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "original database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "database"
-  parent: "original database"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
deleted file mode 100644
index bf2de660..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
+++ /dev/null
@@ -1,61 +0,0 @@
-arg_name: option
-name: _id
-type: mixed
-description: |
-  Value to use as the file document identifier. Defaults to a new
-  :php:`MongoDB\\BSON\\ObjectId ` object.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: chunkSizeBytes
-type: integer
-description: |
-  The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: disableMD5
-type: boolean
-description: |
-  Whether to disable automatic MD5 generation when storing files.
-
-  Defaults to ``false``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: metadata
-type: array|object
-description: |
-  User data for the ``metadata`` field of the file document. If not specified,
-  the ``metadata`` field will not be set on the file document.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: revision
-type: integer
-description: |
-  The revision of the file to retrieve. Files with the name ``filename`` will be
-  differentiated by their ``uploadDate`` field.
-
-  Revision numbers are defined as follows:
-
-  - 0 = the original stored file
-  - 1 = the first revision
-  - 2 = the second revision
-  - etc...
-  - -2 = the second most recent revision
-  - -1 = the most recent revision
-
-   Defaults to -1 (i.e. the most recent revision).
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml
deleted file mode 100644
index f1d6b136..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
-arg_name: param
-name: $filename
-type: string
-description: |
-  The ``filename`` of the file{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $id
-type: mixed
-description: |
-  The ``_id`` of the file{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $stream
-type: resource
-description: |
-  The GridFS stream resource.
-interface: phpmethod
-operation: ~
----
-arg_name: param
-name: $destination
-type: resource
-description: |
-  Writable stream, to which the GridFS file's contents will be written.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
deleted file mode 100644
index c8a7eb79..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-arg_name: option
-name: bucketName
-type: string
-description: |
-  The bucket name, which will be used as a prefix for the files and chunks
-  collections. Defaults to ``"fs"``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: chunkSizeBytes
-type: integer
-description: |
-  The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
deleted file mode 100644
index 5ef826c1..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $manager
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
deleted file mode 100644
index 7e8baa21..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to delete"
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
deleted file mode 100644
index 39d48dc5..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to download"
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $destination
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
deleted file mode 100644
index 9dc941d9..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: revision
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
deleted file mode 100644
index 2704877b..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to download"
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $destination
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml
deleted file mode 100644
index 1f2e9d8e..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml
+++ /dev/null
@@ -1,76 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: skip
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: limit
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: comment
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: cursorType
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: readConcern
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the bucket's read concern.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: readPreference
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the bucket's read preference.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: oplogReplay
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: noCursorTimeout
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowPartialResults
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: typeMap
-replacement:
-  parent: "bucket"
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: modifiers
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
deleted file mode 100644
index 3d0d0ed8..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: skip
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: comment
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBGridFSBucket-method-find-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-MongoDBGridFSBucket-method-find-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: modifiers
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
deleted file mode 100644
index 0801cb21..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $stream
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
deleted file mode 100644
index 0801cb21..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $stream
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
deleted file mode 100644
index 54e7c8c2..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to download"
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
deleted file mode 100644
index 9dc941d9..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: revision
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
deleted file mode 100644
index eb8ec932..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to download"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
deleted file mode 100644
index 592040d6..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: _id
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: chunkSizeBytes
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: metadata
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
deleted file mode 100644
index 6b8efb34..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to create"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
deleted file mode 100644
index e1b140ae..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to rename"
----
-arg_name: param
-name: $newFilename
-type: string
-description: |
-  The new ``filename`` value.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
deleted file mode 100644
index 592040d6..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: _id
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: chunkSizeBytes
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: metadata
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
deleted file mode 100644
index 48fa2db4..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to create"
----
-arg_name: param
-name: $source
-type: resource
-description: |
-  Readable stream, from which the new GridFS file's contents will be read.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml
deleted file mode 100644
index e5b410c4..00000000
--- a/source/includes/apiargs-aggregate-option.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
-arg_name: option
-name: allowDiskUse
-type: boolean
-description: |
-  Enables writing to temporary files. When set to ``true``, aggregation stages
-  can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: batchSize
-type: integer
-description: |
-  Specifies the batch size for the cursor, which will apply to both the initial
-  ``aggregate`` command and any subsequent ``getMore`` commands. This determines
-  the maximum number of documents to return in each response from the server.
-
-  A batchSize of ``0`` is special in that and will only apply to the initial
-  ``aggregate`` command; subsequent ``getMore`` commands will use the server's
-  default batch size. This may be useful for quickly returning a cursor or
-  failure from ``aggregate`` without doing significant server-side work.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
-post: |
-  This only applies when using the :ref:`$out ` and
-  :ref:`$out ` stages.
----
-arg_name: option
-name: explain
-type: boolean
-description: |
-  Specifies whether or not to return the information on the processing of the
-  pipeline.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml
deleted file mode 100644
index cae14187..00000000
--- a/source/includes/apiargs-common-option.yaml
+++ /dev/null
@@ -1,124 +0,0 @@
-arg_name: option
-name: collation
-type: array|object
-description: |
-   :manual:`Collation ` allows users to specify
-   language-specific rules for string comparison, such as rules for lettercase
-   and accent marks. When specifying collation, the ``locale`` field is
-   mandatory; all other collation fields are optional. For descriptions of the
-   fields, see :manual:`Collation Document
-   `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: comment
-type: mixed
-description: |
-  Enables users to specify an arbitrary comment to help trace the operation
-  through the :manual:`database profiler `,
-  :manual:`currentOp ` output, and
-  :manual:`logs `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: hint
-type: string|array|object
-description: |
-  The index to use. Specify either the index name as a string or the index key
-  pattern as a document. If specified, then the query system will only consider
-  plans using the hinted index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: let
-type: array|object
-description: |
-  Map of parameter names and values. Values must be constant or closed
-  expressions that do not reference document fields. Parameters can then be
-  accessed as variables in an aggregate expression context (e.g. ``$$var``).
-
-  This is not supported for server versions prior to 5.0 and will result in an
-  exception at execution time if used.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: maxTimeMS
-type: integer
-description: |
-   The cumulative time limit in milliseconds for processing operations on the
-   cursor. MongoDB aborts the operation at the earliest following
-   :term:`interrupt point`.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-  The default read concern to use for {{resource}} operations. Defaults to the
-  {{parent}}'s read concern.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  resource: "collection"
-  parent: "client"
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-  The default read preference to use for {{resource}} operations. Defaults to
-  the {{parent}}'s read preference.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  resource: "collection"
-  parent: "client"
----
-arg_name: option
-name: session
-type: :php:`MongoDB\\Driver\\Session `
-description: |
-  Client session to associate with the operation.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: typeMap
-type: array
-description: |
-  The :php:`type map
-  `
-  to apply to cursors, which determines how BSON documents are converted to PHP
-  values. Defaults to the {{parent}}'s type map.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  parent: "client"
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-  The default write concern to use for {{resource}} operations. Defaults
-  to the {{parent}}'s write concern.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  resource: "collection"
-  parent: "client"
-...
diff --git a/source/includes/apiargs-common-param.yaml b/source/includes/apiargs-common-param.yaml
deleted file mode 100644
index a8d79082..00000000
--- a/source/includes/apiargs-common-param.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
-arg_name: param
-name: $manager
-type: :php:`MongoDB\\Driver\\Manager `
-description: |
-  The :php:`Manager ` instance from the driver. The
-  manager maintains connections between the driver and your MongoDB instances.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $databaseName
-type: string
-description: |
-  The name of the database{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $collectionName
-type: string
-description: |
-  The name of the {{subject}}{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  subject: "collection"
-  action: ""
----
-arg_name: param
-name: $options
-type: array
-description: |
-  An array specifying the desired options.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-dropCollection-option.yaml b/source/includes/apiargs-dropCollection-option.yaml
deleted file mode 100644
index 158c4a43..00000000
--- a/source/includes/apiargs-dropCollection-option.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-arg_name: option
-name: encryptedFields
-type: array|object
-description: |
-  A document describing encrypted fields for queryable encryption. If omitted,
-  the ``encryptedFieldsMap`` option within the ``autoEncryption`` driver option
-  will be consulted. If ``encryptedFieldsMap`` was defined but does not specify
-  this collection, the library will make a final attempt to consult the
-  server-side value for ``encryptedFields``. See
-  `Field Encryption and Queryability `_
-  in the MongoDB manual for more information.
-
-  .. note::
-
-     This option is not passed to the :manual:`drop `
-     command. The library uses it to determine related metadata collections that
-     should be dropped in addition to an encrypted collection.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-function-with_transaction-param.yaml b/source/includes/apiargs-function-with_transaction-param.yaml
deleted file mode 100644
index 78875e91..00000000
--- a/source/includes/apiargs-function-with_transaction-param.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-arg_name: param
-name: $session
-type: :php:`MongoDB\\Driver\\Session `
-description: |
-  A client session used to execute the transaction.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $callback
-type: callback
-description: |
-  A callback that will be run inside the transaction. The callback must accept a
-  :php:`MongoDB\\Driver\\Session ` object as first
-  argument.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $transactionOptions
-type: array
-description: |
-  Transaction options, which will be passed to
-  :php:`MongoDB\\Driver\\Session::startTransaction `.
-  See the extension documentation for a list of supported options.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-method-watch-param.yaml b/source/includes/apiargs-method-watch-param.yaml
deleted file mode 100644
index e0da852c..00000000
--- a/source/includes/apiargs-method-watch-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $pipeline
-type: array|object
-description: |
-  The pipeline of stages to append to an initial ``$changeStream`` stage.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/extracts-bucket-option.yaml b/source/includes/extracts-bucket-option.yaml
new file mode 100644
index 00000000..0492ae9f
--- /dev/null
+++ b/source/includes/extracts-bucket-option.yaml
@@ -0,0 +1,28 @@
+ref: bucket-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+---
+ref: bucket-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+---
+ref: bucket-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+---
+ref: bucket-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+...
diff --git a/source/includes/extracts-client-option.yaml b/source/includes/extracts-client-option.yaml
new file mode 100644
index 00000000..9b9020bd
--- /dev/null
+++ b/source/includes/extracts-client-option.yaml
@@ -0,0 +1,28 @@
+ref: client-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+---
+ref: client-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+---
+ref: client-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+---
+ref: client-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+...
diff --git a/source/includes/extracts-collection-option.yaml b/source/includes/extracts-collection-option.yaml
new file mode 100644
index 00000000..94d9b9b0
--- /dev/null
+++ b/source/includes/extracts-collection-option.yaml
@@ -0,0 +1,38 @@
+ref: collection-option-collation
+source: 
+  ref: common-option-collation
+  file: extracts-common-option.yaml
+post: |
+  If the collation is unspecified but the collection has a default collation,
+  the operation uses the collation specified for the collection. If no
+  collation is specified for the collection or for the operation, MongoDB uses
+  the simple binary comparison used in prior versions for string comparisons.
+---
+ref: collection-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+---
+ref: collection-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+---
+ref: collection-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+---
+ref: collection-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+...
diff --git a/source/includes/extracts-common-option.yaml b/source/includes/extracts-common-option.yaml
new file mode 100644
index 00000000..65940b1c
--- /dev/null
+++ b/source/includes/extracts-common-option.yaml
@@ -0,0 +1,86 @@
+ref: common-option-collation
+content: |
+  :manual:`Collation ` allows users to specify
+  language-specific rules for string comparison, such as rules for lettercase
+  and accent marks. When specifying collation, the ``locale`` field is
+  mandatory; all other collation fields are optional. For descriptions of the
+  fields, see :manual:`Collation Document `.
+---
+ref: common-option-comment
+content: |
+  Enables users to specify an arbitrary comment to help trace the operation
+  through the :manual:`database profiler `,
+  :manual:`currentOp ` output, and
+  :manual:`logs `.
+---
+ref: common-option-comment-string-before-4.4
+content: |
+  The comment can be any valid BSON type since MongoDB 4.4. Earlier server
+  versions only support string values.
+---
+ref: common-option-hint
+content: |
+  The index to use. Specify either the index name as a string or the index key
+  pattern as a document. If specified, then the query system will only consider
+  plans using the hinted index.
+---
+ref: common-option-let
+content: |
+  Map of parameter names and values. Values must be constant or closed
+  expressions that do not reference document fields. Parameters can then be
+  accessed as variables in an aggregate expression context (e.g. ``$$var``).
+
+  This is not supported for server versions prior to 5.0 and will result in an
+  exception at execution time if used.
+---
+ref: common-option-maxTimeMS
+content: |
+  The cumulative time limit in milliseconds for processing operations on the
+  cursor. MongoDB aborts the operation at the earliest following
+  :term:`interrupt point`.
+---
+ref: common-option-readConcern
+content: |
+  :manual:`Read concern ` to use for the operation.
+  Defaults to the {{object}}'s read concern.
+replacement:
+  object: object
+---
+ref: common-option-readConcern-transaction
+content: |
+  It is not possible to specify a read concern for individual operations as part
+  of a transaction. Instead, set the ``readConcern`` option when
+  :php:`starting the transaction `.
+---
+ref: common-option-readPreference
+content: |
+  :manual:`Read preference ` to use for the
+  operation. Defaults to the {{object}}'s read preference.
+replacement:
+  object: object
+---
+ref: common-option-session
+content: |
+  Client session to associate with the operation.
+---
+ref: common-option-typeMap
+content: |
+  The :php:`type map `
+  to apply to cursors, which determines how BSON documents are converted to PHP
+  values. Defaults to the {{object}}'s type map.
+replacement:
+  object: object
+---
+ref: common-option-writeConcern
+content: |
+  :manual:`Write concern ` to use for the operation.
+  Defaults to the {{object}}'s write concern.
+replacement:
+  object: object
+---
+ref: common-option-writeConcern-transaction
+content: |
+  It is not possible to specify a write concern for individual operations as
+  part of a transaction. Instead, set the ``writeConcern`` option when
+  :php:`starting the transaction `.
+...
diff --git a/source/includes/extracts-database-option.yaml b/source/includes/extracts-database-option.yaml
new file mode 100644
index 00000000..e83c7abf
--- /dev/null
+++ b/source/includes/extracts-database-option.yaml
@@ -0,0 +1,28 @@
+ref: database-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+---
+ref: database-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+---
+ref: database-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+---
+ref: database-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+...
diff --git a/source/includes/extracts-option-requires.yaml b/source/includes/extracts-option-requires.yaml
new file mode 100644
index 00000000..3b65fbba
--- /dev/null
+++ b/source/includes/extracts-option-requires.yaml
@@ -0,0 +1,48 @@
+---
+ref: option-requires-4.2
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "4.2"
+---
+ref: option-requires-4.4
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "4.4"
+---
+ref: option-requires-5.0
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "5.0"
+---
+ref: option-requires-5.3
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "5.3"
+---
+ref: option-requires-6.0
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "6.0"
+---
+ref: option-requires-7.0
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "7.0"
+---
+ref: option-requires-version
+content: |
+  This option is available since MongoDB {{version}} and will result in an
+  exception at execution time if specified for an older server version.
+...
diff --git a/source/includes/apiargs-method-watch-option.yaml b/source/includes/extracts-watch-option.yaml
similarity index 76%
rename from source/includes/apiargs-method-watch-option.yaml
rename to source/includes/extracts-watch-option.yaml
index d0927828..533e76ac 100644
--- a/source/includes/apiargs-method-watch-option.yaml
+++ b/source/includes/extracts-watch-option.yaml
@@ -1,8 +1,5 @@
----
-arg_name: option
-name: batchSize
-type: integer
-description: |
+ref: watch-option-batchSize
+content: |
   Specifies the batch size for the cursor, which will apply to both the initial
   ``aggregate`` command and any subsequent ``getMore`` commands. This determines
   the maximum number of change events to return in each response from the
@@ -14,20 +11,15 @@ description: |
      response for a change stream generally does not include any documents
      unless another option is used to configure its starting point (e.g.
      ``startAfter``).
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: fullDocument
-type: string
-description: |
-  Determines how the "fullDocument" response field will be populated for update
-  operations.
+ref: watch-option-fullDocument
+content: |
+  Determines how the ``fullDocument`` response field will be populated for
+  update operations.
 
   By default, change streams only return the delta of fields (via an
-  "updateDescription" field) for update operations and "fullDocument" is
-  omitted. Insert and replace operations always include the "fullDocument"
+  ``updateDescription`` field) for update operations and ``fullDocument`` is
+  omitted. Insert and replace operations always include the ``fullDocument``
   field. Delete operations omit the field as the document no longer exists.
 
   Specify "updateLookup" to return the current majority-committed version of the
@@ -48,15 +40,10 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: fullDocumentBeforeChange
-type: string
-description: |
-  Determines how the "fullDocumentBeforeChange" response field will be
+ref: watch-option-fullDocumentBeforeChange
+content: |
+  Determines how the ``fullDocumentBeforeChange`` response field will be
   populated. By default, the field is omitted.
 
   MongoDB 6.0+ allows returning the pre-image of the modified document if the
@@ -73,24 +60,16 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
+
+  .. versionadded: 1.13
 ---
-arg_name: option
-name: maxAwaitTimeMS
-type: integer
-description: |
+ref: watch-option-maxAwaitTimeMS
+content: |
   Positive integer denoting the time limit in milliseconds for the server to
   block a getMore operation if no data is available.
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: resumeAfter
-type: array|object
-description: |
+ref: watch-option-resumeAfter
+content: |
   Specifies the logical starting point for the new change stream. The ``_id``
   field in documents returned by the change stream may be used here.
 
@@ -101,14 +80,9 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: showExpandedEvents
-type: boolean
-description: |
+ref: watch-option-showExpandedEvents
+content: |
   If true, instructs the server to include additional DDL events in the change
   stream. The additional events that may be included are:
 
@@ -126,14 +100,11 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
+
+  .. versionadded:: 1.13
 ---
-arg_name: option
-name: startAfter
-type: array|object
-description: |
+ref: watch-option-startAfter
+content: |
   Specifies the logical starting point for the new change stream. The ``_id``
   field in documents returned by the change stream may be used here. Unlike
   ``resumeAfter``, this option can be used with a resume token from an
@@ -149,14 +120,11 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
+
+  .. versionadded: 1.5
 ---
-arg_name: option
-name: startAtOperationTime
-type: :php:`MongoDB\\BSON\\TimestampInterface `
-description: |
+ref: watch-option-startAtOperationTime
+content: |
   If specified, the change stream will only provide changes that occurred at or
   after the specified timestamp. Command responses from a MongoDB 4.0+ server
   include an ``operationTime`` that can be used here. By default, the
@@ -172,7 +140,4 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
 ...
diff --git a/source/reference/function/with_transaction.txt b/source/reference/function/with_transaction.txt
index f7b7b92d..438ea7a1 100644
--- a/source/reference/function/with_transaction.txt
+++ b/source/reference/function/with_transaction.txt
@@ -21,11 +21,27 @@ Definition
 
    .. code-block:: php
 
-      function with_transaction(MongoDB\Driver\Session $session, callable $callback, array $transactionOptions = []): void
+      function with_transaction(
+          MongoDB\Driver\Session $session,
+          callable $callback,
+          array $transactionOptions = []
+      ): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$session`` : :php:`MongoDB\\Driver\\Session `
+  A client session used to execute the transaction.
+
+``$callback`` : :php:`callable `
+  A callback that will be run inside the transaction. The callback must accept a
+  :php:`MongoDB\\Driver\\Session ` object as its first
+  argument.
 
-   .. include:: /includes/apiargs/function-with_transaction-param.rst
+``$transactionOptions`` : array
+  Transaction options, which will be passed to
+  :php:`MongoDB\\Driver\\Session::startTransaction `.
+  See the extension documentation for a list of supported options.
 
 Behavior
 --------
diff --git a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
index 2e8f708b..da115c5f 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
@@ -20,7 +20,7 @@ Definition
 
    .. code-block:: php
 
-      function getModifiedCount(): integer|null
+      function getModifiedCount(): integer
 
    This method should only be called if the write was acknowledged.
 
diff --git a/source/reference/method/MongoDBClient-createClientEncryption.txt b/source/reference/method/MongoDBClient-createClientEncryption.txt
index 9b6f817e..0dd925cd 100644
--- a/source/reference/method/MongoDBClient-createClientEncryption.txt
+++ b/source/reference/method/MongoDBClient-createClientEncryption.txt
@@ -22,15 +22,18 @@ Definition
 
       function createClientEncryption(array $options): MongoDB\Driver\ClientEncryption
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBClient-method-createClientEncryption-param.rst
+``$options`` : array
+  An array specifying the desired options. Refer to the
+  :php:`MongoDB\\Driver\\Manager::createClientEncryption() `
+  extension documentation for a list of supported options.
 
-   The ``$options`` parameter supports all options documented in the
-   :php:`extension manual `.
-   For the ``keyVaultClient`` option, an instance of :phpclass:`MongoDB\\Client`
-   is automatically unwrapped and the :php:`MongoDB\\Driver\\Manager `
-   instance is passed to the extension.
+  If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+  option, it will be unwrapped into a
+  :php:`MongoDB\\Driver\\Manager ` for the
+  extension.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index 3e963ee5..5a268765 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -21,13 +21,46 @@ Definition
 
       function dropDatabase(string $databaseName, array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$databaseName`` : string
+  The name of the database to drop.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/client-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/client-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-listDatabaseNames.txt b/source/reference/method/MongoDBClient-listDatabaseNames.txt
index bf4fb48f..cac7d22c 100644
--- a/source/reference/method/MongoDBClient-listDatabaseNames.txt
+++ b/source/reference/method/MongoDBClient-listDatabaseNames.txt
@@ -23,13 +23,56 @@ Definition
 
       function listDatabaseNames(array $options = []): Iterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedDatabases
+       - boolean
+       - A flag that determines which databases are returned based on the user
+         privileges when access control is enabled. For more information, see the
+         `listDatabases command documentation `_.
+
+         For servers < 4.0.5, this option is ignored.
+
+         .. versionadded:: 1.7
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of databases.
+
+         You can specify a query expression for database fields (e.g. ``name``,
+         ``sizeOnDisk``, ``empty``).
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-param.rst
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-option.rst
+         .. versionadded:: 1.3
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index 822f98d7..dd6b2da8 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -21,13 +21,58 @@ Definition
 
       function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedDatabases
+       - boolean
+       - A flag that determines which databases are returned based on the user
+         privileges when access control is enabled. For more information, see the
+         `listDatabases command documentation `_.
+
+         For servers < 4.0.5, this option is ignored.
+
+         .. versionadded:: 1.7
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of databases.
+
+         You can specify a query expression for database fields (e.g. ``name``,
+         ``sizeOnDisk``, ``empty``).
+
+         .. versionadded:: 1.3
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-option.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 88828c29..6700f023 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -19,15 +19,51 @@ Definition
 
    .. code-block:: php
 
-      function selectCollection(string $databaseName, string $collectionName, array $options = []): MongoDB\Collection
+      function selectCollection(
+          string $databaseName,
+          string $collectionName,
+          array $options = []
+      ): MongoDB\Collection
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$databaseName`` : string
+  The name of the database containing the collection to select.
+
+``$collectionName`` : string
+  The name of the collection to select.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the client's read concern.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the client's read preference.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for collection operations. Defaults to the
+         client's type map.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults to
+         the client's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index a556a06a..b1814516 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -19,15 +19,47 @@ Definition
 
    .. code-block:: php
 
-      function selectDatabase(string $databaseName, array $options = []): MongoDB\Database
+      function selectDatabase(
+          string $databaseName,
+          array $options = []
+      ): MongoDB\Database
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$databaseName`` : string
+  The name of the database to select.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for database operations. Defaults to
+         the client's read concern.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for database operations. Defaults to
+         the client's read preference.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for database operations. Defaults to the
+         client's type map.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for database operations. Defaults to
+         the client's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-startSession.txt b/source/reference/method/MongoDBClient-startSession.txt
index 07a9b2b2..8de00ee0 100644
--- a/source/reference/method/MongoDBClient-startSession.txt
+++ b/source/reference/method/MongoDBClient-startSession.txt
@@ -23,9 +23,13 @@ Definition
 
       function startSession(array $options = []): MongoDB\Driver\Session
 
-   Refer to the :php:`MongoDB\\Driver\\Manager::startSession()
-   ` extension reference for accepted
-   options.
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options. Refer to the
+  :php:`MongoDB\\Driver\\Manager::startSession() `
+  extension documentation for a list of supported options.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-watch.txt b/source/reference/method/MongoDBClient-watch.txt
index 0e7aab34..2977475a 100644
--- a/source/reference/method/MongoDBClient-watch.txt
+++ b/source/reference/method/MongoDBClient-watch.txt
@@ -22,15 +22,90 @@ Definition
 
    .. code-block:: php
 
-      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+      function watch(
+          array $pipeline = [],
+          array $options = []
+      ): MongoDB\ChangeStream
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array|object
+  The pipeline of stages to append to an initial ``$changeStream`` stage.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - batchSize
+       - integer
+       - .. include:: /includes/extracts/watch-option-batchSize.rst
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+  
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - fullDocument
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocument.rst
+
+     * - fullDocumentBeforeChange
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocumentBeforeChange.rst
+
+     * - maxAwaitTimeMS
+       - integer
+       - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/client-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/client-option-readPreference.rst
+
+         This is used for both the initial change stream aggregation and for
+         server selection during an automatic resume.
+
+     * - resumeAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-resumeAfter.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - showExpandedEvents
+       - boolean
+       - .. include:: /includes/extracts/watch-option-showExpandedEvents.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-watch-param.rst
+     * - startAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-startAfter.rst
 
-   The ``$options`` parameter supports the following options:
+     * - startAtOperationTime
+       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-watch-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/client-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index 07694c91..1134df67 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -19,15 +19,195 @@ Definition
 
    .. code-block:: php
 
-      function __construct(?string $uri = null, array $uriOptions = [], array $driverOptions = [])
+      function __construct(
+          ?string $uri = null,
+          array $uriOptions = [],
+          array $driverOptions = []
+      )
 
-   This constructor has the following parameters:
+Parameters
+----------
+
+``$uri`` : string
+  The MongoDB connection string. Refer to
+  :manual:`Connection Strings ` in the MongoDB
+  manual for more information.
+
+  Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified.
+
+  Any special characters in the URI components need to be encoded according to
+  `RFC 3986 `_. This is particularly
+  relevant to the username and password, which can often include special
+  characters such as ``@``, ``:``, or ``%``. When connecting via a Unix domain
+  socket, the socket path may contain special characters such as slashes and
+  must be encoded. The :php:`rawurlencode() ` function may be used
+  to encode constituent parts of the URI.
+
+``$uriOptions`` : array
+  Specifies additional URI options, such as authentication credentials or query
+  string parameters. The options specified in ``$uriOptions`` take precedence
+  over any analogous options present in the ``$uri`` string and do not need to
+  be encoded according to `RFC 3986 `_.
+
+  Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
+  ` extension documentation for a list of
+  supported options.
+
+``$driverOptions`` : array
+  Specifies options specific to the PHP driver. In addition to driver options
+  supported by the :php:`extension `, the library
+  additionally supports specifying a default 
+  :php:`type map `
+  to apply to the cursors it creates.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - autoEncryption
+       - array
+       - Options to configure client-side field-level encryption in the driver.
+         Refer to the
+         :php:`extension documentation `
+         for a list of supported encryption options.
+
+         If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+         option, it will be unwrapped into a
+         :php:`MongoDB\\Driver\\Manager ` for the
+         extension.
+
+         .. versionadded:: 1.6
+
+     * - driver
+       - array
+       - Additional driver metadata to be passed on to the server handshake.
+         This is an array containing ``name``, ``version``, and ``platform``
+         string fields. For example:
+
+         .. code-block:: php
+
+            [
+                'name' => 'my-driver',
+                'version' => '1.2.3-dev',
+                'platform' => 'some-platform',
+            ]
+
+         .. note::
+
+            This feature is primarily designed for custom drivers and ODMs,
+            which may want to identify themselves to the server for diagnostic
+            purposes. Applications wishing to identify themselves should use the
+            ``appName`` URI option instead of this option.
+
+         .. versionadded:: 1.7
+
+     * - serverApi
+       - :php:`MongoDB\\Driver\\ServerApi `
+       - Used to declare an API version on the client. Refer to
+         :manual:`Stable API tutorial ` for additional
+         information.
+
+         .. versionadded:: 1.9
+
+     * - typeMap
+       - array
+       - Default :php:`type map `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
+
+         .. code-block:: php
+
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
+
+     * - allow_invalid_hostname
+       - boolean
+       - Disables hostname validation if ``true``. Defaults to ``false``.
+
+         Allowing invalid hostnames may expose the driver to a
+         `man-in-the-middle attack `__.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the
+            ``tlsAllowInvalidHostnames`` URI option instead.
+
+     * - ca_dir
+       - string
+       - Path to a correctly hashed certificate directory. The system
+         certificate store will be used by default.
+
+         Falls back to the deprecated ``capath`` SSL context option if not
+         specified.
+
+     * - ca_file
+       - string
+       - Path to a certificate authority file. The system certificate store will
+         be used by default.
+
+         Falls back to the deprecated ``cafile`` SSL context option if not
+         specified.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the ``tlsCAFile`` URI option
+            instead.
+
+     * - crl_file
+       - string
+       - Path to a certificate revocation list file.
+
+     * - pem_file
+       - string
+       - Path to a PEM encoded certificate to use for client authentication.
+
+         Falls back to the deprecated ``local_cert`` SSL context option if not
+         specified.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the ``tlsCertificateKeyFile``
+            URI option instead.
+
+     * - pem_pwd
+       - string
+       - Passphrase for the PEM encoded certificate (if applicable).
+
+         Falls back to the deprecated ``passphrase`` SSL context option if not
+         specified.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the
+            ``tlsCertificateKeyFilePassword`` URI option instead.
+
+     * - weak_cert_validation
+       - boolean
+       - Disables certificate validation ``true``. Defaults to ``false``.
+
+         Falls back to the deprecated ``allow_self_signed`` SSL context option
+         if not specified.
+
+         .. deprecated:: 1.6
 
-   .. include:: /includes/apiargs/MongoDBClient-method-construct-param.rst
+            This option has been deprecated. Use the
+            ``tlsAllowInvalidCertificates`` URI option instead.
 
-   The ``$driverOptions`` parameter supports the following options:
+     * - context
+       - resource
+       - :php:`SSL context options ` to be used as
+         fallbacks for other driver options (as specified). Note that the driver
+         does not consult the default stream context.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-construct-driverOptions.rst
+         This option is supported for backwards compatibility, but should be
+         considered deprecated.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
index 5e4097b2..88de4725 100644
--- a/source/reference/method/MongoDBClient__get.txt
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -23,9 +23,11 @@ Definition
 
       function __get(string $databaseName): MongoDB\Database
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBClient-method-get-param.rst
+``$databaseName`` : string
+  The name of the database to select.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index d26d8c8e..ddb66889 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -20,15 +20,120 @@ Definition
 
    .. code-block:: php
 
-      function aggregate(array $pipeline, array $options = []): Traversable
+      function aggregate(
+          array $pipeline,
+          array $options = []
+      ): Traversable
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array
+  Specifies an :manual:`aggregation pipeline `
+  operation.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, aggregation
+         stages can write data to the ``_tmp`` sub-directory in the ``dbPath``
+         directory.
+
+     * - batchSize
+       - integer
+       - Specifies the batch size for the cursor, which will apply to both the
+         initial ``aggregate`` command and any subsequent ``getMore`` commands.
+         This determines the maximum number of documents to return in each
+         response from the server.
+
+         A batchSize of ``0`` is special in that and will only apply to the
+         initial ``aggregate`` command; subsequent ``getMore`` commands will use
+         the server's default batch size. This may be useful for quickly
+         returning a cursor or failure from ``aggregate`` without doing
+         significant server-side work.
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+         This only applies when using the :ref:`$out ` and
+         :ref:`$out ` stages.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         The comment can be any valid BSON type for server versions 4.4 and
+         above. Earlier server versions only support string values.
+
+         .. versionadded:: 1.3
+
+     * - explain
+       - boolean
+       - Specifies whether or not to return the information on the processing of
+         the pipeline.
+
+         .. versionadded:: 1.4
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.3
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.9
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-param.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   The ``$options`` parameter supports the following options:
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-option.rst
+         This only applies when a :ref:`$out ` or
+         :ref:`$merge ` stage is specified.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index e58688cb..a86e9cc6 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -19,15 +19,92 @@ Definition
 
    .. code-block:: php
 
-      function bulkWrite(array $operations, array $options = []): MongoDB\BulkWriteResult
+      function bulkWrite(
+          array $operations,
+          array $options = []
+      ): MongoDB\BulkWriteResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$operations`` : array
+  An array containing the write operations to perform.
+  :phpmethod:`MongoDB\\Collection::bulkWrite()` supports
+  :phpmethod:`deleteMany() `,
+  :phpmethod:`deleteOne() `,
+  :phpmethod:`insertOne() `,
+  :phpmethod:`replaceOne() `,
+  :phpmethod:`updateMany() `, and
+  :phpmethod:`updateOne() ` operations in the
+  following array structure:
+
+  .. code-block:: php
+
+     [
+         [ 'deleteMany' => [ $filter ] ],
+         [ 'deleteOne'  => [ $filter ] ],
+         [ 'insertOne'  => [ $document ] ],
+         [ 'replaceOne' => [ $filter, $replacement, $options ] ],
+         [ 'updateMany' => [ $filter, $update, $options ] ],
+         [ 'updateOne'  => [ $filter, $update, $options ] ],
+     ]
+
+  Arguments correspond to the respective operation methods. However, the
+  ``writeConcern`` option is specified as a top-level option to
+  :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
+  operation.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - ordered
+       - boolean
+       - If ``true``: when a single write fails, the operation will stop without
+         performing the remaining writes and throw an exception.
+
+         If ``false``: when a single write fails, the operation will continue
+         with the remaining writes, if any, and throw an exception.
+
+         The default is ``true``.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 1673ed91..0048703f 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -21,15 +21,77 @@ Definition
 
    .. code-block:: php
 
-      function count(array|object $filter = [], array $options = []): integer
+      function count(
+          array|object $filter = [],
+          array $options = []
+      ): integer
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to count.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionchanged:: 1.2
+
+            If a document is provided, it is passed to the command as-is.
+            Previously, the library would convert the key pattern to an index
+            name.
+
+     * - limit
+       - integer
+       - The maximum number of matching documents to return.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-count-param.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-count-option.rst
+     * - skip
+       - integer
+       - The number of matching documents to skip before returning results.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt
index 44b16c8e..dc62b1d6 100644
--- a/source/reference/method/MongoDBCollection-countDocuments.txt
+++ b/source/reference/method/MongoDBCollection-countDocuments.txt
@@ -23,13 +23,62 @@ Definition
 
       function countDocuments(array|object $filter = [], array $options = []): integer
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to count.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+     * - limit
+       - integer
+       - The maximum number of matching documents to return.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-countDocuments-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-countDocuments-option.rst
+     * - skip
+       - integer
+       - The number of matching documents to skip before returning results.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index ceef2e7b..7f8aca41 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -19,20 +19,114 @@ Definition
 
    .. code-block:: php
 
-      function createIndex(array|object $key, array $options = []): string
+      function createIndex(
+          array|object $key,
+          array $options = []
+      ): string
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$key`` : array|object
+  Specifies the field or fields to index and the index order.
+
+  For example, the following specifies a descending index on the ``username``
+  field:
+
+  .. code-block:: php
+
+     [ 'username' => -1 ]
+
+``$options`` : array
+  An array specifying the desired options.
+
+  The ``$options`` parameter accepts both index *and* command options. A
+  non-exhaustive list of index options follows. For a complete list of index
+  options, refer to the
+  :manual:`createIndexes ` command reference
+  in the MongoDB manual.
+
+  **Index Options** (non-exhaustive)
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - expireAfterSeconds
+       - integer
+       - Creates a :manual:`TTL ` index.
+
+     * - name
+       - string
+       - A name that uniquely identifies the index. By default, MongoDB creates
+         index names based on the key.
+
+     * - partialFilterExpression
+       - array|object
+       - Creates a :manual:`partial ` index.
+
+     * - sparse
+       - boolean
+       - Creates a :manual:`sparse ` index.
+
+     * - unique
+       - boolean
+       - Creates a :manual:`unique ` index.
+
+  **Command Options**
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - commitQuorum
+       - string|integer
+       - Specifies how many data-bearing members of a replica set, including the
+         primary, must complete the index builds successfully before the primary
+         marks the indexes as ready.
+
+         This option accepts the same values for the ``w`` field in a write
+         concern plus ``"votingMembers"``, which indicates all voting
+         data-bearing nodes.
+
+         This is not supported for server versions prior to 4.4 and will result
+         in an exception at execution time if used.
+
+         .. versionadded:: 1.7
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-param.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   The ``$options`` parameter accepts all index options that your MongoDB
-   version supports. MongoDB includes the following options:
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   For a full list of the supported index creation options, refer to the
-   :manual:`createIndexes ` command reference
-   in the MongoDB manual.
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index 76705e9b..efb740ea 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -19,15 +19,78 @@ Definition
 
    .. code-block:: php
 
-      function createIndexes(array $indexes, array $options = []): string[]
+      function createIndexes(
+          array $indexes,
+          array $options = []
+      ): string[]
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$indexes`` : array
+  The indexes to create on the collection.
+
+  For example, the following specifies a unique index on the ``username`` field
+  and a compound index on the ``email`` and ``createdAt`` fields:
+
+  .. code-block:: php
+
+     [
+         [ 'key' => [ 'username' => -1 ], 'unique' => true ],
+         [ 'key' => [ 'email' => 1, 'createdAt' => 1 ] ],
+     ]
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-param.rst
+         .. versionadded:: 1.13
 
-   The ``$options`` parameter supports the following options:
+     * - commitQuorum
+       - string|integer
+       - Specifies how many data-bearing members of a replica set, including the
+         primary, must complete the index builds successfully before the primary
+         marks the indexes as ready.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-option.rst
+         This option accepts the same values for the ``w`` field in a write
+         concern plus ``"votingMembers"``, which indicates all voting
+         data-bearing nodes.
+
+         This is not supported for server versions prior to 4.4 and will result
+         in an exception at execution time if used.
+
+         .. versionadded:: 1.7
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
+
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
@@ -41,15 +104,21 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
 ``$indexes`` parameter
-----------------------
+~~~~~~~~~~~~~~~~~~~~~~
 
 The ``$indexes`` parameter is an array of index specification documents. Each
 element in ``$indexes`` must itself be an array or object with a ``key`` field,
 which corresponds to the ``$key`` parameter of :phpmethod:`createIndex()
 `. The array or object may include other
 fields that correspond to index options accepted by :phpmethod:`createIndex()
-` (excluding ``writeConcern``).
+`. For a full list of the supported index
+creation options, refer to the
+:manual:`createIndexes ` command reference
+in the MongoDB manual.
 
 For example, the following ``$indexes`` parameter creates two indexes. The first
 is an ascending unique index on the ``username`` field and the second is a
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index 29ad2e83..ccb5e37d 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -19,15 +19,65 @@ Definition
 
    .. code-block:: php
 
-      function deleteMany(array|object $filter, array $options = []): MongoDB\DeleteResult
+      function deleteMany(
+          array|object $filter,
+          array $options = []
+      ): MongoDB\DeleteResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to delete.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index 6c888a96..0c659891 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -21,15 +21,65 @@ Definition
 
    .. code-block:: php
 
-      function deleteOne(array|object $filter, array $options = []): MongoDB\DeleteResult
+      function deleteOne(
+          array|object $filter,
+          array $options = []
+      ): MongoDB\DeleteResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to delete.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index 24fd6761..42eae068 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -19,15 +19,70 @@ Definition
 
    .. code-block:: php
 
-      function distinct(string $fieldName, array|object $filter = [], array $options = []): mixed[]
+      function distinct(
+          string $fieldName,
+          array|object $filter = [],
+          array $options = []
+      ): mixed[]
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$fieldName`` : string
+  The field for which to return distinct values.
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents from which to retrieve the
+  distinct values.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-distinct-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-distinct-option.rst
+         .. versionadded:: 1.5
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index a2cd9410..0704ff6a 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -21,13 +21,67 @@ Definition
 
       function drop(array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - encryptedFields
+       - array|object
+       - A document describing encrypted fields for queryable encryption. If
+         omitted, the ``encryptedFieldsMap`` option within the
+         ``autoEncryption`` driver option will be consulted. If
+         ``encryptedFieldsMap`` was defined but does not specify this
+         collection, the library will make a final attempt to consult the
+         server-side value for ``encryptedFields``. See
+         `Field Encryption and Queryability `_
+         in the MongoDB manual for more information.
+
+         .. note::
+
+            This option is not passed to the
+            :manual:`drop ` command. The library uses
+            it to determine related metadata collections that should be dropped
+            in addition to an encrypted collection.
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
+
+         This will be used for the returned command result document.
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-drop-param.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
-   The ``$options`` parameter supports the following options:
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-drop-option.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index 0a7fbb53..07a18145 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -19,15 +19,61 @@ Definition
 
    .. code-block:: php
 
-      function dropIndex(string|MongoDB\Model\IndexInfo $indexName, array $options = []): array|object
+      function dropIndex(
+          string|MongoDB\Model\IndexInfo $indexName,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+  The name or model object of the index to drop. View the existing indexes on
+  the collection using the :phpmethod:`listIndexes()
+  ` method.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
+         This will be used for the returned command result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index ee48d493..41fda6e4 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -22,13 +22,56 @@ Definition
 
       function dropIndexes(array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+  The name or model object of the index to drop. View the existing indexes on
+  the collection using the :phpmethod:`listIndexes()
+  ` method.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
+         This will be used for the returned command result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
index 1a831629..59a7b212 100644
--- a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
+++ b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
@@ -23,13 +23,45 @@ Definition
 
       function countDocuments(array $options = []): integer
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-estimateDocumentCount-param.rst
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
-   The ``$options`` parameter supports the following options:
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-estimateDocumentCount-option.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt
index 600f203b..ad63ec56 100644
--- a/source/reference/method/MongoDBCollection-explain.txt
+++ b/source/reference/method/MongoDBCollection-explain.txt
@@ -21,15 +21,52 @@ Definition
 
    .. code-block:: php
 
-      function explain(MongoDB\Operation\Explainable $explainable, array $options = []): array|object
+      function explain(
+          MongoDB\Operation\Explainable $explainable,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$explainable`` : :phpclass:`MongoDB\\Operation\\Explainable`
+  The command to explain.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         Defaults to the ``comment`` of the explained operation (if any).
+
+         .. versionadded:: 1.13
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-explain-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-explain-option.rst
+     * - verbosity
+       - string
+       - The verbosity level at which to run the command. See the :manual:`explain
+         ` command for more information.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 4fe92389..8c0ce7c2 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -19,15 +19,205 @@ Definition
 
    .. code-block:: php
 
-      function find(array|object $filter = [], array $options = []): MongoDB\Driver\Cursor
+      function find(
+          array|object $filter = [],
+          array $options = []
+      ): MongoDB\Driver\Cursor
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - batchSize
+       - integer
+       - The number of documents to return in the first batch. Defaults to
+         ``101``. A batchSize of ``0`` means that the cursor will be
+         established, but no documents will be returned in the first batch.
+
+         Unlike the previous wire protocol version, a batchSize of ``1`` for the
+         :dbcommand:`find` command does not close the cursor.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - cursorType
+       - integer
+       - Indicates the type of cursor to use. ``cursorType`` supports the
+         following values:
+
+         - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
+         - ``MongoDB\Operation\Find::TAILABLE``
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - limit
+       - integer
+       - The maximum number of documents to return. If unspecified, then
+         defaults to no limit. A limit of ``0`` is equivalent to setting no
+         limit.
+
+         A negative limit is similar to a positive limit but closes the cursor
+         after returning a single batch of results. As such, with a negative
+         limit, if the limited result set does not fit into a single batch, the
+         number of documents received will be less than the specified limit. By
+         passing a negative limit, the client indicates to the server that it
+         will not ask for a subsequent batch via getMore.
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxAwaitTimeMS
+       - integer
+       - Positive integer denoting the time limit in milliseconds for the server
+         to block a getMore operation if no data is available. This option
+         should only be used if cursorType is TAILABLE_AWAIT.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - noCursorTimeout
+       - boolean
+       - Prevents the server from timing out idle cursors after an inactivity
+         period (10 minutes).
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
+     * - snapshot
+       - boolean
+       - Prevents the cursor from returning a document more than once because of
+         an intervening write operation.
 
-   The ``$options`` parameter supports the following options:
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-find-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index 44829db3..c5230c6c 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -19,15 +19,156 @@ Definition
 
    .. code-block:: php
 
-      function findOne(array|object $filter = [], array $options = []): array|object|null
+      function findOne(
+          array|object $filter = [],
+          array $options = []
+      ): array|object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-option.rst
+         This will be used for the returned result document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index e5531f41..b34bd578 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -19,15 +19,87 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndDelete(array|object $filter = [], array $options = []): object|null
+      function findOneAndDelete(
+          array|object $filter = [],
+          array $options = []
+      ): object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to delete.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-param.rst
+         This will be used for the returned result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 66bd7f12..697e7371 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -19,15 +19,110 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndReplace(array|object $filter, array|object $replacement, array $options = []): object|null
+      function findOneAndReplace(
+          array|object $filter,
+          array|object $replacement,
+          array $options = []
+      ): object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to replace.
+
+``$replacement`` : array|object
+  The replacement document.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - returnDocument
+       - integer
+       - Specifies whether to return the document before the replacement is
+         applied, or after. ``returnDocument`` supports the following values:
+
+         - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*)
+         - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
+
+         This will be used for the returned result document.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index c903698b..cbfbad16 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -19,15 +19,121 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndUpdate(array|object $filter, array|object $update, array $options = []): object|null
+      function findOneAndUpdate(
+          array|object $filter,
+          array|object $update,
+          array $options = []
+      ): object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to update.
+
+``$update`` : array|object
+  Specifies the field and value combinations to update and any relevant update
+  operators. ``$update`` uses MongoDB's :method:`update operators
+  `. Starting with MongoDB 4.2, an `aggregation
+  pipeline `_
+  can be passed as this parameter.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - arrayFilters
+       - array
+       - An array of filter documents that determines which array elements to
+         modify for an update operation on an array field.
+
+         .. versionadded:: 1.3
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - returnDocument
+       - integer
+       - Specifies whether to return the document before the update is applied,
+         or after. ``returnDocument`` supports the following values:
+
+         - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*)
+         - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
+
+         This will be used for the returned result document.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 62b0858e..6ff516e7 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -19,15 +19,62 @@ Definition
 
    .. code-block:: php
 
-      function insertMany(array $documents, array $options = []): MongoDB\InsertManyResult
+      function insertMany(
+          array $documents,
+          array $options = []
+      ): MongoDB\InsertManyResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$documents`` : array
+  The documents to insert into the collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - ordered
+       - boolean
+       - If ``true``: when a single write fails, the operation will stop without
+         performing the remaining writes and throw an exception.
+
+         If ``false``: when a single write fails, the operation will continue
+         with the remaining writes, if any, and throw an exception.
+
+         The default is ``true``.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index dd6e2f22..ce6f0484 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -19,15 +19,52 @@ Definition
 
    .. code-block:: php
 
-      function insertOne(array|object $document, array $options = []): MongoDB\InsertOneResult
+      function insertOne(
+          array|object $document,
+          array $options = []
+      ): MongoDB\InsertOneResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$document`` : array|object
+  The document to insert into the collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index 2508b282..84ee74b3 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -21,13 +21,37 @@ Definition
 
       function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-param.rst
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-option.rst
+         .. versionadded:: 1.3
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
index a38872bd..1cb66f35 100644
--- a/source/reference/method/MongoDBCollection-mapReduce.txt
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -24,15 +24,139 @@ Definition
 
    .. code-block:: php
 
-      function mapReduce(MongoDB\BSON\JavascriptInterface $map, MongoDB\BSON\JavascriptInterface $reduce, string|array|object $out, array $options = []): MongoDB\MapReduceResult
+      function mapReduce(
+          MongoDB\BSON\JavascriptInterface $map,
+          MongoDB\BSON\JavascriptInterface $reduce,
+          string|array|object $out,
+          array $options = []
+      ): MongoDB\MapReduceResult
+
+Parameters
+----------
+
+``$map`` : :php:`MongoDB\\BSON\\Javascript `
+  A JavaScript function that associates or "maps" a value with a key and emits
+  the key and value pair.
+
+  .. note::
+
+     Passing a Javascript instance with a scope is deprecated. Put all scope
+     variables in the ``scope`` option of the MapReduce operation.
+
+``$reduce`` : :php:`MongoDB\\BSON\\Javascript `
+  A JavaScript function that "reduces" to a single object all the values
+  associated with a particular key.
+
+  .. note::
+
+     Passing a Javascript instance with a scope is deprecated. Put all scope
+     variables in the ``scope`` option of the MapReduce operation.
+
+``$out`` : string|array|object
+  Specifies where to output the result of the map-reduce operation. You can
+  either output to a collection or return the result inline. On a primary member
+  of a replica set you can output either to a collection or inline, but on a
+  secondary, only inline output is possible.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+         This only applies when results are output to a collection.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - finalize
+       - :php:`MongoDB\\BSON\\Javascript `
+       - Follows the reduce method and modifies the output.
+
+         .. note::
+
+            Passing a Javascript instance with a scope is deprecated. Put all
+            scope variables in the ``scope`` option of the MapReduce operation.
+
+     * - jsMode
+       - boolean
+       - Specifies whether to convert intermediate data into BSON format between
+         the execution of the map and reduce functions.
+
+     * - limit
+       - integer
+       - Specifies a maximum number of documents for the input into the map
+         function.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - query
+       - array|object
+       - Specifies the selection criteria using query operators for determining
+         the documents input to the map function.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+         This option will be ignored when results are output to a collection.
+
+     * - scope
+       - array|object
+       - Specifies global variables that are accessible in the map, reduce, and
+         finalize functions.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   This method has the following parameters:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-mapReduce-param.rst
+     * - verbose
+       - boolean
+       - Specifies whether to include the timing information in the result
+         information.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-mapReduce-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-rename.txt b/source/reference/method/MongoDBCollection-rename.txt
index a40555f2..2b617de9 100644
--- a/source/reference/method/MongoDBCollection-rename.txt
+++ b/source/reference/method/MongoDBCollection-rename.txt
@@ -21,15 +21,63 @@ Definition
 
    .. code-block:: php
 
-      function rename(string $toCollectionName, ?string $toDatabaseName = null, array $options = []): array|object
+      function rename(
+          string $toCollectionName,
+          ?string $toDatabaseName = null,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$toCollectionName`` : string
+  The new name of the collection.
+
+``$toDatabaseName`` : string
+  The new database name of the collection. If a new database name is not
+  specified, the database of the original collection will be used. If the new
+  name specifies a different database, the command copies the collection
+  to the new database and drops the source collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - dropTarget
+       - boolean
+       - If ``true``, MongoDB will drop the target before renaming the
+         collection. The default value is ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-rename-param.rst
+         This will be used for the returned command result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-rename-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index e42f993e..94395eff 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -21,15 +21,80 @@ Definition
 
    .. code-block:: php
 
-      function replaceOne(array|object $filter, array|object $replacement, array $options = []): MongoDB\UpdateResult
+      function replaceOne(
+          array|object $filter,
+          array|object $replacement,
+          array $options = []
+      ): MongoDB\UpdateResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to replace.
+
+``$replacement`` : array|object
+  The replacement document.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.2.rst
+
+         .. versionadded:: 1.6
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 0e5f22b9..07f29211 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -19,15 +19,91 @@ Definition
 
    .. code-block:: php
 
-      function updateMany(array|object $filter, array|object $update, array $options = []): MongoDB\UpdateResult
+      function updateMany(
+          array|object $filter,
+          array|object $update,
+          array $options = []
+      ): MongoDB\UpdateResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to update.
+
+``$update`` : array|object
+  Specifies the field and value combinations to update and any relevant update
+  operators. ``$update`` uses MongoDB's :method:`update operators
+  `. Starting with MongoDB 4.2, an `aggregation
+  pipeline `_
+  can be passed as this parameter.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - arrayFilters
+       - array
+       - An array of filter documents that determines which array elements to
+         modify for an update operation on an array field.
+
+         .. versionadded:: 1.3
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.2.rst
+
+         .. versionadded:: 1.6
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index 2b930e23..2a981cb2 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -21,15 +21,91 @@ Definition
 
    .. code-block:: php
 
-      function updateOne(array|object $filter, array|object $update, array $options = []): MongoDB\UpdateResult
+      function updateOne(
+          array|object $filter,
+          array|object $update,
+          array $options = []
+      ): MongoDB\UpdateResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to update.
+
+``$update`` : array|object
+  Specifies the field and value combinations to update and any relevant update
+  operators. ``$update`` uses MongoDB's :method:`update operators
+  `. Starting with MongoDB 4.2, an `aggregation
+  pipeline `_
+  can be passed as this parameter.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - arrayFilters
+       - array
+       - An array of filter documents that determines which array elements to modify
+         for an update operation on an array field.
+
+         .. versionadded:: 1.3
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.2.rst
+
+         .. versionadded:: 1.6
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
index 50ef408d..c54123bd 100644
--- a/source/reference/method/MongoDBCollection-watch.txt
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -22,15 +22,94 @@ Definition
 
    .. code-block:: php
 
-      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+      function watch(
+          array $pipeline = [],
+          array $options = []
+      ): MongoDB\ChangeStream
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array|object
+  The pipeline of stages to append to an initial ``$changeStream`` stage.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - batchSize
+       - integer
+       - .. include:: /includes/extracts/watch-option-batchSize.rst
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+         Starting in MongoDB 4.2, defaults to simple binary comparison if
+         omitted. In earlier versions, change streams opened on a single
+         collection would inherit the collection's default collation.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+  
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - fullDocument
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocument.rst
+
+     * - fullDocumentBeforeChange
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocumentBeforeChange.rst
+
+     * - maxAwaitTimeMS
+       - integer
+       - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+         This is used for both the initial change stream aggregation and for
+         server selection during an automatic resume.
+
+     * - resumeAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-resumeAfter.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - showExpandedEvents
+       - boolean
+       - .. include:: /includes/extracts/watch-option-showExpandedEvents.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-watch-param.rst
+     * - startAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-startAfter.rst
 
-   The ``$options`` parameter supports the following options:
+     * - startAtOperationTime
+       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-watch-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index a68a5fec..293b093a 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -21,13 +21,41 @@ Definition
 
       function withOptions(array $options = []): MongoDB\Collection
 
-   This method has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-option.rst
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the original collection's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the original collection's read preference.
+
+     * - typeMap
+       - array
+       - The :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. Defaults to the original collection's type map.
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults to
+         the original collection's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
index e8077c73..09173500 100644
--- a/source/reference/method/MongoDBCollection__construct.txt
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -19,15 +19,65 @@ Definition
 
    .. code-block:: php
 
-      function __construct(MongoDB\Driver\Manager $manager, string $databaseName, string $collectionName, array $options = [])
+      function __construct(
+          MongoDB\Driver\Manager $manager,
+          string $databaseName,
+          string $collectionName,
+          array $options = []
+      )
 
    This constructor has the following parameters:
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-construct-param.rst
+``$manager`` : :php:`MongoDB\\Driver\\Manager `
+  The :php:`Manager ` instance from the driver. The
+  manager maintains connections between the driver and your MongoDB instances.
 
-   The ``$options`` parameter supports the following options:
+``$databaseName`` : string
+  The name of the database.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-construct-option.rst
+``$collectionName`` : string
+  The name of the collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the manager's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the manager's read preference.
+
+     * - typeMap
+       - array
+       - Default :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
+
+         .. code-block:: php
+
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults
+         to the manager's write concern.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBDatabase-aggregate.txt b/source/reference/method/MongoDBDatabase-aggregate.txt
index a7884bfe..96d409ae 100644
--- a/source/reference/method/MongoDBDatabase-aggregate.txt
+++ b/source/reference/method/MongoDBDatabase-aggregate.txt
@@ -24,15 +24,105 @@ Definition
 
    .. code-block:: php
 
-      function aggregate(array $pipeline, array $options = []): Traversable
+      function aggregate(
+          array $pipeline,
+          array $options = []
+      ): Traversable
 
-   This method has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBDatabase-method-aggregate-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-aggregate-option.rst
+``$pipeline`` : array
+  Specifies an :manual:`aggregation pipeline `
+  operation.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, aggregation
+         stages can write data to the ``_tmp`` sub-directory in the ``dbPath``
+         directory.
+
+     * - batchSize
+       - integer
+       - Specifies the batch size for the cursor, which will apply to both the
+         initial ``aggregate`` command and any subsequent ``getMore`` commands.
+         This determines the maximum number of documents to return in each
+         response from the server.
+
+         A batchSize of ``0`` is special in that and will only apply to the
+         initial ``aggregate`` command; subsequent ``getMore`` commands will use
+         the server's default batch size. This may be useful for quickly
+         returning a cursor or failure from ``aggregate`` without doing
+         significant server-side work.
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+         This only applies when using the :ref:`$out ` and
+         :ref:`$out ` stages.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         The comment can be any valid BSON type for server versions 4.4 and
+         above. Earlier server versions only support string values.
+
+     * - explain
+       - boolean
+       - Specifies whether or not to return the information on the processing of
+         the pipeline.
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.9
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/database-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/database-option-readPreference.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index 6853daad..50ebfe79 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -21,15 +21,41 @@ Definition
 
    .. code-block:: php
 
-      function command(array|object $command, array $options = []): MongoDB\Driver\Cursor
+      function command(
+          array|object $command,
+          array $options = []
+      ): MongoDB\Driver\Cursor
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$command`` : array|object
+  The :manual:`database command ` document.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/database-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-command-param.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-command-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 56129b97..2351f5d3 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -19,7 +19,10 @@ Definition
 
    .. code-block:: php
 
-      function createCollection(string $collectionName, array $options = []): array|object
+      function createCollection(
+          string $collectionName,
+          array $options = []
+      ): array|object
 
    MongoDB creates collections implicitly when you first reference the
    collection in a command, such as when inserting a document into a new
@@ -33,17 +36,294 @@ Definition
    :manual:`document validation criteria `,
    or configure your storage engine or indexing options.
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection to create.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. note::
+
+     Not all options are available on all versions of MongoDB. Refer to the
+     :manual:`create ` command reference in the
+     MongoDB manual for compatibility considerations.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - autoIndexId
+       - boolean
+       - Specify ``false`` to disable the automatic creation of an index on the
+         ``_id`` field.
+
+         .. important::
+
+            For replica sets, do not set ``autoIndexId`` to ``false``.
+
+         .. deprecated:: 1.4
+            This option has been deprecated since MongoDB 3.2. As of MongoDB
+            4.0, this option cannot be ``false`` when creating a replicated
+            collection (i.e. a collection outside of the ``local`` database in
+            any mongod mode).
+
+     * - capped
+       - boolean
+       - To create a capped collection, specify ``true``. If you specify
+         ``true``, you must also set a maximum size in the ``size`` option.
+
+     * - changeStreamPreAndPostImages
+       - document
+       - Used to configure support for pre- and post-images in change streams.
+         See the :manual:`create ` command
+         documentation for more information.
+
+         .. include:: /includes/extracts/option-requires-6.0.rst
+
+         .. versionadded:: 1.13
+
+     * - clusteredIndex
+       - document
+       - A clustered index specification. See
+         :manual:`Clustered Collections ` or the
+         :manual:`create ` command documentation for
+         more information.
+
+         .. include:: /includes/extracts/option-requires-5.3.rst
+
+         .. versionadded:: 1.13
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - encryptedFields
+       - document
+       - A document describing encrypted fields for queryable encryption. If
+         omitted, the ``encryptedFieldsMap`` option within the
+         ``autoEncryption`` driver option will be consulted. See
+         `Field Encryption and Queryability `_
+         in the MongoDB manual for more information.
+
+         .. include:: /includes/extracts/option-requires-7.0.rst
+
+         .. versionadded:: 1.13
+
+     * - expireAfterSeconds
+       - integer
+       - Used to automatically delete documents in time series collections. See
+         the :manual:`create ` command documentation
+         for more information.
+
+         .. include:: /includes/extracts/option-requires-5.0.rst
+
+         .. versionadded:: 1.9
+
+     * - flags
+       - integer
+       - Available for the MMAPv1 storage engine only to set the
+         ``usePowerOf2Sizes`` and ``noPadding`` flags.
+
+         The library provides constants that you can combine with a
+         :php:`bitwise OR operator ` to set the flag
+         values:
+
+         - ``MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES``: ``1``
+         - ``MongoDB\Operation\CreateCollection::NO_PADDING``: ``2``
+
+         Defaults to ``1``.
+
+         .. note::
+
+            MongoDB 3.0 and later ignores the ``usePowerOf2Sizes`` flag. See
+            :manual:`collMod ` and
+            :manual:`db.createCollection()
+            ` for more information.
+
+     * - indexOptionDefaults
+       - array|object
+       - Allows users to specify a default configuration for indexes when
+         creating a collection.
+
+         The ``indexOptionDefaults`` option accepts a ``storageEngine``
+         document, which should take the following form:
+
+         .. code-block:: none
+
+            { :  }
+
+         Storage engine configurations specified when creating indexes are
+         validated and logged to the :term:`oplog` during replication to support
+         replica sets with members that use different storage engines.
+
+     * - max
+       - integer
+       - The maximum number of documents allowed in the capped collection. The
+         ``size`` option takes precedence over this limit. If a capped
+         collection reaches the ``size`` limit before it reaches the maximum
+         number of documents, MongoDB removes old documents. If you prefer to
+         use the ``max`` limit, ensure that the ``size`` limit, which is
+         required for a capped collection, is sufficient to contain the maximum
+         number of documents.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - pipeline
+       - array
+       - An array that consists of the aggregation pipeline stage(s), which will
+         be applied to the collection or view specified by ``viewOn``. See the
+         :manual:`create ` command documentation for
+         more information.
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - size
+       - integer
+       - Specify a maximum size in bytes for a capped collection. Once a capped
+         collection reaches its maximum size, MongoDB removes the older
+         documents to make space for the new documents. The ``size`` option is
+         required for capped collections and ignored for other collections.
+
+     * - storageEngine
+       - array|object
+       - Available for the WiredTiger storage engine only.
+
+         Allows users to specify configuration to the storage engine on a
+         per-collection basis when creating a collection. The value of the
+         ``storageEngine`` option should take the following form:
+
+         .. code-block:: none
+
+            { :  }
+
+         Storage engine configurations specified when creating collections are
+         validated and logged to the :term:`oplog` during replication to support
+         replica sets with members that use different storage engines.
+
+     * - timeseries
+       - array|object
+       - An object containing options for creating time series collections. See
+         the :manual:`create ` command documentation
+         for supported options.
+
+         .. include:: /includes/extracts/option-requires-5.0.rst
+
+         .. versionadded:: 1.9
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
+
+         This will be used for the returned command result document.
+
+     * - validationAction
+       - string
+       - Determines whether to ``error`` on invalid documents or just ``warn``
+         about the violations but allow invalid documents to be inserted.
+
+         .. important::
+
+            Validation of documents only applies to those documents as
+            determined by the ``validationLevel``.
+
+         .. list-table::
+            :header-rows: 1
+
+            * - ``validationAction``
+              - Description
+
+            * - ``"error"``
+              - **Default**. Documents must pass validation before the write
+                occurs. Otherwise, the write operation fails.
+
+            * - ``"warn"``
+              - Documents do not have to pass validation. If the document fails
+                validation, the write operation logs the validation failure.
+
+     * - validationLevel
+       - string
+       - Determines how strictly MongoDB applies the validation rules to
+         existing documents during an update.
+
+         .. list-table::
+            :header-rows: 1
+
+            * - ``validationLevel``
+              - Description
+
+            * - ``"off"``
+              - No validation for inserts or updates.
+
+            * - ``"strict"``
+              - **Default**. Apply validation rules to all inserts and all updates.
+
+            * - ``"moderate"``
+              - Apply validation rules to inserts and to updates on existing
+                *valid* documents. Do not apply rules to updates on existing
+                *invalid* documents.
+
+     * - validator
+       - array|object
+       - Allows users to specify :manual:`validation rules or expressions
+         ` for the collection. For more information,
+         see :manual:`Document Validation ` in the
+         MongoDB manual.
+
+         The ``validator`` option takes an array that specifies the validation
+         rules or expressions. You can specify the expressions using the same
+         operators as MongoDB's
+         :manual:`query operators ` with the
+         exception of :query:`$geoNear`, :query:`$near`, :query:`$nearSphere`,
+         :query:`$text`, and :query:`$where`.
+
+         .. note::
+
+            - Validation occurs during updates and inserts. Existing documents
+              do not undergo validation checks until modification.
+
+            - You cannot specify a validator for collections in the ``admin``,
+              ``local``, and ``config`` databases.
+
+            - You cannot specify a validator for ``system.*`` collections.
+
+     * - viewOn
+       - string
+       - The name of the source collection or view from which to create the view.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-param.rst
+         .. note::
 
-   The ``$options`` parameter supports the following options:
+            The name is not the full namespace of the collection or view (i.e.
+            it does not include the database name). Views must be created in the
+            same databases as the source collection or view.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-option.rst
+            .. versionadded:: 1.13
 
-   Note that not all options are available on all versions of MongoDB. Refer to
-   the :manual:`create ` command reference in the
-   MongoDB manual for compatibility considerations.
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
index 64c643f0..390f99c6 100644
--- a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
@@ -21,7 +21,13 @@ Definition
 
    .. code-block:: php
 
-      function createEncryptedCollection(string $collectionName, MongoDB\Driver\ClientEncryption $clientEncryption, string $kmsProvider, ?array $masterKey, array $options): array
+      function createEncryptedCollection(
+          string $collectionName,
+          MongoDB\Driver\ClientEncryption $clientEncryption,
+          string $kmsProvider,
+          ?array $masterKey,
+          array $options
+      ): array
 
    This method will automatically create data keys for any encrypted fields
    where ``keyId`` is ``null``. Data keys will be created using
@@ -34,13 +40,33 @@ Definition
    :phpclass:`MongoDB\\Client` objects. Users must configure auto encryption
    after creating the encrypted collection with ``createEncryptedCollection()``.
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the encrypted collection to create.
+
+``$clientEncryption`` : :php:`MongoDB\\Driver\\ClientEncryption `
+  The ClientEncryption object used to create data keys.
+
+``$kmsProvider`` : string
+  KMS provider (e.g. "local", "aws") that will be used to encrypt new data keys.
+  This corresponds to the ``$kmsProvider`` parameter for
+  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+
+``$masterKey`` : array|null
+  KMS-specific key options that will be used to encrypt new data keys. This
+  corresponds to the ``masterKey`` option for
+  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+
+  If ``$kmsProvider`` is "local", this should be ``null``.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-createEncryptedCollection-param.rst
+``$options`` : array
+  An array specifying the desired options.
 
-   The ``$options`` parameter supports the same options as
-   :phpmethod:`MongoDB\\Database::createCollection()`. The ``encryptedFields``
-   option is required.
+  The ``$options`` parameter supports the same options as
+  :phpmethod:`MongoDB\\Database::createCollection()`. The ``encryptedFields``
+  option is required.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index eae1bb6b..457fad1a 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -21,13 +21,43 @@ Definition
 
       function drop(array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-drop-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-drop-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 028e63f0..018f3cca 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -19,15 +19,71 @@ Definition
 
    .. code-block:: php
 
-      function dropCollection(string $collectionName, array $options = []): array|object
+      function dropCollection(
+          string $collectionName,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection to drop.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - encryptedFields
+       - array|object
+       - A document describing encrypted fields for queryable encryption. If
+         omitted, the ``encryptedFieldsMap`` option within the
+         ``autoEncryption`` driver option will be consulted. If
+         ``encryptedFieldsMap`` was defined but does not specify this
+         collection, the library will make a final attempt to consult the
+         server-side value for ``encryptedFields``. See
+         `Field Encryption and Queryability `_
+         in the MongoDB manual for more information.
+
+         .. note::
+
+            This option is not passed to the
+            :manual:`drop ` command. The library uses
+            it to determine related metadata collections that should be dropped
+            in addition to an encrypted collection.
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-listCollectionNames.txt b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
index b6eaa4ce..53814f72 100644
--- a/source/reference/method/MongoDBDatabase-listCollectionNames.txt
+++ b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
@@ -23,13 +23,53 @@ Definition
 
       function listCollectionNames(array $options = []): Iterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedCollections
+       - boolean
+       - A flag that determines which collections are returned based on the user
+         privileges when access control is enabled. For more information, see
+         the :manual:`listCollections `
+         command documentation.
+
+         For servers < 4.0, this option is ignored.
+
+         .. versionadded:: 1.12
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of collections.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-param.rst
+         You can specify a query expression for collection fields (e.g.
+         ``name``, ``options``).
 
-   The ``$options`` parameter supports the following options:
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-option.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index 421b6cab..d66b6a5f 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -21,13 +21,55 @@ Definition
 
       function listCollections(array $options = []): MongoDB\Model\CollectionInfoIterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedCollections
+       - boolean
+       - A flag that determines which collections are returned based on the user
+         privileges when access control is enabled. For more information, see
+         the :manual:`listCollections `
+         command documentation.
+
+         For servers < 4.0, this option is ignored.
+
+         .. versionadded:: 1.12
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of collections.
+
+         You can specify a query expression for collection fields (e.g.
+         ``name``, ``options``).
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-param.rst
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-option.rst
+         .. versionadded:: 1.3
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-modifyCollection.txt b/source/reference/method/MongoDBDatabase-modifyCollection.txt
index 86c1ff52..0a756b01 100644
--- a/source/reference/method/MongoDBDatabase-modifyCollection.txt
+++ b/source/reference/method/MongoDBDatabase-modifyCollection.txt
@@ -22,15 +22,53 @@ Definition
 
    .. code-block:: php
 
-      function modifyCollection(string $collectionName, array $collectionOptions, array $options = []): array|object
+      function modifyCollection(
+          string $collectionName,
+          array $collectionOptions,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection or view to modify.
+
+``$collectionOptions`` : array
+  Collection or view options to assign.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-modifyCollection-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-modifyCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-renameCollection.txt b/source/reference/method/MongoDBDatabase-renameCollection.txt
index 8bbe5b8e..778dc10a 100644
--- a/source/reference/method/MongoDBDatabase-renameCollection.txt
+++ b/source/reference/method/MongoDBDatabase-renameCollection.txt
@@ -21,15 +21,65 @@ Definition
 
    .. code-block:: php
 
-      function renameCollection(string $fromCollectionName, string $toCollectionName, ?string $toDatabaseName = null, array $options = []): array|object
+      function renameCollection(
+          string $fromCollectionName,
+          string $toCollectionName,
+          ?string $toDatabaseName = null,
+          array $options = []
+      ): array|object
+
+Parameters
+----------
+
+``$fromCollectionName`` : string
+  The name of the collection to rename.
+
+``$toCollectionName`` : string
+  The new name of the collection.
+
+``$toDatabaseName`` : string
+  The new database name of the collection. If a new database name is not
+  specified, the current database will be used. If the new name specifies a
+  different database, the command copies the collection to the new database
+  and drops the source collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - dropTarget
+       - boolean
+       - If ``true``, MongoDB will drop the target before renaming the
+         collection. The default value is ``false``.
 
-   This method has the following parameters:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-renameCollection-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-renameCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 14885410..887d4a4d 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -19,15 +19,47 @@ Definition
 
    .. code-block:: php
 
-      function selectCollection(string $collectionName, array $options = []): MongoDB\Collection
+      function selectCollection(
+          string $collectionName,
+          array $options = []
+      ): MongoDB\Collection
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection to select.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the database's read concern.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the database's read preference.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for collection operations. Defaults to the
+         database's type map.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults to
+         the database's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index f9390627..0d115d9b 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -21,13 +21,56 @@ Definition
 
       function selectGridFSBucket(array $options = []): MongoDB\GridFS\Bucket
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bucketName
+       - string
+       - The bucket name, which will be used as a prefix for the files and
+         chunks collections. Defaults to ``"fs"``.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
+
+         Defaults to ``false``.
+
+         .. versionadded: 1.4
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for bucket operations. Defaults to the
+         database's read concern.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for bucket operations. Defaults to
+         the database's read concern.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for bucket operations. Defaults to the
+         database's type map.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for bucket operations. Defaults to the
+         database's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-watch.txt b/source/reference/method/MongoDBDatabase-watch.txt
index 7ff19b73..c79656ec 100644
--- a/source/reference/method/MongoDBDatabase-watch.txt
+++ b/source/reference/method/MongoDBDatabase-watch.txt
@@ -22,15 +22,90 @@ Definition
 
    .. code-block:: php
 
-      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+      function watch(
+          array $pipeline = [],
+          array $options = []
+      ): MongoDB\ChangeStream
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array|object
+  The pipeline of stages to append to an initial ``$changeStream`` stage.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - batchSize
+       - integer
+       - .. include:: /includes/extracts/watch-option-batchSize.rst
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+  
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - fullDocument
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocument.rst
+
+     * - fullDocumentBeforeChange
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocumentBeforeChange.rst
+
+     * - maxAwaitTimeMS
+       - integer
+       - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/database-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/database-option-readPreference.rst
+
+         This is used for both the initial change stream aggregation and for
+         server selection during an automatic resume.
+
+     * - resumeAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-resumeAfter.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - showExpandedEvents
+       - boolean
+       - .. include:: /includes/extracts/watch-option-showExpandedEvents.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-watch-param.rst
+     * - startAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-startAfter.rst
 
-   The ``$options`` parameter supports the following options:
+     * - startAtOperationTime
+       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-watch-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index 6f732eac..fc5d88ec 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -21,13 +21,41 @@ Definition
 
       function withOptions(array $options = []): MongoDB\Database
 
-   This method has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-option.rst
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for database operations. Defaults to
+         the original database's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for database operations. Defaults to
+         the original database's read preference.
+
+     * - typeMap
+       - array
+       - The :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. Defaults to the original database's type map.
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for database operations. Defaults to
+         the original database's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt
index 2d3e7f57..0a715e99 100644
--- a/source/reference/method/MongoDBDatabase__construct.txt
+++ b/source/reference/method/MongoDBDatabase__construct.txt
@@ -19,15 +19,62 @@ Definition
 
    .. code-block:: php
 
-      function __construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = [])
+      function __construct(
+          MongoDB\Driver\Manager $manager,
+          string $databaseName,
+          array $options = []
+      )
 
-   This constructor has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBDatabase-method-construct-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-construct-option.rst
+``$manager`` : :php:`MongoDB\\Driver\\Manager `
+  The :php:`Manager ` instance from the driver. The
+  manager maintains connections between the driver and your MongoDB instances.
+
+``$databaseName`` : string
+  The name of the database.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for database operations. Defaults to
+         the manager's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for database operations. Defaults to
+         the manager's read preference.
+
+     * - typeMap
+       - array
+       - Default :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
+
+         .. code-block:: php
+
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for database operations. Defaults to
+         the manager's write concern.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index 53cef6f9..c888a716 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -21,9 +21,11 @@ Definition
 
       function __get(string $collectionName): MongoDB\Collection
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-get-param.rst
+``$collectionName`` : string
+  The name of the database to select.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-delete.txt b/source/reference/method/MongoDBGridFSBucket-delete.txt
index b063337e..731fb4e4 100644
--- a/source/reference/method/MongoDBGridFSBucket-delete.txt
+++ b/source/reference/method/MongoDBGridFSBucket-delete.txt
@@ -21,9 +21,11 @@ Definition
 
       function delete($id): void
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-delete-param.rst
+``$id`` : mixed
+  The ``_id`` of the file to delete.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
index 2f2aa5da..917f03b5 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
@@ -22,9 +22,14 @@ Definition
 
       function downloadToStream($id, $destination): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$id`` : mixed
+  The ``_id`` of the file to download.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStream-param.rst
+``$destination`` : resource
+  Writable stream, to which the GridFS file's contents will be written.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index acc236f5..8bd4a1d6 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -20,15 +20,47 @@ Definition
 
    .. code-block:: php
 
-      function downloadToStreamByName(string $filename, resource $destination, array $options = []): void
+      function downloadToStreamByName(
+          string $filename,
+          resource $destination,
+          array $options = []
+      ): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to download.
+
+``$destination`` : resource
+  Writable stream, to which the GridFS file's contents will be written.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - revision
+       - integer
+       - The revision of the file to retrieve. Files with the same ``filename``
+         will be differentiated by their ``uploadDate`` field.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-param.rst
+         Revision numbers are defined as follows:
 
-   The ``$options`` parameter supports the following options:
+         - 0 = the original stored file
+         - 1 = the first revision
+         - 2 = the second revision
+         - etc...
+         - -2 = the second most recent revision
+         - -1 = the most recent revision
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-option.rst
+         Defaults to -1 (i.e. the most recent revision).
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index e0a4e662..d112dd66 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -19,15 +19,205 @@ Definition
 
    .. code-block:: php
 
-      function find(array|object $filter = [], array $options = []): MongoDB\Driver\Cursor
+      function find(
+          array|object $filter = [],
+          array $options = []
+      ): MongoDB\Driver\Cursor
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - batchSize
+       - integer
+       - The number of documents to return in the first batch. Defaults to
+         ``101``. A batchSize of ``0`` means that the cursor will be
+         established, but no documents will be returned in the first batch.
+
+         Unlike the previous wire protocol version, a batchSize of ``1`` for the
+         :dbcommand:`find` command does not close the cursor.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - cursorType
+       - integer
+       - Indicates the type of cursor to use. ``cursorType`` supports the
+         following values:
+
+         - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
+         - ``MongoDB\Operation\Find::TAILABLE``
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - limit
+       - integer
+       - The maximum number of documents to return. If unspecified, then
+         defaults to no limit. A limit of ``0`` is equivalent to setting no
+         limit.
+
+         A negative limit is similar to a positive limit but closes the cursor
+         after returning a single batch of results. As such, with a negative
+         limit, if the limited result set does not fit into a single batch, the
+         number of documents received will be less than the specified limit. By
+         passing a negative limit, the client indicates to the server that it
+         will not ask for a subsequent batch via getMore.
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxAwaitTimeMS
+       - integer
+       - Positive integer denoting the time limit in milliseconds for the server
+         to block a getMore operation if no data is available. This option
+         should only be used if cursorType is TAILABLE_AWAIT.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - noCursorTimeout
+       - boolean
+       - Prevents the server from timing out idle cursors after an inactivity
+         period (10 minutes).
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/bucket-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/bucket-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
+     * - snapshot
+       - boolean
+       - Prevents the cursor from returning a document more than once because of
+         an intervening write operation.
 
-   The ``$options`` parameter supports the following options:
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-find-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/bucket-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
index f126448d..1ff9f258 100644
--- a/source/reference/method/MongoDBGridFSBucket-findOne.txt
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -20,15 +20,156 @@ Definition
 
    .. code-block:: php
 
-      function findOne(array|object $filter = [], array $options = []): array|object|null
+      function findOne(
+          array|object $filter = [],
+          array $options = []
+      ): array|object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/bucket-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/bucket-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/bucket-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-findOne-option.rst
+         This will be used for the returned result document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index f8d633ed..fa8625f9 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -21,9 +21,11 @@ Definition
 
       function getFileDocumentForStream(resource $stream): array|object
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileDocumentForStream-param.rst
+``$stream`` : resource
+  The GridFS stream resource.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index f88dc885..b42ab19b 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -21,9 +21,11 @@ Definition
 
       function getFileIdForStream(resource $stream): mixed
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileIdForStream-param.rst
+``$stream`` : resource
+  The GridFS stream resource.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
index 85f2150a..9118cecc 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -21,9 +21,11 @@ Definition
 
       function openDownloadStream($id): resource
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStream-param.rst
+``$id`` : mixed
+  The ``_id`` of the file to download.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
index cb3a336e..4c0b525d 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -19,15 +19,43 @@ Definition
 
    .. code-block:: php
 
-      function openDownloadStreamByName(string $filename, array $options = []): resource
+      function openDownloadStreamByName(
+          string $filename,
+          array $options = []
+      ): resource
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to download.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - revision
+       - integer
+       - The revision of the file to retrieve. Files with the same ``filename``
+         will be differentiated by their ``uploadDate`` field.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-param.rst
+         Revision numbers are defined as follows:
 
-   The ``$options`` parameter supports the following options:
+         - 0 = the original stored file
+         - 1 = the first revision
+         - 2 = the second revision
+         - etc...
+         - -2 = the second most recent revision
+         - -1 = the most recent revision
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-option.rst
+         Defaults to -1 (i.e. the most recent revision).
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 348b325f..2870b544 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -19,15 +19,50 @@ Definition
 
    .. code-block:: php
 
-      function openUploadStream(string $filename, array $options = []): resource
+      function openUploadStream(
+          string $filename,
+          array $options = []
+      ): resource
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to create.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - _id
+       - mixed
+       - Value to use as the file document identifier. Defaults to a new
+         :php:`MongoDB\\BSON\\ObjectId ` object.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes``
+         option.
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-param.rst
+         Defaults to ``false``.
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded: 1.4
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-option.rst
+     * - metadata
+       - array|object
+       - User data for the ``metadata`` field of the file document. If not
+         specified, the ``metadata`` field will not be set on the file document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt
index 888d1ae3..20d9c1d7 100644
--- a/source/reference/method/MongoDBGridFSBucket-rename.txt
+++ b/source/reference/method/MongoDBGridFSBucket-rename.txt
@@ -21,9 +21,14 @@ Definition
 
       function rename($id, string $newFilename): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$id`` : mixed
+  The ``_id`` of the file to rename.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-rename-param.rst
+``$newFilename`` : string
+  The new ``filename`` value.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index 18e5944b..89cb8d2f 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -19,15 +19,54 @@ Definition
 
    .. code-block:: php
 
-      function uploadFromStream(string $filename, resource $source, array $options = []): mixed
+      function uploadFromStream(
+          string $filename,
+          resource $source,
+          array $options = []
+      ): mixed
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to create.
+
+``$source`` : resource
+  Readable stream, from which the new GridFS file's contents will be read.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - _id
+       - mixed
+       - Value to use as the file document identifier. Defaults to a new
+         :php:`MongoDB\\BSON\\ObjectId ` object.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes``
+         option.
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-param.rst
+         Defaults to ``false``.
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded: 1.4
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-option.rst
+     * - metadata
+       - array|object
+       - User data for the ``metadata`` field of the file document. If not
+         specified, the ``metadata`` field will not be set on the file document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index c6c309bb..25271e0c 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -19,15 +19,79 @@ Definition
 
    .. code-block:: php
 
-      function __construct(MongoDB\Driver\Manager $manager, string $databaseName, array $options = [])
+      function __construct(
+          MongoDB\Driver\Manager $manager,
+          string $databaseName,
+          array $options = []
+      )
 
-   This constructor has the following parameters:
+Parameters
+----------
+
+``$manager`` : :php:`MongoDB\\Driver\\Manager `
+  The :php:`Manager ` instance from the driver. The
+  manager maintains connections between the driver and your MongoDB instances.
+
+``$databaseName`` : string
+  The name of the database.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bucketName
+       - string
+       - The bucket name, which will be used as a prefix for the files and
+         chunks collections. Defaults to ``"fs"``.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
+
+         Defaults to ``false``.
+
+         .. versionadded: 1.4
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for bucket operations. Defaults to the
+         manager's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for bucket operations. Defaults to
+         the manager's read preference.
+
+     * - typeMap
+       - array
+       - Default :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-param.rst
+         .. code-block:: php
 
-   The ``$options`` parameter supports the following options:
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for bucket operations. Defaults to the
+         manager's write concern.
 
 Errors/Exceptions
 -----------------
diff --git a/source/tutorial/modeling-bson-data.txt b/source/tutorial/modeling-bson-data.txt
index 24486d1e..5cf09197 100644
--- a/source/tutorial/modeling-bson-data.txt
+++ b/source/tutorial/modeling-bson-data.txt
@@ -10,6 +10,7 @@ Modeling BSON Data
    :depth: 2
    :class: singlecol
 
+.. _php-type-map:
 
 Type Maps
 ---------
@@ -155,7 +156,6 @@ The same document in the MongoDB shell might display as:
 
    :php:`MongoDB\\BSON\\Persistable ` may only be used
    for root and embedded BSON documents. It may not be used for BSON arrays.
-.. _php-type-map:
 
 Working with Enums
 ------------------

From 37ed29d2173bb5df26664b0320a2be3ba2d6fdea Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 22 Jan 2024 14:42:18 -0500
Subject: [PATCH 298/321] PHPLIB-1275: Replace apiargs usage in docs with
 extracts (#1219)

This backports 8f562a701c908b6b7e09e344062094d245050fd3 from master to v1.17
---
 .../apiargs-MongoDBClient-common-option.yaml  |  34 --
 ...Client-method-construct-driverOptions.yaml | 189 ---------
 ...-MongoDBClient-method-construct-param.yaml |  51 ---
 ...t-method-createClientEncryption-param.yaml |   4 -
 ...goDBClient-method-dropDatabase-option.yaml |  25 --
 ...ngoDBClient-method-dropDatabase-param.yaml |  10 -
 ...piargs-MongoDBClient-method-get-param.yaml |   6 -
 ...oDBClient-method-listDatabases-option.yaml |  47 ---
 ...goDBClient-method-listDatabases-param.yaml |   4 -
 ...Client-method-selectCollection-option.yaml |  27 --
 ...BClient-method-selectCollection-param.yaml |  16 -
 ...DBClient-method-selectDatabase-option.yaml |  27 --
 ...oDBClient-method-selectDatabase-param.yaml |  10 -
 ...rgs-MongoDBClient-method-watch-option.yaml |  71 ----
 ...args-MongoDBClient-method-watch-param.yaml |   8 -
 ...iargs-MongoDBCollection-common-option.yaml |  86 -----
 ...piargs-MongoDBCollection-common-param.yaml |  33 --
 ...oDBCollection-method-aggregate-option.yaml |  72 ----
 ...goDBCollection-method-aggregate-param.yaml |  14 -
 ...oDBCollection-method-bulkWrite-option.yaml |  44 ---
 ...goDBCollection-method-bulkWrite-param.yaml |  37 --
 ...oDBCollection-method-construct-option.yaml |  25 --
 ...goDBCollection-method-construct-param.yaml |  16 -
 ...MongoDBCollection-method-count-option.yaml |  64 ---
 ...-MongoDBCollection-method-count-param.yaml |  11 -
 ...llection-method-countDocuments-option.yaml |  56 ---
 ...ollection-method-countDocuments-param.yaml |  11 -
 ...BCollection-method-createIndex-option.yaml | 117 ------
 ...DBCollection-method-createIndex-param.yaml |  20 -
 ...ollection-method-createIndexes-option.yaml |  29 --
 ...Collection-method-createIndexes-param.yaml |  23 --
 ...ction-method-createSearchIndex-option.yaml |  17 -
 ...ection-method-createSearchIndex-param.yaml |  14 -
 ...ion-method-createSearchIndexes-option.yaml |   4 -
 ...tion-method-createSearchIndexes-param.yaml |  21 -
 ...DBCollection-method-deleteMany-option.yaml |  38 --
 ...oDBCollection-method-deleteMany-param.yaml |  11 -
 ...oDBCollection-method-deleteOne-option.yaml |  38 --
 ...goDBCollection-method-deleteOne-param.yaml |  11 -
 ...goDBCollection-method-distinct-option.yaml |  37 --
 ...ngoDBCollection-method-distinct-param.yaml |  20 -
 ...-MongoDBCollection-method-drop-option.yaml |  31 --
 ...s-MongoDBCollection-method-drop-param.yaml |   4 -
 ...oDBCollection-method-dropIndex-option.yaml |  31 --
 ...goDBCollection-method-dropIndex-param.yaml |  15 -
 ...BCollection-method-dropIndexes-option.yaml |  29 --
 ...DBCollection-method-dropIndexes-param.yaml |   4 -
 ...lection-method-dropSearchIndex-option.yaml |   4 -
 ...llection-method-dropSearchIndex-param.yaml |  13 -
 ...n-method-estimateDocumentCount-option.yaml |  25 --
 ...on-method-estimateDocumentCount-param.yaml |   4 -
 ...ngoDBCollection-method-explain-option.yaml |  31 --
 ...ongoDBCollection-method-explain-param.yaml |  13 -
 ...-MongoDBCollection-method-find-option.yaml | 263 -------------
 ...s-MongoDBCollection-method-find-param.yaml |  11 -
 ...ngoDBCollection-method-findOne-option.yaml |  84 ----
 ...ongoDBCollection-method-findOne-param.yaml |  11 -
 ...ection-method-findOneAndDelete-option.yaml |  56 ---
 ...lection-method-findOneAndDelete-param.yaml |  11 -
 ...ction-method-findOneAndReplace-option.yaml |  77 ----
 ...ection-method-findOneAndReplace-param.yaml |  15 -
 ...ection-method-findOneAndUpdate-option.yaml |  83 ----
 ...lection-method-findOneAndUpdate-param.yaml |  15 -
 ...DBCollection-method-insertMany-option.yaml |  27 --
 ...oDBCollection-method-insertMany-param.yaml |  13 -
 ...oDBCollection-method-insertOne-option.yaml |  23 --
 ...goDBCollection-method-insertOne-param.yaml |  13 -
 ...BCollection-method-listIndexes-option.yaml |  19 -
 ...DBCollection-method-listIndexes-param.yaml |   4 -
 ...ction-method-listSearchIndexes-option.yaml |  44 ---
 ...ection-method-listSearchIndexes-param.yaml |   4 -
 ...oDBCollection-method-mapReduce-option.yaml | 113 ------
 ...goDBCollection-method-mapReduce-param.yaml |  46 ---
 ...ongoDBCollection-method-rename-option.yaml |  33 --
 ...MongoDBCollection-method-rename-param.yaml |  25 --
 ...DBCollection-method-replaceOne-option.yaml |  46 ---
 ...oDBCollection-method-replaceOne-param.yaml |  15 -
 ...DBCollection-method-updateMany-option.yaml |  52 ---
 ...oDBCollection-method-updateMany-param.yaml |  15 -
 ...oDBCollection-method-updateOne-option.yaml |  52 ---
 ...goDBCollection-method-updateOne-param.yaml |  15 -
 ...ction-method-updateSearchIndex-option.yaml |   4 -
 ...ection-method-updateSearchIndex-param.yaml |  25 --
 ...MongoDBCollection-method-watch-option.yaml |  73 ----
 ...-MongoDBCollection-method-watch-param.yaml |   8 -
 ...BCollection-method-withOptions-option.yaml |  27 --
 ...DBCollection-method-withOptions-param.yaml |   4 -
 ...apiargs-MongoDBDatabase-common-option.yaml |  36 --
 ...ngoDBDatabase-method-aggregate-option.yaml |  64 ---
 ...ongoDBDatabase-method-aggregate-param.yaml |  14 -
 ...MongoDBDatabase-method-command-option.yaml |  17 -
 ...-MongoDBDatabase-method-command-param.yaml |  13 -
 ...ngoDBDatabase-method-construct-option.yaml |  25 --
 ...ongoDBDatabase-method-construct-param.yaml |  12 -
 ...tabase-method-createCollection-option.yaml | 363 ------------------
 ...atabase-method-createCollection-param.yaml |  10 -
 ...ethod-createEncryptedCollection-param.yaml |  47 ---
 ...gs-MongoDBDatabase-method-drop-option.yaml |  25 --
 ...rgs-MongoDBDatabase-method-drop-param.yaml |   4 -
 ...Database-method-dropCollection-option.yaml |  31 --
 ...BDatabase-method-dropCollection-param.yaml |  10 -
 ...args-MongoDBDatabase-method-get-param.yaml |   6 -
 ...atabase-method-listCollections-option.yaml |  46 ---
 ...Database-method-listCollections-param.yaml |   4 -
 ...tabase-method-modifyCollection-option.yaml |  23 --
 ...atabase-method-modifyCollection-param.yaml |  20 -
 ...tabase-method-renameCollection-option.yaml |  33 --
 ...atabase-method-renameCollection-param.yaml |  34 --
 ...tabase-method-selectCollection-option.yaml |  27 --
 ...atabase-method-selectCollection-param.yaml |  10 -
 ...base-method-selectGridFSBucket-option.yaml |  52 ---
 ...abase-method-selectGridFSBucket-param.yaml |   4 -
 ...s-MongoDBDatabase-method-watch-option.yaml |  71 ----
 ...gs-MongoDBDatabase-method-watch-param.yaml |   8 -
 ...oDBDatabase-method-withOptions-option.yaml |  27 --
 ...goDBDatabase-method-withOptions-param.yaml |   4 -
 ...rgs-MongoDBGridFSBucket-common-option.yaml |  61 ---
 ...args-MongoDBGridFSBucket-common-param.yaml |  39 --
 ...BGridFSBucket-method-construct-option.yaml |  50 ---
 ...DBGridFSBucket-method-construct-param.yaml |  12 -
 ...ngoDBGridFSBucket-method-delete-param.yaml |   6 -
 ...SBucket-method-downloadToStream-param.yaml |  10 -
 ...-method-downloadToStreamByName-option.yaml |   4 -
 ...t-method-downloadToStreamByName-param.yaml |  14 -
 ...ongoDBGridFSBucket-method-find-option.yaml |  76 ----
 ...oDBGridFSBucket-method-findOne-option.yaml |  46 ---
 ...method-getFileDocumentForStream-param.yaml |   4 -
 ...ucket-method-getFileIdForStream-param.yaml |   4 -
 ...ucket-method-openDownloadStream-param.yaml |   6 -
 ...ethod-openDownloadStreamByName-option.yaml |   4 -
 ...method-openDownloadStreamByName-param.yaml |  10 -
 ...Bucket-method-openUploadStream-option.yaml |  18 -
 ...SBucket-method-openUploadStream-param.yaml |  10 -
 ...ngoDBGridFSBucket-method-rename-param.yaml |  15 -
 ...Bucket-method-uploadFromStream-option.yaml |  18 -
 ...SBucket-method-uploadFromStream-param.yaml |  19 -
 source/includes/apiargs-aggregate-option.yaml |  43 ---
 source/includes/apiargs-common-option.yaml    | 124 ------
 source/includes/apiargs-common-param.yaml     |  42 --
 .../apiargs-dropCollection-option.yaml        |  21 -
 .../apiargs-function-add_logger-param.yaml    |  11 -
 .../apiargs-function-remove_logger-param.yaml |  11 -
 ...iargs-function-with_transaction-param.yaml |  31 --
 .../includes/apiargs-method-watch-param.yaml  |  13 -
 source/includes/extracts-bucket-option.yaml   |  28 ++
 source/includes/extracts-client-option.yaml   |  28 ++
 .../includes/extracts-collection-option.yaml  |  38 ++
 source/includes/extracts-common-option.yaml   |  86 +++++
 source/includes/extracts-database-option.yaml |  28 ++
 source/includes/extracts-note.yaml            |  24 +-
 source/includes/extracts-option-requires.yaml |  48 +++
 ...option.yaml => extracts-watch-option.yaml} |  89 ++---
 source/reference/function/add_logger.txt      |   8 +-
 source/reference/function/remove_logger.txt   |   8 +-
 .../reference/function/with_transaction.txt   |  22 +-
 ...ongoDBBulkWriteResult-getModifiedCount.txt |   2 +-
 .../MongoDBClient-createClientEncryption.txt  |  17 +-
 .../method/MongoDBClient-dropDatabase.txt     |  41 +-
 .../MongoDBClient-listDatabaseNames.txt       |  51 ++-
 .../method/MongoDBClient-listDatabases.txt    |  53 ++-
 .../method/MongoDBClient-selectCollection.txt |  46 ++-
 .../method/MongoDBClient-selectDatabase.txt   |  42 +-
 .../method/MongoDBClient-startSession.txt     |  10 +-
 .../reference/method/MongoDBClient-watch.txt  |  85 +++-
 .../method/MongoDBClient__construct.txt       | 190 ++++++++-
 .../reference/method/MongoDBClient__get.txt   |   6 +-
 .../method/MongoDBCollection-aggregate.txt    | 115 +++++-
 .../method/MongoDBCollection-bulkWrite.txt    |  87 ++++-
 .../method/MongoDBCollection-count.txt        |  72 +++-
 .../MongoDBCollection-countDocuments.txt      |  57 ++-
 .../method/MongoDBCollection-createIndex.txt  | 112 +++++-
 .../MongoDBCollection-createIndexes.txt       |  83 +++-
 .../MongoDBCollection-createSearchIndex.txt   |  42 +-
 .../MongoDBCollection-createSearchIndexes.txt |  42 +-
 .../method/MongoDBCollection-deleteMany.txt   |  60 ++-
 .../method/MongoDBCollection-deleteOne.txt    |  60 ++-
 .../method/MongoDBCollection-distinct.txt     |  65 +++-
 .../method/MongoDBCollection-drop.txt         |  62 ++-
 .../method/MongoDBCollection-dropIndex.txt    |  56 ++-
 .../method/MongoDBCollection-dropIndexes.txt  |  51 ++-
 .../MongoDBCollection-dropSearchIndex.txt     |  23 +-
 ...ngoDBCollection-estimatedDocumentCount.txt |  40 +-
 .../method/MongoDBCollection-explain.txt      |  47 ++-
 .../method/MongoDBCollection-find.txt         | 200 +++++++++-
 .../method/MongoDBCollection-findOne.txt      | 151 +++++++-
 .../MongoDBCollection-findOneAndDelete.txt    |  82 +++-
 .../MongoDBCollection-findOneAndReplace.txt   | 105 ++++-
 .../MongoDBCollection-findOneAndUpdate.txt    | 116 +++++-
 .../method/MongoDBCollection-insertMany.txt   |  57 ++-
 .../method/MongoDBCollection-insertOne.txt    |  47 ++-
 .../method/MongoDBCollection-listIndexes.txt  |  32 +-
 .../MongoDBCollection-listSearchIndexes.txt   |  66 +++-
 .../method/MongoDBCollection-mapReduce.txt    | 134 ++++++-
 .../method/MongoDBCollection-rename.txt       |  58 ++-
 .../method/MongoDBCollection-replaceOne.txt   |  75 +++-
 .../method/MongoDBCollection-updateMany.txt   |  86 ++++-
 .../method/MongoDBCollection-updateOne.txt    |  86 ++++-
 .../MongoDBCollection-updateSearchIndex.txt   |  41 +-
 .../method/MongoDBCollection-watch.txt        |  89 ++++-
 .../method/MongoDBCollection-withOptions.txt  |  40 +-
 .../method/MongoDBCollection__construct.txt   |  58 ++-
 .../method/MongoDBDatabase-aggregate.txt      | 104 ++++-
 .../method/MongoDBDatabase-command.txt        |  36 +-
 .../MongoDBDatabase-createCollection.txt      | 296 +++++++++++++-
 ...goDBDatabase-createEncryptedCollection.txt |  38 +-
 .../reference/method/MongoDBDatabase-drop.txt |  38 +-
 .../method/MongoDBDatabase-dropCollection.txt |  66 +++-
 .../MongoDBDatabase-listCollectionNames.txt   |  48 ++-
 .../MongoDBDatabase-listCollections.txt       |  50 ++-
 .../MongoDBDatabase-modifyCollection.txt      |  48 ++-
 .../MongoDBDatabase-renameCollection.txt      |  60 ++-
 .../MongoDBDatabase-selectCollection.txt      |  42 +-
 .../MongoDBDatabase-selectGridFSBucket.txt    |  51 ++-
 .../method/MongoDBDatabase-watch.txt          |  85 +++-
 .../method/MongoDBDatabase-withOptions.txt    |  40 +-
 .../method/MongoDBDatabase__construct.txt     |  61 ++-
 .../reference/method/MongoDBDatabase__get.txt |   6 +-
 .../method/MongoDBGridFSBucket-delete.txt     |   6 +-
 .../MongoDBGridFSBucket-downloadToStream.txt  |   9 +-
 ...oDBGridFSBucket-downloadToStreamByName.txt |  42 +-
 .../method/MongoDBGridFSBucket-find.txt       | 200 +++++++++-
 .../method/MongoDBGridFSBucket-findOne.txt    | 151 +++++++-
 ...BGridFSBucket-getFileDocumentForStream.txt |   6 +-
 ...MongoDBGridFSBucket-getFileIdForStream.txt |   6 +-
 ...MongoDBGridFSBucket-openDownloadStream.txt |   6 +-
 ...BGridFSBucket-openDownloadStreamByName.txt |  38 +-
 .../MongoDBGridFSBucket-openUploadStream.txt  |  45 ++-
 .../method/MongoDBGridFSBucket-rename.txt     |   9 +-
 .../MongoDBGridFSBucket-uploadFromStream.txt  |  49 ++-
 .../method/MongoDBGridFSBucket__construct.txt |  74 +++-
 source/tutorial/modeling-bson-data.txt        |   2 +-
 231 files changed, 4819 insertions(+), 5130 deletions(-)
 delete mode 100644 source/includes/apiargs-MongoDBClient-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-get-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-watch-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBClient-method-watch-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-common-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-count-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-count-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-find-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-find-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-rename-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-rename-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
 delete mode 100644 source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
 delete mode 100644 source/includes/apiargs-aggregate-option.yaml
 delete mode 100644 source/includes/apiargs-common-option.yaml
 delete mode 100644 source/includes/apiargs-common-param.yaml
 delete mode 100644 source/includes/apiargs-dropCollection-option.yaml
 delete mode 100644 source/includes/apiargs-function-add_logger-param.yaml
 delete mode 100644 source/includes/apiargs-function-remove_logger-param.yaml
 delete mode 100644 source/includes/apiargs-function-with_transaction-param.yaml
 delete mode 100644 source/includes/apiargs-method-watch-param.yaml
 create mode 100644 source/includes/extracts-bucket-option.yaml
 create mode 100644 source/includes/extracts-client-option.yaml
 create mode 100644 source/includes/extracts-collection-option.yaml
 create mode 100644 source/includes/extracts-common-option.yaml
 create mode 100644 source/includes/extracts-database-option.yaml
 create mode 100644 source/includes/extracts-option-requires.yaml
 rename source/includes/{apiargs-method-watch-option.yaml => extracts-watch-option.yaml} (76%)

diff --git a/source/includes/apiargs-MongoDBClient-common-option.yaml b/source/includes/apiargs-MongoDBClient-common-option.yaml
deleted file mode 100644
index 4ffc52a9..00000000
--- a/source/includes/apiargs-MongoDBClient-common-option.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the client's read concern.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the client's read preference.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-   :manual:`Write concern ` to use for the operation.
-   Defaults to the client's write concern.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml b/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
deleted file mode 100644
index 8406bd09..00000000
--- a/source/includes/apiargs-MongoDBClient-method-construct-driverOptions.yaml
+++ /dev/null
@@ -1,189 +0,0 @@
-arg_name: option
-name: autoEncryption
-type: array
-description: |
-  Options to configure client-side field-level encryption in the driver. The
-  encryption options are documented in the :php:`extension documentation
-  `.
-  For the ``keyVaultClient`` option, you may pass a :phpclass:`MongoDB\\Client`
-  instance, which will be unwrapped to provide a :php:`MongoDB\\Driver\\Manager `
-  to the extension.
-
-  .. versionadded:: 1.6
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: driver
-type: array
-description: |
-  Additional driver metadata to be passed on to the server handshake. This is an
-  array containing ``name``, ``version``, and ``platform`` fields:
-
-  .. code-block:: php
-
-     [
-         'name' => 'my-driver',
-         'version' => '1.2.3-dev',
-         'platform' => 'some-platform',
-     ]
-
-  .. note::
-
-     This feature is primarily designed for custom drivers and ODMs, which may
-     want to identify themselves to the server for diagnostic purposes.
-     Applications should use the ``appName`` URI option instead of driver
-     metadata.
-
-  .. versionadded:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: serverApi
-type: :php:`MongoDB\\Driver\\ServerApi `
-description: |
-  Used to declare an API version on the client. See the
-  :manual:`Stable API tutorial ` for usage.
-
-  .. versionadded:: 1.9
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: typeMap
-type: array
-description: |
-  Default :php:`type map
-  `
-  to apply to cursors, which determines how BSON documents are converted to PHP
-  values. The |php-library| uses the following type map by default:
-
-  .. code-block:: php
-
-     [
-         'array' => 'MongoDB\Model\BSONArray',
-         'document' => 'MongoDB\Model\BSONDocument',
-         'root' => 'MongoDB\Model\BSONDocument',
-     ]
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: allow_invalid_hostname
-type: boolean
-description: |
-  Disables hostname validation if ``true``. Defaults to ``false``.
-
-  Allowing invalid hostnames may expose the driver to a `man-in-the-middle
-  attack `_.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsAllowInvalidHostnames`` URI
-     option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: ca_dir
-type: string
-description: |
-  Path to a correctly hashed certificate directory. The system certificate store
-  will be used by default.
-
-  Falls back to the deprecated ``capath`` SSL context option if not specified.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: ca_file
-type: string
-description: |
-  Path to a certificate authority file. The system certificate store will be
-  used by default.
-
-  Falls back to the deprecated ``cafile`` SSL context option if not specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsCAFile`` URI option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: crl_file
-type: string
-description: |
-  Path to a certificate revocation list file.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: pem_file
-type: string
-description: |
-  Path to a PEM encoded certificate to use for client authentication.
-
-  Falls back to the deprecated ``local_cert`` SSL context option if not
-  specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsCertificateKeyFile`` URI
-     option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: pem_pwd
-type: string
-description: |
-  Passphrase for the PEM encoded certificate (if applicable).
-
-  Falls back to the deprecated ``passphrase`` SSL context option if not
-  specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsCertificateKeyFilePassword``
-     URI option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: weak_cert_validation
-type: boolean
-description: |
-  Disables certificate validation ``true``. Defaults to ``false``.
-
-  Falls back to the deprecated ``allow_self_signed`` SSL context option if not
-  specified.
-
-  .. deprecated:: 1.6
-     This option has been deprecated. Use the ``tlsAllowInvalidCertificates``
-     URI option instead.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: context
-type: resource
-description: |
-  :php:`SSL context options ` to be used as fallbacks
-  for other driver options (as specified). Note that the driver does not consult
-  the default stream context.
-
-  This option is supported for backwards compatibility, but should be considered
-  deprecated.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml b/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
deleted file mode 100644
index 62998287..00000000
--- a/source/includes/apiargs-MongoDBClient-method-construct-param.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
-arg_name: param
-name: $uri
-type: string
-description: |
-  The URI of the standalone, replica set, or sharded cluster to which to
-  connect. Refer to :manual:`Connection String URI Format
-  ` in the MongoDB manual for more information.
-
-  Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified.
-
-  Any special characters in the URI components need to be encoded according to
-  `RFC 3986 `_. This is particularly
-  relevant to the username and password, which can often include special
-  characters such as ``@``, ``:``, or ``%``. When connecting via a Unix domain
-  socket, the socket path may contain special characters such as slashes and
-  must be encoded. The :php:`rawurlencode() ` function may be used
-  to encode constituent parts of the URI.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: param
-name: $uriOptions
-type: array
-description: |
-  Specifies additional URI options, such as authentication credentials or query
-  string parameters. The options specified in ``$uriOptions`` take precedence
-  over any analogous options present in the ``$uri`` string and do not need to
-  be encoded according to `RFC 3986 `_.
-
-  Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
-  ` extension reference and :manual:`MongoDB
-  connection string ` documentation for accepted
-  options.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: param
-name: $driverOptions
-type: array
-description: |
-  Specify driver-specific options, such as SSL options. In addition to any
-  options supported by the :php:`extension `, the
-  |php-library| allows you to specify a default :php:`type map
-  `
-  to apply to the cursors it creates.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml b/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBClient-method-createClientEncryption-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
deleted file mode 100644
index be0a19aa..00000000
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
deleted file mode 100644
index 07b76834..00000000
--- a/source/includes/apiargs-MongoDBClient-method-dropDatabase-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " to drop"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-get-param.yaml b/source/includes/apiargs-MongoDBClient-method-get-param.yaml
deleted file mode 100644
index e9d3ccc6..00000000
--- a/source/includes/apiargs-MongoDBClient-method-get-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " to select"
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
deleted file mode 100644
index 38baf93a..00000000
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-option.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-arg_name: option
-name: authorizedDatabases
-type: boolean
-description: |
-  A flag that determines which databases are returned based on the user
-  privileges when access control is enabled. For more information, see the
-  `listDatabases command documentation `_.
-
-  For servers < 4.0.5, this option is ignored.
-
-  .. versionadded:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: filter
-type: array|object
-description: |
-  A query expression to filter the list of databases.
-
-  You can specify a query expression for database fields (e.g. ``name``,
-  ``sizeOnDisk``, ``empty``).
-
-  .. versionadded:: 1.3
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
diff --git a/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml b/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBClient-method-listDatabases-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml b/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
deleted file mode 100644
index d81d3181..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectCollection-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "client"
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
deleted file mode 100644
index 99c76446..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectCollection-param.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " containing the collection to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
deleted file mode 100644
index e4ffd3c6..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectDatabase-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "database"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "database"
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "client"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "database"
-  parent: "client"
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml b/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
deleted file mode 100644
index 8e5f9d45..00000000
--- a/source/includes/apiargs-MongoDBClient-method-selectDatabase-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
-replacement:
-  action: " to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml b/source/includes/apiargs-MongoDBClient-method-watch-option.yaml
deleted file mode 100644
index cad9c3f7..00000000
--- a/source/includes/apiargs-MongoDBClient-method-watch-option.yaml
+++ /dev/null
@@ -1,71 +0,0 @@
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocument
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocumentBeforeChange
-post: |
-  .. versionadded: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: maxAwaitTimeMS
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: readPreference
-post: |
-  This is used for both the initial change stream aggregation and for
-  server selection during an automatic resume.
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: resumeAfter
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: showExpandedEvents
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAfter
-post: |
-  .. versionadded: 1.5
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAtOperationTime
----
-source:
-  file: apiargs-MongoDBClient-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBClient-method-watch-param.yaml b/source/includes/apiargs-MongoDBClient-method-watch-param.yaml
deleted file mode 100644
index b00e450c..00000000
--- a/source/includes/apiargs-MongoDBClient-method-watch-param.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $pipeline
----
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-common-option.yaml b/source/includes/apiargs-MongoDBCollection-common-option.yaml
deleted file mode 100644
index fb919ea4..00000000
--- a/source/includes/apiargs-MongoDBCollection-common-option.yaml
+++ /dev/null
@@ -1,86 +0,0 @@
-arg_name: option
-name: arrayFilters
-type: array
-description: |
-   An array of filter documents that determines which array elements to modify
-   for an update operation on an array field.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: bypassDocumentValidation
-type: boolean
-description: |
-   If ``true``, allows the write operation to circumvent document level
-   validation. Defaults to ``false``.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
-post: |
-   If the collation is unspecified but the collection has a default collation,
-   the operation uses the collation specified for the collection. If no
-   collation is specified for the collection or for the operation, MongoDB uses
-   the simple binary comparison used in prior versions for string comparisons.
----
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the collection's read concern.
-
-   It is not possible to specify a :manual:`read concern
-   ` for individual operations as part of a
-   transaction. Instead, set the ``readConcern`` option when starting the
-   transaction with :php:`startTransaction `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the collection's read preference.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "collection"
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-   :manual:`Write concern ` to use for the operation.
-   Defaults to the collection's write concern.
-
-   It is not possible to specify a :manual:`write concern
-   ` for individual operations as part of a
-   transaction. Instead, set the ``writeConcern`` option when starting the
-   transaction with :php:`startTransaction `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: upsert
-type: boolean
-description: |
-   If set to ``true``, creates a new document when no document matches the query
-   criteria. The default value is ``false``, which does not insert a new
-   document when no match is found.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-common-param.yaml b/source/includes/apiargs-MongoDBCollection-common-param.yaml
deleted file mode 100644
index 47100d19..00000000
--- a/source/includes/apiargs-MongoDBCollection-common-param.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-arg_name: param
-name: $filter
-type: array|object
-description: |
-  The filter criteria that specifies the documents{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $replacement
-type: array|object
-description: |
-  The replacement document.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $update
-type: array|object
-description: |
-  Specifies the field and value combinations to update and any relevant update
-  operators. ``$update`` uses MongoDB's :method:`update operators
-  `. Starting with MongoDB 4.2, an `aggregation
-  pipeline `_
-  can be passed as this parameter.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
deleted file mode 100644
index a299eefa..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-option.yaml
+++ /dev/null
@@ -1,72 +0,0 @@
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: explain
-post: |
-  .. versionadded:: 1.4
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.9
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-post: |
-  This only applies when a :ref:`$out ` or :ref:`$merge `
-  stage is specified.
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml b/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
deleted file mode 100644
index cbad3b49..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-aggregate-param.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-arg_name: param
-name: $pipeline
-type: array
-description: |
-  Specifies an :manual:`aggregation pipeline `
-  operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
deleted file mode 100644
index 25d8e24d..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-option.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-arg_name: option
-name: ordered
-type: boolean
-description: |
-  If ``true``: when a single write fails, the operation will stop without
-  performing the remaining writes and throw an exception.
-
-  If ``false``: when a single write fails, the operation will continue with the
-  remaining writes, if any, and throw an exception.
-
-  The default is ``true``.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml b/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
deleted file mode 100644
index 79423a63..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-bulkWrite-param.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-arg_name: param
-name: $operations
-type: array
-description: |
-  An array containing the write operations to perform.
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` supports
-  :phpmethod:`deleteMany() `,
-  :phpmethod:`deleteOne() `,
-  :phpmethod:`insertOne() `,
-  :phpmethod:`replaceOne() `,
-  :phpmethod:`updateMany() `, and
-  :phpmethod:`updateOne() ` operations in the
-  following array structure:
-
-  .. code-block:: php
-
-     [
-         [ 'deleteMany' => [ $filter ] ],
-         [ 'deleteOne'  => [ $filter ] ],
-         [ 'insertOne'  => [ $document ] ],
-         [ 'replaceOne' => [ $filter, $replacement, $options ] ],
-         [ 'updateMany' => [ $filter, $update, $options ] ],
-         [ 'updateOne'  => [ $filter, $update, $options ] ],
-     ]
-
-  Arguments correspond to the respective operation methods. However, the
-  ``writeConcern`` option is specified as a top-level option to
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
-  operation.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
deleted file mode 100644
index 7d422ca0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-construct-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "manager"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "manager"
----
-source:
-  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "manager"
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml b/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
deleted file mode 100644
index 0827800b..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-construct-param.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $manager
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml b/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
deleted file mode 100644
index 3d839e04..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-count-option.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: hint
-type: string|array|object
-description: |
-  The index to use. Specify either the index name as a string or the index key
-  pattern as a document. If specified, then the query system will only consider
-  plans using the hinted index.
-
-  .. versionchanged:: 1.2
-     If a document is provided, it is passed to the command as-is. Previously,
-     the library would convert the key pattern to an index name.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  The maximum number of matching documents to return.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: skip
-type: integer
-description: |
-  The number of matching documents to skip before returning results.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-count-param.yaml b/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
deleted file mode 100644
index e18c616b..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-count-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to count"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml b/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
deleted file mode 100644
index da1f0113..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-countDocuments-option.yaml
+++ /dev/null
@@ -1,56 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
----
-arg_name: option
-name: hint
-type: string|array|object
-description: |
-  The index to use. Specify either the index name as a string or the index key
-  pattern as a document. If specified, then the query system will only consider
-  plans using the hinted index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  The maximum number of matching documents to return.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-arg_name: option
-name: skip
-type: integer
-description: |
-  The number of matching documents to skip before returning results.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml b/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
deleted file mode 100644
index e18c616b..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-countDocuments-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to count"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
deleted file mode 100644
index 18283767..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-option.yaml
+++ /dev/null
@@ -1,117 +0,0 @@
-arg_name: option
-name: commitQuorum
-type: string|integer
-description: |
-  Specifies how many data-bearing members of a replica set, including the
-  primary, must complete the index builds successfully before the primary marks
-  the indexes as ready.
-
-  This option accepts the same values for the ``w`` field in a write concern
-  plus ``"votingMembers"``, which indicates all voting data-bearing nodes.
-
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: unique
-type: boolean
-description: |
-  Creates a :manual:`unique ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
-pre: |
-  Specifies the :manual:`collation
-  ` for the index.
----
-arg_name: option
-name: partialFilterExpression
-type: array|object
-description: |
-  Creates a :manual:`partial ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: sparse
-type: boolean
-description: |
-  Creates a :manual:`sparse ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: expireAfterSeconds
-type: integer
-description: |
-  Creates a :manual:`TTL ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: name
-type: string
-description: |
-  A name that uniquely identifies the index. By default, MongoDB creates index
-  names based on the key.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: background
-type: string
-description: |
-  Instructs MongoDB to build the index :manual:`as a background
-  ` process.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: 2dsphereIndexVersion
-type: integer
-description: |
-  Overrides the server's default version for a :manual:`2dsphere
-  ` index.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
deleted file mode 100644
index c2979d91..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndex-param.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-arg_name: param
-name: $key
-type: array|object
-description: |
-  Specifies the field or fields to index and the index order.
-
-  For example, the following specifies a descending index on the ``username``
-  field:
-
-  .. code-block:: php
-
-     [ 'username' => -1 ]
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
deleted file mode 100644
index 54c33bfa..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-option.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-method-createIndex-option.yaml
-  ref: commitQuorum
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
deleted file mode 100644
index e98d9aad..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createIndexes-param.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-arg_name: param
-name: $indexes
-type: array
-description: |
-  The indexes to create on the collection.
-
-  For example, the following specifies a unique index on the ``username`` field
-  and a compound index on the ``email`` and ``createdAt`` fields:
-
-  .. code-block:: php
-
-     [
-         [ 'key' => [ 'username' => -1 ], 'unique' => true ],
-         [ 'key' => [ 'email' => 1, 'createdAt' => 1 ] ],
-     ]
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml
deleted file mode 100644
index c6adffe8..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-option.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-arg_name: option
-name: name
-type: string
-description: |
-  Name of the search index to create.
-
-  You cannot create multiple indexes with the same name on a single collection.
-
-  If you do not specify a name, the index is named "default".
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml
deleted file mode 100644
index bec75136..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createSearchIndex-param.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-arg_name: param
-name: $definition
-type: array|object
-description: |
-  Document describing the index to create. For details on definition syntax, see 
-  :manual:`Search Index Definition Syntax `.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml
deleted file mode 100644
index 7661d09e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml
deleted file mode 100644
index 4003b24d..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-createSearchIndexes-param.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-arg_name: param
-name: $indexes
-type: array
-description: |
-  Array of documents describing the indexes to create.
-
-  A required ``definition`` document field describes the index to create. For
-  details on definition syntax, see 
-  :manual:`Search Index Definition Syntax `.
-
-  An optional ``name`` string field specifies the name of the search index to
-  create. You cannot create multiple indexes with the same name on a single
-  collection. If you do not specify a name, the index is named "default".
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
deleted file mode 100644
index 110911f5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-option.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
deleted file mode 100644
index 92797eb5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteMany-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to delete"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
deleted file mode 100644
index 110911f5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-option.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
deleted file mode 100644
index 92797eb5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-deleteOne-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to delete"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
deleted file mode 100644
index 05a1b285..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-distinct-option.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  .. versionadded:: 1.5
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml b/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
deleted file mode 100644
index 37cd9b50..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-distinct-param.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-arg_name: param
-name: $fieldName
-type: string
-description: |
-  The field for which to return distinct values.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " from which to retrieve the distinct values"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
deleted file mode 100644
index 5eb5efab..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-drop-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-dropCollection-option.yaml
-  ref: encryptedFields
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml b/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-drop-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
deleted file mode 100644
index b87e09b7..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
deleted file mode 100644
index 7cac6d1d..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndex-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-arg_name: param
-name: $indexName
-type: string| :phpclass:`MongoDB\\Model\\IndexInfo`
-description: |
-  The name or model object of the index to drop. View the existing indexes on
-  the collection using the :phpmethod:`listIndexes()
-  ` method.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
deleted file mode 100644
index aff9f4d7..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-option.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropIndexes-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml
deleted file mode 100644
index 7661d09e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml
deleted file mode 100644
index 9a57fc98..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-dropSearchIndex-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $name
-type: string
-description: |
-  Name of the index to drop.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
deleted file mode 100644
index 7289296e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml b/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-estimateDocumentCount-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml b/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
deleted file mode 100644
index 650633bc..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-explain-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  Defaults to the ``comment`` of the explained operation (if any).
-
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-arg_name: option
-name: verbosity
-type: string
-description: |
-  The verbosity level at which to run the command. See the :manual:`explain
-  ` command for more information.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml b/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
deleted file mode 100644
index 59f15637..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-explain-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $explainable
-type: :phpclass:`MongoDB\\Operation\\Explainable`
-description: |
-  The command to explain.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml b/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
deleted file mode 100644
index 1b01599e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-find-option.yaml
+++ /dev/null
@@ -1,263 +0,0 @@
-arg_name: option
-name: projection
-type: array|object
-description: |
-  The :ref:`projection specification ` to determine which fields to
-  include in the returned documents. See :manual:`Project Fields to Return from
-  Query ` and
-  :manual:`Projection Operators ` in the MongoDB
-  manual.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: sort
-type: array|object
-description: |
-  The sort specification for the ordering of the results.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: skip
-type: integer
-description: |
-  Number of documents to skip. Defaults to ``0``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  The maximum number of documents to return. If unspecified, then defaults to no
-  limit. A limit of ``0`` is equivalent to setting no limit.
-
-  A negative limit is similar to a positive limit but closes the cursor after
-  returning a single batch of results. As such, with a negative limit, if the
-  limited result set does not fit into a single batch, the number of documents
-  received will be less than the specified limit. By passing a negative limit, the
-  client indicates to the server that it will not ask for a subsequent batch via
-  getMore.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: allowDiskUse
-type: boolean
-description: |
-  Enables writing to temporary files. When set to ``true``, queries can write
-  data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: batchSize
-type: integer
-description: |
-  The number of documents to return in the first batch. Defaults to ``101``. A
-  batchSize of ``0`` means that the cursor will be established, but no documents
-  will be returned in the first batch.
-
-  Unlike the previous wire protocol version, a batchSize of ``1`` for the
-  :dbcommand:`find` command does not close the cursor.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
----
-arg_name: option
-name: cursorType
-type: integer
-description: |
-  Indicates the type of cursor to use. ``cursorType`` supports the following
-  values:
-
-   - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
-   - ``MongoDB\Operation\Find::TAILABLE``
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  .. versionadded:: 1.2
----
-arg_name: option
-name: maxAwaitTimeMS
-type: integer
-description: |
-  Positive integer denoting the time limit in milliseconds for the server to
-  block a getMore operation if no data is available. This option should only be
-  used if cursorType is TAILABLE_AWAIT.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: max
-type: array|object
-description: |
-  The exclusive upper bound for a specific index.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: maxScan
-type: integer
-description: |
-  Maximum number of documents or index keys to scan when executing the query.
-
-  .. deprecated:: 1.4
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: min
-type: array|object
-description: |
-  The inclusive lower bound for a specific index.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: oplogReplay
-type: boolean
-description: |
-  Internal use for replica sets. To use ``oplogReplay``, you must include the
-  following condition in the filter:
-
-  .. code-block:: javascript
-
-     { ts: { $gte:  } }
-
-  The :php:`MongoDB\\BSON\\Timestamp ` class
-  reference describes how to represent MongoDB's BSON timestamp type with PHP.
-
-  .. deprecated:: 1.7
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: noCursorTimeout
-type: boolean
-description: |
-  Prevents the server from timing out idle cursors after an inactivity period
-  (10 minutes).
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: returnKey
-type: boolean
-description: |
-  If true, returns only the index keys in the resulting documents.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: showRecordId
-type: boolean
-description: |
-  Determines whether to return the record identifier for each document. If true,
-  adds a field $recordId to the returned documents.
-
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: snapshot
-type: boolean
-description: |
-  Prevents the cursor from returning a document more than once because of an
-  intervening write operation.
-
-  .. deprecated:: 1.4
-  .. versionadded:: 1.2
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: allowPartialResults
-type: boolean
-description: |
-  For queries against a sharded collection, returns partial results from the
-  :program:`mongos` if some shards are unavailable instead of throwing an error.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
----
-arg_name: option
-name: modifiers
-type: array|object
-description: |
-  :manual:`Meta operators ` that modify the
-  output or behavior of a query. Use of these operators is deprecated in favor
-  of named options.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-find-param.yaml b/source/includes/apiargs-MongoDBCollection-method-find-param.yaml
deleted file mode 100644
index 5683a7bb..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-find-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to query"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
deleted file mode 100644
index 139e700a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-option.yaml
+++ /dev/null
@@ -1,84 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: skip
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: comment
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  .. versionadded:: 1.2
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: max
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: maxScan
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: min
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: returnKey
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: showRecordId
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: modifiers
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
deleted file mode 100644
index 5683a7bb..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOne-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: true
-replacement:
-  action: " to query"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
deleted file mode 100644
index d8f2b3a4..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
+++ /dev/null
@@ -1,56 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
deleted file mode 100644
index 92797eb5..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndDelete-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to delete"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
deleted file mode 100644
index b509ac94..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
+++ /dev/null
@@ -1,77 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-arg_name: option
-name: returnDocument
-type: integer
-description: |
-  Specifies whether to return the document before the replacement is applied, or
-  after. ``returnDocument`` supports the following values:
-
-  - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*)
-  - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
deleted file mode 100644
index 32ed6b35..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndReplace-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to replace"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $replacement
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
deleted file mode 100644
index a8f895f1..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+++ /dev/null
@@ -1,83 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: arrayFilters
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.4+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.7
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-arg_name: option
-name: returnDocument
-type: integer
-description: |
-  Specifies whether to return the document before the update is applied, or
-  after. ``returnDocument`` supports the following values:
-
-  - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*)
-  - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml b/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
deleted file mode 100644
index a335678a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to update"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $update
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
deleted file mode 100644
index 60f197d2..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-method-bulkWrite-option.yaml
-  ref: ordered
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
deleted file mode 100644
index 78246d30..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertMany-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $documents
-type: array
-description: |
-  The documents to insert into the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
deleted file mode 100644
index adf17cb6..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-option.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
deleted file mode 100644
index 5dc231d3..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-insertOne-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $document
-type: array|object
-description: |
-  The document to insert into the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
deleted file mode 100644
index aa939b95..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-listIndexes-option.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-listIndexes-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml b/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml
deleted file mode 100644
index 910024ee..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-option.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
----
-arg_name: option
-name: name
-type: string
-description: |
-  Name of the index to return information about.
-
-  If name is not specified, information for all indexes on the collection will
-  be returned.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml b/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-listSearchIndexes-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
deleted file mode 100644
index 478d12dd..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-option.yaml
+++ /dev/null
@@ -1,113 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
-post: |
-  This only applies when results are output to a collection.
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: finalize
-type: :php:`MongoDB\\BSON\\Javascript `
-description: |
-  Follows the reduce method and modifies the output.
-
-  .. note::
-
-     Passing a Javascript instance with a scope is deprecated. Put all scope
-     variables in the ``scope`` option of the MapReduce operation.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: jsMode
-type: boolean
-description: |
-  Specifies whether to convert intermediate data into BSON format between the
-  execution of the map and reduce functions.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: limit
-type: integer
-description: |
-  Specifies a maximum number of documents for the input into the map function.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-arg_name: option
-name: query
-type: array|object
-description: |
-  Specifies the selection criteria using query operators for determining the
-  documents input to the map function.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
-post: |
-  This option will be ignored when results are output to a collection.
----
-arg_name: option
-name: scope
-type: array|object
-description: |
-  Specifies global variables that are accessible in the map, reduce, and finalize
-  functions.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
----
-arg_name: option
-name: verbose
-type: boolean
-description: |
-  Specifies whether to include the timing information in the result information.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml b/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
deleted file mode 100644
index 6a76d636..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-mapReduce-param.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-arg_name: param
-name: $map
-type: :php:`MongoDB\\BSON\\Javascript `
-description: |
-  A JavaScript function that associates or "maps" a value with a key and emits
-  the key and value pair.
-
-  .. note::
-
-     Passing a Javascript instance with a scope is deprecated. Put all scope
-     variables in the ``scope`` option of the MapReduce operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $reduce
-type: :php:`MongoDB\\BSON\\Javascript `
-description: |
-  A JavaScript function that "reduces" to a single object all the values
-  associated with a particular key.
-
-  .. note::
-
-     Passing a Javascript instance with a scope is deprecated. Put all scope
-     variables in the ``scope`` option of the MapReduce operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $out
-type: string|array|object
-description: |
-  Specifies where to output the result of the map-reduce operation. You can
-  either output to a collection or return the result inline. On a primary member
-  of a replica set you can output either to a collection or inline, but on a
-  secondary, only inline output is possible.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml b/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml
deleted file mode 100644
index 0b0b0809..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-rename-option.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
----
-arg_name: option
-name: dropTarget
-type: boolean
-description: |
-  If ``true``, MongoDB will drop the target before renaming the collection. The
-  default value is ``false``.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml b/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml
deleted file mode 100644
index 459b2789..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-rename-param.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-arg_name: param
-name: $toCollectionName
-type: string
-description: |
-  The new name of the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $toDatabaseName
-type: string
-description: |
-  The new database name of the collection. If a new database name is not
-  specified, the database of the original collection will be used. If the new
-  name specifies a different database, the command copies the collection
-  to the new database and drops the source collection.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
deleted file mode 100644
index 676296d2..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-option.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.2+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.6
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
deleted file mode 100644
index 32ed6b35..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-replaceOne-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to replace"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $replacement
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
deleted file mode 100644
index 64eec34e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-option.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: arrayFilters
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.2+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.6
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
deleted file mode 100644
index a335678a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateMany-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to update"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $update
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
deleted file mode 100644
index 64eec34e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-option.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: upsert
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: arrayFilters
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
-post: |
-  This option is available in MongoDB 4.2+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.6
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
deleted file mode 100644
index a335678a..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateOne-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $filter
-optional: false
-replacement:
-  action: " to update"
----
-source:
-  file: apiargs-MongoDBCollection-common-param.yaml
-  ref: $update
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml b/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml
deleted file mode 100644
index 7661d09e..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml b/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml
deleted file mode 100644
index f5893878..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-updateSearchIndex-param.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-arg_name: param
-name: $name
-type: string
-description: |
-  Name of the index to update.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $definition
-type: array|object
-description: |
-  Document describing the updated search index definition. The specified
-  definition replaces the prior definition in the search index. For details on
-  definition syntax, see 
-  :manual:`Search Index Definition Syntax `.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
deleted file mode 100644
index 2b8ac8e4..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-watch-option.yaml
+++ /dev/null
@@ -1,73 +0,0 @@
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocument
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocumentBeforeChange
-post: |
-  .. versionadded: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: maxAwaitTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: readPreference
-post: |
-  This is used for both the initial change stream aggregation and for
-  server selection during an automatic resume.
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: resumeAfter
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: showExpandedEvents
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAfter
-post: |
-  .. versionadded: 1.5
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAtOperationTime
-post: |
-  .. versionadded:: 1.4
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml b/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
deleted file mode 100644
index b00e450c..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-watch-param.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $pipeline
----
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
deleted file mode 100644
index 681144f3..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-withOptions-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "original collection"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "original collection"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "original collection"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "original collection"
-...
diff --git a/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml b/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBCollection-method-withOptions-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-common-option.yaml b/source/includes/apiargs-MongoDBDatabase-common-option.yaml
deleted file mode 100644
index b03dac7a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-common-option.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the database's read concern.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the database's read preference.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "database"
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-   :manual:`Write concern ` to use for the operation.
-   Defaults to the database's write concern.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
deleted file mode 100644
index 93bccd2f..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-option.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: bypassDocumentValidation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
----
-source:
-  file: apiargs-aggregate-option.yaml
-  ref: explain
----
-source:
-  file: apiargs-common-option.yaml
-  ref: hint
----
-source:
-  file: apiargs-common-option.yaml
-  ref: let
-post: |
-  .. versionadded:: 1.9
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-post: |
-  This only applies when a :ref:`$out ` or :ref:`$merge `
-  stage is specified.
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
deleted file mode 100644
index cbad3b49..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-aggregate-param.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-arg_name: param
-name: $pipeline
-type: array
-description: |
-  Specifies an :manual:`aggregation pipeline `
-  operation.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
deleted file mode 100644
index 934e325d..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-command-option.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the database's read preference.
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
deleted file mode 100644
index 5a4b03d7..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-command-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $command
-type: array|object
-description: |
-  The :manual:`database command ` document.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
deleted file mode 100644
index d398069a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-construct-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "database"
-  parent: "manager"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "database"
-  parent: "manager"
----
-source:
-  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "database"
-  parent: "manager"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
deleted file mode 100644
index 5ef826c1..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-construct-param.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $manager
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
deleted file mode 100644
index ceb7dd07..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
+++ /dev/null
@@ -1,363 +0,0 @@
-arg_name: option
-name: autoIndexId
-type: boolean
-description: |
-  Specify ``false`` to disable the automatic creation of an index on the ``_id``
-  field.
-
-  .. important::
-
-     For replica sets, do not set ``autoIndexId`` to ``false``.
-
-  .. deprecated:: 1.4
-     This option has been deprecated since MongoDB 3.2. As of MongoDB 4.0, this
-     option cannot be ``false`` when creating a replicated collection (i.e. a
-     collection outside of the ``local`` database in any mongod mode).
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: capped
-type: boolean
-description: |
-  To create a capped collection, specify ``true``. If you specify ``true``, you
-  must also set a maximum size in the ``size`` option.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: changeStreamPreAndPostImages
-type: document
-description: |
-  Used to configure support for pre- and post-images in change streams. See the
-  :manual:`create ` command documentation for more
-  information.
-
-  This option is available in MongoDB 6.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: clusteredIndex
-type: document
-description: |
-  A clustered index specification. See
-  :manual:`Clustered Collections ` or the
-  :manual:`create ` command documentation for more
-  information.
-
-  This option is available in MongoDB 5.3+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
-pre: |
-  Specifies the :manual:`collation
-  ` for the collection.
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: encryptedFields
-type: document
-description: |
-  A document describing encrypted fields for queryable encryption. If omitted,
-  the ``encryptedFieldsMap`` option within the ``autoEncryption`` driver option
-  will be consulted. See
-  `Field Encryption and Queryability `_
-  in the MongoDB manual for more information.
-
-  This option is available in MongoDB 7.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: expireAfterSeconds
-type: integer
-description: |
-  Used to automatically delete documents in time series collections. See the
-  :manual:`create ` command documentation for more
-  information.
-
-  This option is available in MongoDB 5.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.9
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: flags
-type: integer
-description: |
-  Available for the MMAPv1 storage engine only to set the ``usePowerOf2Sizes``
-  and ``noPadding`` flags.
-
-  The |php-library| provides constants that you can combine with a :php:`bitwise
-  OR operator ` to set the flag values:
-
-  - ``MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES``: ``1``
-  - ``MongoDB\Operation\CreateCollection::NO_PADDING``: ``2``
-
-  Defaults to ``1``.
-
-  .. note::
-
-     MongoDB 3.0 and later ignores the ``usePowerOf2Sizes`` flag. See
-     :manual:`collMod ` and
-     :manual:`db.createCollection()
-     ` for more information.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: indexOptionDefaults
-type: array|object
-description: |
-  Allows users to specify a default configuration for indexes when creating a
-  collection.
-
-  The ``indexOptionDefaults`` option accepts a ``storageEngine`` document,
-  which should take the following form:
-
-  .. code-block:: none
-  
-     { :  }
-
-  Storage engine configurations specified when creating indexes are validated
-  and logged to the :term:`oplog` during replication to support replica sets
-  with members that use different storage engines.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: max
-type: integer
-description: |
-  The maximum number of documents allowed in the capped collection. The ``size``
-  option takes precedence over this limit. If a capped collection reaches the
-  ``size`` limit before it reaches the maximum number of documents, MongoDB
-  removes old documents. If you prefer to use the ``max`` limit, ensure that the
-  ``size`` limit, which is required for a capped collection, is sufficient to
-  contain the maximum number of documents.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-arg_name: option
-name: pipeline
-type: array
-description: |
-  An array that consists of the aggregation pipeline stage(s), which will be
-  applied to the collection or view specified by ``viewOn``. See the
-  :manual:`create ` command documentation for more
-  information.
-  
-  .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-arg_name: option
-name: size
-type: integer
-description: |
-  Specify a maximum size in bytes for a capped collection. Once a capped
-  collection reaches its maximum size, MongoDB removes the older documents to
-  make space for the new documents. The ``size`` option is required for capped
-  collections and ignored for other collections.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: storageEngine
-type: array|object
-description: |
-  Available for the WiredTiger storage engine only.
-
-  Allows users to specify configuration to the storage engine on a
-  per-collection basis when creating a collection. The value of the
-  ``storageEngine`` option should take the following form:
-
-  .. code-block:: none
-  
-     { :  }
-
-  Storage engine configurations specified when creating collections are
-  validated and logged to the :term:`oplog` during replication to support
-  replica sets with members that use different storage engines.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: timeseries
-type: array|object
-description: |
-  An object containing options for creating time series collections. See the
-  :manual:`create ` command documentation for
-  supported options.
-
-  This option is available in MongoDB 5.0+ and will result in an exception at
-  execution time if specified for an older server version.
-
-  .. versionadded:: 1.9
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-arg_name: option
-name: validator
-type: array|object
-description: |
-  Allows users to specify :manual:`validation rules or expressions
-  ` for the collection. For more information, see
-  :manual:`Document Validation ` in the MongoDB
-  manual.
-
-  The ``validator`` option takes an array that specifies the validation rules or
-  expressions. You can specify the expressions using the same operators as
-  MongoDB's :manual:`query operators ` with the
-  exception of :query:`$geoNear`, :query:`$near`, :query:`$nearSphere`,
-  :query:`$text`, and :query:`$where`.
-
-  .. note::
-
-     - Validation occurs during updates and inserts. Existing documents do not
-       undergo validation checks until modification.
-
-     - You cannot specify a validator for collections in the ``admin``,
-       ``local``, and ``config`` databases.
-
-     - You cannot specify a validator for ``system.*`` collections.
-operation: ~
-interface: phpmethod
-optional: true
----
-arg_name: option
-name: validationAction
-type: string
-description: |
-   Determines whether to ``error`` on invalid documents or just ``warn`` about
-   the violations but allow invalid documents to be inserted.
-
-   .. important::
-
-      Validation of documents only applies to those documents as determined by
-      the ``validationLevel``.
-
-   .. list-table::
-      :header-rows: 1
-
-      * - ``validationAction``
-
-        - Description
-
-      * - ``"error"``
-
-        - **Default**. Documents must pass validation before the write occurs.
-          Otherwise, the write operation fails.
-
-      * - ``"warn"``
-
-        - Documents do not have to pass validation. If the document fails
-          validation, the write operation logs the validation failure.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: validationLevel
-type: string
-description: |
-   Determines how strictly MongoDB applies the validation rules to existing
-   documents during an update.
-
-   .. list-table::
-      :header-rows: 1
-
-      * - ``validationLevel``
-
-        - Description
-
-      * - ``"off"``
-
-        - No validation for inserts or updates.
-
-      * - ``"strict"``
-
-        - **Default**. Apply validation rules to all inserts and all updates.
-
-      * - ``"moderate"``
-
-        - Apply validation rules to inserts and to updates on existing *valid*
-          documents. Do not apply rules to updates on existing *invalid*
-          documents.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: viewOn
-type: string
-description: |
-  The name of the source collection or view from which to create the view.
-
-  .. note::
-
-     The name is not the full namespace of the collection or view (i.e. it does
-     not include the database name). Views must be created in the same databases
-     as the source collection or view.
-     
-     .. versionadded:: 1.13
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
deleted file mode 100644
index b6bb2dcc..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-createCollection-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to create"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
deleted file mode 100644
index 6d56d678..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-createEncryptedCollection-param.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  subject: "encrypted collection"
-  action: " to create"
----
-arg_name: param
-name: $clientEncryption
-type: :php:`MongoDB\\Driver\\ClientEncryption `
-description: |
-  The ClientEncryption object used to create data keys.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $kmsProvider
-type: string
-description: |
-  KMS provider (e.g. "local", "aws") that will be used to encrypt new data keys.
-  This corresponds to the ``$kmsProvider`` parameter for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $masterKey
-type: array|null
-description: |
-  KMS-specific key options that will be used to encrypt new data keys. This
-  corresponds to the ``masterKey`` option for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
-
-  If ``$kmsProvider`` is "local", this should be ``null``.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-optional: false
-post: |
-  The ``encryptedFields`` option is required.
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
deleted file mode 100644
index e725fc1b..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-option.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-drop-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
deleted file mode 100644
index 0034b5e8..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-option.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-source:
-  file: apiargs-dropCollection-option.yaml
-  ref: encryptedFields
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
deleted file mode 100644
index c8e0a614..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-dropCollection-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to drop"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
deleted file mode 100644
index 651c85f9..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-get-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to select"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
deleted file mode 100644
index bacf7280..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-option.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-arg_name: option
-name: authorizedCollections
-type: boolean
-description: |
-  A flag that determines which collections are returned based on the user
-  privileges when access control is enabled. For more information, see the
-  `listCollections command documentation `_.
-
-  For servers < 4.0, this option is ignored.
-
-  .. versionadded:: 1.12
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-arg_name: option
-name: filter
-type: array|object
-description: |
-  A query expression to filter the list of collections.
-
-  You can specify a query expression for collection fields (e.g. ``name``,
-  ``options``).
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
-post: |
-  .. versionadded:: 1.3
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-listCollections-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
deleted file mode 100644
index b27c16cf..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
deleted file mode 100644
index 16597b3a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  subject: "collection or view"
-  action: " to modify"
----
-arg_name: param
-name: $collectionOptions
-type: array
-description: |
-  Collection or view options to assign.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml
deleted file mode 100644
index bb026bd9..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-option.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  This is not supported for server versions prior to 4.4 and will result in an
-  exception at execution time if used.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned command result document.
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: writeConcern
----
-arg_name: option
-name: dropTarget
-type: boolean
-description: |
-  If ``true``, MongoDB will drop the target before renaming the collection. The
-  default value is ``false``.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml
deleted file mode 100644
index 3043f4dd..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-renameCollection-param.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-arg_name: param
-name: $fromCollectionName
-type: string
-description: |
-  The name of the collection to rename.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $toCollectionName
-type: string
-description: |
-  The new name of the collection.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $toDatabaseName
-type: string
-description: |
-  The new database name of the collection. If a new database name is not
-  specified, the current database will be used. If the new name specifies a
-  different database, the command copies the collection to the new database
-  and drops the source collection.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
deleted file mode 100644
index 932c1b16..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "collection"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "collection"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "collection"
-  parent: "database"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
deleted file mode 100644
index 46d4e72a..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectCollection-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $collectionName
-replacement:
-  action: " to select"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
deleted file mode 100644
index 2039d114..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-option.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-arg_name: option
-name: bucketName
-type: string
-description: |
-  The bucket name, which will be used as a prefix for the files and chunks
-  collections. Defaults to ``"fs"``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: chunkSizeBytes
-type: integer
-description: |
-  The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-selectGridFSBucket-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
deleted file mode 100644
index b24efbec..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-watch-option.yaml
+++ /dev/null
@@ -1,71 +0,0 @@
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-common-option.yaml
-  ref: comment
-post: |
-  The comment can be any valid BSON type for server versions 4.4 and above.
-  Earlier server versions only support string values.
-
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocument
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: fullDocumentBeforeChange
-post: |
-  .. versionadded: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: maxAwaitTimeMS
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: readPreference
-post: |
-  This is used for both the initial change stream aggregation and for
-  server selection during an automatic resume.
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: resumeAfter
----
-source:
-  file: apiargs-common-option.yaml
-  ref: session
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: showExpandedEvents
-post: |
-  .. versionadded:: 1.13
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAfter
-post: |
-  .. versionadded: 1.5
----
-source:
-  file: apiargs-method-watch-option.yaml
-  ref: startAtOperationTime
----
-source:
-  file: apiargs-MongoDBDatabase-common-option.yaml
-  ref: typeMap
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
deleted file mode 100644
index b00e450c..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-watch-param.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $pipeline
----
-source:
-  file: apiargs-method-watch-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
deleted file mode 100644
index c048182c..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-withOptions-option.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "database"
-  parent: "original database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "database"
-  parent: "original database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: typeMap
-replacement:
-  parent: "original database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "database"
-  parent: "original database"
-...
diff --git a/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml b/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
deleted file mode 100644
index 73ad04d0..00000000
--- a/source/includes/apiargs-MongoDBDatabase-method-withOptions-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
deleted file mode 100644
index bf2de660..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
+++ /dev/null
@@ -1,61 +0,0 @@
-arg_name: option
-name: _id
-type: mixed
-description: |
-  Value to use as the file document identifier. Defaults to a new
-  :php:`MongoDB\\BSON\\ObjectId ` object.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: chunkSizeBytes
-type: integer
-description: |
-  The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: disableMD5
-type: boolean
-description: |
-  Whether to disable automatic MD5 generation when storing files.
-
-  Defaults to ``false``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: metadata
-type: array|object
-description: |
-  User data for the ``metadata`` field of the file document. If not specified,
-  the ``metadata`` field will not be set on the file document.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: revision
-type: integer
-description: |
-  The revision of the file to retrieve. Files with the name ``filename`` will be
-  differentiated by their ``uploadDate`` field.
-
-  Revision numbers are defined as follows:
-
-  - 0 = the original stored file
-  - 1 = the first revision
-  - 2 = the second revision
-  - etc...
-  - -2 = the second most recent revision
-  - -1 = the most recent revision
-
-   Defaults to -1 (i.e. the most recent revision).
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml
deleted file mode 100644
index f1d6b136..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-common-param.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
-arg_name: param
-name: $filename
-type: string
-description: |
-  The ``filename`` of the file{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $id
-type: mixed
-description: |
-  The ``_id`` of the file{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $stream
-type: resource
-description: |
-  The GridFS stream resource.
-interface: phpmethod
-operation: ~
----
-arg_name: param
-name: $destination
-type: resource
-description: |
-  Writable stream, to which the GridFS file's contents will be written.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
deleted file mode 100644
index c8a7eb79..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-option.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-arg_name: option
-name: bucketName
-type: string
-description: |
-  The bucket name, which will be used as a prefix for the files and chunks
-  collections. Defaults to ``"fs"``.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: chunkSizeBytes
-type: integer
-description: |
-  The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-common-option.yaml
-  ref: readPreference
-replacement:
-  resource: "bucket"
-  parent: "database"
----
-source:
-  file: apiargs-MongoDBClient-method-construct-driverOptions.yaml
-  ref: typeMap
----
-source:
-  file: apiargs-common-option.yaml
-  ref: writeConcern
-replacement:
-  resource: "bucket"
-  parent: "database"
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
deleted file mode 100644
index 5ef826c1..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-construct-param.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-source:
-  file: apiargs-common-param.yaml
-  ref: $manager
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $databaseName
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
deleted file mode 100644
index 7e8baa21..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-delete-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to delete"
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
deleted file mode 100644
index 39d48dc5..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStream-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to download"
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $destination
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
deleted file mode 100644
index 9dc941d9..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: revision
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
deleted file mode 100644
index 2704877b..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-downloadToStreamByName-param.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to download"
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $destination
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml
deleted file mode 100644
index 1f2e9d8e..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-find-option.yaml
+++ /dev/null
@@ -1,76 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: skip
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: limit
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: batchSize
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: comment
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: cursorType
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: readConcern
-description: |
-   :manual:`Read concern ` to use for the operation.
-   Defaults to the bucket's read concern.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: readPreference
-description: |
-   :manual:`Read preference ` to use for the
-   operation. Defaults to the bucket's read preference.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: oplogReplay
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: noCursorTimeout
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowPartialResults
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: typeMap
-replacement:
-  parent: "bucket"
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: modifiers
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
deleted file mode 100644
index 3d0d0ed8..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-findOne-option.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: projection
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: sort
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: skip
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: allowDiskUse
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: collation
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: comment
----
-source:
-  file: apiargs-common-option.yaml
-  ref: maxTimeMS
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: readConcern
----
-source:
-  file: apiargs-MongoDBGridFSBucket-method-find-option.yaml
-  ref: readPreference
----
-source:
-  file: apiargs-MongoDBGridFSBucket-method-find-option.yaml
-  ref: typeMap
-post: |
-  This will be used for the returned result document.
----
-source:
-  file: apiargs-MongoDBCollection-method-find-option.yaml
-  ref: modifiers
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
deleted file mode 100644
index 0801cb21..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileDocumentForStream-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $stream
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
deleted file mode 100644
index 0801cb21..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-getFileIdForStream-param.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $stream
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
deleted file mode 100644
index 54e7c8c2..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStream-param.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to download"
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
deleted file mode 100644
index 9dc941d9..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-option.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: revision
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
deleted file mode 100644
index eb8ec932..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openDownloadStreamByName-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to download"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
deleted file mode 100644
index 592040d6..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-option.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: _id
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: chunkSizeBytes
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: metadata
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
deleted file mode 100644
index 6b8efb34..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-openUploadStream-param.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to create"
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
deleted file mode 100644
index e1b140ae..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-rename-param.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $id
-replacement:
-  resource: " to rename"
----
-arg_name: param
-name: $newFilename
-type: string
-description: |
-  The new ``filename`` value.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
deleted file mode 100644
index 592040d6..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-option.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: _id
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: chunkSizeBytes
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: disableMD5
-post: |
-  .. versionadded: 1.4
----
-source:
-  file: apiargs-MongoDBGridFSBucket-common-option.yaml
-  ref: metadata
-...
diff --git a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml b/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
deleted file mode 100644
index 48fa2db4..00000000
--- a/source/includes/apiargs-MongoDBGridFSBucket-method-uploadFromStream-param.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-source:
-  file: apiargs-MongoDBGridFSBucket-common-param.yaml
-  ref: $filename
-replacement:
-  resource: " to create"
----
-arg_name: param
-name: $source
-type: resource
-description: |
-  Readable stream, from which the new GridFS file's contents will be read.
-interface: phpmethod
-operation: ~
-optional: false
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/apiargs-aggregate-option.yaml b/source/includes/apiargs-aggregate-option.yaml
deleted file mode 100644
index e5b410c4..00000000
--- a/source/includes/apiargs-aggregate-option.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
-arg_name: option
-name: allowDiskUse
-type: boolean
-description: |
-  Enables writing to temporary files. When set to ``true``, aggregation stages
-  can write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: batchSize
-type: integer
-description: |
-  Specifies the batch size for the cursor, which will apply to both the initial
-  ``aggregate`` command and any subsequent ``getMore`` commands. This determines
-  the maximum number of documents to return in each response from the server.
-
-  A batchSize of ``0`` is special in that and will only apply to the initial
-  ``aggregate`` command; subsequent ``getMore`` commands will use the server's
-  default batch size. This may be useful for quickly returning a cursor or
-  failure from ``aggregate`` without doing significant server-side work.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-MongoDBCollection-common-option.yaml
-  ref: bypassDocumentValidation
-post: |
-  This only applies when using the :ref:`$out ` and
-  :ref:`$out ` stages.
----
-arg_name: option
-name: explain
-type: boolean
-description: |
-  Specifies whether or not to return the information on the processing of the
-  pipeline.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-common-option.yaml b/source/includes/apiargs-common-option.yaml
deleted file mode 100644
index cae14187..00000000
--- a/source/includes/apiargs-common-option.yaml
+++ /dev/null
@@ -1,124 +0,0 @@
-arg_name: option
-name: collation
-type: array|object
-description: |
-   :manual:`Collation ` allows users to specify
-   language-specific rules for string comparison, such as rules for lettercase
-   and accent marks. When specifying collation, the ``locale`` field is
-   mandatory; all other collation fields are optional. For descriptions of the
-   fields, see :manual:`Collation Document
-   `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: comment
-type: mixed
-description: |
-  Enables users to specify an arbitrary comment to help trace the operation
-  through the :manual:`database profiler `,
-  :manual:`currentOp ` output, and
-  :manual:`logs `.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: hint
-type: string|array|object
-description: |
-  The index to use. Specify either the index name as a string or the index key
-  pattern as a document. If specified, then the query system will only consider
-  plans using the hinted index.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: let
-type: array|object
-description: |
-  Map of parameter names and values. Values must be constant or closed
-  expressions that do not reference document fields. Parameters can then be
-  accessed as variables in an aggregate expression context (e.g. ``$$var``).
-
-  This is not supported for server versions prior to 5.0 and will result in an
-  exception at execution time if used.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: maxTimeMS
-type: integer
-description: |
-   The cumulative time limit in milliseconds for processing operations on the
-   cursor. MongoDB aborts the operation at the earliest following
-   :term:`interrupt point`.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: readConcern
-type: :php:`MongoDB\\Driver\\ReadConcern `
-description: |
-  The default read concern to use for {{resource}} operations. Defaults to the
-  {{parent}}'s read concern.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  resource: "collection"
-  parent: "client"
----
-arg_name: option
-name: readPreference
-type: :php:`MongoDB\\Driver\\ReadPreference `
-description: |
-  The default read preference to use for {{resource}} operations. Defaults to
-  the {{parent}}'s read preference.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  resource: "collection"
-  parent: "client"
----
-arg_name: option
-name: session
-type: :php:`MongoDB\\Driver\\Session `
-description: |
-  Client session to associate with the operation.
-interface: phpmethod
-operation: ~
-optional: true
----
-arg_name: option
-name: typeMap
-type: array
-description: |
-  The :php:`type map
-  `
-  to apply to cursors, which determines how BSON documents are converted to PHP
-  values. Defaults to the {{parent}}'s type map.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  parent: "client"
----
-arg_name: option
-name: writeConcern
-type: :php:`MongoDB\\Driver\\WriteConcern `
-description: |
-  The default write concern to use for {{resource}} operations. Defaults
-  to the {{parent}}'s write concern.
-interface: phpmethod
-operation: ~
-optional: true
-replacement:
-  resource: "collection"
-  parent: "client"
-...
diff --git a/source/includes/apiargs-common-param.yaml b/source/includes/apiargs-common-param.yaml
deleted file mode 100644
index a8d79082..00000000
--- a/source/includes/apiargs-common-param.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
-arg_name: param
-name: $manager
-type: :php:`MongoDB\\Driver\\Manager `
-description: |
-  The :php:`Manager ` instance from the driver. The
-  manager maintains connections between the driver and your MongoDB instances.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $databaseName
-type: string
-description: |
-  The name of the database{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  action: ""
----
-arg_name: param
-name: $collectionName
-type: string
-description: |
-  The name of the {{subject}}{{action}}.
-interface: phpmethod
-operation: ~
-optional: false
-replacement:
-  subject: "collection"
-  action: ""
----
-arg_name: param
-name: $options
-type: array
-description: |
-  An array specifying the desired options.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-dropCollection-option.yaml b/source/includes/apiargs-dropCollection-option.yaml
deleted file mode 100644
index 158c4a43..00000000
--- a/source/includes/apiargs-dropCollection-option.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-arg_name: option
-name: encryptedFields
-type: array|object
-description: |
-  A document describing encrypted fields for queryable encryption. If omitted,
-  the ``encryptedFieldsMap`` option within the ``autoEncryption`` driver option
-  will be consulted. If ``encryptedFieldsMap`` was defined but does not specify
-  this collection, the library will make a final attempt to consult the
-  server-side value for ``encryptedFields``. See
-  `Field Encryption and Queryability `_
-  in the MongoDB manual for more information.
-
-  .. note::
-
-     This option is not passed to the :manual:`drop `
-     command. The library uses it to determine related metadata collections that
-     should be dropped in addition to an encrypted collection.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-function-add_logger-param.yaml b/source/includes/apiargs-function-add_logger-param.yaml
deleted file mode 100644
index 424b405f..00000000
--- a/source/includes/apiargs-function-add_logger-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-arg_name: param
-name: $logger
-type: Psr\\Log\\LoggerInterface
-description: |
-  A logger to register.
-
-  If the logger is already registered, the method will have no effect.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-function-remove_logger-param.yaml b/source/includes/apiargs-function-remove_logger-param.yaml
deleted file mode 100644
index 7ee1be56..00000000
--- a/source/includes/apiargs-function-remove_logger-param.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-arg_name: param
-name: $logger
-type: Psr\\Log\\LoggerInterface
-description: |
-  A logger to unregister.
-
-  If the logger is not registered, the method will have no effect.
-interface: phpmethod
-operation: ~
-optional: false
-...
diff --git a/source/includes/apiargs-function-with_transaction-param.yaml b/source/includes/apiargs-function-with_transaction-param.yaml
deleted file mode 100644
index 78875e91..00000000
--- a/source/includes/apiargs-function-with_transaction-param.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-arg_name: param
-name: $session
-type: :php:`MongoDB\\Driver\\Session `
-description: |
-  A client session used to execute the transaction.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $callback
-type: callback
-description: |
-  A callback that will be run inside the transaction. The callback must accept a
-  :php:`MongoDB\\Driver\\Session ` object as first
-  argument.
-interface: phpmethod
-operation: ~
-optional: false
----
-arg_name: param
-name: $transactionOptions
-type: array
-description: |
-  Transaction options, which will be passed to
-  :php:`MongoDB\\Driver\\Session::startTransaction `.
-  See the extension documentation for a list of supported options.
-interface: phpmethod
-operation: ~
-optional: true
-...
diff --git a/source/includes/apiargs-method-watch-param.yaml b/source/includes/apiargs-method-watch-param.yaml
deleted file mode 100644
index e0da852c..00000000
--- a/source/includes/apiargs-method-watch-param.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-arg_name: param
-name: $pipeline
-type: array|object
-description: |
-  The pipeline of stages to append to an initial ``$changeStream`` stage.
-interface: phpmethod
-operation: ~
-optional: true
----
-source:
-  file: apiargs-common-param.yaml
-  ref: $options
-...
diff --git a/source/includes/extracts-bucket-option.yaml b/source/includes/extracts-bucket-option.yaml
new file mode 100644
index 00000000..0492ae9f
--- /dev/null
+++ b/source/includes/extracts-bucket-option.yaml
@@ -0,0 +1,28 @@
+ref: bucket-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+---
+ref: bucket-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+---
+ref: bucket-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+---
+ref: bucket-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: bucket
+...
diff --git a/source/includes/extracts-client-option.yaml b/source/includes/extracts-client-option.yaml
new file mode 100644
index 00000000..9b9020bd
--- /dev/null
+++ b/source/includes/extracts-client-option.yaml
@@ -0,0 +1,28 @@
+ref: client-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+---
+ref: client-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+---
+ref: client-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+---
+ref: client-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: client
+...
diff --git a/source/includes/extracts-collection-option.yaml b/source/includes/extracts-collection-option.yaml
new file mode 100644
index 00000000..94d9b9b0
--- /dev/null
+++ b/source/includes/extracts-collection-option.yaml
@@ -0,0 +1,38 @@
+ref: collection-option-collation
+source: 
+  ref: common-option-collation
+  file: extracts-common-option.yaml
+post: |
+  If the collation is unspecified but the collection has a default collation,
+  the operation uses the collation specified for the collection. If no
+  collation is specified for the collection or for the operation, MongoDB uses
+  the simple binary comparison used in prior versions for string comparisons.
+---
+ref: collection-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+---
+ref: collection-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+---
+ref: collection-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+---
+ref: collection-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: collection
+...
diff --git a/source/includes/extracts-common-option.yaml b/source/includes/extracts-common-option.yaml
new file mode 100644
index 00000000..65940b1c
--- /dev/null
+++ b/source/includes/extracts-common-option.yaml
@@ -0,0 +1,86 @@
+ref: common-option-collation
+content: |
+  :manual:`Collation ` allows users to specify
+  language-specific rules for string comparison, such as rules for lettercase
+  and accent marks. When specifying collation, the ``locale`` field is
+  mandatory; all other collation fields are optional. For descriptions of the
+  fields, see :manual:`Collation Document `.
+---
+ref: common-option-comment
+content: |
+  Enables users to specify an arbitrary comment to help trace the operation
+  through the :manual:`database profiler `,
+  :manual:`currentOp ` output, and
+  :manual:`logs `.
+---
+ref: common-option-comment-string-before-4.4
+content: |
+  The comment can be any valid BSON type since MongoDB 4.4. Earlier server
+  versions only support string values.
+---
+ref: common-option-hint
+content: |
+  The index to use. Specify either the index name as a string or the index key
+  pattern as a document. If specified, then the query system will only consider
+  plans using the hinted index.
+---
+ref: common-option-let
+content: |
+  Map of parameter names and values. Values must be constant or closed
+  expressions that do not reference document fields. Parameters can then be
+  accessed as variables in an aggregate expression context (e.g. ``$$var``).
+
+  This is not supported for server versions prior to 5.0 and will result in an
+  exception at execution time if used.
+---
+ref: common-option-maxTimeMS
+content: |
+  The cumulative time limit in milliseconds for processing operations on the
+  cursor. MongoDB aborts the operation at the earliest following
+  :term:`interrupt point`.
+---
+ref: common-option-readConcern
+content: |
+  :manual:`Read concern ` to use for the operation.
+  Defaults to the {{object}}'s read concern.
+replacement:
+  object: object
+---
+ref: common-option-readConcern-transaction
+content: |
+  It is not possible to specify a read concern for individual operations as part
+  of a transaction. Instead, set the ``readConcern`` option when
+  :php:`starting the transaction `.
+---
+ref: common-option-readPreference
+content: |
+  :manual:`Read preference ` to use for the
+  operation. Defaults to the {{object}}'s read preference.
+replacement:
+  object: object
+---
+ref: common-option-session
+content: |
+  Client session to associate with the operation.
+---
+ref: common-option-typeMap
+content: |
+  The :php:`type map `
+  to apply to cursors, which determines how BSON documents are converted to PHP
+  values. Defaults to the {{object}}'s type map.
+replacement:
+  object: object
+---
+ref: common-option-writeConcern
+content: |
+  :manual:`Write concern ` to use for the operation.
+  Defaults to the {{object}}'s write concern.
+replacement:
+  object: object
+---
+ref: common-option-writeConcern-transaction
+content: |
+  It is not possible to specify a write concern for individual operations as
+  part of a transaction. Instead, set the ``writeConcern`` option when
+  :php:`starting the transaction `.
+...
diff --git a/source/includes/extracts-database-option.yaml b/source/includes/extracts-database-option.yaml
new file mode 100644
index 00000000..e83c7abf
--- /dev/null
+++ b/source/includes/extracts-database-option.yaml
@@ -0,0 +1,28 @@
+ref: database-option-readConcern
+source:
+  ref: common-option-readConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+---
+ref: database-option-readPreference
+source:
+  ref: common-option-readPreference
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+---
+ref: database-option-typeMap
+source:
+  ref: common-option-typeMap
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+---
+ref: database-option-writeConcern
+source:
+  ref: common-option-writeConcern
+  file: extracts-common-option.yaml
+replacement:
+  object: database
+...
diff --git a/source/includes/extracts-note.yaml b/source/includes/extracts-note.yaml
index 46dadfea..4c41e191 100644
--- a/source/includes/extracts-note.yaml
+++ b/source/includes/extracts-note.yaml
@@ -12,21 +12,17 @@ content: |
 ---
 ref: note-atlas-search-requirement
 content: |
-  .. note::
-
-     This command can only be run on a deployment hosted on
-     :manual:`MongoDB Atlas ` and requires an Atlas cluster tier of at
-     least M10. A
-     `Local Atlas Deployment `__
-     can also be used for development.
+  This command can only be run on a deployment hosted on
+  :manual:`MongoDB Atlas ` and requires an Atlas cluster tier of at
+  least M10. A
+  `Local Atlas Deployment `__
+  can also be used for development.
 ---
 ref: note-atlas-search-async
 content: |
-   .. note::
-
-      Atlas Search indexes are managed asynchronously. After creating or
-      updating an index, you can periodically execute
-      :phpmethod:`MongoDB\\Collection::listSearchIndexes()` and check the
-      ``queryable`` :manual:`output field  `
-      to determine whether it is ready to be used.
+  Atlas Search indexes are managed asynchronously. After creating or updating an
+  index, you can periodically execute
+  :phpmethod:`MongoDB\\Collection::listSearchIndexes()` and check the
+  ``queryable`` :manual:`output field  `
+  to determine whether it is ready to be used.
 ...
diff --git a/source/includes/extracts-option-requires.yaml b/source/includes/extracts-option-requires.yaml
new file mode 100644
index 00000000..3b65fbba
--- /dev/null
+++ b/source/includes/extracts-option-requires.yaml
@@ -0,0 +1,48 @@
+---
+ref: option-requires-4.2
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "4.2"
+---
+ref: option-requires-4.4
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "4.4"
+---
+ref: option-requires-5.0
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "5.0"
+---
+ref: option-requires-5.3
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "5.3"
+---
+ref: option-requires-6.0
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "6.0"
+---
+ref: option-requires-7.0
+source:
+  ref: option-requires-version
+  file: extracts-option-requires.yaml
+replacement:
+  version: "7.0"
+---
+ref: option-requires-version
+content: |
+  This option is available since MongoDB {{version}} and will result in an
+  exception at execution time if specified for an older server version.
+...
diff --git a/source/includes/apiargs-method-watch-option.yaml b/source/includes/extracts-watch-option.yaml
similarity index 76%
rename from source/includes/apiargs-method-watch-option.yaml
rename to source/includes/extracts-watch-option.yaml
index d0927828..533e76ac 100644
--- a/source/includes/apiargs-method-watch-option.yaml
+++ b/source/includes/extracts-watch-option.yaml
@@ -1,8 +1,5 @@
----
-arg_name: option
-name: batchSize
-type: integer
-description: |
+ref: watch-option-batchSize
+content: |
   Specifies the batch size for the cursor, which will apply to both the initial
   ``aggregate`` command and any subsequent ``getMore`` commands. This determines
   the maximum number of change events to return in each response from the
@@ -14,20 +11,15 @@ description: |
      response for a change stream generally does not include any documents
      unless another option is used to configure its starting point (e.g.
      ``startAfter``).
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: fullDocument
-type: string
-description: |
-  Determines how the "fullDocument" response field will be populated for update
-  operations.
+ref: watch-option-fullDocument
+content: |
+  Determines how the ``fullDocument`` response field will be populated for
+  update operations.
 
   By default, change streams only return the delta of fields (via an
-  "updateDescription" field) for update operations and "fullDocument" is
-  omitted. Insert and replace operations always include the "fullDocument"
+  ``updateDescription`` field) for update operations and ``fullDocument`` is
+  omitted. Insert and replace operations always include the ``fullDocument``
   field. Delete operations omit the field as the document no longer exists.
 
   Specify "updateLookup" to return the current majority-committed version of the
@@ -48,15 +40,10 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: fullDocumentBeforeChange
-type: string
-description: |
-  Determines how the "fullDocumentBeforeChange" response field will be
+ref: watch-option-fullDocumentBeforeChange
+content: |
+  Determines how the ``fullDocumentBeforeChange`` response field will be
   populated. By default, the field is omitted.
 
   MongoDB 6.0+ allows returning the pre-image of the modified document if the
@@ -73,24 +60,16 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
+
+  .. versionadded: 1.13
 ---
-arg_name: option
-name: maxAwaitTimeMS
-type: integer
-description: |
+ref: watch-option-maxAwaitTimeMS
+content: |
   Positive integer denoting the time limit in milliseconds for the server to
   block a getMore operation if no data is available.
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: resumeAfter
-type: array|object
-description: |
+ref: watch-option-resumeAfter
+content: |
   Specifies the logical starting point for the new change stream. The ``_id``
   field in documents returned by the change stream may be used here.
 
@@ -101,14 +80,9 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
 ---
-arg_name: option
-name: showExpandedEvents
-type: boolean
-description: |
+ref: watch-option-showExpandedEvents
+content: |
   If true, instructs the server to include additional DDL events in the change
   stream. The additional events that may be included are:
 
@@ -126,14 +100,11 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
+
+  .. versionadded:: 1.13
 ---
-arg_name: option
-name: startAfter
-type: array|object
-description: |
+ref: watch-option-startAfter
+content: |
   Specifies the logical starting point for the new change stream. The ``_id``
   field in documents returned by the change stream may be used here. Unlike
   ``resumeAfter``, this option can be used with a resume token from an
@@ -149,14 +120,11 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
+
+  .. versionadded: 1.5
 ---
-arg_name: option
-name: startAtOperationTime
-type: :php:`MongoDB\\BSON\\TimestampInterface `
-description: |
+ref: watch-option-startAtOperationTime
+content: |
   If specified, the change stream will only provide changes that occurred at or
   after the specified timestamp. Command responses from a MongoDB 4.0+ server
   include an ``operationTime`` that can be used here. By default, the
@@ -172,7 +140,4 @@ description: |
   .. note::
 
      This is an option of the ``$changeStream`` pipeline stage.
-interface: phpmethod
-operation: ~
-optional: true
 ...
diff --git a/source/reference/function/add_logger.txt b/source/reference/function/add_logger.txt
index ada7c9de..f00039df 100644
--- a/source/reference/function/add_logger.txt
+++ b/source/reference/function/add_logger.txt
@@ -23,9 +23,13 @@ Definition
 
       function add_logger(Psr\Log\LoggerInterface $logger): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$logger`` : Psr\\Log\\LoggerInterface
+  A logger to register.
 
-   .. include:: /includes/apiargs/function-add_logger-param.rst
+  If the logger is already registered, the method will have no effect.
 
 Behavior
 --------
diff --git a/source/reference/function/remove_logger.txt b/source/reference/function/remove_logger.txt
index d183f94b..5ced6f0a 100644
--- a/source/reference/function/remove_logger.txt
+++ b/source/reference/function/remove_logger.txt
@@ -23,9 +23,13 @@ Definition
 
       function remove_logger(Psr\Log\LoggerInterface $logger): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$logger`` : Psr\\Log\\LoggerInterface
+  A logger to unregister.
 
-   .. include:: /includes/apiargs/function-remove_logger-param.rst
+  If the logger is not registered, the method will have no effect.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/function/with_transaction.txt b/source/reference/function/with_transaction.txt
index f7b7b92d..438ea7a1 100644
--- a/source/reference/function/with_transaction.txt
+++ b/source/reference/function/with_transaction.txt
@@ -21,11 +21,27 @@ Definition
 
    .. code-block:: php
 
-      function with_transaction(MongoDB\Driver\Session $session, callable $callback, array $transactionOptions = []): void
+      function with_transaction(
+          MongoDB\Driver\Session $session,
+          callable $callback,
+          array $transactionOptions = []
+      ): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$session`` : :php:`MongoDB\\Driver\\Session `
+  A client session used to execute the transaction.
+
+``$callback`` : :php:`callable `
+  A callback that will be run inside the transaction. The callback must accept a
+  :php:`MongoDB\\Driver\\Session ` object as its first
+  argument.
 
-   .. include:: /includes/apiargs/function-with_transaction-param.rst
+``$transactionOptions`` : array
+  Transaction options, which will be passed to
+  :php:`MongoDB\\Driver\\Session::startTransaction `.
+  See the extension documentation for a list of supported options.
 
 Behavior
 --------
diff --git a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
index 2e8f708b..da115c5f 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
@@ -20,7 +20,7 @@ Definition
 
    .. code-block:: php
 
-      function getModifiedCount(): integer|null
+      function getModifiedCount(): integer
 
    This method should only be called if the write was acknowledged.
 
diff --git a/source/reference/method/MongoDBClient-createClientEncryption.txt b/source/reference/method/MongoDBClient-createClientEncryption.txt
index 9b6f817e..0dd925cd 100644
--- a/source/reference/method/MongoDBClient-createClientEncryption.txt
+++ b/source/reference/method/MongoDBClient-createClientEncryption.txt
@@ -22,15 +22,18 @@ Definition
 
       function createClientEncryption(array $options): MongoDB\Driver\ClientEncryption
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBClient-method-createClientEncryption-param.rst
+``$options`` : array
+  An array specifying the desired options. Refer to the
+  :php:`MongoDB\\Driver\\Manager::createClientEncryption() `
+  extension documentation for a list of supported options.
 
-   The ``$options`` parameter supports all options documented in the
-   :php:`extension manual `.
-   For the ``keyVaultClient`` option, an instance of :phpclass:`MongoDB\\Client`
-   is automatically unwrapped and the :php:`MongoDB\\Driver\\Manager `
-   instance is passed to the extension.
+  If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+  option, it will be unwrapped into a
+  :php:`MongoDB\\Driver\\Manager ` for the
+  extension.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index 3e963ee5..5a268765 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -21,13 +21,46 @@ Definition
 
       function dropDatabase(string $databaseName, array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$databaseName`` : string
+  The name of the database to drop.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/client-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-dropDatabase-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/client-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-listDatabaseNames.txt b/source/reference/method/MongoDBClient-listDatabaseNames.txt
index bf4fb48f..cac7d22c 100644
--- a/source/reference/method/MongoDBClient-listDatabaseNames.txt
+++ b/source/reference/method/MongoDBClient-listDatabaseNames.txt
@@ -23,13 +23,56 @@ Definition
 
       function listDatabaseNames(array $options = []): Iterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedDatabases
+       - boolean
+       - A flag that determines which databases are returned based on the user
+         privileges when access control is enabled. For more information, see the
+         `listDatabases command documentation `_.
+
+         For servers < 4.0.5, this option is ignored.
+
+         .. versionadded:: 1.7
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of databases.
+
+         You can specify a query expression for database fields (e.g. ``name``,
+         ``sizeOnDisk``, ``empty``).
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-param.rst
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-option.rst
+         .. versionadded:: 1.3
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index 822f98d7..dd6b2da8 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -21,13 +21,58 @@ Definition
 
       function listDatabases(array $options = []): MongoDB\Model\DatabaseInfoIterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedDatabases
+       - boolean
+       - A flag that determines which databases are returned based on the user
+         privileges when access control is enabled. For more information, see the
+         `listDatabases command documentation `_.
+
+         For servers < 4.0.5, this option is ignored.
+
+         .. versionadded:: 1.7
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of databases.
+
+         You can specify a query expression for database fields (e.g. ``name``,
+         ``sizeOnDisk``, ``empty``).
+
+         .. versionadded:: 1.3
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
 
-   .. include:: /includes/apiargs/MongoDBClient-method-listDatabases-option.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 88828c29..6700f023 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -19,15 +19,51 @@ Definition
 
    .. code-block:: php
 
-      function selectCollection(string $databaseName, string $collectionName, array $options = []): MongoDB\Collection
+      function selectCollection(
+          string $databaseName,
+          string $collectionName,
+          array $options = []
+      ): MongoDB\Collection
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$databaseName`` : string
+  The name of the database containing the collection to select.
+
+``$collectionName`` : string
+  The name of the collection to select.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the client's read concern.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the client's read preference.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for collection operations. Defaults to the
+         client's type map.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults to
+         the client's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index a556a06a..b1814516 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -19,15 +19,47 @@ Definition
 
    .. code-block:: php
 
-      function selectDatabase(string $databaseName, array $options = []): MongoDB\Database
+      function selectDatabase(
+          string $databaseName,
+          array $options = []
+      ): MongoDB\Database
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$databaseName`` : string
+  The name of the database to select.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for database operations. Defaults to
+         the client's read concern.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for database operations. Defaults to
+         the client's read preference.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for database operations. Defaults to the
+         client's type map.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-selectDatabase-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for database operations. Defaults to
+         the client's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-startSession.txt b/source/reference/method/MongoDBClient-startSession.txt
index 07a9b2b2..8de00ee0 100644
--- a/source/reference/method/MongoDBClient-startSession.txt
+++ b/source/reference/method/MongoDBClient-startSession.txt
@@ -23,9 +23,13 @@ Definition
 
       function startSession(array $options = []): MongoDB\Driver\Session
 
-   Refer to the :php:`MongoDB\\Driver\\Manager::startSession()
-   ` extension reference for accepted
-   options.
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options. Refer to the
+  :php:`MongoDB\\Driver\\Manager::startSession() `
+  extension documentation for a list of supported options.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient-watch.txt b/source/reference/method/MongoDBClient-watch.txt
index 0e7aab34..2977475a 100644
--- a/source/reference/method/MongoDBClient-watch.txt
+++ b/source/reference/method/MongoDBClient-watch.txt
@@ -22,15 +22,90 @@ Definition
 
    .. code-block:: php
 
-      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+      function watch(
+          array $pipeline = [],
+          array $options = []
+      ): MongoDB\ChangeStream
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array|object
+  The pipeline of stages to append to an initial ``$changeStream`` stage.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - batchSize
+       - integer
+       - .. include:: /includes/extracts/watch-option-batchSize.rst
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+  
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - fullDocument
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocument.rst
+
+     * - fullDocumentBeforeChange
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocumentBeforeChange.rst
+
+     * - maxAwaitTimeMS
+       - integer
+       - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/client-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/client-option-readPreference.rst
+
+         This is used for both the initial change stream aggregation and for
+         server selection during an automatic resume.
+
+     * - resumeAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-resumeAfter.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - showExpandedEvents
+       - boolean
+       - .. include:: /includes/extracts/watch-option-showExpandedEvents.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-watch-param.rst
+     * - startAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-startAfter.rst
 
-   The ``$options`` parameter supports the following options:
+     * - startAtOperationTime
+       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
-   .. include:: /includes/apiargs/MongoDBClient-method-watch-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/client-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index 07694c91..1134df67 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -19,15 +19,195 @@ Definition
 
    .. code-block:: php
 
-      function __construct(?string $uri = null, array $uriOptions = [], array $driverOptions = [])
+      function __construct(
+          ?string $uri = null,
+          array $uriOptions = [],
+          array $driverOptions = []
+      )
 
-   This constructor has the following parameters:
+Parameters
+----------
+
+``$uri`` : string
+  The MongoDB connection string. Refer to
+  :manual:`Connection Strings ` in the MongoDB
+  manual for more information.
+
+  Defaults to ``"mongodb://127.0.0.1:27017"`` if unspecified.
+
+  Any special characters in the URI components need to be encoded according to
+  `RFC 3986 `_. This is particularly
+  relevant to the username and password, which can often include special
+  characters such as ``@``, ``:``, or ``%``. When connecting via a Unix domain
+  socket, the socket path may contain special characters such as slashes and
+  must be encoded. The :php:`rawurlencode() ` function may be used
+  to encode constituent parts of the URI.
+
+``$uriOptions`` : array
+  Specifies additional URI options, such as authentication credentials or query
+  string parameters. The options specified in ``$uriOptions`` take precedence
+  over any analogous options present in the ``$uri`` string and do not need to
+  be encoded according to `RFC 3986 `_.
+
+  Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
+  ` extension documentation for a list of
+  supported options.
+
+``$driverOptions`` : array
+  Specifies options specific to the PHP driver. In addition to driver options
+  supported by the :php:`extension `, the library
+  additionally supports specifying a default 
+  :php:`type map `
+  to apply to the cursors it creates.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - autoEncryption
+       - array
+       - Options to configure client-side field-level encryption in the driver.
+         Refer to the
+         :php:`extension documentation `
+         for a list of supported encryption options.
+
+         If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+         option, it will be unwrapped into a
+         :php:`MongoDB\\Driver\\Manager ` for the
+         extension.
+
+         .. versionadded:: 1.6
+
+     * - driver
+       - array
+       - Additional driver metadata to be passed on to the server handshake.
+         This is an array containing ``name``, ``version``, and ``platform``
+         string fields. For example:
+
+         .. code-block:: php
+
+            [
+                'name' => 'my-driver',
+                'version' => '1.2.3-dev',
+                'platform' => 'some-platform',
+            ]
+
+         .. note::
+
+            This feature is primarily designed for custom drivers and ODMs,
+            which may want to identify themselves to the server for diagnostic
+            purposes. Applications wishing to identify themselves should use the
+            ``appName`` URI option instead of this option.
+
+         .. versionadded:: 1.7
+
+     * - serverApi
+       - :php:`MongoDB\\Driver\\ServerApi `
+       - Used to declare an API version on the client. Refer to
+         :manual:`Stable API tutorial ` for additional
+         information.
+
+         .. versionadded:: 1.9
+
+     * - typeMap
+       - array
+       - Default :php:`type map `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
+
+         .. code-block:: php
+
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
+
+     * - allow_invalid_hostname
+       - boolean
+       - Disables hostname validation if ``true``. Defaults to ``false``.
+
+         Allowing invalid hostnames may expose the driver to a
+         `man-in-the-middle attack `__.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the
+            ``tlsAllowInvalidHostnames`` URI option instead.
+
+     * - ca_dir
+       - string
+       - Path to a correctly hashed certificate directory. The system
+         certificate store will be used by default.
+
+         Falls back to the deprecated ``capath`` SSL context option if not
+         specified.
+
+     * - ca_file
+       - string
+       - Path to a certificate authority file. The system certificate store will
+         be used by default.
+
+         Falls back to the deprecated ``cafile`` SSL context option if not
+         specified.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the ``tlsCAFile`` URI option
+            instead.
+
+     * - crl_file
+       - string
+       - Path to a certificate revocation list file.
+
+     * - pem_file
+       - string
+       - Path to a PEM encoded certificate to use for client authentication.
+
+         Falls back to the deprecated ``local_cert`` SSL context option if not
+         specified.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the ``tlsCertificateKeyFile``
+            URI option instead.
+
+     * - pem_pwd
+       - string
+       - Passphrase for the PEM encoded certificate (if applicable).
+
+         Falls back to the deprecated ``passphrase`` SSL context option if not
+         specified.
+
+         .. deprecated:: 1.6
+
+            This option has been deprecated. Use the
+            ``tlsCertificateKeyFilePassword`` URI option instead.
+
+     * - weak_cert_validation
+       - boolean
+       - Disables certificate validation ``true``. Defaults to ``false``.
+
+         Falls back to the deprecated ``allow_self_signed`` SSL context option
+         if not specified.
+
+         .. deprecated:: 1.6
 
-   .. include:: /includes/apiargs/MongoDBClient-method-construct-param.rst
+            This option has been deprecated. Use the
+            ``tlsAllowInvalidCertificates`` URI option instead.
 
-   The ``$driverOptions`` parameter supports the following options:
+     * - context
+       - resource
+       - :php:`SSL context options ` to be used as
+         fallbacks for other driver options (as specified). Note that the driver
+         does not consult the default stream context.
 
-   .. include:: /includes/apiargs/MongoDBClient-method-construct-driverOptions.rst
+         This option is supported for backwards compatibility, but should be
+         considered deprecated.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
index 5e4097b2..88de4725 100644
--- a/source/reference/method/MongoDBClient__get.txt
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -23,9 +23,11 @@ Definition
 
       function __get(string $databaseName): MongoDB\Database
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBClient-method-get-param.rst
+``$databaseName`` : string
+  The name of the database to select.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index 6975098d..11f9d19b 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -20,15 +20,120 @@ Definition
 
    .. code-block:: php
 
-      function aggregate(array $pipeline, array $options = []): Traversable
+      function aggregate(
+          array $pipeline,
+          array $options = []
+      ): Traversable
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array
+  Specifies an :manual:`aggregation pipeline `
+  operation.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, aggregation
+         stages can write data to the ``_tmp`` sub-directory in the ``dbPath``
+         directory.
+
+     * - batchSize
+       - integer
+       - Specifies the batch size for the cursor, which will apply to both the
+         initial ``aggregate`` command and any subsequent ``getMore`` commands.
+         This determines the maximum number of documents to return in each
+         response from the server.
+
+         A batchSize of ``0`` is special in that and will only apply to the
+         initial ``aggregate`` command; subsequent ``getMore`` commands will use
+         the server's default batch size. This may be useful for quickly
+         returning a cursor or failure from ``aggregate`` without doing
+         significant server-side work.
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+         This only applies when using the :ref:`$out ` and
+         :ref:`$out ` stages.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         The comment can be any valid BSON type for server versions 4.4 and
+         above. Earlier server versions only support string values.
+
+         .. versionadded:: 1.3
+
+     * - explain
+       - boolean
+       - Specifies whether or not to return the information on the processing of
+         the pipeline.
+
+         .. versionadded:: 1.4
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.3
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.9
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-param.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   The ``$options`` parameter supports the following options:
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-aggregate-option.rst
+         This only applies when a :ref:`$out ` or
+         :ref:`$merge ` stage is specified.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index e58688cb..a86e9cc6 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -19,15 +19,92 @@ Definition
 
    .. code-block:: php
 
-      function bulkWrite(array $operations, array $options = []): MongoDB\BulkWriteResult
+      function bulkWrite(
+          array $operations,
+          array $options = []
+      ): MongoDB\BulkWriteResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$operations`` : array
+  An array containing the write operations to perform.
+  :phpmethod:`MongoDB\\Collection::bulkWrite()` supports
+  :phpmethod:`deleteMany() `,
+  :phpmethod:`deleteOne() `,
+  :phpmethod:`insertOne() `,
+  :phpmethod:`replaceOne() `,
+  :phpmethod:`updateMany() `, and
+  :phpmethod:`updateOne() ` operations in the
+  following array structure:
+
+  .. code-block:: php
+
+     [
+         [ 'deleteMany' => [ $filter ] ],
+         [ 'deleteOne'  => [ $filter ] ],
+         [ 'insertOne'  => [ $document ] ],
+         [ 'replaceOne' => [ $filter, $replacement, $options ] ],
+         [ 'updateMany' => [ $filter, $update, $options ] ],
+         [ 'updateOne'  => [ $filter, $update, $options ] ],
+     ]
+
+  Arguments correspond to the respective operation methods. However, the
+  ``writeConcern`` option is specified as a top-level option to
+  :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
+  operation.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - ordered
+       - boolean
+       - If ``true``: when a single write fails, the operation will stop without
+         performing the remaining writes and throw an exception.
+
+         If ``false``: when a single write fails, the operation will continue
+         with the remaining writes, if any, and throw an exception.
+
+         The default is ``true``.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-bulkWrite-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 1673ed91..0048703f 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -21,15 +21,77 @@ Definition
 
    .. code-block:: php
 
-      function count(array|object $filter = [], array $options = []): integer
+      function count(
+          array|object $filter = [],
+          array $options = []
+      ): integer
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to count.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionchanged:: 1.2
+
+            If a document is provided, it is passed to the command as-is.
+            Previously, the library would convert the key pattern to an index
+            name.
+
+     * - limit
+       - integer
+       - The maximum number of matching documents to return.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-count-param.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-count-option.rst
+     * - skip
+       - integer
+       - The number of matching documents to skip before returning results.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt
index 44b16c8e..dc62b1d6 100644
--- a/source/reference/method/MongoDBCollection-countDocuments.txt
+++ b/source/reference/method/MongoDBCollection-countDocuments.txt
@@ -23,13 +23,62 @@ Definition
 
       function countDocuments(array|object $filter = [], array $options = []): integer
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to count.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+     * - limit
+       - integer
+       - The maximum number of matching documents to return.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-countDocuments-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-countDocuments-option.rst
+     * - skip
+       - integer
+       - The number of matching documents to skip before returning results.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index ceef2e7b..7f8aca41 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -19,20 +19,114 @@ Definition
 
    .. code-block:: php
 
-      function createIndex(array|object $key, array $options = []): string
+      function createIndex(
+          array|object $key,
+          array $options = []
+      ): string
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$key`` : array|object
+  Specifies the field or fields to index and the index order.
+
+  For example, the following specifies a descending index on the ``username``
+  field:
+
+  .. code-block:: php
+
+     [ 'username' => -1 ]
+
+``$options`` : array
+  An array specifying the desired options.
+
+  The ``$options`` parameter accepts both index *and* command options. A
+  non-exhaustive list of index options follows. For a complete list of index
+  options, refer to the
+  :manual:`createIndexes ` command reference
+  in the MongoDB manual.
+
+  **Index Options** (non-exhaustive)
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - expireAfterSeconds
+       - integer
+       - Creates a :manual:`TTL ` index.
+
+     * - name
+       - string
+       - A name that uniquely identifies the index. By default, MongoDB creates
+         index names based on the key.
+
+     * - partialFilterExpression
+       - array|object
+       - Creates a :manual:`partial ` index.
+
+     * - sparse
+       - boolean
+       - Creates a :manual:`sparse ` index.
+
+     * - unique
+       - boolean
+       - Creates a :manual:`unique ` index.
+
+  **Command Options**
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - commitQuorum
+       - string|integer
+       - Specifies how many data-bearing members of a replica set, including the
+         primary, must complete the index builds successfully before the primary
+         marks the indexes as ready.
+
+         This option accepts the same values for the ``w`` field in a write
+         concern plus ``"votingMembers"``, which indicates all voting
+         data-bearing nodes.
+
+         This is not supported for server versions prior to 4.4 and will result
+         in an exception at execution time if used.
+
+         .. versionadded:: 1.7
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-param.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   The ``$options`` parameter accepts all index options that your MongoDB
-   version supports. MongoDB includes the following options:
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndex-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   For a full list of the supported index creation options, refer to the
-   :manual:`createIndexes ` command reference
-   in the MongoDB manual.
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index 76705e9b..efb740ea 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -19,15 +19,78 @@ Definition
 
    .. code-block:: php
 
-      function createIndexes(array $indexes, array $options = []): string[]
+      function createIndexes(
+          array $indexes,
+          array $options = []
+      ): string[]
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$indexes`` : array
+  The indexes to create on the collection.
+
+  For example, the following specifies a unique index on the ``username`` field
+  and a compound index on the ``email`` and ``createdAt`` fields:
+
+  .. code-block:: php
+
+     [
+         [ 'key' => [ 'username' => -1 ], 'unique' => true ],
+         [ 'key' => [ 'email' => 1, 'createdAt' => 1 ] ],
+     ]
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-param.rst
+         .. versionadded:: 1.13
 
-   The ``$options`` parameter supports the following options:
+     * - commitQuorum
+       - string|integer
+       - Specifies how many data-bearing members of a replica set, including the
+         primary, must complete the index builds successfully before the primary
+         marks the indexes as ready.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createIndexes-option.rst
+         This option accepts the same values for the ``w`` field in a write
+         concern plus ``"votingMembers"``, which indicates all voting
+         data-bearing nodes.
+
+         This is not supported for server versions prior to 4.4 and will result
+         in an exception at execution time if used.
+
+         .. versionadded:: 1.7
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
+
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
@@ -41,15 +104,21 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
 ``$indexes`` parameter
-----------------------
+~~~~~~~~~~~~~~~~~~~~~~
 
 The ``$indexes`` parameter is an array of index specification documents. Each
 element in ``$indexes`` must itself be an array or object with a ``key`` field,
 which corresponds to the ``$key`` parameter of :phpmethod:`createIndex()
 `. The array or object may include other
 fields that correspond to index options accepted by :phpmethod:`createIndex()
-` (excluding ``writeConcern``).
+`. For a full list of the supported index
+creation options, refer to the
+:manual:`createIndexes ` command reference
+in the MongoDB manual.
 
 For example, the following ``$indexes`` parameter creates two indexes. The first
 is an ascending unique index on the ``username`` field and the second is a
diff --git a/source/reference/method/MongoDBCollection-createSearchIndex.txt b/source/reference/method/MongoDBCollection-createSearchIndex.txt
index d3f63773..df947463 100644
--- a/source/reference/method/MongoDBCollection-createSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-createSearchIndex.txt
@@ -21,18 +21,41 @@ Definition
 
    .. code-block:: php
 
-      function createSearchIndex(array|object $definition, array $options = []): string
+      function createSearchIndex(
+          array|object $definition,
+          array $options = []
+      ): string
 
-   This method has the following parameters:
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndex-param.rst
+Parameters
+----------
 
-   The ``$options`` parameter supports the following options:
+``$definition`` : array|object
+  Document describing the index to create. For details on definition syntax, see
+  :manual:`Search Index Definition Syntax `.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndex-option.rst
+``$options`` : array
+  An array specifying the desired options.
 
-   .. include:: /includes/extracts/note-atlas-search-requirement.rst
-   .. include:: /includes/extracts/note-atlas-search-async.rst
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+     * - name
+       - string
+       - Name of the search index to create.
+
+         You cannot create multiple indexes with the same name on a single
+         collection. If you do not specify a name, the index is named "default".
 
 Return Values
 -------------
@@ -46,6 +69,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-atlas-search-async.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-createSearchIndexes.txt b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
index 176dbf6a..584d94b3 100644
--- a/source/reference/method/MongoDBCollection-createSearchIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
@@ -21,18 +21,41 @@ Definition
 
    .. code-block:: php
 
-      function createSearchIndexes(array $indexes, array $options = []): string
+      function createSearchIndexes(
+          array $indexes,
+          array $options = []
+      ): string
 
-   This method has the following parameters:
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndexes-param.rst
+Parameters
+----------
 
-   The ``$options`` parameter supports the following options:
+``$indexes`` : array
+  Array of documents describing the indexes to create.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-createSearchIndexes-option.rst
+  A required ``definition`` document field describes the index to create. For
+  details on definition syntax, see
+  :manual:`Search Index Definition Syntax `.
 
-   .. include:: /includes/extracts/note-atlas-search-requirement.rst
-   .. include:: /includes/extracts/note-atlas-search-async.rst
+  An optional ``name`` string field specifies the name of the search index to
+  create. You cannot create multiple indexes with the same name on a single
+  collection. If you do not specify a name, the index is named "default".
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
 
 Return Values
 -------------
@@ -46,6 +69,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-atlas-search-async.rst
+
 Examples
 --------
 
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index 29ad2e83..ccb5e37d 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -19,15 +19,65 @@ Definition
 
    .. code-block:: php
 
-      function deleteMany(array|object $filter, array $options = []): MongoDB\DeleteResult
+      function deleteMany(
+          array|object $filter,
+          array $options = []
+      ): MongoDB\DeleteResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to delete.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteMany-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index 6c888a96..0c659891 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -21,15 +21,65 @@ Definition
 
    .. code-block:: php
 
-      function deleteOne(array|object $filter, array $options = []): MongoDB\DeleteResult
+      function deleteOne(
+          array|object $filter,
+          array $options = []
+      ): MongoDB\DeleteResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to delete.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-deleteOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index 24fd6761..42eae068 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -19,15 +19,70 @@ Definition
 
    .. code-block:: php
 
-      function distinct(string $fieldName, array|object $filter = [], array $options = []): mixed[]
+      function distinct(
+          string $fieldName,
+          array|object $filter = [],
+          array $options = []
+      ): mixed[]
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$fieldName`` : string
+  The field for which to return distinct values.
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents from which to retrieve the
+  distinct values.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-distinct-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-distinct-option.rst
+         .. versionadded:: 1.5
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index a2cd9410..0704ff6a 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -21,13 +21,67 @@ Definition
 
       function drop(array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - encryptedFields
+       - array|object
+       - A document describing encrypted fields for queryable encryption. If
+         omitted, the ``encryptedFieldsMap`` option within the
+         ``autoEncryption`` driver option will be consulted. If
+         ``encryptedFieldsMap`` was defined but does not specify this
+         collection, the library will make a final attempt to consult the
+         server-side value for ``encryptedFields``. See
+         `Field Encryption and Queryability `_
+         in the MongoDB manual for more information.
+
+         .. note::
+
+            This option is not passed to the
+            :manual:`drop ` command. The library uses
+            it to determine related metadata collections that should be dropped
+            in addition to an encrypted collection.
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
+
+         This will be used for the returned command result document.
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-drop-param.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
-   The ``$options`` parameter supports the following options:
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-drop-option.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index 0a7fbb53..07a18145 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -19,15 +19,61 @@ Definition
 
    .. code-block:: php
 
-      function dropIndex(string|MongoDB\Model\IndexInfo $indexName, array $options = []): array|object
+      function dropIndex(
+          string|MongoDB\Model\IndexInfo $indexName,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+  The name or model object of the index to drop. View the existing indexes on
+  the collection using the :phpmethod:`listIndexes()
+  ` method.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
+         This will be used for the returned command result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index ee48d493..41fda6e4 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -22,13 +22,56 @@ Definition
 
       function dropIndexes(array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+  The name or model object of the index to drop. View the existing indexes on
+  the collection using the :phpmethod:`listIndexes()
+  ` method.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+         .. versionadded:: 1.3
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-param.rst
+         This will be used for the returned command result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropIndex-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-dropSearchIndex.txt b/source/reference/method/MongoDBCollection-dropSearchIndex.txt
index befd5bf0..f3499273 100644
--- a/source/reference/method/MongoDBCollection-dropSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropSearchIndex.txt
@@ -23,15 +23,28 @@ Definition
 
       function dropSearchIndex(string $name, array $options = []): void
 
-   This method has the following parameters:
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropSearchIndex-param.rst
+Parameters
+----------
 
-   The ``$options`` parameter supports the following options:
+``$name`` : string
+  Name of the index to drop.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-dropSearchIndex-option.rst
+``$options`` : array
+  An array specifying the desired options.
 
-   .. include:: /includes/extracts/note-atlas-search-requirement.rst
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
index 1a831629..59a7b212 100644
--- a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
+++ b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
@@ -23,13 +23,45 @@ Definition
 
       function countDocuments(array $options = []): integer
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-estimateDocumentCount-param.rst
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
-   The ``$options`` parameter supports the following options:
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-estimateDocumentCount-option.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt
index 600f203b..ad63ec56 100644
--- a/source/reference/method/MongoDBCollection-explain.txt
+++ b/source/reference/method/MongoDBCollection-explain.txt
@@ -21,15 +21,52 @@ Definition
 
    .. code-block:: php
 
-      function explain(MongoDB\Operation\Explainable $explainable, array $options = []): array|object
+      function explain(
+          MongoDB\Operation\Explainable $explainable,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$explainable`` : :phpclass:`MongoDB\\Operation\\Explainable`
+  The command to explain.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         Defaults to the ``comment`` of the explained operation (if any).
+
+         .. versionadded:: 1.13
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-explain-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-explain-option.rst
+     * - verbosity
+       - string
+       - The verbosity level at which to run the command. See the :manual:`explain
+         ` command for more information.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 4fe92389..8c0ce7c2 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -19,15 +19,205 @@ Definition
 
    .. code-block:: php
 
-      function find(array|object $filter = [], array $options = []): MongoDB\Driver\Cursor
+      function find(
+          array|object $filter = [],
+          array $options = []
+      ): MongoDB\Driver\Cursor
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - batchSize
+       - integer
+       - The number of documents to return in the first batch. Defaults to
+         ``101``. A batchSize of ``0`` means that the cursor will be
+         established, but no documents will be returned in the first batch.
+
+         Unlike the previous wire protocol version, a batchSize of ``1`` for the
+         :dbcommand:`find` command does not close the cursor.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - cursorType
+       - integer
+       - Indicates the type of cursor to use. ``cursorType`` supports the
+         following values:
+
+         - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
+         - ``MongoDB\Operation\Find::TAILABLE``
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - limit
+       - integer
+       - The maximum number of documents to return. If unspecified, then
+         defaults to no limit. A limit of ``0`` is equivalent to setting no
+         limit.
+
+         A negative limit is similar to a positive limit but closes the cursor
+         after returning a single batch of results. As such, with a negative
+         limit, if the limited result set does not fit into a single batch, the
+         number of documents received will be less than the specified limit. By
+         passing a negative limit, the client indicates to the server that it
+         will not ask for a subsequent batch via getMore.
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxAwaitTimeMS
+       - integer
+       - Positive integer denoting the time limit in milliseconds for the server
+         to block a getMore operation if no data is available. This option
+         should only be used if cursorType is TAILABLE_AWAIT.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - noCursorTimeout
+       - boolean
+       - Prevents the server from timing out idle cursors after an inactivity
+         period (10 minutes).
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
+     * - snapshot
+       - boolean
+       - Prevents the cursor from returning a document more than once because of
+         an intervening write operation.
 
-   The ``$options`` parameter supports the following options:
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-find-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index 44829db3..c5230c6c 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -19,15 +19,156 @@ Definition
 
    .. code-block:: php
 
-      function findOne(array|object $filter = [], array $options = []): array|object|null
+      function findOne(
+          array|object $filter = [],
+          array $options = []
+      ): array|object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-option.rst
+         This will be used for the returned result document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index e5531f41..b34bd578 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -19,15 +19,87 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndDelete(array|object $filter = [], array $options = []): object|null
+      function findOneAndDelete(
+          array|object $filter = [],
+          array $options = []
+      ): object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to delete.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-param.rst
+         This will be used for the returned result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 66bd7f12..697e7371 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -19,15 +19,110 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndReplace(array|object $filter, array|object $replacement, array $options = []): object|null
+      function findOneAndReplace(
+          array|object $filter,
+          array|object $replacement,
+          array $options = []
+      ): object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to replace.
+
+``$replacement`` : array|object
+  The replacement document.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - returnDocument
+       - integer
+       - Specifies whether to return the document before the replacement is
+         applied, or after. ``returnDocument`` supports the following values:
+
+         - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_BEFORE`` (*default*)
+         - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
+
+         This will be used for the returned result document.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index c903698b..cbfbad16 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -19,15 +19,121 @@ Definition
 
    .. code-block:: php
 
-      function findOneAndUpdate(array|object $filter, array|object $update, array $options = []): object|null
+      function findOneAndUpdate(
+          array|object $filter,
+          array|object $update,
+          array $options = []
+      ): object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to update.
+
+``$update`` : array|object
+  Specifies the field and value combinations to update and any relevant update
+  operators. ``$update`` uses MongoDB's :method:`update operators
+  `. Starting with MongoDB 4.2, an `aggregation
+  pipeline `_
+  can be passed as this parameter.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - arrayFilters
+       - array
+       - An array of filter documents that determines which array elements to
+         modify for an update operation on an array field.
+
+         .. versionadded:: 1.3
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.7
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - returnDocument
+       - integer
+       - Specifies whether to return the document before the update is applied,
+         or after. ``returnDocument`` supports the following values:
+
+         - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_BEFORE`` (*default*)
+         - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
+
+         This will be used for the returned result document.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 62b0858e..6ff516e7 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -19,15 +19,62 @@ Definition
 
    .. code-block:: php
 
-      function insertMany(array $documents, array $options = []): MongoDB\InsertManyResult
+      function insertMany(
+          array $documents,
+          array $options = []
+      ): MongoDB\InsertManyResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$documents`` : array
+  The documents to insert into the collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - ordered
+       - boolean
+       - If ``true``: when a single write fails, the operation will stop without
+         performing the remaining writes and throw an exception.
+
+         If ``false``: when a single write fails, the operation will continue
+         with the remaining writes, if any, and throw an exception.
+
+         The default is ``true``.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertMany-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index dd6e2f22..ce6f0484 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -19,15 +19,52 @@ Definition
 
    .. code-block:: php
 
-      function insertOne(array|object $document, array $options = []): MongoDB\InsertOneResult
+      function insertOne(
+          array|object $document,
+          array $options = []
+      ): MongoDB\InsertOneResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$document`` : array|object
+  The document to insert into the collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-param.rst
+         .. versionadded:: 1.3
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-insertOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index 2508b282..84ee74b3 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -21,13 +21,37 @@ Definition
 
       function listIndexes(array $options = []): MongoDB\Model\IndexInfoIterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-param.rst
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-listIndexes-option.rst
+         .. versionadded:: 1.3
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-listSearchIndexes.txt b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
index 8dc98600..e8db9521 100644
--- a/source/reference/method/MongoDBCollection-listSearchIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
@@ -23,15 +23,71 @@ Definition
 
       function listSearchIndexes(array $options = []): Countable&Iterator
 
-   This method has the following parameters:
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
+
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-listSearchIndexes-param.rst
+``$options`` : array
+  An array specifying the desired options.
 
-   The ``$options`` parameter supports the following options:
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-listSearchIndexes-option.rst
+     * - Name
+       - Type
+       - Description
 
-   .. include:: /includes/extracts/note-atlas-search-requirement.rst
+     * - batchSize
+       - integer
+       - Specifies the batch size for the cursor, which will apply to both the
+         initial ``aggregate`` command and any subsequent ``getMore`` commands.
+         This determines the maximum number of documents to return in each
+         response from the server.
+
+         A batchSize of ``0`` is special in that and will only apply to the
+         initial ``aggregate`` command; subsequent ``getMore`` commands will use
+         the server's default batch size. This may be useful for quickly
+         returning a cursor or failure from ``aggregate`` without doing
+         significant server-side work.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - name
+       - string
+       - Name of the index to return information about.
+
+         If name is not specified, information for all indexes on the collection
+         will be returned.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
index a38872bd..1cb66f35 100644
--- a/source/reference/method/MongoDBCollection-mapReduce.txt
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -24,15 +24,139 @@ Definition
 
    .. code-block:: php
 
-      function mapReduce(MongoDB\BSON\JavascriptInterface $map, MongoDB\BSON\JavascriptInterface $reduce, string|array|object $out, array $options = []): MongoDB\MapReduceResult
+      function mapReduce(
+          MongoDB\BSON\JavascriptInterface $map,
+          MongoDB\BSON\JavascriptInterface $reduce,
+          string|array|object $out,
+          array $options = []
+      ): MongoDB\MapReduceResult
+
+Parameters
+----------
+
+``$map`` : :php:`MongoDB\\BSON\\Javascript `
+  A JavaScript function that associates or "maps" a value with a key and emits
+  the key and value pair.
+
+  .. note::
+
+     Passing a Javascript instance with a scope is deprecated. Put all scope
+     variables in the ``scope`` option of the MapReduce operation.
+
+``$reduce`` : :php:`MongoDB\\BSON\\Javascript `
+  A JavaScript function that "reduces" to a single object all the values
+  associated with a particular key.
+
+  .. note::
+
+     Passing a Javascript instance with a scope is deprecated. Put all scope
+     variables in the ``scope`` option of the MapReduce operation.
+
+``$out`` : string|array|object
+  Specifies where to output the result of the map-reduce operation. You can
+  either output to a collection or return the result inline. On a primary member
+  of a replica set you can output either to a collection or inline, but on a
+  secondary, only inline output is possible.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+         This only applies when results are output to a collection.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - finalize
+       - :php:`MongoDB\\BSON\\Javascript `
+       - Follows the reduce method and modifies the output.
+
+         .. note::
+
+            Passing a Javascript instance with a scope is deprecated. Put all
+            scope variables in the ``scope`` option of the MapReduce operation.
+
+     * - jsMode
+       - boolean
+       - Specifies whether to convert intermediate data into BSON format between
+         the execution of the map and reduce functions.
+
+     * - limit
+       - integer
+       - Specifies a maximum number of documents for the input into the map
+         function.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - query
+       - array|object
+       - Specifies the selection criteria using query operators for determining
+         the documents input to the map function.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+         This option will be ignored when results are output to a collection.
+
+     * - scope
+       - array|object
+       - Specifies global variables that are accessible in the map, reduce, and
+         finalize functions.
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   This method has the following parameters:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-mapReduce-param.rst
+     * - verbose
+       - boolean
+       - Specifies whether to include the timing information in the result
+         information.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-mapReduce-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-rename.txt b/source/reference/method/MongoDBCollection-rename.txt
index a40555f2..2b617de9 100644
--- a/source/reference/method/MongoDBCollection-rename.txt
+++ b/source/reference/method/MongoDBCollection-rename.txt
@@ -21,15 +21,63 @@ Definition
 
    .. code-block:: php
 
-      function rename(string $toCollectionName, ?string $toDatabaseName = null, array $options = []): array|object
+      function rename(
+          string $toCollectionName,
+          ?string $toDatabaseName = null,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$toCollectionName`` : string
+  The new name of the collection.
+
+``$toDatabaseName`` : string
+  The new database name of the collection. If a new database name is not
+  specified, the database of the original collection will be used. If the new
+  name specifies a different database, the command copies the collection
+  to the new database and drops the source collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - dropTarget
+       - boolean
+       - If ``true``, MongoDB will drop the target before renaming the
+         collection. The default value is ``false``.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-rename-param.rst
+         This will be used for the returned command result document.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-rename-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index e42f993e..94395eff 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -21,15 +21,80 @@ Definition
 
    .. code-block:: php
 
-      function replaceOne(array|object $filter, array|object $replacement, array $options = []): MongoDB\UpdateResult
+      function replaceOne(
+          array|object $filter,
+          array|object $replacement,
+          array $options = []
+      ): MongoDB\UpdateResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to replace.
+
+``$replacement`` : array|object
+  The replacement document.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.2.rst
+
+         .. versionadded:: 1.6
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-replaceOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 0e5f22b9..07f29211 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -19,15 +19,91 @@ Definition
 
    .. code-block:: php
 
-      function updateMany(array|object $filter, array|object $update, array $options = []): MongoDB\UpdateResult
+      function updateMany(
+          array|object $filter,
+          array|object $update,
+          array $options = []
+      ): MongoDB\UpdateResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to update.
+
+``$update`` : array|object
+  Specifies the field and value combinations to update and any relevant update
+  operators. ``$update`` uses MongoDB's :method:`update operators
+  `. Starting with MongoDB 4.2, an `aggregation
+  pipeline `_
+  can be passed as this parameter.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - arrayFilters
+       - array
+       - An array of filter documents that determines which array elements to
+         modify for an update operation on an array field.
+
+         .. versionadded:: 1.3
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.2.rst
+
+         .. versionadded:: 1.6
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateMany-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index 2b930e23..2a981cb2 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -21,15 +21,91 @@ Definition
 
    .. code-block:: php
 
-      function updateOne(array|object $filter, array|object $update, array $options = []): MongoDB\UpdateResult
+      function updateOne(
+          array|object $filter,
+          array|object $update,
+          array $options = []
+      ): MongoDB\UpdateResult
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to update.
+
+``$update`` : array|object
+  Specifies the field and value combinations to update and any relevant update
+  operators. ``$update`` uses MongoDB's :method:`update operators
+  `. Starting with MongoDB 4.2, an `aggregation
+  pipeline `_
+  can be passed as this parameter.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - arrayFilters
+       - array
+       - An array of filter documents that determines which array elements to modify
+         for an update operation on an array field.
+
+         .. versionadded:: 1.3
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/collection-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. include:: /includes/extracts/option-requires-4.2.rst
+
+         .. versionadded:: 1.6
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-param.rst
+     * - upsert
+       - boolean
+       - If set to ``true``, creates a new document when no document matches the
+         query criteria. The default value is ``false``, which does not insert a
+         new document when no match is found.
 
-   The ``$options`` parameter supports the following options:
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateOne-option.rst
+         .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-updateSearchIndex.txt b/source/reference/method/MongoDBCollection-updateSearchIndex.txt
index 2633d379..bf165910 100644
--- a/source/reference/method/MongoDBCollection-updateSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-updateSearchIndex.txt
@@ -21,18 +21,40 @@ Definition
 
    .. code-block:: php
 
-      function updateSearchIndex(string $name, array|object $definition, array $options = []): void
+      function updateSearchIndex(
+          string $name,
+          array|object $definition,
+          array $options = []
+      ): void
 
-   This method has the following parameters:
+   .. include:: /includes/extracts/note-atlas-search-requirement.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateSearchIndex-param.rst
+Parameters
+----------
 
-   The ``$options`` parameter supports the following options:
+``$name`` : string
+  Name of the index to update.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-updateSearchIndex-option.rst
+``$definition`` : array|object
+  Document describing the updated search index definition. The specified
+  definition replaces the prior definition in the search index. For details on
+  definition syntax, see
+  :manual:`Search Index Definition Syntax `.
 
-   .. include:: /includes/extracts/note-atlas-search-requirement.rst
-   .. include:: /includes/extracts/note-atlas-search-async.rst
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
 
 Errors/Exceptions
 -----------------
@@ -41,6 +63,11 @@ Errors/Exceptions
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
 
+Behavior
+--------
+
+.. include:: /includes/extracts/note-atlas-search-async.rst
+
 See Also
 --------
 
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
index 50ef408d..c54123bd 100644
--- a/source/reference/method/MongoDBCollection-watch.txt
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -22,15 +22,94 @@ Definition
 
    .. code-block:: php
 
-      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+      function watch(
+          array $pipeline = [],
+          array $options = []
+      ): MongoDB\ChangeStream
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array|object
+  The pipeline of stages to append to an initial ``$changeStream`` stage.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - batchSize
+       - integer
+       - .. include:: /includes/extracts/watch-option-batchSize.rst
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+         Starting in MongoDB 4.2, defaults to simple binary comparison if
+         omitted. In earlier versions, change streams opened on a single
+         collection would inherit the collection's default collation.
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+  
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - fullDocument
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocument.rst
+
+     * - fullDocumentBeforeChange
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocumentBeforeChange.rst
+
+     * - maxAwaitTimeMS
+       - integer
+       - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/collection-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/collection-option-readPreference.rst
+
+         This is used for both the initial change stream aggregation and for
+         server selection during an automatic resume.
+
+     * - resumeAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-resumeAfter.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - showExpandedEvents
+       - boolean
+       - .. include:: /includes/extracts/watch-option-showExpandedEvents.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-watch-param.rst
+     * - startAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-startAfter.rst
 
-   The ``$options`` parameter supports the following options:
+     * - startAtOperationTime
+       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-watch-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/collection-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index a68a5fec..293b093a 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -21,13 +21,41 @@ Definition
 
       function withOptions(array $options = []): MongoDB\Collection
 
-   This method has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-withOptions-option.rst
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the original collection's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the original collection's read preference.
+
+     * - typeMap
+       - array
+       - The :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. Defaults to the original collection's type map.
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults to
+         the original collection's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
index e8077c73..09173500 100644
--- a/source/reference/method/MongoDBCollection__construct.txt
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -19,15 +19,65 @@ Definition
 
    .. code-block:: php
 
-      function __construct(MongoDB\Driver\Manager $manager, string $databaseName, string $collectionName, array $options = [])
+      function __construct(
+          MongoDB\Driver\Manager $manager,
+          string $databaseName,
+          string $collectionName,
+          array $options = []
+      )
 
    This constructor has the following parameters:
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-construct-param.rst
+``$manager`` : :php:`MongoDB\\Driver\\Manager `
+  The :php:`Manager ` instance from the driver. The
+  manager maintains connections between the driver and your MongoDB instances.
 
-   The ``$options`` parameter supports the following options:
+``$databaseName`` : string
+  The name of the database.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-construct-option.rst
+``$collectionName`` : string
+  The name of the collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the manager's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the manager's read preference.
+
+     * - typeMap
+       - array
+       - Default :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
+
+         .. code-block:: php
+
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults
+         to the manager's write concern.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBDatabase-aggregate.txt b/source/reference/method/MongoDBDatabase-aggregate.txt
index a7884bfe..96d409ae 100644
--- a/source/reference/method/MongoDBDatabase-aggregate.txt
+++ b/source/reference/method/MongoDBDatabase-aggregate.txt
@@ -24,15 +24,105 @@ Definition
 
    .. code-block:: php
 
-      function aggregate(array $pipeline, array $options = []): Traversable
+      function aggregate(
+          array $pipeline,
+          array $options = []
+      ): Traversable
 
-   This method has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBDatabase-method-aggregate-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-aggregate-option.rst
+``$pipeline`` : array
+  Specifies an :manual:`aggregation pipeline `
+  operation.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, aggregation
+         stages can write data to the ``_tmp`` sub-directory in the ``dbPath``
+         directory.
+
+     * - batchSize
+       - integer
+       - Specifies the batch size for the cursor, which will apply to both the
+         initial ``aggregate`` command and any subsequent ``getMore`` commands.
+         This determines the maximum number of documents to return in each
+         response from the server.
+
+         A batchSize of ``0`` is special in that and will only apply to the
+         initial ``aggregate`` command; subsequent ``getMore`` commands will use
+         the server's default batch size. This may be useful for quickly
+         returning a cursor or failure from ``aggregate`` without doing
+         significant server-side work.
+
+     * - bypassDocumentValidation
+       - boolean
+       - If ``true``, allows the write operation to circumvent document level
+         validation. Defaults to ``false``.
+
+         This only applies when using the :ref:`$out ` and
+         :ref:`$out ` stages.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         The comment can be any valid BSON type for server versions 4.4 and
+         above. Earlier server versions only support string values.
+
+     * - explain
+       - boolean
+       - Specifies whether or not to return the information on the processing of
+         the pipeline.
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.9
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/database-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/database-option-readPreference.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index 6853daad..50ebfe79 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -21,15 +21,41 @@ Definition
 
    .. code-block:: php
 
-      function command(array|object $command, array $options = []): MongoDB\Driver\Cursor
+      function command(
+          array|object $command,
+          array $options = []
+      ): MongoDB\Driver\Cursor
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$command`` : array|object
+  The :manual:`database command ` document.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/database-option-readPreference.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-command-param.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-command-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 56129b97..2351f5d3 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -19,7 +19,10 @@ Definition
 
    .. code-block:: php
 
-      function createCollection(string $collectionName, array $options = []): array|object
+      function createCollection(
+          string $collectionName,
+          array $options = []
+      ): array|object
 
    MongoDB creates collections implicitly when you first reference the
    collection in a command, such as when inserting a document into a new
@@ -33,17 +36,294 @@ Definition
    :manual:`document validation criteria `,
    or configure your storage engine or indexing options.
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection to create.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. note::
+
+     Not all options are available on all versions of MongoDB. Refer to the
+     :manual:`create ` command reference in the
+     MongoDB manual for compatibility considerations.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - autoIndexId
+       - boolean
+       - Specify ``false`` to disable the automatic creation of an index on the
+         ``_id`` field.
+
+         .. important::
+
+            For replica sets, do not set ``autoIndexId`` to ``false``.
+
+         .. deprecated:: 1.4
+            This option has been deprecated since MongoDB 3.2. As of MongoDB
+            4.0, this option cannot be ``false`` when creating a replicated
+            collection (i.e. a collection outside of the ``local`` database in
+            any mongod mode).
+
+     * - capped
+       - boolean
+       - To create a capped collection, specify ``true``. If you specify
+         ``true``, you must also set a maximum size in the ``size`` option.
+
+     * - changeStreamPreAndPostImages
+       - document
+       - Used to configure support for pre- and post-images in change streams.
+         See the :manual:`create ` command
+         documentation for more information.
+
+         .. include:: /includes/extracts/option-requires-6.0.rst
+
+         .. versionadded:: 1.13
+
+     * - clusteredIndex
+       - document
+       - A clustered index specification. See
+         :manual:`Clustered Collections ` or the
+         :manual:`create ` command documentation for
+         more information.
+
+         .. include:: /includes/extracts/option-requires-5.3.rst
+
+         .. versionadded:: 1.13
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - encryptedFields
+       - document
+       - A document describing encrypted fields for queryable encryption. If
+         omitted, the ``encryptedFieldsMap`` option within the
+         ``autoEncryption`` driver option will be consulted. See
+         `Field Encryption and Queryability `_
+         in the MongoDB manual for more information.
+
+         .. include:: /includes/extracts/option-requires-7.0.rst
+
+         .. versionadded:: 1.13
+
+     * - expireAfterSeconds
+       - integer
+       - Used to automatically delete documents in time series collections. See
+         the :manual:`create ` command documentation
+         for more information.
+
+         .. include:: /includes/extracts/option-requires-5.0.rst
+
+         .. versionadded:: 1.9
+
+     * - flags
+       - integer
+       - Available for the MMAPv1 storage engine only to set the
+         ``usePowerOf2Sizes`` and ``noPadding`` flags.
+
+         The library provides constants that you can combine with a
+         :php:`bitwise OR operator ` to set the flag
+         values:
+
+         - ``MongoDB\Operation\CreateCollection::USE_POWER_OF_2_SIZES``: ``1``
+         - ``MongoDB\Operation\CreateCollection::NO_PADDING``: ``2``
+
+         Defaults to ``1``.
+
+         .. note::
+
+            MongoDB 3.0 and later ignores the ``usePowerOf2Sizes`` flag. See
+            :manual:`collMod ` and
+            :manual:`db.createCollection()
+            ` for more information.
+
+     * - indexOptionDefaults
+       - array|object
+       - Allows users to specify a default configuration for indexes when
+         creating a collection.
+
+         The ``indexOptionDefaults`` option accepts a ``storageEngine``
+         document, which should take the following form:
+
+         .. code-block:: none
+
+            { :  }
+
+         Storage engine configurations specified when creating indexes are
+         validated and logged to the :term:`oplog` during replication to support
+         replica sets with members that use different storage engines.
+
+     * - max
+       - integer
+       - The maximum number of documents allowed in the capped collection. The
+         ``size`` option takes precedence over this limit. If a capped
+         collection reaches the ``size`` limit before it reaches the maximum
+         number of documents, MongoDB removes old documents. If you prefer to
+         use the ``max`` limit, ensure that the ``size`` limit, which is
+         required for a capped collection, is sufficient to contain the maximum
+         number of documents.
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - pipeline
+       - array
+       - An array that consists of the aggregation pipeline stage(s), which will
+         be applied to the collection or view specified by ``viewOn``. See the
+         :manual:`create ` command documentation for
+         more information.
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - size
+       - integer
+       - Specify a maximum size in bytes for a capped collection. Once a capped
+         collection reaches its maximum size, MongoDB removes the older
+         documents to make space for the new documents. The ``size`` option is
+         required for capped collections and ignored for other collections.
+
+     * - storageEngine
+       - array|object
+       - Available for the WiredTiger storage engine only.
+
+         Allows users to specify configuration to the storage engine on a
+         per-collection basis when creating a collection. The value of the
+         ``storageEngine`` option should take the following form:
+
+         .. code-block:: none
+
+            { :  }
+
+         Storage engine configurations specified when creating collections are
+         validated and logged to the :term:`oplog` during replication to support
+         replica sets with members that use different storage engines.
+
+     * - timeseries
+       - array|object
+       - An object containing options for creating time series collections. See
+         the :manual:`create ` command documentation
+         for supported options.
+
+         .. include:: /includes/extracts/option-requires-5.0.rst
+
+         .. versionadded:: 1.9
+
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
+
+         This will be used for the returned command result document.
+
+     * - validationAction
+       - string
+       - Determines whether to ``error`` on invalid documents or just ``warn``
+         about the violations but allow invalid documents to be inserted.
+
+         .. important::
+
+            Validation of documents only applies to those documents as
+            determined by the ``validationLevel``.
+
+         .. list-table::
+            :header-rows: 1
+
+            * - ``validationAction``
+              - Description
+
+            * - ``"error"``
+              - **Default**. Documents must pass validation before the write
+                occurs. Otherwise, the write operation fails.
+
+            * - ``"warn"``
+              - Documents do not have to pass validation. If the document fails
+                validation, the write operation logs the validation failure.
+
+     * - validationLevel
+       - string
+       - Determines how strictly MongoDB applies the validation rules to
+         existing documents during an update.
+
+         .. list-table::
+            :header-rows: 1
+
+            * - ``validationLevel``
+              - Description
+
+            * - ``"off"``
+              - No validation for inserts or updates.
+
+            * - ``"strict"``
+              - **Default**. Apply validation rules to all inserts and all updates.
+
+            * - ``"moderate"``
+              - Apply validation rules to inserts and to updates on existing
+                *valid* documents. Do not apply rules to updates on existing
+                *invalid* documents.
+
+     * - validator
+       - array|object
+       - Allows users to specify :manual:`validation rules or expressions
+         ` for the collection. For more information,
+         see :manual:`Document Validation ` in the
+         MongoDB manual.
+
+         The ``validator`` option takes an array that specifies the validation
+         rules or expressions. You can specify the expressions using the same
+         operators as MongoDB's
+         :manual:`query operators ` with the
+         exception of :query:`$geoNear`, :query:`$near`, :query:`$nearSphere`,
+         :query:`$text`, and :query:`$where`.
+
+         .. note::
+
+            - Validation occurs during updates and inserts. Existing documents
+              do not undergo validation checks until modification.
+
+            - You cannot specify a validator for collections in the ``admin``,
+              ``local``, and ``config`` databases.
+
+            - You cannot specify a validator for ``system.*`` collections.
+
+     * - viewOn
+       - string
+       - The name of the source collection or view from which to create the view.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-param.rst
+         .. note::
 
-   The ``$options`` parameter supports the following options:
+            The name is not the full namespace of the collection or view (i.e.
+            it does not include the database name). Views must be created in the
+            same databases as the source collection or view.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-createCollection-option.rst
+            .. versionadded:: 1.13
 
-   Note that not all options are available on all versions of MongoDB. Refer to
-   the :manual:`create ` command reference in the
-   MongoDB manual for compatibility considerations.
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
index 64c643f0..390f99c6 100644
--- a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
@@ -21,7 +21,13 @@ Definition
 
    .. code-block:: php
 
-      function createEncryptedCollection(string $collectionName, MongoDB\Driver\ClientEncryption $clientEncryption, string $kmsProvider, ?array $masterKey, array $options): array
+      function createEncryptedCollection(
+          string $collectionName,
+          MongoDB\Driver\ClientEncryption $clientEncryption,
+          string $kmsProvider,
+          ?array $masterKey,
+          array $options
+      ): array
 
    This method will automatically create data keys for any encrypted fields
    where ``keyId`` is ``null``. Data keys will be created using
@@ -34,13 +40,33 @@ Definition
    :phpclass:`MongoDB\\Client` objects. Users must configure auto encryption
    after creating the encrypted collection with ``createEncryptedCollection()``.
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the encrypted collection to create.
+
+``$clientEncryption`` : :php:`MongoDB\\Driver\\ClientEncryption `
+  The ClientEncryption object used to create data keys.
+
+``$kmsProvider`` : string
+  KMS provider (e.g. "local", "aws") that will be used to encrypt new data keys.
+  This corresponds to the ``$kmsProvider`` parameter for
+  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+
+``$masterKey`` : array|null
+  KMS-specific key options that will be used to encrypt new data keys. This
+  corresponds to the ``masterKey`` option for
+  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+
+  If ``$kmsProvider`` is "local", this should be ``null``.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-createEncryptedCollection-param.rst
+``$options`` : array
+  An array specifying the desired options.
 
-   The ``$options`` parameter supports the same options as
-   :phpmethod:`MongoDB\\Database::createCollection()`. The ``encryptedFields``
-   option is required.
+  The ``$options`` parameter supports the same options as
+  :phpmethod:`MongoDB\\Database::createCollection()`. The ``encryptedFields``
+  option is required.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index eae1bb6b..457fad1a 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -21,13 +21,43 @@ Definition
 
       function drop(array $options = []): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-drop-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-drop-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 028e63f0..018f3cca 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -19,15 +19,71 @@ Definition
 
    .. code-block:: php
 
-      function dropCollection(string $collectionName, array $options = []): array|object
+      function dropCollection(
+          string $collectionName,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection to drop.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - encryptedFields
+       - array|object
+       - A document describing encrypted fields for queryable encryption. If
+         omitted, the ``encryptedFieldsMap`` option within the
+         ``autoEncryption`` driver option will be consulted. If
+         ``encryptedFieldsMap`` was defined but does not specify this
+         collection, the library will make a final attempt to consult the
+         server-side value for ``encryptedFields``. See
+         `Field Encryption and Queryability `_
+         in the MongoDB manual for more information.
+
+         .. note::
+
+            This option is not passed to the
+            :manual:`drop ` command. The library uses
+            it to determine related metadata collections that should be dropped
+            in addition to an encrypted collection.
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-dropCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-listCollectionNames.txt b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
index b6eaa4ce..53814f72 100644
--- a/source/reference/method/MongoDBDatabase-listCollectionNames.txt
+++ b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
@@ -23,13 +23,53 @@ Definition
 
       function listCollectionNames(array $options = []): Iterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedCollections
+       - boolean
+       - A flag that determines which collections are returned based on the user
+         privileges when access control is enabled. For more information, see
+         the :manual:`listCollections `
+         command documentation.
+
+         For servers < 4.0, this option is ignored.
+
+         .. versionadded:: 1.12
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of collections.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-param.rst
+         You can specify a query expression for collection fields (e.g.
+         ``name``, ``options``).
 
-   The ``$options`` parameter supports the following options:
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-option.rst
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index 421b6cab..d66b6a5f 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -21,13 +21,55 @@ Definition
 
       function listCollections(array $options = []): MongoDB\Model\CollectionInfoIterator
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - authorizedCollections
+       - boolean
+       - A flag that determines which collections are returned based on the user
+         privileges when access control is enabled. For more information, see
+         the :manual:`listCollections `
+         command documentation.
+
+         For servers < 4.0, this option is ignored.
+
+         .. versionadded:: 1.12
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - filter
+       - array|object
+       - A query expression to filter the list of collections.
+
+         You can specify a query expression for collection fields (e.g.
+         ``name``, ``options``).
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-param.rst
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
-   The ``$options`` parameter supports the following options:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-listCollections-option.rst
+         .. versionadded:: 1.3
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-modifyCollection.txt b/source/reference/method/MongoDBDatabase-modifyCollection.txt
index 86c1ff52..0a756b01 100644
--- a/source/reference/method/MongoDBDatabase-modifyCollection.txt
+++ b/source/reference/method/MongoDBDatabase-modifyCollection.txt
@@ -22,15 +22,53 @@ Definition
 
    .. code-block:: php
 
-      function modifyCollection(string $collectionName, array $collectionOptions, array $options = []): array|object
+      function modifyCollection(
+          string $collectionName,
+          array $collectionOptions,
+          array $options = []
+      ): array|object
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection or view to modify.
+
+``$collectionOptions`` : array
+  Collection or view options to assign.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-modifyCollection-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-modifyCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-renameCollection.txt b/source/reference/method/MongoDBDatabase-renameCollection.txt
index 8bbe5b8e..778dc10a 100644
--- a/source/reference/method/MongoDBDatabase-renameCollection.txt
+++ b/source/reference/method/MongoDBDatabase-renameCollection.txt
@@ -21,15 +21,65 @@ Definition
 
    .. code-block:: php
 
-      function renameCollection(string $fromCollectionName, string $toCollectionName, ?string $toDatabaseName = null, array $options = []): array|object
+      function renameCollection(
+          string $fromCollectionName,
+          string $toCollectionName,
+          ?string $toDatabaseName = null,
+          array $options = []
+      ): array|object
+
+Parameters
+----------
+
+``$fromCollectionName`` : string
+  The name of the collection to rename.
+
+``$toCollectionName`` : string
+  The new name of the collection.
+
+``$toDatabaseName`` : string
+  The new database name of the collection. If a new database name is not
+  specified, the current database will be used. If the new name specifies a
+  different database, the command copies the collection to the new database
+  and drops the source collection.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/option-requires-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - dropTarget
+       - boolean
+       - If ``true``, MongoDB will drop the target before renaming the
+         collection. The default value is ``false``.
 
-   This method has the following parameters:
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-renameCollection-param.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
-   The ``$options`` parameter supports the following options:
+         This will be used for the returned command result document.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-renameCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 14885410..887d4a4d 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -19,15 +19,47 @@ Definition
 
    .. code-block:: php
 
-      function selectCollection(string $collectionName, array $options = []): MongoDB\Collection
+      function selectCollection(
+          string $collectionName,
+          array $options = []
+      ): MongoDB\Collection
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$collectionName`` : string
+  The name of the collection to select.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for collection operations. Defaults to
+         the database's read concern.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for collection operations. Defaults
+         to the database's read preference.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for collection operations. Defaults to the
+         database's type map.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectCollection-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for collection operations. Defaults to
+         the database's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index f9390627..0d115d9b 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -21,13 +21,56 @@ Definition
 
       function selectGridFSBucket(array $options = []): MongoDB\GridFS\Bucket
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bucketName
+       - string
+       - The bucket name, which will be used as a prefix for the files and
+         chunks collections. Defaults to ``"fs"``.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
+
+         Defaults to ``false``.
+
+         .. versionadded: 1.4
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for bucket operations. Defaults to the
+         database's read concern.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-param.rst
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for bucket operations. Defaults to
+         the database's read concern.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - The default type map to use for bucket operations. Defaults to the
+         database's type map.
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-selectGridFSBucket-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for bucket operations. Defaults to the
+         database's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-watch.txt b/source/reference/method/MongoDBDatabase-watch.txt
index 7ff19b73..c79656ec 100644
--- a/source/reference/method/MongoDBDatabase-watch.txt
+++ b/source/reference/method/MongoDBDatabase-watch.txt
@@ -22,15 +22,90 @@ Definition
 
    .. code-block:: php
 
-      function watch(array $pipeline = [], array $options = []): MongoDB\ChangeStream
+      function watch(
+          array $pipeline = [],
+          array $options = []
+      ): MongoDB\ChangeStream
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$pipeline`` : array|object
+  The pipeline of stages to append to an initial ``$changeStream`` stage.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - batchSize
+       - integer
+       - .. include:: /includes/extracts/watch-option-batchSize.rst
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+  
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+         .. versionadded:: 1.13
+
+     * - fullDocument
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocument.rst
+
+     * - fullDocumentBeforeChange
+       - string
+       - .. include:: /includes/extracts/watch-option-fullDocumentBeforeChange.rst
+
+     * - maxAwaitTimeMS
+       - integer
+       - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/database-option-readConcern.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/database-option-readPreference.rst
+
+         This is used for both the initial change stream aggregation and for
+         server selection during an automatic resume.
+
+     * - resumeAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-resumeAfter.rst
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+     * - showExpandedEvents
+       - boolean
+       - .. include:: /includes/extracts/watch-option-showExpandedEvents.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-watch-param.rst
+     * - startAfter
+       - array|object
+       - .. include:: /includes/extracts/watch-option-startAfter.rst
 
-   The ``$options`` parameter supports the following options:
+     * - startAtOperationTime
+       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-watch-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/database-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index 6f732eac..fc5d88ec 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -21,13 +21,41 @@ Definition
 
       function withOptions(array $options = []): MongoDB\Database
 
-   This method has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-withOptions-option.rst
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for database operations. Defaults to
+         the original database's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for database operations. Defaults to
+         the original database's read preference.
+
+     * - typeMap
+       - array
+       - The :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. Defaults to the original database's type map.
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for database operations. Defaults to
+         the original database's write concern.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt
index 2d3e7f57..0a715e99 100644
--- a/source/reference/method/MongoDBDatabase__construct.txt
+++ b/source/reference/method/MongoDBDatabase__construct.txt
@@ -19,15 +19,62 @@ Definition
 
    .. code-block:: php
 
-      function __construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = [])
+      function __construct(
+          MongoDB\Driver\Manager $manager,
+          string $databaseName,
+          array $options = []
+      )
 
-   This constructor has the following parameters:
-
-   .. include:: /includes/apiargs/MongoDBDatabase-method-construct-param.rst
-
-   The ``$options`` parameter supports the following options:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-construct-option.rst
+``$manager`` : :php:`MongoDB\\Driver\\Manager `
+  The :php:`Manager ` instance from the driver. The
+  manager maintains connections between the driver and your MongoDB instances.
+
+``$databaseName`` : string
+  The name of the database.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for database operations. Defaults to
+         the manager's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for database operations. Defaults to
+         the manager's read preference.
+
+     * - typeMap
+       - array
+       - Default :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
+
+         .. code-block:: php
+
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
+
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for database operations. Defaults to
+         the manager's write concern.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index 53cef6f9..c888a716 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -21,9 +21,11 @@ Definition
 
       function __get(string $collectionName): MongoDB\Collection
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBDatabase-method-get-param.rst
+``$collectionName`` : string
+  The name of the database to select.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-delete.txt b/source/reference/method/MongoDBGridFSBucket-delete.txt
index b063337e..731fb4e4 100644
--- a/source/reference/method/MongoDBGridFSBucket-delete.txt
+++ b/source/reference/method/MongoDBGridFSBucket-delete.txt
@@ -21,9 +21,11 @@ Definition
 
       function delete($id): void
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-delete-param.rst
+``$id`` : mixed
+  The ``_id`` of the file to delete.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
index 2f2aa5da..917f03b5 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
@@ -22,9 +22,14 @@ Definition
 
       function downloadToStream($id, $destination): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$id`` : mixed
+  The ``_id`` of the file to download.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStream-param.rst
+``$destination`` : resource
+  Writable stream, to which the GridFS file's contents will be written.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index acc236f5..8bd4a1d6 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -20,15 +20,47 @@ Definition
 
    .. code-block:: php
 
-      function downloadToStreamByName(string $filename, resource $destination, array $options = []): void
+      function downloadToStreamByName(
+          string $filename,
+          resource $destination,
+          array $options = []
+      ): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to download.
+
+``$destination`` : resource
+  Writable stream, to which the GridFS file's contents will be written.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - revision
+       - integer
+       - The revision of the file to retrieve. Files with the same ``filename``
+         will be differentiated by their ``uploadDate`` field.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-param.rst
+         Revision numbers are defined as follows:
 
-   The ``$options`` parameter supports the following options:
+         - 0 = the original stored file
+         - 1 = the first revision
+         - 2 = the second revision
+         - etc...
+         - -2 = the second most recent revision
+         - -1 = the most recent revision
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-downloadToStreamByName-option.rst
+         Defaults to -1 (i.e. the most recent revision).
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index e0a4e662..d112dd66 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -19,15 +19,205 @@ Definition
 
    .. code-block:: php
 
-      function find(array|object $filter = [], array $options = []): MongoDB\Driver\Cursor
+      function find(
+          array|object $filter = [],
+          array $options = []
+      ): MongoDB\Driver\Cursor
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - batchSize
+       - integer
+       - The number of documents to return in the first batch. Defaults to
+         ``101``. A batchSize of ``0`` means that the cursor will be
+         established, but no documents will be returned in the first batch.
+
+         Unlike the previous wire protocol version, a batchSize of ``1`` for the
+         :dbcommand:`find` command does not close the cursor.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - cursorType
+       - integer
+       - Indicates the type of cursor to use. ``cursorType`` supports the
+         following values:
+
+         - ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
+         - ``MongoDB\Operation\Find::TAILABLE``
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - limit
+       - integer
+       - The maximum number of documents to return. If unspecified, then
+         defaults to no limit. A limit of ``0`` is equivalent to setting no
+         limit.
+
+         A negative limit is similar to a positive limit but closes the cursor
+         after returning a single batch of results. As such, with a negative
+         limit, if the limited result set does not fit into a single batch, the
+         number of documents received will be less than the specified limit. By
+         passing a negative limit, the client indicates to the server that it
+         will not ask for a subsequent batch via getMore.
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxAwaitTimeMS
+       - integer
+       - Positive integer denoting the time limit in milliseconds for the server
+         to block a getMore operation if no data is available. This option
+         should only be used if cursorType is TAILABLE_AWAIT.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - noCursorTimeout
+       - boolean
+       - Prevents the server from timing out idle cursors after an inactivity
+         period (10 minutes).
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/bucket-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/bucket-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
+
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-find-param.rst
+     * - snapshot
+       - boolean
+       - Prevents the cursor from returning a document more than once because of
+         an intervening write operation.
 
-   The ``$options`` parameter supports the following options:
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-find-option.rst
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/bucket-option-typeMap.rst
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
index f126448d..1ff9f258 100644
--- a/source/reference/method/MongoDBGridFSBucket-findOne.txt
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -20,15 +20,156 @@ Definition
 
    .. code-block:: php
 
-      function findOne(array|object $filter = [], array $options = []): array|object|null
+      function findOne(
+          array|object $filter = [],
+          array $options = []
+      ): array|object|null
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filter`` : array|object
+  The filter criteria that specifies the documents to query.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - allowDiskUse
+       - boolean
+       - Enables writing to temporary files. When set to ``true``, queries can
+         write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.
+
+     * - allowPartialResults
+       - boolean
+       - For queries against a sharded collection, returns partial results from
+         the :program:`mongos` if some shards are unavailable instead of
+         throwing an error.
+
+     * - collation
+       - array|object
+       - .. include:: /includes/extracts/common-option-collation.rst
+
+     * - comment
+       - mixed
+       - .. include:: /includes/extracts/common-option-comment.rst
+
+         .. include:: /includes/extracts/common-option-comment-string-before-4.4.rst
+
+     * - hint
+       - string|array|object
+       - .. include:: /includes/extracts/common-option-hint.rst
+
+         .. versionadded:: 1.2
+
+     * - let
+       - array|object
+       - .. include:: /includes/extracts/common-option-let.rst
+
+         .. versionadded:: 1.13
+
+     * - max
+       - array|object
+       - The exclusive upper bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - maxScan
+       - integer
+       - Maximum number of documents or index keys to scan when executing the
+         query.
+
+         .. deprecated:: 1.4
+         .. versionadded:: 1.2
+
+     * - maxTimeMS
+       - integer
+       - .. include:: /includes/extracts/common-option-maxTimeMS.rst
+
+     * - min
+       - array|object
+       - The inclusive lower bound for a specific index.
+
+         .. versionadded:: 1.2
+
+     * - modifiers
+       - array|object
+       - :manual:`Meta operators ` that
+         modify the output or behavior of a query. Use of these operators is
+         deprecated in favor of named options.
+
+     * - oplogReplay
+       - boolean
+       - Internal use for replica sets. To use ``oplogReplay``, you must include
+         the following condition in the filter:
+
+         .. code-block:: javascript
+
+            { ts: { $gte:  } }
+
+         The :php:`MongoDB\\BSON\\Timestamp `
+         class reference describes how to represent MongoDB's BSON timestamp
+         type with PHP.
+
+         .. deprecated:: 1.7
+
+     * - projection
+       - array|object
+       - The :ref:`projection specification ` to determine which
+         fields to include in the returned documents. See
+         :manual:`Project Fields to Return from Query `
+         and :manual:`Projection Operators ` in
+         the MongoDB manual.
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - .. include:: /includes/extracts/bucket-option-readConcern.rst
+
+         .. include:: /includes/extracts/common-option-readConcern-transaction.rst
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - .. include:: /includes/extracts/bucket-option-readPreference.rst
+
+     * - returnKey
+       - boolean
+       - If true, returns only the index keys in the resulting documents.
+
+         .. versionadded:: 1.2
+
+     * - session
+       - :php:`MongoDB\\Driver\\Session `
+       - .. include:: /includes/extracts/common-option-session.rst
+
+         .. versionadded:: 1.3
+
+     * - showRecordId
+       - boolean
+       - Determines whether to return the record identifier for each document.
+         If true, adds a field ``$recordId`` to the returned documents.
+
+         .. versionadded:: 1.2
+
+     * - skip
+       - integer
+       - Number of documents to skip. Defaults to ``0``.
 
-   .. include:: /includes/apiargs/MongoDBCollection-method-findOne-param.rst
+     * - sort
+       - array|object
+       - The sort specification for the ordering of the results.
 
-   The ``$options`` parameter supports the following options:
+     * - typeMap
+       - array
+       - .. include:: /includes/extracts/bucket-option-typeMap.rst
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-findOne-option.rst
+         This will be used for the returned result document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index f8d633ed..fa8625f9 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -21,9 +21,11 @@ Definition
 
       function getFileDocumentForStream(resource $stream): array|object
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileDocumentForStream-param.rst
+``$stream`` : resource
+  The GridFS stream resource.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index f88dc885..b42ab19b 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -21,9 +21,11 @@ Definition
 
       function getFileIdForStream(resource $stream): mixed
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-getFileIdForStream-param.rst
+``$stream`` : resource
+  The GridFS stream resource.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
index 85f2150a..9118cecc 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -21,9 +21,11 @@ Definition
 
       function openDownloadStream($id): resource
 
-   This method has the following parameters:
+Parameters
+----------
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStream-param.rst
+``$id`` : mixed
+  The ``_id`` of the file to download.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
index cb3a336e..4c0b525d 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -19,15 +19,43 @@ Definition
 
    .. code-block:: php
 
-      function openDownloadStreamByName(string $filename, array $options = []): resource
+      function openDownloadStreamByName(
+          string $filename,
+          array $options = []
+      ): resource
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to download.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - revision
+       - integer
+       - The revision of the file to retrieve. Files with the same ``filename``
+         will be differentiated by their ``uploadDate`` field.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-param.rst
+         Revision numbers are defined as follows:
 
-   The ``$options`` parameter supports the following options:
+         - 0 = the original stored file
+         - 1 = the first revision
+         - 2 = the second revision
+         - etc...
+         - -2 = the second most recent revision
+         - -1 = the most recent revision
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openDownloadStreamByName-option.rst
+         Defaults to -1 (i.e. the most recent revision).
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 348b325f..2870b544 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -19,15 +19,50 @@ Definition
 
    .. code-block:: php
 
-      function openUploadStream(string $filename, array $options = []): resource
+      function openUploadStream(
+          string $filename,
+          array $options = []
+      ): resource
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to create.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - _id
+       - mixed
+       - Value to use as the file document identifier. Defaults to a new
+         :php:`MongoDB\\BSON\\ObjectId ` object.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes``
+         option.
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-param.rst
+         Defaults to ``false``.
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded: 1.4
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-openUploadStream-option.rst
+     * - metadata
+       - array|object
+       - User data for the ``metadata`` field of the file document. If not
+         specified, the ``metadata`` field will not be set on the file document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt
index 888d1ae3..20d9c1d7 100644
--- a/source/reference/method/MongoDBGridFSBucket-rename.txt
+++ b/source/reference/method/MongoDBGridFSBucket-rename.txt
@@ -21,9 +21,14 @@ Definition
 
       function rename($id, string $newFilename): void
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$id`` : mixed
+  The ``_id`` of the file to rename.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-rename-param.rst
+``$newFilename`` : string
+  The new ``filename`` value.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index 18e5944b..89cb8d2f 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -19,15 +19,54 @@ Definition
 
    .. code-block:: php
 
-      function uploadFromStream(string $filename, resource $source, array $options = []): mixed
+      function uploadFromStream(
+          string $filename,
+          resource $source,
+          array $options = []
+      ): mixed
 
-   This method has the following parameters:
+Parameters
+----------
+
+``$filename`` : string
+  The ``filename`` of the file to create.
+
+``$source`` : resource
+  Readable stream, from which the new GridFS file's contents will be read.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - _id
+       - mixed
+       - Value to use as the file document identifier. Defaults to a new
+         :php:`MongoDB\\BSON\\ObjectId ` object.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes``
+         option.
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-param.rst
+         Defaults to ``false``.
 
-   The ``$options`` parameter supports the following options:
+         .. versionadded: 1.4
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-uploadFromStream-option.rst
+     * - metadata
+       - array|object
+       - User data for the ``metadata`` field of the file document. If not
+         specified, the ``metadata`` field will not be set on the file document.
 
 Return Values
 -------------
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index c6c309bb..25271e0c 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -19,15 +19,79 @@ Definition
 
    .. code-block:: php
 
-      function __construct(MongoDB\Driver\Manager $manager, string $databaseName, array $options = [])
+      function __construct(
+          MongoDB\Driver\Manager $manager,
+          string $databaseName,
+          array $options = []
+      )
 
-   This constructor has the following parameters:
+Parameters
+----------
+
+``$manager`` : :php:`MongoDB\\Driver\\Manager `
+  The :php:`Manager ` instance from the driver. The
+  manager maintains connections between the driver and your MongoDB instances.
+
+``$databaseName`` : string
+  The name of the database.
+
+``$options`` : array
+  An array specifying the desired options.
+
+  .. list-table::
+     :header-rows: 1
+     :widths: 20 20 80
+
+     * - Name
+       - Type
+       - Description
+
+     * - bucketName
+       - string
+       - The bucket name, which will be used as a prefix for the files and
+         chunks collections. Defaults to ``"fs"``.
+
+     * - chunkSizeBytes
+       - integer
+       - The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
+
+     * - disableMD5
+       - boolean
+       - Whether to disable automatic MD5 generation when storing files.
+
+         Defaults to ``false``.
+
+         .. versionadded: 1.4
+
+     * - readConcern
+       - :php:`MongoDB\\Driver\\ReadConcern `
+       - The default read concern to use for bucket operations. Defaults to the
+         manager's read concern.
+
+     * - readPreference
+       - :php:`MongoDB\\Driver\\ReadPreference `
+       - The default read preference to use for bucket operations. Defaults to
+         the manager's read preference.
+
+     * - typeMap
+       - array
+       - Default :php:`type map
+         `
+         to apply to cursors, which determines how BSON documents are converted
+         to PHP values. The library uses the following type map by default:
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-param.rst
+         .. code-block:: php
 
-   The ``$options`` parameter supports the following options:
+            [
+                'array' => 'MongoDB\Model\BSONArray',
+                'document' => 'MongoDB\Model\BSONDocument',
+                'root' => 'MongoDB\Model\BSONDocument',
+            ]
 
-   .. include:: /includes/apiargs/MongoDBGridFSBucket-method-construct-option.rst
+     * - writeConcern
+       - :php:`MongoDB\\Driver\\WriteConcern `
+       - The default write concern to use for bucket operations. Defaults to the
+         manager's write concern.
 
 Errors/Exceptions
 -----------------
diff --git a/source/tutorial/modeling-bson-data.txt b/source/tutorial/modeling-bson-data.txt
index 24486d1e..5cf09197 100644
--- a/source/tutorial/modeling-bson-data.txt
+++ b/source/tutorial/modeling-bson-data.txt
@@ -10,6 +10,7 @@ Modeling BSON Data
    :depth: 2
    :class: singlecol
 
+.. _php-type-map:
 
 Type Maps
 ---------
@@ -155,7 +156,6 @@ The same document in the MongoDB shell might display as:
 
    :php:`MongoDB\\BSON\\Persistable ` may only be used
    for root and embedded BSON documents. It may not be used for BSON arrays.
-.. _php-type-map:
 
 Working with Enums
 ------------------

From 152bab0fffdc9e3977345c934a915a2fb9c17750 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Thu, 1 Feb 2024 11:42:39 -0500
Subject: [PATCH 299/321] PHPLIB-1321: Use correct method in
 createSearchIndexes() example (#1225)

---
 .../MongoDBCollection-createSearchIndexes.txt | 21 ++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/source/reference/method/MongoDBCollection-createSearchIndexes.txt b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
index 584d94b3..a3081e60 100644
--- a/source/reference/method/MongoDBCollection-createSearchIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
@@ -77,8 +77,8 @@ Behavior
 Examples
 --------
 
-Create Indexes with Static and Dynamic Mappings
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Create an Index with Dynamic Mappings
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 The following example creates an Atlas Search index using
 `dynamic mappings `__
@@ -91,18 +91,25 @@ to index all document fields containing
 
    $collection = (new MongoDB\Client)->selectCollection('test', 'articles');
 
-   $indexName = $collection->createSearchIndex(
-      ['mappings' => ['dynamic' => true]],
-      ['name' => 'test-search-index']
+   $indexNames = $collection->createSearchIndexes(
+       [
+           [
+               'name' => 'test-search-index',
+               'definition' => ['mappings' => ['dynamic' => true]],
+           ],
+       ]
    );
 
-   var_dump($indexName);
+   var_dump($indexNames);
 
 The output would then resemble:
 
 .. code-block:: none
 
-   string(17) "test-search-index"
+   array(1) {
+     [0]=>
+     string(17) "test-search-index"
+   }
 
 See Also
 --------

From 040c2ed9757ce3484ab1a6a7c8e380ec69eb74c2 Mon Sep 17 00:00:00 2001
From: Chris Cho 
Date: Tue, 20 Feb 2024 11:16:31 -0500
Subject: [PATCH 300/321] DOCSP-36898: fix seealso admonition formatting
 (#1230)

---
 source/tutorial/crud.txt               | 36 +++++++++++++++++++-------
 source/tutorial/modeling-bson-data.txt |  4 ++-
 2 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index b5588acb..3abbf579 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -68,7 +68,9 @@ The output would then resemble:
    Inserted 1 document(s)
    int(1)
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::insertOne()`
+.. seealso::
+
+   :phpmethod:`MongoDB\\Collection::insertOne()`
 
 Insert Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
@@ -84,7 +86,9 @@ the inserted documents.
    :start-after: start-crud-include
    :end-before: end-crud-include
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::insertMany()`
+.. seealso::
+
+   :phpmethod:`MongoDB\\Collection::insertMany()`
 
 Query Documents
 ---------------
@@ -153,7 +157,9 @@ The output would then resemble:
    when matching an ``_id`` with an :manual:`ObjectId `
    value, as strings and ObjectIds are not directly comparable.
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::findOne()`
+.. seealso::
+
+   :phpmethod:`MongoDB\\Collection::findOne()`
 
 .. _php-find-many-documents:
 
@@ -190,7 +196,9 @@ The output would resemble:
    07307
    07310
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::find()`
+.. seealso::
+
+   :phpmethod:`MongoDB\\Collection::find()`
 
 .. _php-query-projection:
 
@@ -387,7 +395,9 @@ An equivalent filter could be constructed using the :query:`$regex` operator:
        'state' => 'TX',
    ]
 
-.. seealso:: :manual:`$regex ` in the MongoDB manual
+.. seealso::
+
+   :manual:`$regex ` in the MongoDB manual
 
 Although MongoDB's regular expression syntax is not exactly the same as PHP's
 :php:`PCRE ` syntax, :php:`preg_quote() `
@@ -446,7 +456,9 @@ The output would then resemble:
    PA has 1458 zip codes
    IL has 1237 zip codes
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::aggregate()`
+.. seealso::
+
+   :phpmethod:`MongoDB\\Collection::aggregate()`
 
 Update Documents
 ----------------
@@ -574,7 +586,9 @@ operation therefore resembles:
    Matched 3 document(s)
    Modified 2 document(s)
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::updateMany()`
+.. seealso::
+
+   :phpmethod:`MongoDB\\Collection::updateMany()`
 
 Replace Documents
 ~~~~~~~~~~~~~~~~~
@@ -737,7 +751,9 @@ The output would then resemble:
 
    Deleted 1 document(s)
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::deleteOne()`
+.. seealso::
+
+   :phpmethod:`MongoDB\\Collection::deleteOne()`
 
 Delete Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
@@ -773,4 +789,6 @@ The output would then resemble:
 
    Deleted 2 document(s)
 
-.. seealso:: :phpmethod:`MongoDB\\Collection::deleteMany()`
+.. seealso::
+
+   :phpmethod:`MongoDB\\Collection::deleteMany()`
diff --git a/source/tutorial/modeling-bson-data.txt b/source/tutorial/modeling-bson-data.txt
index 5cf09197..46ab3cf9 100644
--- a/source/tutorial/modeling-bson-data.txt
+++ b/source/tutorial/modeling-bson-data.txt
@@ -45,7 +45,9 @@ A type map may specify any class that implements
 ``"array"``, ``"stdClass``", and ``"object"`` (``"stdClass``" and ``"object"``
 are aliases of one another).
 
-.. seealso:: :php:`Deserialization from BSON ` in the PHP manual
+.. seealso::
+
+   :php:`Deserialization from BSON ` in the PHP manual
 
 
 Persistable Classes

From 74606682937211e332015fc7240556a2d8f5029c Mon Sep 17 00:00:00 2001
From: Nora Reidy 
Date: Wed, 21 Feb 2024 15:39:30 -0500
Subject: [PATCH 301/321] DOCSP-36027: Shorten class headings in nav (#1229)

Also consolidates result classes to a single section
---
 .../class/MongoDBBulkWriteResult.txt          |  37 ++++
 .../reference/class/MongoDBChangeStream.txt   |  42 ++++
 source/reference/class/MongoDBClient.txt      |  52 +++--
 source/reference/class/MongoDBCollection.txt  | 130 ++++++++----
 source/reference/class/MongoDBDatabase.txt    |  66 ++++--
 .../reference/class/MongoDBDeleteResult.txt   |  26 +++
 .../reference/class/MongoDBGridFSBucket.txt   |  72 ++++---
 .../class/MongoDBInsertManyResult.txt         |  27 +++
 .../class/MongoDBInsertOneResult.txt          |  27 +++
 .../class/MongoDBMapReduceResult.txt          |  34 +++
 .../class/MongoDBModelCollectionInfo.txt      |  49 +++++
 .../MongoDBModelCollectionInfoIterator.txt    |  20 ++
 .../class/MongoDBModelDatabaseInfo.txt        |  39 ++++
 .../MongoDBModelDatabaseInfoIterator.txt      |  20 ++
 .../reference/class/MongoDBModelIndexInfo.txt |  51 +++++
 .../class/MongoDBModelIndexInfoIterator.txt   |  20 ++
 .../reference/class/MongoDBUpdateResult.txt   |  33 +++
 source/reference/enumeration-classes.txt      | 193 ------------------
 source/reference/functions.txt                |  10 +-
 .../method/MongoDBCollection-mapReduce.txt    |   4 +-
 .../MongoDBGridFSBucket-getWriteConcern.txt   |   6 +-
 source/reference/result-classes.txt           |  80 ++------
 source/reference/write-result-classes.txt     | 143 -------------
 23 files changed, 664 insertions(+), 517 deletions(-)
 create mode 100644 source/reference/class/MongoDBBulkWriteResult.txt
 create mode 100644 source/reference/class/MongoDBChangeStream.txt
 create mode 100644 source/reference/class/MongoDBDeleteResult.txt
 create mode 100644 source/reference/class/MongoDBInsertManyResult.txt
 create mode 100644 source/reference/class/MongoDBInsertOneResult.txt
 create mode 100644 source/reference/class/MongoDBMapReduceResult.txt
 create mode 100644 source/reference/class/MongoDBModelCollectionInfo.txt
 create mode 100644 source/reference/class/MongoDBModelCollectionInfoIterator.txt
 create mode 100644 source/reference/class/MongoDBModelDatabaseInfo.txt
 create mode 100644 source/reference/class/MongoDBModelDatabaseInfoIterator.txt
 create mode 100644 source/reference/class/MongoDBModelIndexInfo.txt
 create mode 100644 source/reference/class/MongoDBModelIndexInfoIterator.txt
 create mode 100644 source/reference/class/MongoDBUpdateResult.txt
 delete mode 100644 source/reference/enumeration-classes.txt
 delete mode 100644 source/reference/write-result-classes.txt

diff --git a/source/reference/class/MongoDBBulkWriteResult.txt b/source/reference/class/MongoDBBulkWriteResult.txt
new file mode 100644
index 00000000..f33b036d
--- /dev/null
+++ b/source/reference/class/MongoDBBulkWriteResult.txt
@@ -0,0 +1,37 @@
+==============================
+MongoDB\\BulkWriteResult Class
+==============================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\BulkWriteResult
+
+   This class contains information about an executed bulk write operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::bulkWrite()`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getDeletedCount() 
+   getInsertedCount() 
+   getInsertedIds() 
+   getMatchedCount() 
+   getModifiedCount() 
+   getUpsertedCount() 
+   getUpsertedIds() 
+   isAcknowledged() 
+
+- :phpmethod:`MongoDB\\BulkWriteResult::getDeletedCount()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedCount()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedIds()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getMatchedCount()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getModifiedCount()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getUpsertedCount()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getUpsertedIds()`
+- :phpmethod:`MongoDB\\BulkWriteResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBChangeStream.txt b/source/reference/class/MongoDBChangeStream.txt
new file mode 100644
index 00000000..3142aeec
--- /dev/null
+++ b/source/reference/class/MongoDBChangeStream.txt
@@ -0,0 +1,42 @@
+===========================
+MongoDB\\ChangeStream Class
+===========================
+
+.. versionadded:: 1.3
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\ChangeStream
+
+   This class extends PHP's :php:`Iterator `
+   interface. An instance of this class is returned by
+   :phpmethod:`MongoDB\\Client::watch()`,
+   :phpmethod:`MongoDB\\Database::watch()`, and
+   :phpmethod:`MongoDB\\Collection::watch()`.
+
+   This class allows for iteration of events in a change stream. It also allows
+   iteration to automatically resume after certain errors, such as a replica set
+   failover.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   current() 
+   getCursorId() 
+   getResumeToken() 
+   key() 
+   next() 
+   rewind() 
+   valid() 
+
+- :phpmethod:`MongoDB\\ChangeStream::current()`
+- :phpmethod:`MongoDB\\ChangeStream::getCursorId()`
+- :phpmethod:`MongoDB\\ChangeStream::getResumeToken()`
+- :phpmethod:`MongoDB\\ChangeStream::key()`
+- :phpmethod:`MongoDB\\ChangeStream::next()`
+- :phpmethod:`MongoDB\\ChangeStream::rewind()`
+- :phpmethod:`MongoDB\\ChangeStream::valid()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
index 654a474a..afbdf696 100644
--- a/source/reference/class/MongoDBClient.txt
+++ b/source/reference/class/MongoDBClient.txt
@@ -28,20 +28,38 @@ Methods
 .. toctree::
    :titlesonly:
 
-   /reference/method/MongoDBClient__construct
-   /reference/method/MongoDBClient__get
-   /reference/method/MongoDBClient-addSubscriber
-   /reference/method/MongoDBClient-createClientEncryption
-   /reference/method/MongoDBClient-dropDatabase
-   /reference/method/MongoDBClient-getManager
-   /reference/method/MongoDBClient-getReadConcern
-   /reference/method/MongoDBClient-getReadPreference
-   /reference/method/MongoDBClient-getTypeMap
-   /reference/method/MongoDBClient-getWriteConcern
-   /reference/method/MongoDBClient-listDatabaseNames
-   /reference/method/MongoDBClient-listDatabases
-   /reference/method/MongoDBClient-removeSubscriber
-   /reference/method/MongoDBClient-selectCollection
-   /reference/method/MongoDBClient-selectDatabase
-   /reference/method/MongoDBClient-startSession
-   /reference/method/MongoDBClient-watch
+   __construct() 
+   __get() 
+   addSubscriber() 
+   createClientEncryption() 
+   dropDatabase() 
+   getManager() 
+   getReadConcern() 
+   getReadPreference() 
+   getTypeMap() 
+   getWriteConcern() 
+   listDatabaseNames() 
+   listDatabases() 
+   removeSubscriber() 
+   selectCollection() 
+   selectDatabase() 
+   startSession() 
+   watch() 
+
+- :phpmethod:`MongoDB\\Client::__construct()`
+- :phpmethod:`MongoDB\\Client::__get()`
+- :phpmethod:`MongoDB\\Client::addSubscriber()`
+- :phpmethod:`MongoDB\\Client::createClientEncryption()`
+- :phpmethod:`MongoDB\\Client::dropDatabase()`
+- :phpmethod:`MongoDB\\Client::getManager()`
+- :phpmethod:`MongoDB\\Client::getReadConcern()`
+- :phpmethod:`MongoDB\\Client::getReadPreference()`
+- :phpmethod:`MongoDB\\Client::getTypeMap()`
+- :phpmethod:`MongoDB\\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\\Client::listDatabaseNames()`
+- :phpmethod:`MongoDB\\Client::listDatabases()`
+- :phpmethod:`MongoDB\\Client::removeSubscriber()`
+- :phpmethod:`MongoDB\\Client::selectCollection()`
+- :phpmethod:`MongoDB\\Client::selectDatabase()`
+- :phpmethod:`MongoDB\\Client::startSession()`
+- :phpmethod:`MongoDB\\Client::watch()`
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index 2d03b162..45789ee0 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -58,46 +58,90 @@ Methods
 .. toctree::
    :titlesonly:
 
-   /reference/method/MongoDBCollection__construct
-   /reference/method/MongoDBCollection-aggregate
-   /reference/method/MongoDBCollection-bulkWrite
-   /reference/method/MongoDBCollection-count
-   /reference/method/MongoDBCollection-countDocuments
-   /reference/method/MongoDBCollection-createIndex
-   /reference/method/MongoDBCollection-createIndexes
-   /reference/method/MongoDBCollection-createSearchIndex
-   /reference/method/MongoDBCollection-createSearchIndexes
-   /reference/method/MongoDBCollection-deleteMany
-   /reference/method/MongoDBCollection-deleteOne
-   /reference/method/MongoDBCollection-distinct
-   /reference/method/MongoDBCollection-drop
-   /reference/method/MongoDBCollection-dropIndex
-   /reference/method/MongoDBCollection-dropIndexes
-   /reference/method/MongoDBCollection-dropSearchIndex
-   /reference/method/MongoDBCollection-estimatedDocumentCount
-   /reference/method/MongoDBCollection-explain
-   /reference/method/MongoDBCollection-find
-   /reference/method/MongoDBCollection-findOne
-   /reference/method/MongoDBCollection-findOneAndDelete
-   /reference/method/MongoDBCollection-findOneAndReplace
-   /reference/method/MongoDBCollection-findOneAndUpdate
-   /reference/method/MongoDBCollection-getCollectionName
-   /reference/method/MongoDBCollection-getDatabaseName
-   /reference/method/MongoDBCollection-getManager
-   /reference/method/MongoDBCollection-getNamespace
-   /reference/method/MongoDBCollection-getReadConcern
-   /reference/method/MongoDBCollection-getReadPreference
-   /reference/method/MongoDBCollection-getTypeMap
-   /reference/method/MongoDBCollection-getWriteConcern
-   /reference/method/MongoDBCollection-insertMany
-   /reference/method/MongoDBCollection-insertOne
-   /reference/method/MongoDBCollection-listIndexes
-   /reference/method/MongoDBCollection-listSearchIndexes
-   /reference/method/MongoDBCollection-mapReduce
-   /reference/method/MongoDBCollection-rename
-   /reference/method/MongoDBCollection-replaceOne
-   /reference/method/MongoDBCollection-updateMany
-   /reference/method/MongoDBCollection-updateOne
-   /reference/method/MongoDBCollection-updateSearchIndex
-   /reference/method/MongoDBCollection-watch
-   /reference/method/MongoDBCollection-withOptions
+   __construct() 
+   aggregate() 
+   bulkWrite() 
+   count() 
+   countDocuments() 
+   createIndex() 
+   createIndexes() 
+   createSearchIndex() 
+   createSearchIndexes() 
+   deleteMany() 
+   deleteOne() 
+   distinct() 
+   drop() 
+   dropIndex() 
+   dropIndexes() 
+   dropSearchIndex() 
+   estimatedDocumentCount() 
+   explain() 
+   find() 
+   findOne() 
+   findOneAndDelete() 
+   findOneAndReplace() 
+   findOneAndUpdate() 
+   getCollectionName() 
+   getDatabaseName() 
+   getManager() 
+   getNamespace() 
+   getReadConcern() 
+   getReadPreference() 
+   getTypeMap() 
+   getWriteConcern() 
+   insertMany() 
+   insertOne() 
+   listIndexes() 
+   listSearchIndexes() 
+   mapReduce() 
+   rename() 
+   replaceOne() 
+   updateMany() 
+   updateOne() 
+   updateSearchIndex() 
+   watch() 
+   withOptions() 
+
+- :phpmethod:`MongoDB\\Collection::__construct()`
+- :phpmethod:`MongoDB\\Collection::aggregate()`
+- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\\Collection::count()`
+- :phpmethod:`MongoDB\\Collection::countDocuments()`
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\\Collection::createIndexes()`
+- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\\Collection::deleteMany()`
+- :phpmethod:`MongoDB\\Collection::deleteOne()`
+- :phpmethod:`MongoDB\\Collection::distinct()`
+- :phpmethod:`MongoDB\\Collection::drop()`
+- :phpmethod:`MongoDB\\Collection::dropIndex()`
+- :phpmethod:`MongoDB\\Collection::dropIndexes()`
+- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
+- :phpmethod:`MongoDB\\Collection::explain()`
+- :phpmethod:`MongoDB\\Collection::find()`
+- :phpmethod:`MongoDB\\Collection::findOne()`
+- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+- :phpmethod:`MongoDB\\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\\Collection::getManager()`
+- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\\Collection::insertMany()`
+- :phpmethod:`MongoDB\\Collection::insertOne()`
+- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\\Collection::rename()`
+- :phpmethod:`MongoDB\\Collection::replaceOne()`
+- :phpmethod:`MongoDB\\Collection::updateMany()`
+- :phpmethod:`MongoDB\\Collection::updateOne()`
+- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :phpmethod:`MongoDB\\Collection::watch()`
+- :phpmethod:`MongoDB\\Collection::withOptions()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index ac0e0d16..f92d2314 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -43,26 +43,48 @@ Methods
 .. toctree::
    :titlesonly:
 
-   /reference/method/MongoDBDatabase__construct
-   /reference/method/MongoDBDatabase__get
-   /reference/method/MongoDBDatabase-aggregate
-   /reference/method/MongoDBDatabase-command
-   /reference/method/MongoDBDatabase-createCollection
-   /reference/method/MongoDBDatabase-createEncryptedCollection
-   /reference/method/MongoDBDatabase-drop
-   /reference/method/MongoDBDatabase-dropCollection
-   /reference/method/MongoDBDatabase-getDatabaseName
-   /reference/method/MongoDBDatabase-getManager
-   /reference/method/MongoDBDatabase-getReadConcern
-   /reference/method/MongoDBDatabase-getReadPreference
-   /reference/method/MongoDBDatabase-getTypeMap
-   /reference/method/MongoDBDatabase-getWriteConcern
-   /reference/method/MongoDBDatabase-listCollectionNames
-   /reference/method/MongoDBDatabase-listCollections
-   /reference/method/MongoDBDatabase-modifyCollection
-   /reference/method/MongoDBDatabase-renameCollection
-   /reference/method/MongoDBDatabase-selectCollection
-   /reference/method/MongoDBDatabase-selectGridFSBucket
-   /reference/method/MongoDBDatabase-watch
-   /reference/method/MongoDBDatabase-withOptions
+   __construct() 
+   __get() 
+   aggregate() 
+   command() 
+   createCollection() 
+   createEncryptedCollection() 
+   drop() 
+   dropCollection() 
+   getDatabaseName() 
+   getManager() 
+   getReadConcern() 
+   getReadPreference() 
+   getTypeMap() 
+   getWriteConcern() 
+   listCollectionNames() 
+   listCollections() 
+   modifyCollection() 
+   renameCollection() 
+   selectCollection() 
+   selectGridFSBucket() 
+   watch() 
+   withOptions() 
 
+- :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\\Database::__get()`
+- :phpmethod:`MongoDB\\Database::aggregate()`
+- :phpmethod:`MongoDB\\Database::command()`
+- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\\Database::createEncryptedCollection()`
+- :phpmethod:`MongoDB\\Database::drop()`
+- :phpmethod:`MongoDB\\Database::dropCollection()`
+- :phpmethod:`MongoDB\\Database::getDatabaseName()`
+- :phpmethod:`MongoDB\\Database::getManager()`
+- :phpmethod:`MongoDB\\Database::getReadConcern()`
+- :phpmethod:`MongoDB\\Database::getReadPreference()`
+- :phpmethod:`MongoDB\\Database::getTypeMap()`
+- :phpmethod:`MongoDB\\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\\Database::listCollectionNames()`
+- :phpmethod:`MongoDB\\Database::listCollections()`
+- :phpmethod:`MongoDB\\Database::modifyCollection()`
+- :phpmethod:`MongoDB\\Database::renameCollection()`
+- :phpmethod:`MongoDB\\Database::selectCollection()`
+- :phpmethod:`MongoDB\\Database::selectGridFSBucket()`
+- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\\Database::withOptions()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBDeleteResult.txt b/source/reference/class/MongoDBDeleteResult.txt
new file mode 100644
index 00000000..02c2c8c1
--- /dev/null
+++ b/source/reference/class/MongoDBDeleteResult.txt
@@ -0,0 +1,26 @@
+===========================
+MongoDB\\DeleteResult Class
+===========================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\DeleteResult
+
+   This class contains information about an executed delete operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::deleteMany()` or
+   :phpmethod:`MongoDB\\Collection::deleteOne()`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getDeletedCount() 
+   isAcknowledged() 
+
+- :phpmethod:`MongoDB\\DeleteResult::getDeletedCount()`
+- :phpmethod:`MongoDB\\DeleteResult::isAcknowledged()`
diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 7b4bb54c..2c29cd75 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -34,27 +34,51 @@ Methods
 .. toctree::
    :titlesonly:
 
-   /reference/method/MongoDBGridFSBucket__construct
-   /reference/method/MongoDBGridFSBucket-delete
-   /reference/method/MongoDBGridFSBucket-downloadToStream
-   /reference/method/MongoDBGridFSBucket-downloadToStreamByName
-   /reference/method/MongoDBGridFSBucket-drop
-   /reference/method/MongoDBGridFSBucket-find
-   /reference/method/MongoDBGridFSBucket-findOne
-   /reference/method/MongoDBGridFSBucket-getBucketName
-   /reference/method/MongoDBGridFSBucket-getChunksCollection
-   /reference/method/MongoDBGridFSBucket-getChunkSizeBytes
-   /reference/method/MongoDBGridFSBucket-getDatabaseName
-   /reference/method/MongoDBGridFSBucket-getFileDocumentForStream
-   /reference/method/MongoDBGridFSBucket-getFileIdForStream
-   /reference/method/MongoDBGridFSBucket-getFilesCollection
-   /reference/method/MongoDBGridFSBucket-getReadConcern
-   /reference/method/MongoDBGridFSBucket-getReadPreference
-   /reference/method/MongoDBGridFSBucket-getTypeMap
-   /reference/method/MongoDBGridFSBucket-getWriteConcern
-   /reference/method/MongoDBGridFSBucket-openDownloadStream
-   /reference/method/MongoDBGridFSBucket-openDownloadStreamByName
-   /reference/method/MongoDBGridFSBucket-openUploadStream
-   /reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias
-   /reference/method/MongoDBGridFSBucket-rename
-   /reference/method/MongoDBGridFSBucket-uploadFromStream
+   __construct() 
+   delete() 
+   downloadToStream() 
+   downloadToStreamByName() 
+   drop() 
+   find() 
+   findOne() 
+   getBucketName() 
+   getChunksCollection() 
+   getChunkSizeBytes() 
+   getDatabaseName() 
+   getFileDocumentForStream() 
+   getFileIdForStream() 
+   getFilesCollection() 
+   getReadConcern() 
+   getReadPreference() 
+   getTypeMap() 
+   getWriteConcern() 
+   openDownloadStream() 
+   openDownloadStreamByName() 
+   openUploadStream() 
+   registerGlobalStreamWrapperAlias() 
+   rename() 
+   uploadFromStream() 
+
+- :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::delete()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::drop()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::find()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::findOne()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getBucketName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getChunksCollection()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getChunkSizeBytes()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getDatabaseName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getFilesCollection()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::registerGlobalStreamWrapperAlias()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::rename()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
diff --git a/source/reference/class/MongoDBInsertManyResult.txt b/source/reference/class/MongoDBInsertManyResult.txt
new file mode 100644
index 00000000..16d9b482
--- /dev/null
+++ b/source/reference/class/MongoDBInsertManyResult.txt
@@ -0,0 +1,27 @@
+===============================
+MongoDB\\InsertManyResult Class
+===============================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\InsertManyResult
+
+   This class contains information about an executed bulk insert operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::insertMany()`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getInsertedCount() 
+   getInsertedIds() 
+   isAcknowledged() 
+
+- :phpmethod:`MongoDB\\InsertManyResult::getInsertedCount()`
+- :phpmethod:`MongoDB\\InsertManyResult::getInsertedIds()`
+- :phpmethod:`MongoDB\\InsertManyResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBInsertOneResult.txt b/source/reference/class/MongoDBInsertOneResult.txt
new file mode 100644
index 00000000..19454d22
--- /dev/null
+++ b/source/reference/class/MongoDBInsertOneResult.txt
@@ -0,0 +1,27 @@
+==============================
+MongoDB\\InsertOneResult Class
+==============================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\InsertOneResult
+
+   This class contains information about an executed insert operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::insertOne()`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getInsertedCount() 
+   getInsertedId() 
+   isAcknowledged() 
+
+- :phpmethod:`MongoDB\\InsertOneResult::getInsertedCount()`
+- :phpmethod:`MongoDB\\InsertOneResult::getInsertedId()`
+- :phpmethod:`MongoDB\\InsertOneResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBMapReduceResult.txt b/source/reference/class/MongoDBMapReduceResult.txt
new file mode 100644
index 00000000..601f6f82
--- /dev/null
+++ b/source/reference/class/MongoDBMapReduceResult.txt
@@ -0,0 +1,34 @@
+==============================
+MongoDB\\MapReduceResult Class
+==============================
+
+.. versionadded:: 1.2
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\MapReduceResult
+
+   This class extends PHP's :php:`IteratorAggregate `
+   interface. An instance of this class is returned by
+   :phpmethod:`MongoDB\\Collection::mapReduce()`.
+
+   This class allows for iteration of map-reduce results irrespective of the
+   output method (e.g. inline, collection). It also provides access to command
+   statistics.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getCounts() 
+   getExecutionTimeMS() 
+   getIterator() 
+   getTiming() 
+
+- :phpmethod:`MongoDB\\MapReduceResult::getCounts()`
+- :phpmethod:`MongoDB\\MapReduceResult::getExecutionTimeMS()`
+- :phpmethod:`MongoDB\\MapReduceResult::getIterator()`
+- :phpmethod:`MongoDB\\MapReduceResult::getTiming()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelCollectionInfo.txt b/source/reference/class/MongoDBModelCollectionInfo.txt
new file mode 100644
index 00000000..17807095
--- /dev/null
+++ b/source/reference/class/MongoDBModelCollectionInfo.txt
@@ -0,0 +1,49 @@
+====================================
+MongoDB\\Model\\CollectionInfo Class
+====================================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\CollectionInfo
+
+   This class models information about a collection. Instances of this class are
+   returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\\Database::listCollections()`.
+
+.. versionchanged:: 1.4
+
+   This class implements PHP's :php:`ArrayAccess ` interface. This
+   provides a mechanism for accessing index fields for which there exists no
+   helper method. :php:`isset() ` may be used to check for the existence
+   of a field before accessing it with ``[]``.
+
+   .. note::
+
+      The :phpclass:`MongoDB\\Model\\CollectionInfo` class is immutable. Attempting
+      to modify it via the :php:`ArrayAccess ` interface will
+      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getCappedMax() 
+   getCappedSize() 
+   getIdIndex() 
+   getInfo() 
+   getName() 
+   getOptions() 
+   getType() 
+   isCapped() 
+
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getIdIndex()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getInfo()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getName()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getType()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelCollectionInfoIterator.txt b/source/reference/class/MongoDBModelCollectionInfoIterator.txt
new file mode 100644
index 00000000..5358f213
--- /dev/null
+++ b/source/reference/class/MongoDBModelCollectionInfoIterator.txt
@@ -0,0 +1,20 @@
+============================================
+MongoDB\\Model\\CollectionInfoIterator Class
+============================================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\CollectionInfoIterator
+
+   This interface extends PHP's :php:`Iterator `
+   interface. An instance of this interface is returned by
+   :phpmethod:`MongoDB\\Database::listCollections()`.
+
+Methods
+-------
+
+This interface adds no new methods to :php:`Iterator
+`, but specifies that :php:`current()
+` will return an instance of
+:phpclass:`MongoDB\\Model\\CollectionInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelDatabaseInfo.txt b/source/reference/class/MongoDBModelDatabaseInfo.txt
new file mode 100644
index 00000000..e0f45852
--- /dev/null
+++ b/source/reference/class/MongoDBModelDatabaseInfo.txt
@@ -0,0 +1,39 @@
+==================================
+MongoDB\\Model\\DatabaseInfo Class
+==================================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\DatabaseInfo
+
+   This class models information about a database. Instances of this class are
+   returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`.
+
+.. versionchanged:: 1.4
+
+   This class implements PHP's :php:`ArrayAccess ` interface. This
+   provides a mechanism for accessing index fields for which there exists no
+   helper method. :php:`isset() ` may be used to check for the existence
+   of a field before accessing it with ``[]``.
+
+   .. note::
+
+      The :phpclass:`MongoDB\\Model\\DatabaseInfo` class is immutable. Attempting
+      to modify it via the :php:`ArrayAccess ` interface will
+      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getName() 
+   getSizeOnDisk() 
+   isEmpty() 
+
+- :phpmethod:`MongoDB\\Model\\DatabaseInfo::getName()`
+- :phpmethod:`MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()`
+- :phpmethod:`MongoDB\\Model\\DatabaseInfo::isEmpty()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelDatabaseInfoIterator.txt b/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
new file mode 100644
index 00000000..960ca256
--- /dev/null
+++ b/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
@@ -0,0 +1,20 @@
+==========================================
+MongoDB\\Model\\DatabaseInfoIterator Class
+==========================================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\DatabaseInfoIterator
+
+   This interface extends PHP's :php:`Iterator `
+   interface. An instance of this interface is returned by
+   :phpmethod:`MongoDB\\Client::listDatabases()`.
+
+Methods
+-------
+
+This interface adds no new methods to :php:`Iterator
+`, but specifies that :php:`current()
+` will return an instance of
+:phpclass:`MongoDB\\Model\\DatabaseInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelIndexInfo.txt b/source/reference/class/MongoDBModelIndexInfo.txt
new file mode 100644
index 00000000..8b9c42c8
--- /dev/null
+++ b/source/reference/class/MongoDBModelIndexInfo.txt
@@ -0,0 +1,51 @@
+===============================
+MongoDB\\Model\\IndexInfo Class
+===============================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\IndexInfo
+
+   This class models information about an index. Instances of this class are
+   returned by traversing a :phpclass:`MongoDB\\Model\\IndexInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\\Collection::listIndexes()`.
+
+   This class implements PHP's :php:`ArrayAccess ` interface. This
+   provides a mechanism for accessing index fields for which there exists no
+   helper method. :php:`isset() ` may be used to check for the existence
+   of a field before accessing it with ``[]``.
+
+   .. note::
+
+      The :phpclass:`MongoDB\\Model\\IndexInfo` class is immutable. Attempting
+      to modify it via the :php:`ArrayAccess ` interface will
+      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getKey() 
+   getName() 
+   getNamespace() 
+   getVersion() 
+   is2dSphere() 
+   isGeoHaystack() 
+   isSparse() 
+   isText() 
+   isTtl() 
+   isUnique() 
+
+- :phpmethod:`MongoDB\\Model\\IndexInfo::getKey()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::getName()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::getNamespace()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::getVersion()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::is2dSphere()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::isGeoHaystack()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::isSparse()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::isText()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::isTtl()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::isUnique()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelIndexInfoIterator.txt b/source/reference/class/MongoDBModelIndexInfoIterator.txt
new file mode 100644
index 00000000..2b154706
--- /dev/null
+++ b/source/reference/class/MongoDBModelIndexInfoIterator.txt
@@ -0,0 +1,20 @@
+=======================================
+MongoDB\\Model\\IndexInfoIterator Class
+=======================================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\IndexInfoIterator
+
+   This interface extends PHP's :php:`Iterator `
+   interface. An instance of this interface is returned by
+   :phpmethod:`MongoDB\\Collection::listIndexes()`.
+
+Methods
+-------
+
+This interface adds no new methods to :php:`Iterator
+`, but specifies that :php:`current()
+` will return an instance of
+:phpclass:`MongoDB\\Model\\IndexInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBUpdateResult.txt b/source/reference/class/MongoDBUpdateResult.txt
new file mode 100644
index 00000000..0534980d
--- /dev/null
+++ b/source/reference/class/MongoDBUpdateResult.txt
@@ -0,0 +1,33 @@
+===========================
+MongoDB\\UpdateResult Class
+===========================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\UpdateResult
+
+   This class contains information about an executed update or replace
+   operation. It encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::replaceOne()`,
+   :phpmethod:`MongoDB\\Collection::updateMany()`, or
+   :phpmethod:`MongoDB\\Collection::updateOne()`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getMatchedCount() 
+   getModifiedCount() 
+   getUpsertedCount() 
+   getUpsertedId() 
+   isAcknowledged() 
+
+- :phpmethod:`MongoDB\\UpdateResult::getMatchedCount()`
+- :phpmethod:`MongoDB\\UpdateResult::getModifiedCount()`
+- :phpmethod:`MongoDB\\UpdateResult::getUpsertedCount()`
+- :phpmethod:`MongoDB\\UpdateResult::getUpsertedId()`
+- :phpmethod:`MongoDB\\UpdateResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/enumeration-classes.txt b/source/reference/enumeration-classes.txt
deleted file mode 100644
index bb2a629a..00000000
--- a/source/reference/enumeration-classes.txt
+++ /dev/null
@@ -1,193 +0,0 @@
-===================
-Enumeration Classes
-===================
-
-.. default-domain:: mongodb
-
-.. contents:: On this page
-   :local:
-   :backlinks: none
-   :depth: 1
-   :class: singlecol
-
-MongoDB\\Model\\CollectionInfo
-------------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\Model\\CollectionInfo
-
-   This class models information about a collection. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Database::listCollections()`.
-
-.. versionchanged:: 1.4
-
-   This class implements PHP's :php:`ArrayAccess ` interface. This
-   provides a mechanism for accessing index fields for which there exists no
-   helper method. :php:`isset() ` may be used to check for the existence
-   of a field before accessing it with ``[]``.
-
-   .. note::
-
-      The :phpclass:`MongoDB\\Model\\CollectionInfo` class is immutable. Attempting
-      to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBModelCollectionInfo-getCappedMax
-   /reference/method/MongoDBModelCollectionInfo-getCappedSize
-   /reference/method/MongoDBModelCollectionInfo-getIdIndex
-   /reference/method/MongoDBModelCollectionInfo-getInfo
-   /reference/method/MongoDBModelCollectionInfo-getName
-   /reference/method/MongoDBModelCollectionInfo-getOptions
-   /reference/method/MongoDBModelCollectionInfo-getType
-   /reference/method/MongoDBModelCollectionInfo-isCapped
-
-----
-
-MongoDB\\Model\\CollectionInfoIterator
---------------------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\Model\\CollectionInfoIterator
-
-   This interface extends PHP's :php:`Iterator `
-   interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Database::listCollections()`.
-
-Methods
-~~~~~~~
-
-This interface adds no new methods to :php:`Iterator
-`, but specifies that :php:`current()
-` will return an instance of
-:phpclass:`MongoDB\\Model\\CollectionInfo`.
-
-----
-
-MongoDB\\Model\\DatabaseInfo
-----------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\Model\\DatabaseInfo
-
-   This class models information about a database. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`.
-
-.. versionchanged:: 1.4
-
-   This class implements PHP's :php:`ArrayAccess ` interface. This
-   provides a mechanism for accessing index fields for which there exists no
-   helper method. :php:`isset() ` may be used to check for the existence
-   of a field before accessing it with ``[]``.
-
-   .. note::
-
-      The :phpclass:`MongoDB\\Model\\DatabaseInfo` class is immutable. Attempting
-      to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBModelDatabaseInfo-getName
-   /reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk
-   /reference/method/MongoDBModelDatabaseInfo-isEmpty
-
-----
-
-MongoDB\\Model\\DatabaseInfoIterator
-------------------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\Model\\DatabaseInfoIterator
-
-   This interface extends PHP's :php:`Iterator `
-   interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Client::listDatabases()`.
-
-Methods
-~~~~~~~
-
-This interface adds no new methods to :php:`Iterator
-`, but specifies that :php:`current()
-` will return an instance of
-:phpclass:`MongoDB\\Model\\DatabaseInfo`.
-
-----
-
-MongoDB\\Model\\IndexInfo
--------------------------
-
-.. phpclass:: MongoDB\\Model\\IndexInfo
-
-   This class models information about an index. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\IndexInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Collection::listIndexes()`.
-
-   This class implements PHP's :php:`ArrayAccess ` interface. This
-   provides a mechanism for accessing index fields for which there exists no
-   helper method. :php:`isset() ` may be used to check for the existence
-   of a field before accessing it with ``[]``.
-
-   .. note::
-
-      The :phpclass:`MongoDB\\Model\\IndexInfo` class is immutable. Attempting
-      to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBModelIndexInfo-getKey
-   /reference/method/MongoDBModelIndexInfo-getName
-   /reference/method/MongoDBModelIndexInfo-getNamespace
-   /reference/method/MongoDBModelIndexInfo-getVersion
-   /reference/method/MongoDBModelIndexInfo-is2dSphere
-   /reference/method/MongoDBModelIndexInfo-isGeoHaystack
-   /reference/method/MongoDBModelIndexInfo-isSparse
-   /reference/method/MongoDBModelIndexInfo-isText
-   /reference/method/MongoDBModelIndexInfo-isTtl
-   /reference/method/MongoDBModelIndexInfo-isUnique
-
-----
-
-MongoDB\\Model\\IndexInfoIterator
----------------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\Model\\IndexInfoIterator
-
-   This interface extends PHP's :php:`Iterator `
-   interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Collection::listIndexes()`.
-
-Methods
-~~~~~~~
-
-This interface adds no new methods to :php:`Iterator
-`, but specifies that :php:`current()
-` will return an instance of
-:phpclass:`MongoDB\\Model\\IndexInfo`.
diff --git a/source/reference/functions.txt b/source/reference/functions.txt
index fb38d568..b5a7e586 100644
--- a/source/reference/functions.txt
+++ b/source/reference/functions.txt
@@ -13,6 +13,10 @@ Functions
 .. toctree::
    :titlesonly:
 
-   /reference/function/add_logger
-   /reference/function/remove_logger
-   /reference/function/with_transaction
+   add_logger() 
+   remove_logger() 
+   with_transaction() 
+
+- :phpmethod:`MongoDB\\add_logger()`
+- :phpmethod:`MongoDB\\remove_logger()`
+- :phpmethod:`MongoDB\\with_transaction()`
\ No newline at end of file
diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
index 1cb66f35..9081c36c 100644
--- a/source/reference/method/MongoDBCollection-mapReduce.txt
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -1,6 +1,6 @@
-=================================
+================================
 MongoDB\\Collection::mapReduce()
-=================================
+================================
 
 .. deprecated:: 1.12
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
index b77f1f00..77303b92 100644
--- a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
@@ -1,6 +1,6 @@
-=========================================
-MongoDB\\GridFS\Bucket::getWriteConcern()
-=========================================
+==========================================
+MongoDB\\GridFS\\Bucket::getWriteConcern()
+==========================================
 
 .. versionadded:: 1.2
 
diff --git a/source/reference/result-classes.txt b/source/reference/result-classes.txt
index 3371c137..db5ff759 100644
--- a/source/reference/result-classes.txt
+++ b/source/reference/result-classes.txt
@@ -4,73 +4,19 @@ Result Classes
 
 .. default-domain:: mongodb
 
-.. contents:: On this page
-   :local:
-   :backlinks: none
-   :depth: 1
-   :class: singlecol
-
-MongoDB\\ChangeStream
----------------------
-
-.. versionadded:: 1.3
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\ChangeStream
-
-   This class extends PHP's :php:`Iterator `
-   interface. An instance of this class is returned by
-   :phpmethod:`MongoDB\\Client::watch()`,
-   :phpmethod:`MongoDB\\Database::watch()`, and
-   :phpmethod:`MongoDB\\Collection::watch()`.
-
-   This class allows for iteration of events in a change stream. It also allows
-   iteration to automatically resume after certain errors, such as a replica set
-   failover.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBChangeStream-current
-   /reference/method/MongoDBChangeStream-getCursorId
-   /reference/method/MongoDBChangeStream-getResumeToken
-   /reference/method/MongoDBChangeStream-key
-   /reference/method/MongoDBChangeStream-next
-   /reference/method/MongoDBChangeStream-rewind
-   /reference/method/MongoDBChangeStream-valid
-
-----
-
-MongoDB\\MapReduceResult
-------------------------
-
-.. versionadded:: 1.2
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\MapReduceResult
-
-   This class extends PHP's :php:`IteratorAggregate `
-   interface. An instance of this class is returned by
-   :phpmethod:`MongoDB\\Collection::mapReduce()`.
-
-   This class allows for iteration of map-reduce results irrespective of the
-   output method (e.g. inline, collection). It also provides access to command
-   statistics.
-
-Methods
-~~~~~~~
-
 .. toctree::
    :titlesonly:
 
-   /reference/method/MongoDBMapReduceResult-getCounts
-   /reference/method/MongoDBMapReduceResult-getExecutionTimeMS
-   /reference/method/MongoDBMapReduceResult-getIterator
-   /reference/method/MongoDBMapReduceResult-getTiming
+   BulkWriteResult Class 
+   DeleteResult Class 
+   InsertManyResult Class 
+   InsertOneResult Class 
+   UpdateResult Class 
+   ChangeStream Class 
+   MapReduceResult Class 
+   CollectionInfo Class 
+   CollectionInfoIterator Class 
+   DatabaseInfo Class 
+   DatabaseInfoIterator Class 
+   IndexInfo Class 
+   IndexInfoIterator Class 
\ No newline at end of file
diff --git a/source/reference/write-result-classes.txt b/source/reference/write-result-classes.txt
deleted file mode 100644
index f410c083..00000000
--- a/source/reference/write-result-classes.txt
+++ /dev/null
@@ -1,143 +0,0 @@
-====================
-Write Result Classes
-====================
-
-.. default-domain:: mongodb
-
-.. contents:: On this page
-   :local:
-   :backlinks: none
-   :depth: 1
-   :class: singlecol
-
-MongoDB\\BulkWriteResult
-------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\BulkWriteResult
-
-   This class contains information about an executed bulk write operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::bulkWrite()`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBBulkWriteResult-getDeletedCount
-   /reference/method/MongoDBBulkWriteResult-getInsertedCount
-   /reference/method/MongoDBBulkWriteResult-getInsertedIds
-   /reference/method/MongoDBBulkWriteResult-getMatchedCount
-   /reference/method/MongoDBBulkWriteResult-getModifiedCount
-   /reference/method/MongoDBBulkWriteResult-getUpsertedCount
-   /reference/method/MongoDBBulkWriteResult-getUpsertedIds
-   /reference/method/MongoDBBulkWriteResult-isAcknowledged
-
-----
-
-MongoDB\\DeleteResult
----------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\DeleteResult
-
-   This class contains information about an executed delete operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::deleteMany()` or
-   :phpmethod:`MongoDB\\Collection::deleteOne()`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBDeleteResult-getDeletedCount
-   /reference/method/MongoDBDeleteResult-isAcknowledged
-
-----
-
-MongoDB\\InsertManyResult
--------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\InsertManyResult
-
-   This class contains information about an executed bulk insert operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::insertMany()`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBInsertManyResult-getInsertedCount
-   /reference/method/MongoDBInsertManyResult-getInsertedIds
-   /reference/method/MongoDBInsertManyResult-isAcknowledged
-
-----
-
-MongoDB\\InsertOneResult
-------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\InsertOneResult
-
-   This class contains information about an executed insert operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::insertOne()`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBInsertOneResult-getInsertedCount
-   /reference/method/MongoDBInsertOneResult-getInsertedId
-   /reference/method/MongoDBInsertOneResult-isAcknowledged
-
-----
-
-MongoDB\\UpdateResult
----------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\UpdateResult
-
-   This class contains information about an executed update or replace
-   operation. It encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::replaceOne()`,
-   :phpmethod:`MongoDB\\Collection::updateMany()`, or
-   :phpmethod:`MongoDB\\Collection::updateOne()`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBUpdateResult-getMatchedCount
-   /reference/method/MongoDBUpdateResult-getModifiedCount
-   /reference/method/MongoDBUpdateResult-getUpsertedCount
-   /reference/method/MongoDBUpdateResult-getUpsertedId
-   /reference/method/MongoDBUpdateResult-isAcknowledged

From dc828585f4c2095e841423739f2e43ae8d23b30c Mon Sep 17 00:00:00 2001
From: Nora Reidy 
Date: Wed, 21 Feb 2024 15:41:56 -0500
Subject: [PATCH 302/321] DOCSP-37038: Fix broken links (#1233)

---
 source/includes/extracts-note.yaml                   | 2 +-
 source/reference/method/MongoDBClient__construct.txt | 6 +++---
 source/tutorial/collation.txt                        | 2 +-
 source/tutorial/decimal128.txt                       | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/source/includes/extracts-note.yaml b/source/includes/extracts-note.yaml
index 4c41e191..d2130910 100644
--- a/source/includes/extracts-note.yaml
+++ b/source/includes/extracts-note.yaml
@@ -13,7 +13,7 @@ content: |
 ref: note-atlas-search-requirement
 content: |
   This command can only be run on a deployment hosted on
-  :manual:`MongoDB Atlas ` and requires an Atlas cluster tier of at
+  `MongoDB Atlas `__ and requires an Atlas cluster tier of at
   least M10. A
   `Local Atlas Deployment `__
   can also be used for development.
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index 1134df67..17c213ff 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -107,9 +107,9 @@ Parameters
 
      * - serverApi
        - :php:`MongoDB\\Driver\\ServerApi `
-       - Used to declare an API version on the client. Refer to
-         :manual:`Stable API tutorial ` for additional
-         information.
+       - Used to declare an API version on the client. Refer to the
+         :manual:`Stable API ` page in the Server manual for
+         additional information.
 
          .. versionadded:: 1.9
 
diff --git a/source/tutorial/collation.txt b/source/tutorial/collation.txt
index 28225db0..a867ae25 100644
--- a/source/tutorial/collation.txt
+++ b/source/tutorial/collation.txt
@@ -16,7 +16,7 @@ Overview
 --------
 
 MongoDB 3.4 introduced support for :manual:`collations
-`, which provide a set of rules to comply with the
+`, which provide a set of rules to comply with the
 conventions of a particular language when comparing strings.
 
 For example, in Canadian French, the last accent in a given word determines the
diff --git a/source/tutorial/decimal128.txt b/source/tutorial/decimal128.txt
index 3bdab8f1..f73074f3 100644
--- a/source/tutorial/decimal128.txt
+++ b/source/tutorial/decimal128.txt
@@ -14,7 +14,7 @@ Overview
 --------
 
 MongoDB 3.4 introduced support for a :manual:`Decimal128 BSON type
-`, which is a 128-bit decimal-based
+`, which is a 128-bit decimal-based
 floating-point value capable of emulating decimal rounding with exact precision.
 This functionality is intended for applications that handle :manual:`monetary
 data `, such as financial and tax computations.

From d6752534e61114e8a0610ffcf3e25f69b82c98ef Mon Sep 17 00:00:00 2001
From: Nora Reidy 
Date: Tue, 27 Feb 2024 11:20:49 -0500
Subject: [PATCH 303/321] DOCSP-36027: Shorten class headings in nav (#1236)

Also consolidates result classes to a single section

Backport of 00d44d41a4eb67586207d149d24fd93b1eb5bc6d
---
 .../class/MongoDBBulkWriteResult.txt          |  37 ++++
 .../reference/class/MongoDBChangeStream.txt   |  42 ++++
 source/reference/class/MongoDBClient.txt      |  46 +++--
 source/reference/class/MongoDBCollection.txt  | 115 +++++++----
 source/reference/class/MongoDBDatabase.txt    |  66 ++++--
 .../reference/class/MongoDBDeleteResult.txt   |  26 +++
 .../reference/class/MongoDBGridFSBucket.txt   |  69 ++++---
 .../class/MongoDBInsertManyResult.txt         |  27 +++
 .../class/MongoDBInsertOneResult.txt          |  27 +++
 .../class/MongoDBMapReduceResult.txt          |  34 +++
 .../class/MongoDBModelCollectionInfo.txt      |  49 +++++
 .../MongoDBModelCollectionInfoIterator.txt    |  20 ++
 .../class/MongoDBModelDatabaseInfo.txt        |  39 ++++
 .../MongoDBModelDatabaseInfoIterator.txt      |  20 ++
 .../reference/class/MongoDBModelIndexInfo.txt |  51 +++++
 .../class/MongoDBModelIndexInfoIterator.txt   |  20 ++
 .../reference/class/MongoDBUpdateResult.txt   |  33 +++
 source/reference/enumeration-classes.txt      | 193 ------------------
 source/reference/functions.txt                |   4 +-
 .../method/MongoDBCollection-mapReduce.txt    |   4 +-
 .../MongoDBGridFSBucket-getWriteConcern.txt   |   6 +-
 source/reference/result-classes.txt           |  80 ++------
 source/reference/write-result-classes.txt     | 143 -------------
 23 files changed, 644 insertions(+), 507 deletions(-)
 create mode 100644 source/reference/class/MongoDBBulkWriteResult.txt
 create mode 100644 source/reference/class/MongoDBChangeStream.txt
 create mode 100644 source/reference/class/MongoDBDeleteResult.txt
 create mode 100644 source/reference/class/MongoDBInsertManyResult.txt
 create mode 100644 source/reference/class/MongoDBInsertOneResult.txt
 create mode 100644 source/reference/class/MongoDBMapReduceResult.txt
 create mode 100644 source/reference/class/MongoDBModelCollectionInfo.txt
 create mode 100644 source/reference/class/MongoDBModelCollectionInfoIterator.txt
 create mode 100644 source/reference/class/MongoDBModelDatabaseInfo.txt
 create mode 100644 source/reference/class/MongoDBModelDatabaseInfoIterator.txt
 create mode 100644 source/reference/class/MongoDBModelIndexInfo.txt
 create mode 100644 source/reference/class/MongoDBModelIndexInfoIterator.txt
 create mode 100644 source/reference/class/MongoDBUpdateResult.txt
 delete mode 100644 source/reference/enumeration-classes.txt
 delete mode 100644 source/reference/write-result-classes.txt

diff --git a/source/reference/class/MongoDBBulkWriteResult.txt b/source/reference/class/MongoDBBulkWriteResult.txt
new file mode 100644
index 00000000..f33b036d
--- /dev/null
+++ b/source/reference/class/MongoDBBulkWriteResult.txt
@@ -0,0 +1,37 @@
+==============================
+MongoDB\\BulkWriteResult Class
+==============================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\BulkWriteResult
+
+   This class contains information about an executed bulk write operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::bulkWrite()`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getDeletedCount() 
+   getInsertedCount() 
+   getInsertedIds() 
+   getMatchedCount() 
+   getModifiedCount() 
+   getUpsertedCount() 
+   getUpsertedIds() 
+   isAcknowledged() 
+
+- :phpmethod:`MongoDB\\BulkWriteResult::getDeletedCount()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedCount()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedIds()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getMatchedCount()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getModifiedCount()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getUpsertedCount()`
+- :phpmethod:`MongoDB\\BulkWriteResult::getUpsertedIds()`
+- :phpmethod:`MongoDB\\BulkWriteResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBChangeStream.txt b/source/reference/class/MongoDBChangeStream.txt
new file mode 100644
index 00000000..3142aeec
--- /dev/null
+++ b/source/reference/class/MongoDBChangeStream.txt
@@ -0,0 +1,42 @@
+===========================
+MongoDB\\ChangeStream Class
+===========================
+
+.. versionadded:: 1.3
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\ChangeStream
+
+   This class extends PHP's :php:`Iterator `
+   interface. An instance of this class is returned by
+   :phpmethod:`MongoDB\\Client::watch()`,
+   :phpmethod:`MongoDB\\Database::watch()`, and
+   :phpmethod:`MongoDB\\Collection::watch()`.
+
+   This class allows for iteration of events in a change stream. It also allows
+   iteration to automatically resume after certain errors, such as a replica set
+   failover.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   current() 
+   getCursorId() 
+   getResumeToken() 
+   key() 
+   next() 
+   rewind() 
+   valid() 
+
+- :phpmethod:`MongoDB\\ChangeStream::current()`
+- :phpmethod:`MongoDB\\ChangeStream::getCursorId()`
+- :phpmethod:`MongoDB\\ChangeStream::getResumeToken()`
+- :phpmethod:`MongoDB\\ChangeStream::key()`
+- :phpmethod:`MongoDB\\ChangeStream::next()`
+- :phpmethod:`MongoDB\\ChangeStream::rewind()`
+- :phpmethod:`MongoDB\\ChangeStream::valid()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
index b677ebb1..75739252 100644
--- a/source/reference/class/MongoDBClient.txt
+++ b/source/reference/class/MongoDBClient.txt
@@ -28,18 +28,34 @@ Methods
 .. toctree::
    :titlesonly:
 
-   /reference/method/MongoDBClient__construct
-   /reference/method/MongoDBClient__get
-   /reference/method/MongoDBClient-createClientEncryption
-   /reference/method/MongoDBClient-dropDatabase
-   /reference/method/MongoDBClient-getManager
-   /reference/method/MongoDBClient-getReadConcern
-   /reference/method/MongoDBClient-getReadPreference
-   /reference/method/MongoDBClient-getTypeMap
-   /reference/method/MongoDBClient-getWriteConcern
-   /reference/method/MongoDBClient-listDatabaseNames
-   /reference/method/MongoDBClient-listDatabases
-   /reference/method/MongoDBClient-selectCollection
-   /reference/method/MongoDBClient-selectDatabase
-   /reference/method/MongoDBClient-startSession
-   /reference/method/MongoDBClient-watch
+   __construct() 
+   __get() 
+   createClientEncryption() 
+   dropDatabase() 
+   getManager() 
+   getReadConcern() 
+   getReadPreference() 
+   getTypeMap() 
+   getWriteConcern() 
+   listDatabaseNames() 
+   listDatabases() 
+   selectCollection() 
+   selectDatabase() 
+   startSession() 
+   watch() 
+
+- :phpmethod:`MongoDB\\Client::__construct()`
+- :phpmethod:`MongoDB\\Client::__get()`
+- :phpmethod:`MongoDB\\Client::createClientEncryption()`
+- :phpmethod:`MongoDB\\Client::dropDatabase()`
+- :phpmethod:`MongoDB\\Client::getManager()`
+- :phpmethod:`MongoDB\\Client::getReadConcern()`
+- :phpmethod:`MongoDB\\Client::getReadPreference()`
+- :phpmethod:`MongoDB\\Client::getTypeMap()`
+- :phpmethod:`MongoDB\\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\\Client::listDatabaseNames()`
+- :phpmethod:`MongoDB\\Client::listDatabases()`
+- :phpmethod:`MongoDB\\Client::selectCollection()`
+- :phpmethod:`MongoDB\\Client::selectDatabase()`
+- :phpmethod:`MongoDB\\Client::startSession()`
+- :phpmethod:`MongoDB\\Client::watch()`
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index 9c9aa313..e303643b 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -58,41 +58,80 @@ Methods
 .. toctree::
    :titlesonly:
 
-   /reference/method/MongoDBCollection__construct
-   /reference/method/MongoDBCollection-aggregate
-   /reference/method/MongoDBCollection-bulkWrite
-   /reference/method/MongoDBCollection-count
-   /reference/method/MongoDBCollection-countDocuments
-   /reference/method/MongoDBCollection-createIndex
-   /reference/method/MongoDBCollection-createIndexes
-   /reference/method/MongoDBCollection-deleteMany
-   /reference/method/MongoDBCollection-deleteOne
-   /reference/method/MongoDBCollection-distinct
-   /reference/method/MongoDBCollection-drop
-   /reference/method/MongoDBCollection-dropIndex
-   /reference/method/MongoDBCollection-dropIndexes
-   /reference/method/MongoDBCollection-estimatedDocumentCount
-   /reference/method/MongoDBCollection-explain
-   /reference/method/MongoDBCollection-find
-   /reference/method/MongoDBCollection-findOne
-   /reference/method/MongoDBCollection-findOneAndDelete
-   /reference/method/MongoDBCollection-findOneAndReplace
-   /reference/method/MongoDBCollection-findOneAndUpdate
-   /reference/method/MongoDBCollection-getCollectionName
-   /reference/method/MongoDBCollection-getDatabaseName
-   /reference/method/MongoDBCollection-getManager
-   /reference/method/MongoDBCollection-getNamespace
-   /reference/method/MongoDBCollection-getReadConcern
-   /reference/method/MongoDBCollection-getReadPreference
-   /reference/method/MongoDBCollection-getTypeMap
-   /reference/method/MongoDBCollection-getWriteConcern
-   /reference/method/MongoDBCollection-insertMany
-   /reference/method/MongoDBCollection-insertOne
-   /reference/method/MongoDBCollection-listIndexes
-   /reference/method/MongoDBCollection-mapReduce
-   /reference/method/MongoDBCollection-rename
-   /reference/method/MongoDBCollection-replaceOne
-   /reference/method/MongoDBCollection-updateMany
-   /reference/method/MongoDBCollection-updateOne
-   /reference/method/MongoDBCollection-watch
-   /reference/method/MongoDBCollection-withOptions
+   __construct() 
+   aggregate() 
+   bulkWrite() 
+   count() 
+   countDocuments() 
+   createIndex() 
+   createIndexes() 
+   deleteMany() 
+   deleteOne() 
+   distinct() 
+   drop() 
+   dropIndex() 
+   dropIndexes() 
+   estimatedDocumentCount() 
+   explain() 
+   find() 
+   findOne() 
+   findOneAndDelete() 
+   findOneAndReplace() 
+   findOneAndUpdate() 
+   getCollectionName() 
+   getDatabaseName() 
+   getManager() 
+   getNamespace() 
+   getReadConcern() 
+   getReadPreference() 
+   getTypeMap() 
+   getWriteConcern() 
+   insertMany() 
+   insertOne() 
+   listIndexes() 
+   mapReduce() 
+   rename() 
+   replaceOne() 
+   updateMany() 
+   updateOne() 
+   watch() 
+   withOptions() 
+
+- :phpmethod:`MongoDB\\Collection::__construct()`
+- :phpmethod:`MongoDB\\Collection::aggregate()`
+- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\\Collection::count()`
+- :phpmethod:`MongoDB\\Collection::countDocuments()`
+- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\\Collection::createIndexes()`
+- :phpmethod:`MongoDB\\Collection::deleteMany()`
+- :phpmethod:`MongoDB\\Collection::deleteOne()`
+- :phpmethod:`MongoDB\\Collection::distinct()`
+- :phpmethod:`MongoDB\\Collection::drop()`
+- :phpmethod:`MongoDB\\Collection::dropIndex()`
+- :phpmethod:`MongoDB\\Collection::dropIndexes()`
+- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
+- :phpmethod:`MongoDB\\Collection::explain()`
+- :phpmethod:`MongoDB\\Collection::find()`
+- :phpmethod:`MongoDB\\Collection::findOne()`
+- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+- :phpmethod:`MongoDB\\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\\Collection::getManager()`
+- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\\Collection::insertMany()`
+- :phpmethod:`MongoDB\\Collection::insertOne()`
+- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\\Collection::rename()`
+- :phpmethod:`MongoDB\\Collection::replaceOne()`
+- :phpmethod:`MongoDB\\Collection::updateMany()`
+- :phpmethod:`MongoDB\\Collection::updateOne()`
+- :phpmethod:`MongoDB\\Collection::watch()`
+- :phpmethod:`MongoDB\\Collection::withOptions()`
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index ac0e0d16..f92d2314 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -43,26 +43,48 @@ Methods
 .. toctree::
    :titlesonly:
 
-   /reference/method/MongoDBDatabase__construct
-   /reference/method/MongoDBDatabase__get
-   /reference/method/MongoDBDatabase-aggregate
-   /reference/method/MongoDBDatabase-command
-   /reference/method/MongoDBDatabase-createCollection
-   /reference/method/MongoDBDatabase-createEncryptedCollection
-   /reference/method/MongoDBDatabase-drop
-   /reference/method/MongoDBDatabase-dropCollection
-   /reference/method/MongoDBDatabase-getDatabaseName
-   /reference/method/MongoDBDatabase-getManager
-   /reference/method/MongoDBDatabase-getReadConcern
-   /reference/method/MongoDBDatabase-getReadPreference
-   /reference/method/MongoDBDatabase-getTypeMap
-   /reference/method/MongoDBDatabase-getWriteConcern
-   /reference/method/MongoDBDatabase-listCollectionNames
-   /reference/method/MongoDBDatabase-listCollections
-   /reference/method/MongoDBDatabase-modifyCollection
-   /reference/method/MongoDBDatabase-renameCollection
-   /reference/method/MongoDBDatabase-selectCollection
-   /reference/method/MongoDBDatabase-selectGridFSBucket
-   /reference/method/MongoDBDatabase-watch
-   /reference/method/MongoDBDatabase-withOptions
+   __construct() 
+   __get() 
+   aggregate() 
+   command() 
+   createCollection() 
+   createEncryptedCollection() 
+   drop() 
+   dropCollection() 
+   getDatabaseName() 
+   getManager() 
+   getReadConcern() 
+   getReadPreference() 
+   getTypeMap() 
+   getWriteConcern() 
+   listCollectionNames() 
+   listCollections() 
+   modifyCollection() 
+   renameCollection() 
+   selectCollection() 
+   selectGridFSBucket() 
+   watch() 
+   withOptions() 
 
+- :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\\Database::__get()`
+- :phpmethod:`MongoDB\\Database::aggregate()`
+- :phpmethod:`MongoDB\\Database::command()`
+- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\\Database::createEncryptedCollection()`
+- :phpmethod:`MongoDB\\Database::drop()`
+- :phpmethod:`MongoDB\\Database::dropCollection()`
+- :phpmethod:`MongoDB\\Database::getDatabaseName()`
+- :phpmethod:`MongoDB\\Database::getManager()`
+- :phpmethod:`MongoDB\\Database::getReadConcern()`
+- :phpmethod:`MongoDB\\Database::getReadPreference()`
+- :phpmethod:`MongoDB\\Database::getTypeMap()`
+- :phpmethod:`MongoDB\\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\\Database::listCollectionNames()`
+- :phpmethod:`MongoDB\\Database::listCollections()`
+- :phpmethod:`MongoDB\\Database::modifyCollection()`
+- :phpmethod:`MongoDB\\Database::renameCollection()`
+- :phpmethod:`MongoDB\\Database::selectCollection()`
+- :phpmethod:`MongoDB\\Database::selectGridFSBucket()`
+- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\\Database::withOptions()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBDeleteResult.txt b/source/reference/class/MongoDBDeleteResult.txt
new file mode 100644
index 00000000..02c2c8c1
--- /dev/null
+++ b/source/reference/class/MongoDBDeleteResult.txt
@@ -0,0 +1,26 @@
+===========================
+MongoDB\\DeleteResult Class
+===========================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\DeleteResult
+
+   This class contains information about an executed delete operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::deleteMany()` or
+   :phpmethod:`MongoDB\\Collection::deleteOne()`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getDeletedCount() 
+   isAcknowledged() 
+
+- :phpmethod:`MongoDB\\DeleteResult::getDeletedCount()`
+- :phpmethod:`MongoDB\\DeleteResult::isAcknowledged()`
diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 0fdeb5cb..7703a678 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -34,26 +34,49 @@ Methods
 .. toctree::
    :titlesonly:
 
-   /reference/method/MongoDBGridFSBucket__construct
-   /reference/method/MongoDBGridFSBucket-delete
-   /reference/method/MongoDBGridFSBucket-downloadToStream
-   /reference/method/MongoDBGridFSBucket-downloadToStreamByName
-   /reference/method/MongoDBGridFSBucket-drop
-   /reference/method/MongoDBGridFSBucket-find
-   /reference/method/MongoDBGridFSBucket-findOne
-   /reference/method/MongoDBGridFSBucket-getBucketName
-   /reference/method/MongoDBGridFSBucket-getChunksCollection
-   /reference/method/MongoDBGridFSBucket-getChunkSizeBytes
-   /reference/method/MongoDBGridFSBucket-getDatabaseName
-   /reference/method/MongoDBGridFSBucket-getFileDocumentForStream
-   /reference/method/MongoDBGridFSBucket-getFileIdForStream
-   /reference/method/MongoDBGridFSBucket-getFilesCollection
-   /reference/method/MongoDBGridFSBucket-getReadConcern
-   /reference/method/MongoDBGridFSBucket-getReadPreference
-   /reference/method/MongoDBGridFSBucket-getTypeMap
-   /reference/method/MongoDBGridFSBucket-getWriteConcern
-   /reference/method/MongoDBGridFSBucket-openDownloadStream
-   /reference/method/MongoDBGridFSBucket-openDownloadStreamByName
-   /reference/method/MongoDBGridFSBucket-openUploadStream
-   /reference/method/MongoDBGridFSBucket-rename
-   /reference/method/MongoDBGridFSBucket-uploadFromStream
+   __construct() 
+   delete() 
+   downloadToStream() 
+   downloadToStreamByName() 
+   drop() 
+   find() 
+   findOne() 
+   getBucketName() 
+   getChunksCollection() 
+   getChunkSizeBytes() 
+   getDatabaseName() 
+   getFileDocumentForStream() 
+   getFileIdForStream() 
+   getFilesCollection() 
+   getReadConcern() 
+   getReadPreference() 
+   getTypeMap() 
+   getWriteConcern() 
+   openDownloadStream() 
+   openDownloadStreamByName() 
+   openUploadStream() 
+   rename() 
+   uploadFromStream() 
+
+- :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::delete()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::drop()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::find()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::findOne()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getBucketName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getChunksCollection()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getChunkSizeBytes()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getDatabaseName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getFilesCollection()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::rename()`
+- :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
diff --git a/source/reference/class/MongoDBInsertManyResult.txt b/source/reference/class/MongoDBInsertManyResult.txt
new file mode 100644
index 00000000..16d9b482
--- /dev/null
+++ b/source/reference/class/MongoDBInsertManyResult.txt
@@ -0,0 +1,27 @@
+===============================
+MongoDB\\InsertManyResult Class
+===============================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\InsertManyResult
+
+   This class contains information about an executed bulk insert operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::insertMany()`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getInsertedCount() 
+   getInsertedIds() 
+   isAcknowledged() 
+
+- :phpmethod:`MongoDB\\InsertManyResult::getInsertedCount()`
+- :phpmethod:`MongoDB\\InsertManyResult::getInsertedIds()`
+- :phpmethod:`MongoDB\\InsertManyResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBInsertOneResult.txt b/source/reference/class/MongoDBInsertOneResult.txt
new file mode 100644
index 00000000..19454d22
--- /dev/null
+++ b/source/reference/class/MongoDBInsertOneResult.txt
@@ -0,0 +1,27 @@
+==============================
+MongoDB\\InsertOneResult Class
+==============================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\InsertOneResult
+
+   This class contains information about an executed insert operation. It
+   encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::insertOne()`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getInsertedCount() 
+   getInsertedId() 
+   isAcknowledged() 
+
+- :phpmethod:`MongoDB\\InsertOneResult::getInsertedCount()`
+- :phpmethod:`MongoDB\\InsertOneResult::getInsertedId()`
+- :phpmethod:`MongoDB\\InsertOneResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBMapReduceResult.txt b/source/reference/class/MongoDBMapReduceResult.txt
new file mode 100644
index 00000000..601f6f82
--- /dev/null
+++ b/source/reference/class/MongoDBMapReduceResult.txt
@@ -0,0 +1,34 @@
+==============================
+MongoDB\\MapReduceResult Class
+==============================
+
+.. versionadded:: 1.2
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\MapReduceResult
+
+   This class extends PHP's :php:`IteratorAggregate `
+   interface. An instance of this class is returned by
+   :phpmethod:`MongoDB\\Collection::mapReduce()`.
+
+   This class allows for iteration of map-reduce results irrespective of the
+   output method (e.g. inline, collection). It also provides access to command
+   statistics.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getCounts() 
+   getExecutionTimeMS() 
+   getIterator() 
+   getTiming() 
+
+- :phpmethod:`MongoDB\\MapReduceResult::getCounts()`
+- :phpmethod:`MongoDB\\MapReduceResult::getExecutionTimeMS()`
+- :phpmethod:`MongoDB\\MapReduceResult::getIterator()`
+- :phpmethod:`MongoDB\\MapReduceResult::getTiming()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelCollectionInfo.txt b/source/reference/class/MongoDBModelCollectionInfo.txt
new file mode 100644
index 00000000..17807095
--- /dev/null
+++ b/source/reference/class/MongoDBModelCollectionInfo.txt
@@ -0,0 +1,49 @@
+====================================
+MongoDB\\Model\\CollectionInfo Class
+====================================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\CollectionInfo
+
+   This class models information about a collection. Instances of this class are
+   returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\\Database::listCollections()`.
+
+.. versionchanged:: 1.4
+
+   This class implements PHP's :php:`ArrayAccess ` interface. This
+   provides a mechanism for accessing index fields for which there exists no
+   helper method. :php:`isset() ` may be used to check for the existence
+   of a field before accessing it with ``[]``.
+
+   .. note::
+
+      The :phpclass:`MongoDB\\Model\\CollectionInfo` class is immutable. Attempting
+      to modify it via the :php:`ArrayAccess ` interface will
+      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getCappedMax() 
+   getCappedSize() 
+   getIdIndex() 
+   getInfo() 
+   getName() 
+   getOptions() 
+   getType() 
+   isCapped() 
+
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getIdIndex()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getInfo()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getName()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::getType()`
+- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelCollectionInfoIterator.txt b/source/reference/class/MongoDBModelCollectionInfoIterator.txt
new file mode 100644
index 00000000..5358f213
--- /dev/null
+++ b/source/reference/class/MongoDBModelCollectionInfoIterator.txt
@@ -0,0 +1,20 @@
+============================================
+MongoDB\\Model\\CollectionInfoIterator Class
+============================================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\CollectionInfoIterator
+
+   This interface extends PHP's :php:`Iterator `
+   interface. An instance of this interface is returned by
+   :phpmethod:`MongoDB\\Database::listCollections()`.
+
+Methods
+-------
+
+This interface adds no new methods to :php:`Iterator
+`, but specifies that :php:`current()
+` will return an instance of
+:phpclass:`MongoDB\\Model\\CollectionInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelDatabaseInfo.txt b/source/reference/class/MongoDBModelDatabaseInfo.txt
new file mode 100644
index 00000000..e0f45852
--- /dev/null
+++ b/source/reference/class/MongoDBModelDatabaseInfo.txt
@@ -0,0 +1,39 @@
+==================================
+MongoDB\\Model\\DatabaseInfo Class
+==================================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\DatabaseInfo
+
+   This class models information about a database. Instances of this class are
+   returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`.
+
+.. versionchanged:: 1.4
+
+   This class implements PHP's :php:`ArrayAccess ` interface. This
+   provides a mechanism for accessing index fields for which there exists no
+   helper method. :php:`isset() ` may be used to check for the existence
+   of a field before accessing it with ``[]``.
+
+   .. note::
+
+      The :phpclass:`MongoDB\\Model\\DatabaseInfo` class is immutable. Attempting
+      to modify it via the :php:`ArrayAccess ` interface will
+      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getName() 
+   getSizeOnDisk() 
+   isEmpty() 
+
+- :phpmethod:`MongoDB\\Model\\DatabaseInfo::getName()`
+- :phpmethod:`MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()`
+- :phpmethod:`MongoDB\\Model\\DatabaseInfo::isEmpty()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelDatabaseInfoIterator.txt b/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
new file mode 100644
index 00000000..960ca256
--- /dev/null
+++ b/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
@@ -0,0 +1,20 @@
+==========================================
+MongoDB\\Model\\DatabaseInfoIterator Class
+==========================================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\DatabaseInfoIterator
+
+   This interface extends PHP's :php:`Iterator `
+   interface. An instance of this interface is returned by
+   :phpmethod:`MongoDB\\Client::listDatabases()`.
+
+Methods
+-------
+
+This interface adds no new methods to :php:`Iterator
+`, but specifies that :php:`current()
+` will return an instance of
+:phpclass:`MongoDB\\Model\\DatabaseInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelIndexInfo.txt b/source/reference/class/MongoDBModelIndexInfo.txt
new file mode 100644
index 00000000..8b9c42c8
--- /dev/null
+++ b/source/reference/class/MongoDBModelIndexInfo.txt
@@ -0,0 +1,51 @@
+===============================
+MongoDB\\Model\\IndexInfo Class
+===============================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\IndexInfo
+
+   This class models information about an index. Instances of this class are
+   returned by traversing a :phpclass:`MongoDB\\Model\\IndexInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\\Collection::listIndexes()`.
+
+   This class implements PHP's :php:`ArrayAccess ` interface. This
+   provides a mechanism for accessing index fields for which there exists no
+   helper method. :php:`isset() ` may be used to check for the existence
+   of a field before accessing it with ``[]``.
+
+   .. note::
+
+      The :phpclass:`MongoDB\\Model\\IndexInfo` class is immutable. Attempting
+      to modify it via the :php:`ArrayAccess ` interface will
+      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getKey() 
+   getName() 
+   getNamespace() 
+   getVersion() 
+   is2dSphere() 
+   isGeoHaystack() 
+   isSparse() 
+   isText() 
+   isTtl() 
+   isUnique() 
+
+- :phpmethod:`MongoDB\\Model\\IndexInfo::getKey()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::getName()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::getNamespace()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::getVersion()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::is2dSphere()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::isGeoHaystack()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::isSparse()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::isText()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::isTtl()`
+- :phpmethod:`MongoDB\\Model\\IndexInfo::isUnique()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelIndexInfoIterator.txt b/source/reference/class/MongoDBModelIndexInfoIterator.txt
new file mode 100644
index 00000000..2b154706
--- /dev/null
+++ b/source/reference/class/MongoDBModelIndexInfoIterator.txt
@@ -0,0 +1,20 @@
+=======================================
+MongoDB\\Model\\IndexInfoIterator Class
+=======================================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\Model\\IndexInfoIterator
+
+   This interface extends PHP's :php:`Iterator `
+   interface. An instance of this interface is returned by
+   :phpmethod:`MongoDB\\Collection::listIndexes()`.
+
+Methods
+-------
+
+This interface adds no new methods to :php:`Iterator
+`, but specifies that :php:`current()
+` will return an instance of
+:phpclass:`MongoDB\\Model\\IndexInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBUpdateResult.txt b/source/reference/class/MongoDBUpdateResult.txt
new file mode 100644
index 00000000..0534980d
--- /dev/null
+++ b/source/reference/class/MongoDBUpdateResult.txt
@@ -0,0 +1,33 @@
+===========================
+MongoDB\\UpdateResult Class
+===========================
+
+Definition
+----------
+
+.. phpclass:: MongoDB\\UpdateResult
+
+   This class contains information about an executed update or replace
+   operation. It encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   ` object and is returned from
+   :phpmethod:`MongoDB\\Collection::replaceOne()`,
+   :phpmethod:`MongoDB\\Collection::updateMany()`, or
+   :phpmethod:`MongoDB\\Collection::updateOne()`.
+
+Methods
+-------
+
+.. toctree::
+   :titlesonly:
+
+   getMatchedCount() 
+   getModifiedCount() 
+   getUpsertedCount() 
+   getUpsertedId() 
+   isAcknowledged() 
+
+- :phpmethod:`MongoDB\\UpdateResult::getMatchedCount()`
+- :phpmethod:`MongoDB\\UpdateResult::getModifiedCount()`
+- :phpmethod:`MongoDB\\UpdateResult::getUpsertedCount()`
+- :phpmethod:`MongoDB\\UpdateResult::getUpsertedId()`
+- :phpmethod:`MongoDB\\UpdateResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/enumeration-classes.txt b/source/reference/enumeration-classes.txt
deleted file mode 100644
index bb2a629a..00000000
--- a/source/reference/enumeration-classes.txt
+++ /dev/null
@@ -1,193 +0,0 @@
-===================
-Enumeration Classes
-===================
-
-.. default-domain:: mongodb
-
-.. contents:: On this page
-   :local:
-   :backlinks: none
-   :depth: 1
-   :class: singlecol
-
-MongoDB\\Model\\CollectionInfo
-------------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\Model\\CollectionInfo
-
-   This class models information about a collection. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Database::listCollections()`.
-
-.. versionchanged:: 1.4
-
-   This class implements PHP's :php:`ArrayAccess ` interface. This
-   provides a mechanism for accessing index fields for which there exists no
-   helper method. :php:`isset() ` may be used to check for the existence
-   of a field before accessing it with ``[]``.
-
-   .. note::
-
-      The :phpclass:`MongoDB\\Model\\CollectionInfo` class is immutable. Attempting
-      to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBModelCollectionInfo-getCappedMax
-   /reference/method/MongoDBModelCollectionInfo-getCappedSize
-   /reference/method/MongoDBModelCollectionInfo-getIdIndex
-   /reference/method/MongoDBModelCollectionInfo-getInfo
-   /reference/method/MongoDBModelCollectionInfo-getName
-   /reference/method/MongoDBModelCollectionInfo-getOptions
-   /reference/method/MongoDBModelCollectionInfo-getType
-   /reference/method/MongoDBModelCollectionInfo-isCapped
-
-----
-
-MongoDB\\Model\\CollectionInfoIterator
---------------------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\Model\\CollectionInfoIterator
-
-   This interface extends PHP's :php:`Iterator `
-   interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Database::listCollections()`.
-
-Methods
-~~~~~~~
-
-This interface adds no new methods to :php:`Iterator
-`, but specifies that :php:`current()
-` will return an instance of
-:phpclass:`MongoDB\\Model\\CollectionInfo`.
-
-----
-
-MongoDB\\Model\\DatabaseInfo
-----------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\Model\\DatabaseInfo
-
-   This class models information about a database. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`.
-
-.. versionchanged:: 1.4
-
-   This class implements PHP's :php:`ArrayAccess ` interface. This
-   provides a mechanism for accessing index fields for which there exists no
-   helper method. :php:`isset() ` may be used to check for the existence
-   of a field before accessing it with ``[]``.
-
-   .. note::
-
-      The :phpclass:`MongoDB\\Model\\DatabaseInfo` class is immutable. Attempting
-      to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBModelDatabaseInfo-getName
-   /reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk
-   /reference/method/MongoDBModelDatabaseInfo-isEmpty
-
-----
-
-MongoDB\\Model\\DatabaseInfoIterator
-------------------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\Model\\DatabaseInfoIterator
-
-   This interface extends PHP's :php:`Iterator `
-   interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Client::listDatabases()`.
-
-Methods
-~~~~~~~
-
-This interface adds no new methods to :php:`Iterator
-`, but specifies that :php:`current()
-` will return an instance of
-:phpclass:`MongoDB\\Model\\DatabaseInfo`.
-
-----
-
-MongoDB\\Model\\IndexInfo
--------------------------
-
-.. phpclass:: MongoDB\\Model\\IndexInfo
-
-   This class models information about an index. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\IndexInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Collection::listIndexes()`.
-
-   This class implements PHP's :php:`ArrayAccess ` interface. This
-   provides a mechanism for accessing index fields for which there exists no
-   helper method. :php:`isset() ` may be used to check for the existence
-   of a field before accessing it with ``[]``.
-
-   .. note::
-
-      The :phpclass:`MongoDB\\Model\\IndexInfo` class is immutable. Attempting
-      to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBModelIndexInfo-getKey
-   /reference/method/MongoDBModelIndexInfo-getName
-   /reference/method/MongoDBModelIndexInfo-getNamespace
-   /reference/method/MongoDBModelIndexInfo-getVersion
-   /reference/method/MongoDBModelIndexInfo-is2dSphere
-   /reference/method/MongoDBModelIndexInfo-isGeoHaystack
-   /reference/method/MongoDBModelIndexInfo-isSparse
-   /reference/method/MongoDBModelIndexInfo-isText
-   /reference/method/MongoDBModelIndexInfo-isTtl
-   /reference/method/MongoDBModelIndexInfo-isUnique
-
-----
-
-MongoDB\\Model\\IndexInfoIterator
----------------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\Model\\IndexInfoIterator
-
-   This interface extends PHP's :php:`Iterator `
-   interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Collection::listIndexes()`.
-
-Methods
-~~~~~~~
-
-This interface adds no new methods to :php:`Iterator
-`, but specifies that :php:`current()
-` will return an instance of
-:phpclass:`MongoDB\\Model\\IndexInfo`.
diff --git a/source/reference/functions.txt b/source/reference/functions.txt
index 4ce49e3f..ca1aadf3 100644
--- a/source/reference/functions.txt
+++ b/source/reference/functions.txt
@@ -13,4 +13,6 @@ Functions
 .. toctree::
    :titlesonly:
 
-   /reference/function/with_transaction
+   with_transaction() 
+
+- :phpmethod:`MongoDB\\with_transaction()`
diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
index 1cb66f35..9081c36c 100644
--- a/source/reference/method/MongoDBCollection-mapReduce.txt
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -1,6 +1,6 @@
-=================================
+================================
 MongoDB\\Collection::mapReduce()
-=================================
+================================
 
 .. deprecated:: 1.12
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
index b77f1f00..77303b92 100644
--- a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
@@ -1,6 +1,6 @@
-=========================================
-MongoDB\\GridFS\Bucket::getWriteConcern()
-=========================================
+==========================================
+MongoDB\\GridFS\\Bucket::getWriteConcern()
+==========================================
 
 .. versionadded:: 1.2
 
diff --git a/source/reference/result-classes.txt b/source/reference/result-classes.txt
index 3371c137..db5ff759 100644
--- a/source/reference/result-classes.txt
+++ b/source/reference/result-classes.txt
@@ -4,73 +4,19 @@ Result Classes
 
 .. default-domain:: mongodb
 
-.. contents:: On this page
-   :local:
-   :backlinks: none
-   :depth: 1
-   :class: singlecol
-
-MongoDB\\ChangeStream
----------------------
-
-.. versionadded:: 1.3
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\ChangeStream
-
-   This class extends PHP's :php:`Iterator `
-   interface. An instance of this class is returned by
-   :phpmethod:`MongoDB\\Client::watch()`,
-   :phpmethod:`MongoDB\\Database::watch()`, and
-   :phpmethod:`MongoDB\\Collection::watch()`.
-
-   This class allows for iteration of events in a change stream. It also allows
-   iteration to automatically resume after certain errors, such as a replica set
-   failover.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBChangeStream-current
-   /reference/method/MongoDBChangeStream-getCursorId
-   /reference/method/MongoDBChangeStream-getResumeToken
-   /reference/method/MongoDBChangeStream-key
-   /reference/method/MongoDBChangeStream-next
-   /reference/method/MongoDBChangeStream-rewind
-   /reference/method/MongoDBChangeStream-valid
-
-----
-
-MongoDB\\MapReduceResult
-------------------------
-
-.. versionadded:: 1.2
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\MapReduceResult
-
-   This class extends PHP's :php:`IteratorAggregate `
-   interface. An instance of this class is returned by
-   :phpmethod:`MongoDB\\Collection::mapReduce()`.
-
-   This class allows for iteration of map-reduce results irrespective of the
-   output method (e.g. inline, collection). It also provides access to command
-   statistics.
-
-Methods
-~~~~~~~
-
 .. toctree::
    :titlesonly:
 
-   /reference/method/MongoDBMapReduceResult-getCounts
-   /reference/method/MongoDBMapReduceResult-getExecutionTimeMS
-   /reference/method/MongoDBMapReduceResult-getIterator
-   /reference/method/MongoDBMapReduceResult-getTiming
+   BulkWriteResult Class 
+   DeleteResult Class 
+   InsertManyResult Class 
+   InsertOneResult Class 
+   UpdateResult Class 
+   ChangeStream Class 
+   MapReduceResult Class 
+   CollectionInfo Class 
+   CollectionInfoIterator Class 
+   DatabaseInfo Class 
+   DatabaseInfoIterator Class 
+   IndexInfo Class 
+   IndexInfoIterator Class 
\ No newline at end of file
diff --git a/source/reference/write-result-classes.txt b/source/reference/write-result-classes.txt
deleted file mode 100644
index f410c083..00000000
--- a/source/reference/write-result-classes.txt
+++ /dev/null
@@ -1,143 +0,0 @@
-====================
-Write Result Classes
-====================
-
-.. default-domain:: mongodb
-
-.. contents:: On this page
-   :local:
-   :backlinks: none
-   :depth: 1
-   :class: singlecol
-
-MongoDB\\BulkWriteResult
-------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\BulkWriteResult
-
-   This class contains information about an executed bulk write operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::bulkWrite()`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBBulkWriteResult-getDeletedCount
-   /reference/method/MongoDBBulkWriteResult-getInsertedCount
-   /reference/method/MongoDBBulkWriteResult-getInsertedIds
-   /reference/method/MongoDBBulkWriteResult-getMatchedCount
-   /reference/method/MongoDBBulkWriteResult-getModifiedCount
-   /reference/method/MongoDBBulkWriteResult-getUpsertedCount
-   /reference/method/MongoDBBulkWriteResult-getUpsertedIds
-   /reference/method/MongoDBBulkWriteResult-isAcknowledged
-
-----
-
-MongoDB\\DeleteResult
----------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\DeleteResult
-
-   This class contains information about an executed delete operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::deleteMany()` or
-   :phpmethod:`MongoDB\\Collection::deleteOne()`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBDeleteResult-getDeletedCount
-   /reference/method/MongoDBDeleteResult-isAcknowledged
-
-----
-
-MongoDB\\InsertManyResult
--------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\InsertManyResult
-
-   This class contains information about an executed bulk insert operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::insertMany()`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBInsertManyResult-getInsertedCount
-   /reference/method/MongoDBInsertManyResult-getInsertedIds
-   /reference/method/MongoDBInsertManyResult-isAcknowledged
-
-----
-
-MongoDB\\InsertOneResult
-------------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\InsertOneResult
-
-   This class contains information about an executed insert operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::insertOne()`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBInsertOneResult-getInsertedCount
-   /reference/method/MongoDBInsertOneResult-getInsertedId
-   /reference/method/MongoDBInsertOneResult-isAcknowledged
-
-----
-
-MongoDB\\UpdateResult
----------------------
-
-Definition
-~~~~~~~~~~
-
-.. phpclass:: MongoDB\\UpdateResult
-
-   This class contains information about an executed update or replace
-   operation. It encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::replaceOne()`,
-   :phpmethod:`MongoDB\\Collection::updateMany()`, or
-   :phpmethod:`MongoDB\\Collection::updateOne()`.
-
-Methods
-~~~~~~~
-
-.. toctree::
-   :titlesonly:
-
-   /reference/method/MongoDBUpdateResult-getMatchedCount
-   /reference/method/MongoDBUpdateResult-getModifiedCount
-   /reference/method/MongoDBUpdateResult-getUpsertedCount
-   /reference/method/MongoDBUpdateResult-getUpsertedId
-   /reference/method/MongoDBUpdateResult-isAcknowledged

From e74c0c1ba6313d49cae960a8aba7a111ab4fd6e4 Mon Sep 17 00:00:00 2001
From: Nora Reidy 
Date: Mon, 4 Mar 2024 10:32:07 -0500
Subject: [PATCH 304/321] DOCSP-36627: Fix double backslashes (#1239)

---
 source/faq.txt                                |   2 +-
 .../includes/extracts-bulkwriteexception.yaml |   4 +-
 source/includes/extracts-error.yaml           |  18 +--
 source/includes/extracts-note.yaml            |   2 +-
 source/index.txt                              |   2 +-
 source/reference/bson.txt                     |  16 +--
 .../class/MongoDBBulkWriteResult.txt          |  23 ++-
 .../reference/class/MongoDBChangeStream.txt   |  22 +--
 source/reference/class/MongoDBClient.txt      |  36 ++---
 source/reference/class/MongoDBCollection.txt  | 107 +++++++-------
 source/reference/class/MongoDBDatabase.txt    |  62 ++++----
 .../reference/class/MongoDBDeleteResult.txt   |  13 +-
 .../reference/class/MongoDBGridFSBucket.txt   |  52 +++----
 .../class/MongoDBInsertManyResult.txt         |  13 +-
 .../class/MongoDBInsertOneResult.txt          |  13 +-
 .../class/MongoDBMapReduceResult.txt          |  12 +-
 .../class/MongoDBModelCollectionInfo.txt      |  26 ++--
 .../MongoDBModelCollectionInfoIterator.txt    |   6 +-
 .../class/MongoDBModelDatabaseInfo.txt        |  16 +--
 .../MongoDBModelDatabaseInfoIterator.txt      |   6 +-
 .../reference/class/MongoDBModelIndexInfo.txt |  30 ++--
 .../class/MongoDBModelIndexInfoIterator.txt   |   6 +-
 .../reference/class/MongoDBUpdateResult.txt   |  20 +--
 source/reference/exception-classes.txt        |  42 +++---
 .../reference/function/with_transaction.txt   |  14 +-
 source/reference/functions.txt                |   2 +-
 ...MongoDBBulkWriteResult-getDeletedCount.txt |   4 +-
 ...ongoDBBulkWriteResult-getInsertedCount.txt |   4 +-
 .../MongoDBBulkWriteResult-getInsertedIds.txt |   4 +-
 ...MongoDBBulkWriteResult-getMatchedCount.txt |   8 +-
 ...ongoDBBulkWriteResult-getModifiedCount.txt |   8 +-
 ...ongoDBBulkWriteResult-getUpsertedCount.txt |   4 +-
 .../MongoDBBulkWriteResult-getUpsertedIds.txt |   6 +-
 .../MongoDBBulkWriteResult-isAcknowledged.txt |   4 +-
 .../method/MongoDBChangeStream-current.txt    |  12 +-
 .../MongoDBChangeStream-getCursorId.txt       |  14 +-
 .../MongoDBChangeStream-getResumeToken.txt    |   8 +-
 .../method/MongoDBChangeStream-key.txt        |  10 +-
 .../method/MongoDBChangeStream-next.txt       |  10 +-
 .../method/MongoDBChangeStream-rewind.txt     |  18 +--
 .../method/MongoDBChangeStream-valid.txt      |  12 +-
 .../MongoDBClient-createClientEncryption.txt  |  14 +-
 .../method/MongoDBClient-dropDatabase.txt     |   8 +-
 .../method/MongoDBClient-getManager.txt       |  12 +-
 .../method/MongoDBClient-getReadConcern.txt   |  12 +-
 .../MongoDBClient-getReadPreference.txt       |  10 +-
 .../method/MongoDBClient-getTypeMap.txt       |   8 +-
 .../method/MongoDBClient-getWriteConcern.txt  |  12 +-
 .../MongoDBClient-listDatabaseNames.txt       |   6 +-
 .../method/MongoDBClient-listDatabases.txt    |  10 +-
 .../method/MongoDBClient-selectCollection.txt |  16 +--
 .../method/MongoDBClient-selectDatabase.txt   |  16 +--
 .../method/MongoDBClient-startSession.txt     |   6 +-
 .../reference/method/MongoDBClient-watch.txt  |  16 +--
 .../method/MongoDBClient__construct.txt       |  26 ++--
 .../reference/method/MongoDBClient__get.txt   |  16 +--
 .../method/MongoDBCollection-aggregate.txt    |  18 +--
 .../method/MongoDBCollection-bulkWrite.txt    |  40 +++---
 .../method/MongoDBCollection-count.txt        |  14 +-
 .../MongoDBCollection-countDocuments.txt      |  14 +-
 .../method/MongoDBCollection-createIndex.txt  |   8 +-
 .../MongoDBCollection-createIndexes.txt       |  12 +-
 .../method/MongoDBCollection-deleteMany.txt   |  14 +-
 .../method/MongoDBCollection-deleteOne.txt    |  14 +-
 .../method/MongoDBCollection-distinct.txt     |   8 +-
 .../method/MongoDBCollection-drop.txt         |   8 +-
 .../method/MongoDBCollection-dropIndex.txt    |  12 +-
 .../method/MongoDBCollection-dropIndexes.txt  |  12 +-
 ...ngoDBCollection-estimatedDocumentCount.txt |  10 +-
 .../method/MongoDBCollection-explain.txt      |   6 +-
 .../method/MongoDBCollection-find.txt         |  14 +-
 .../method/MongoDBCollection-findOne.txt      |  14 +-
 .../MongoDBCollection-findOneAndDelete.txt    |  10 +-
 .../MongoDBCollection-findOneAndReplace.txt   |  10 +-
 .../MongoDBCollection-findOneAndUpdate.txt    |  10 +-
 .../MongoDBCollection-getCollectionName.txt   |   6 +-
 .../MongoDBCollection-getDatabaseName.txt     |   6 +-
 .../method/MongoDBCollection-getManager.txt   |  12 +-
 .../method/MongoDBCollection-getNamespace.txt |   6 +-
 .../MongoDBCollection-getReadConcern.txt      |  12 +-
 .../MongoDBCollection-getReadPreference.txt   |  10 +-
 .../method/MongoDBCollection-getTypeMap.txt   |   8 +-
 .../MongoDBCollection-getWriteConcern.txt     |  12 +-
 .../method/MongoDBCollection-insertMany.txt   |  14 +-
 .../method/MongoDBCollection-insertOne.txt    |  14 +-
 .../method/MongoDBCollection-listIndexes.txt  |   8 +-
 .../method/MongoDBCollection-mapReduce.txt    |  18 +--
 .../method/MongoDBCollection-rename.txt       |   8 +-
 .../method/MongoDBCollection-replaceOne.txt   |  16 +--
 .../method/MongoDBCollection-updateMany.txt   |  16 +--
 .../method/MongoDBCollection-updateOne.txt    |  16 +--
 .../method/MongoDBCollection-watch.txt        |  16 +--
 .../method/MongoDBCollection-withOptions.txt  |  12 +-
 .../method/MongoDBCollection__construct.txt   |  26 ++--
 .../method/MongoDBDatabase-aggregate.txt      |  16 +--
 .../method/MongoDBDatabase-command.txt        |  14 +-
 .../MongoDBDatabase-createCollection.txt      |   8 +-
 ...goDBDatabase-createEncryptedCollection.txt |  26 ++--
 .../reference/method/MongoDBDatabase-drop.txt |   8 +-
 .../method/MongoDBDatabase-dropCollection.txt |   8 +-
 .../MongoDBDatabase-getDatabaseName.txt       |   2 +-
 .../method/MongoDBDatabase-getManager.txt     |  12 +-
 .../method/MongoDBDatabase-getReadConcern.txt |  12 +-
 .../MongoDBDatabase-getReadPreference.txt     |  10 +-
 .../method/MongoDBDatabase-getTypeMap.txt     |   8 +-
 .../MongoDBDatabase-getWriteConcern.txt       |  12 +-
 .../MongoDBDatabase-listCollectionNames.txt   |   6 +-
 .../MongoDBDatabase-listCollections.txt       |  10 +-
 .../MongoDBDatabase-modifyCollection.txt      |   6 +-
 .../MongoDBDatabase-renameCollection.txt      |   8 +-
 .../MongoDBDatabase-selectCollection.txt      |  18 +--
 .../MongoDBDatabase-selectGridFSBucket.txt    |  14 +-
 .../method/MongoDBDatabase-watch.txt          |  16 +--
 .../method/MongoDBDatabase-withOptions.txt    |  12 +-
 .../method/MongoDBDatabase__construct.txt     |  22 +--
 .../reference/method/MongoDBDatabase__get.txt |  14 +-
 .../MongoDBDeleteResult-getDeletedCount.txt   |   4 +-
 .../MongoDBDeleteResult-isAcknowledged.txt    |   4 +-
 .../method/MongoDBGridFSBucket-delete.txt     |   2 +-
 .../MongoDBGridFSBucket-downloadToStream.txt  |   8 +-
 ...oDBGridFSBucket-downloadToStreamByName.txt |   8 +-
 .../method/MongoDBGridFSBucket-drop.txt       |   2 +-
 .../method/MongoDBGridFSBucket-find.txt       |  16 +--
 .../method/MongoDBGridFSBucket-findOne.txt    |  14 +-
 .../MongoDBGridFSBucket-getBucketName.txt     |   2 +-
 .../MongoDBGridFSBucket-getChunkSizeBytes.txt |   2 +-
 ...ongoDBGridFSBucket-getChunksCollection.txt |   4 +-
 .../MongoDBGridFSBucket-getDatabaseName.txt   |   2 +-
 ...BGridFSBucket-getFileDocumentForStream.txt |   4 +-
 ...MongoDBGridFSBucket-getFileIdForStream.txt |   4 +-
 ...MongoDBGridFSBucket-getFilesCollection.txt |   4 +-
 .../MongoDBGridFSBucket-getReadConcern.txt    |  12 +-
 .../MongoDBGridFSBucket-getReadPreference.txt |  10 +-
 .../method/MongoDBGridFSBucket-getTypeMap.txt |   8 +-
 .../MongoDBGridFSBucket-getWriteConcern.txt   |  12 +-
 ...MongoDBGridFSBucket-openDownloadStream.txt |   8 +-
 ...BGridFSBucket-openDownloadStreamByName.txt |   8 +-
 .../MongoDBGridFSBucket-openUploadStream.txt  |   6 +-
 .../method/MongoDBGridFSBucket-rename.txt     |   2 +-
 .../MongoDBGridFSBucket-uploadFromStream.txt  |   8 +-
 .../method/MongoDBGridFSBucket__construct.txt |  18 +--
 ...ngoDBInsertManyResult-getInsertedCount.txt |   4 +-
 ...MongoDBInsertManyResult-getInsertedIds.txt |   4 +-
 ...MongoDBInsertManyResult-isAcknowledged.txt |   4 +-
 ...ongoDBInsertOneResult-getInsertedCount.txt |   4 +-
 .../MongoDBInsertOneResult-getInsertedId.txt  |   4 +-
 .../MongoDBInsertOneResult-isAcknowledged.txt |   4 +-
 .../MongoDBMapReduceResult-getCounts.txt      |   4 +-
 ...goDBMapReduceResult-getExecutionTimeMS.txt |   4 +-
 .../MongoDBMapReduceResult-getIterator.txt    |   4 +-
 .../MongoDBMapReduceResult-getTiming.txt      |   8 +-
 ...ongoDBModelCollectionInfo-getCappedMax.txt |  12 +-
 ...ngoDBModelCollectionInfo-getCappedSize.txt |  12 +-
 .../MongoDBModelCollectionInfo-getIdIndex.txt |   4 +-
 .../MongoDBModelCollectionInfo-getInfo.txt    |   4 +-
 .../MongoDBModelCollectionInfo-getName.txt    |   4 +-
 .../MongoDBModelCollectionInfo-getOptions.txt |   6 +-
 .../MongoDBModelCollectionInfo-getType.txt    |   4 +-
 .../MongoDBModelCollectionInfo-isCapped.txt   |   8 +-
 .../MongoDBModelDatabaseInfo-getName.txt      |   4 +-
 ...MongoDBModelDatabaseInfo-getSizeOnDisk.txt |   2 +-
 .../MongoDBModelDatabaseInfo-isEmpty.txt      |   2 +-
 .../method/MongoDBModelIndexInfo-getKey.txt   |   6 +-
 .../method/MongoDBModelIndexInfo-getName.txt  |   6 +-
 .../MongoDBModelIndexInfo-getNamespace.txt    |   6 +-
 .../MongoDBModelIndexInfo-getVersion.txt      |   4 +-
 .../MongoDBModelIndexInfo-is2dSphere.txt      |   6 +-
 .../MongoDBModelIndexInfo-isGeoHaystack.txt   |   6 +-
 .../method/MongoDBModelIndexInfo-isSparse.txt |   6 +-
 .../method/MongoDBModelIndexInfo-isText.txt   |   6 +-
 .../method/MongoDBModelIndexInfo-isTtl.txt    |   6 +-
 .../method/MongoDBModelIndexInfo-isUnique.txt |   6 +-
 .../MongoDBUpdateResult-getMatchedCount.txt   |   6 +-
 .../MongoDBUpdateResult-getModifiedCount.txt  |   8 +-
 .../MongoDBUpdateResult-getUpsertedCount.txt  |   4 +-
 .../MongoDBUpdateResult-getUpsertedId.txt     |   6 +-
 .../MongoDBUpdateResult-isAcknowledged.txt    |   4 +-
 source/tutorial/client-side-encryption.txt    |   2 +-
 source/tutorial/collation.txt                 |   6 +-
 source/tutorial/commands.txt                  |  16 +--
 source/tutorial/connecting.txt                |   2 +-
 source/tutorial/crud.txt                      | 106 +++++++-------
 source/tutorial/custom-types.txt              |  22 +--
 source/tutorial/gridfs.txt                    |  24 ++--
 source/tutorial/indexes.txt                   |  18 +--
 source/tutorial/modeling-bson-data.txt        |  26 ++--
 source/tutorial/stable-api.txt                |   8 +-
 source/tutorial/tailable-cursor.txt           |   8 +-
 source/upgrade.txt                            | 132 +++++++++---------
 189 files changed, 1177 insertions(+), 1182 deletions(-)

diff --git a/source/faq.txt b/source/faq.txt
index 9cdd9a25..fef32264 100644
--- a/source/faq.txt
+++ b/source/faq.txt
@@ -124,7 +124,7 @@ The following are all examples of
     [TLS handshake failed: certificate verify failed (64): IP address mismatch calling hello on 'b.example.com:27017']
 
 These errors typically manifest as a
-:php:`MongoDB\\Driver\\Exception\\ConnectionTimeoutException `
+:php:`MongoDB\Driver\Exception\ConnectionTimeoutException `
 exception from the driver. The actual exception messages originate from
 libmongoc, which is the underlying library used by the PHP driver. Since these
 messages can take many forms, it's helpful to break down the structure of the
diff --git a/source/includes/extracts-bulkwriteexception.yaml b/source/includes/extracts-bulkwriteexception.yaml
index f002063f..6276458e 100644
--- a/source/includes/extracts-bulkwriteexception.yaml
+++ b/source/includes/extracts-bulkwriteexception.yaml
@@ -1,9 +1,9 @@
 ref: bulkwriteexception-result
 content: |
-  If a :php:`MongoDB\\Driver\\Exception\\BulkWriteException
+  If a :php:`MongoDB\Driver\Exception\BulkWriteException
   ` is thrown, users should call
   :php:`getWriteResult() ` and
-  inspect the returned :php:`MongoDB\\Driver\\WriteResult
+  inspect the returned :php:`MongoDB\Driver\WriteResult
   ` object to determine the nature of the error.
 
   For example, a write operation may have been successfully applied to the
diff --git a/source/includes/extracts-error.yaml b/source/includes/extracts-error.yaml
index cfada049..1a41843a 100644
--- a/source/includes/extracts-error.yaml
+++ b/source/includes/extracts-error.yaml
@@ -1,6 +1,6 @@
 ref: error-driver-bulkwriteexception
 content: |
-  :php:`MongoDB\\Driver\\Exception\\BulkWriteException
+  :php:`MongoDB\Driver\Exception\BulkWriteException
   ` for errors related to the write
   operation. Users should inspect the value returned by :php:`getWriteResult()
   ` to determine the nature of the
@@ -8,45 +8,45 @@ content: |
 ---
 ref: error-driver-invalidargumentexception
 content: |
-  :php:`MongoDB\\Driver\\Exception\\InvalidArgumentException
+  :php:`MongoDB\Driver\Exception\InvalidArgumentException
   ` for errors related to the
   parsing of parameters or options at the driver level.
 ---
 ref: error-driver-runtimeexception
 content: |
-  :php:`MongoDB\\Driver\\Exception\\RuntimeException
+  :php:`MongoDB\Driver\Exception\RuntimeException
   ` for other errors at the driver
   level (e.g. connection errors).
 ---
 ref: error-badmethodcallexception-write-result
 content: |
-  :phpclass:`MongoDB\\Exception\\BadMethodCallException` if this method is
+  :phpclass:`MongoDB\Exception\BadMethodCallException` if this method is
   called and the write operation used an unacknowledged :manual:`write concern
   `.
 ---
 ref: error-invalidargumentexception
 content: |
-  :phpclass:`MongoDB\\Exception\\InvalidArgumentException` for errors related to
+  :phpclass:`MongoDB\Exception\InvalidArgumentException` for errors related to
   the parsing of parameters or options.
 ---
 ref: error-unexpectedvalueexception
 content: |
-  :phpclass:`MongoDB\\Exception\\UnexpectedValueException` if the command
+  :phpclass:`MongoDB\Exception\UnexpectedValueException` if the command
   response from the server was malformed.
 ---
 ref: error-unsupportedexception
 content: |
-  :phpclass:`MongoDB\\Exception\\UnsupportedException` if options are used and
+  :phpclass:`MongoDB\Exception\UnsupportedException` if options are used and
   not supported by the selected server (e.g. ``collation``, ``readConcern``,
   ``writeConcern``).
 ---
 ref: error-gridfs-filenotfoundexception
 content: |
-  :phpclass:`MongoDB\\GridFS\\Exception\\FileNotFoundException` if no file was
+  :phpclass:`MongoDB\GridFS\Exception\FileNotFoundException` if no file was
   found for the selection criteria.
 ---
 ref: error-gridfs-corruptfileexception
 content: |
-  :phpclass:`MongoDB\\GridFS\\Exception\\CorruptFileException` if the file's
+  :phpclass:`MongoDB\GridFS\Exception\CorruptFileException` if the file's
   metadata or chunk documents contain unexpected or invalid data.
 ...
diff --git a/source/includes/extracts-note.yaml b/source/includes/extracts-note.yaml
index 7790f0c3..6b4e033c 100644
--- a/source/includes/extracts-note.yaml
+++ b/source/includes/extracts-note.yaml
@@ -7,6 +7,6 @@ content: |
   ` rules. When matching a special
   BSON type the query criteria should use the respective :php:`BSON class
   ` in the driver (e.g. use
-  :php:`MongoDB\\BSON\\ObjectId ` to match an
+  :php:`MongoDB\BSON\ObjectId ` to match an
   :manual:`ObjectId `).
 ...
diff --git a/source/index.txt b/source/index.txt
index 5cbf328a..7e76323f 100644
--- a/source/index.txt
+++ b/source/index.txt
@@ -12,7 +12,7 @@ The ``mongodb`` extension provides a limited API to connect to the database and
 execute generic commands, queries, and write operations. In contrast, the
 |php-library| provides a full-featured API and models client, database, and
 collection objects. Each of those classes provide various helper methods for
-performing operations in context. For example, :phpclass:`MongoDB\\Collection`
+performing operations in context. For example, :phpclass:`MongoDB\Collection`
 implements methods for executing CRUD operations and managing indexes on the
 collection, among other things.
 
diff --git a/source/reference/bson.txt b/source/reference/bson.txt
index b9fbbaa2..30753247 100644
--- a/source/reference/bson.txt
+++ b/source/reference/bson.txt
@@ -18,18 +18,18 @@ of JSON documents, though it contains more data types than JSON. For the BSON
 spec, see `bsonspec.org `_.
 
 By default, the |php-library| returns BSON documents as
-:phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as
-:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively.
+:phpclass:`MongoDB\Model\BSONDocument` objects and BSON arrays as
+:phpclass:`MongoDB\Model\BSONArray` objects, respectively.
 
 Classes
 -------
 
-.. phpclass:: MongoDB\\Model\\BSONArray
+.. phpclass:: MongoDB\Model\BSONArray
 
    This class extends PHP's :php:`ArrayObject ` class. It also
    implements PHP's :php:`JsonSerializable ` interface and the
-   driver's :php:`MongoDB\\BSON\\Serializable ` and
-   :php:`MongoDB\\BSON\\Unserializable `
+   driver's :php:`MongoDB\BSON\Serializable ` and
+   :php:`MongoDB\BSON\Unserializable `
    interfaces.
 
    By default, the library will deserialize BSON arrays as instances of this
@@ -37,12 +37,12 @@ Classes
    serialize as an array type (:php:`array_values() ` is used
    internally to numerically reindex the array).
 
-.. phpclass:: MongoDB\\Model\\BSONDocument
+.. phpclass:: MongoDB\Model\BSONDocument
 
    This class extends PHP's :php:`ArrayObject ` class. It also
    implements PHP's :php:`JsonSerializable ` interface and the
-   driver's :php:`MongoDB\\BSON\\Serializable ` and
-   :php:`MongoDB\\BSON\\Unserializable `
+   driver's :php:`MongoDB\BSON\Serializable ` and
+   :php:`MongoDB\BSON\Unserializable `
    interfaces.
 
    By default, the library will deserialize BSON documents as instances of this
diff --git a/source/reference/class/MongoDBBulkWriteResult.txt b/source/reference/class/MongoDBBulkWriteResult.txt
index f33b036d..2e8c78cf 100644
--- a/source/reference/class/MongoDBBulkWriteResult.txt
+++ b/source/reference/class/MongoDBBulkWriteResult.txt
@@ -5,12 +5,11 @@ MongoDB\\BulkWriteResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\BulkWriteResult
+.. phpclass:: MongoDB\BulkWriteResult
 
    This class contains information about an executed bulk write operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::bulkWrite()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::bulkWrite()`.
 
 Methods
 -------
@@ -27,11 +26,11 @@ Methods
    getUpsertedIds() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\BulkWriteResult::getDeletedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedIds()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getMatchedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getModifiedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getUpsertedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getUpsertedIds()`
-- :phpmethod:`MongoDB\\BulkWriteResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\BulkWriteResult::getDeletedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getInsertedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getInsertedIds()`
+- :phpmethod:`MongoDB\BulkWriteResult::getMatchedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getModifiedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getUpsertedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getUpsertedIds()`
+- :phpmethod:`MongoDB\BulkWriteResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBChangeStream.txt b/source/reference/class/MongoDBChangeStream.txt
index 3142aeec..bd82c5e0 100644
--- a/source/reference/class/MongoDBChangeStream.txt
+++ b/source/reference/class/MongoDBChangeStream.txt
@@ -7,13 +7,13 @@ MongoDB\\ChangeStream Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\ChangeStream
+.. phpclass:: MongoDB\ChangeStream
 
    This class extends PHP's :php:`Iterator `
    interface. An instance of this class is returned by
-   :phpmethod:`MongoDB\\Client::watch()`,
-   :phpmethod:`MongoDB\\Database::watch()`, and
-   :phpmethod:`MongoDB\\Collection::watch()`.
+   :phpmethod:`MongoDB\Client::watch()`,
+   :phpmethod:`MongoDB\Database::watch()`, and
+   :phpmethod:`MongoDB\Collection::watch()`.
 
    This class allows for iteration of events in a change stream. It also allows
    iteration to automatically resume after certain errors, such as a replica set
@@ -33,10 +33,10 @@ Methods
    rewind() 
    valid() 
 
-- :phpmethod:`MongoDB\\ChangeStream::current()`
-- :phpmethod:`MongoDB\\ChangeStream::getCursorId()`
-- :phpmethod:`MongoDB\\ChangeStream::getResumeToken()`
-- :phpmethod:`MongoDB\\ChangeStream::key()`
-- :phpmethod:`MongoDB\\ChangeStream::next()`
-- :phpmethod:`MongoDB\\ChangeStream::rewind()`
-- :phpmethod:`MongoDB\\ChangeStream::valid()`
\ No newline at end of file
+- :phpmethod:`MongoDB\ChangeStream::current()`
+- :phpmethod:`MongoDB\ChangeStream::getCursorId()`
+- :phpmethod:`MongoDB\ChangeStream::getResumeToken()`
+- :phpmethod:`MongoDB\ChangeStream::key()`
+- :phpmethod:`MongoDB\ChangeStream::next()`
+- :phpmethod:`MongoDB\ChangeStream::rewind()`
+- :phpmethod:`MongoDB\ChangeStream::valid()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
index 75739252..b1710507 100644
--- a/source/reference/class/MongoDBClient.txt
+++ b/source/reference/class/MongoDBClient.txt
@@ -13,13 +13,13 @@ MongoDB\\Client Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Client
+.. phpclass:: MongoDB\Client
 
    This class serves as an entry point for the |php-library|. It is the
    preferred class for connecting to a MongoDB server or cluster of servers and
    acts as a gateway for accessing individual databases and collections.
-   :phpclass:`MongoDB\\Client` is analogous to the driver's
-   :php:`MongoDB\\Driver\\Manager ` class, which it
+   :phpclass:`MongoDB\Client` is analogous to the driver's
+   :php:`MongoDB\Driver\Manager ` class, which it
    `composes `_.
 
 Methods
@@ -44,18 +44,18 @@ Methods
    startSession() 
    watch() 
 
-- :phpmethod:`MongoDB\\Client::__construct()`
-- :phpmethod:`MongoDB\\Client::__get()`
-- :phpmethod:`MongoDB\\Client::createClientEncryption()`
-- :phpmethod:`MongoDB\\Client::dropDatabase()`
-- :phpmethod:`MongoDB\\Client::getManager()`
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Client::listDatabaseNames()`
-- :phpmethod:`MongoDB\\Client::listDatabases()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
-- :phpmethod:`MongoDB\\Client::selectDatabase()`
-- :phpmethod:`MongoDB\\Client::startSession()`
-- :phpmethod:`MongoDB\\Client::watch()`
+- :phpmethod:`MongoDB\Client::__construct()`
+- :phpmethod:`MongoDB\Client::__get()`
+- :phpmethod:`MongoDB\Client::createClientEncryption()`
+- :phpmethod:`MongoDB\Client::dropDatabase()`
+- :phpmethod:`MongoDB\Client::getManager()`
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Client::listDatabaseNames()`
+- :phpmethod:`MongoDB\Client::listDatabases()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
+- :phpmethod:`MongoDB\Client::selectDatabase()`
+- :phpmethod:`MongoDB\Client::startSession()`
+- :phpmethod:`MongoDB\Client::watch()`
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index e303643b..43346a38 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -13,29 +13,28 @@ MongoDB\\Collection Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Collection
+.. phpclass:: MongoDB\Collection
 
    Provides methods for common operations on collections and documents,
    including CRUD operations and index management.
 
    You can construct collections directly using the driver's
-   :php:`MongoDB\\Driver\\Manager ` class or
-   select a collection from the library's :phpclass:`MongoDB\\Client` or
-   :phpclass:`MongoDB\\Database` classes. A collection may also be cloned from
-   an existing :phpclass:`MongoDB\\Collection` object via the
-   :phpmethod:`withOptions() ` method.
+   :php:`MongoDB\Driver\Manager ` class or
+   select a collection from the library's :phpclass:`MongoDB\Client` or
+   :phpclass:`MongoDB\Database` classes. A collection may also be cloned from
+   an existing :phpclass:`MongoDB\Collection` object via the
+   :phpmethod:`withOptions() ` method.
 
-   :phpclass:`MongoDB\\Collection` supports the :php:`readConcern
+   :phpclass:`MongoDB\Collection` supports the :php:`readConcern
    `, :php:`readPreference
    `, :php:`typeMap
    `,
    and :php:`writeConcern ` options. If you omit an
    option, the collection inherits the value from the :php:`Manager
-   ` constructor argument or the :phpclass:`Client
-   ` or :phpclass:`Database ` object used to
-   select the collection.
+   ` constructor argument or the :phpclass:`Client `
+   or :phpclass:`Database ` object used to select the collection.
 
-   Operations within the :phpclass:`MongoDB\\Collection` class inherit the
+   Operations within the :phpclass:`MongoDB\Collection` class inherit the
    collection's options.
 
 Type Map Limitations
@@ -45,11 +44,11 @@ The :manual:`aggregate ` (when not using a
 cursor), :manual:`distinct `, and
 :manual:`findAndModify ` helpers do not
 support a ``typeMap`` option due to a driver limitation. The
-:phpmethod:`aggregate() `,
-:phpmethod:`distinct() `,
-:phpmethod:`findOneAndReplace() `,
-:phpmethod:`findOneAndUpdate() `, and
-:phpmethod:`findOneAndDelete() `
+:phpmethod:`aggregate() `,
+:phpmethod:`distinct() `,
+:phpmethod:`findOneAndReplace() `,
+:phpmethod:`findOneAndUpdate() `, and
+:phpmethod:`findOneAndDelete() `
 methods return BSON documents as ``stdClass`` objects and BSON arrays as arrays.
 
 Methods
@@ -97,41 +96,41 @@ Methods
    watch() 
    withOptions() 
 
-- :phpmethod:`MongoDB\\Collection::__construct()`
-- :phpmethod:`MongoDB\\Collection::aggregate()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
-- :phpmethod:`MongoDB\\Collection::count()`
-- :phpmethod:`MongoDB\\Collection::countDocuments()`
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::createIndexes()`
-- :phpmethod:`MongoDB\\Collection::deleteMany()`
-- :phpmethod:`MongoDB\\Collection::deleteOne()`
-- :phpmethod:`MongoDB\\Collection::distinct()`
-- :phpmethod:`MongoDB\\Collection::drop()`
-- :phpmethod:`MongoDB\\Collection::dropIndex()`
-- :phpmethod:`MongoDB\\Collection::dropIndexes()`
-- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
-- :phpmethod:`MongoDB\\Collection::explain()`
-- :phpmethod:`MongoDB\\Collection::find()`
-- :phpmethod:`MongoDB\\Collection::findOne()`
-- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
-- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
-- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
-- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
-- :phpmethod:`MongoDB\\Collection::getManager()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
-- :phpmethod:`MongoDB\\Collection::rename()`
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Collection::withOptions()`
+- :phpmethod:`MongoDB\Collection::__construct()`
+- :phpmethod:`MongoDB\Collection::aggregate()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::count()`
+- :phpmethod:`MongoDB\Collection::countDocuments()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndexes()`
+- :phpmethod:`MongoDB\Collection::deleteMany()`
+- :phpmethod:`MongoDB\Collection::deleteOne()`
+- :phpmethod:`MongoDB\Collection::distinct()`
+- :phpmethod:`MongoDB\Collection::drop()`
+- :phpmethod:`MongoDB\Collection::dropIndex()`
+- :phpmethod:`MongoDB\Collection::dropIndexes()`
+- :phpmethod:`MongoDB\Collection::estimatedDocumentCount()`
+- :phpmethod:`MongoDB\Collection::explain()`
+- :phpmethod:`MongoDB\Collection::find()`
+- :phpmethod:`MongoDB\Collection::findOne()`
+- :phpmethod:`MongoDB\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\Collection::getManager()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::rename()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Collection::withOptions()`
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index f92d2314..c5a5b3a5 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -13,28 +13,28 @@ MongoDB\\Database Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Database
+.. phpclass:: MongoDB\Database
 
    Provides methods for common operations on a database, such as executing
    database commands and managing collections.
 
    You can construct a database directly using the driver's
-   :php:`MongoDB\\Driver\\Manager ` class or
-   select a database from the library's :phpclass:`MongoDB\\Client` class. A
-   database may also be cloned from an existing :phpclass:`MongoDB\\Database`
-   object via the :phpmethod:`withOptions() `
+   :php:`MongoDB\Driver\Manager ` class or
+   select a database from the library's :phpclass:`MongoDB\Client` class. A
+   database may also be cloned from an existing :phpclass:`MongoDB\Database`
+   object via the :phpmethod:`withOptions() `
    method.
 
-   :phpclass:`MongoDB\\Database` supports the :php:`readConcern
+   :phpclass:`MongoDB\Database` supports the :php:`readConcern
    `, :php:`readPreference
    `, :php:`typeMap
    `,
    and :php:`writeConcern ` options. If you omit an
    option, the database inherits the value from the :php:`Manager
-   ` constructor argument or the :phpclass:`Client
-   ` object used to select the database.
+   ` constructor argument or the :phpclass:`Client `
+   object used to select the database.
 
-   Operations within the :phpclass:`MongoDB\\Database` class inherit the
+   Operations within the :phpclass:`MongoDB\Database` class inherit the
    Database's options.
 
 Methods
@@ -66,25 +66,25 @@ Methods
    watch() 
    withOptions() 
 
-- :phpmethod:`MongoDB\\Database::__construct()`
-- :phpmethod:`MongoDB\\Database::__get()`
-- :phpmethod:`MongoDB\\Database::aggregate()`
-- :phpmethod:`MongoDB\\Database::command()`
-- :phpmethod:`MongoDB\\Database::createCollection()`
-- :phpmethod:`MongoDB\\Database::createEncryptedCollection()`
-- :phpmethod:`MongoDB\\Database::drop()`
-- :phpmethod:`MongoDB\\Database::dropCollection()`
-- :phpmethod:`MongoDB\\Database::getDatabaseName()`
-- :phpmethod:`MongoDB\\Database::getManager()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::listCollectionNames()`
-- :phpmethod:`MongoDB\\Database::listCollections()`
-- :phpmethod:`MongoDB\\Database::modifyCollection()`
-- :phpmethod:`MongoDB\\Database::renameCollection()`
-- :phpmethod:`MongoDB\\Database::selectCollection()`
-- :phpmethod:`MongoDB\\Database::selectGridFSBucket()`
-- :phpmethod:`MongoDB\\Database::watch()`
-- :phpmethod:`MongoDB\\Database::withOptions()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Database::__construct()`
+- :phpmethod:`MongoDB\Database::__get()`
+- :phpmethod:`MongoDB\Database::aggregate()`
+- :phpmethod:`MongoDB\Database::command()`
+- :phpmethod:`MongoDB\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createEncryptedCollection()`
+- :phpmethod:`MongoDB\Database::drop()`
+- :phpmethod:`MongoDB\Database::dropCollection()`
+- :phpmethod:`MongoDB\Database::getDatabaseName()`
+- :phpmethod:`MongoDB\Database::getManager()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::listCollectionNames()`
+- :phpmethod:`MongoDB\Database::listCollections()`
+- :phpmethod:`MongoDB\Database::modifyCollection()`
+- :phpmethod:`MongoDB\Database::renameCollection()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
+- :phpmethod:`MongoDB\Database::selectGridFSBucket()`
+- :phpmethod:`MongoDB\Database::watch()`
+- :phpmethod:`MongoDB\Database::withOptions()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBDeleteResult.txt b/source/reference/class/MongoDBDeleteResult.txt
index 02c2c8c1..cd4aa2bc 100644
--- a/source/reference/class/MongoDBDeleteResult.txt
+++ b/source/reference/class/MongoDBDeleteResult.txt
@@ -5,13 +5,12 @@ MongoDB\\DeleteResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\DeleteResult
+.. phpclass:: MongoDB\DeleteResult
 
    This class contains information about an executed delete operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::deleteMany()` or
-   :phpmethod:`MongoDB\\Collection::deleteOne()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::deleteMany()` or
+   :phpmethod:`MongoDB\Collection::deleteOne()`.
 
 Methods
 -------
@@ -22,5 +21,5 @@ Methods
    getDeletedCount() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\DeleteResult::getDeletedCount()`
-- :phpmethod:`MongoDB\\DeleteResult::isAcknowledged()`
+- :phpmethod:`MongoDB\DeleteResult::getDeletedCount()`
+- :phpmethod:`MongoDB\DeleteResult::isAcknowledged()`
diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 7703a678..0a83a32e 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -13,19 +13,19 @@ MongoDB\\GridFS\\Bucket Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\GridFS\\Bucket
+.. phpclass:: MongoDB\GridFS\Bucket
 
    :manual:`GridFS ` is a specification for storing and retrieving
    files in MongoDB. GridFS uses two collections to store files. One collection
    stores the file chunks (e.g. ``fs.chunks``), and the other stores file
-   metadata (e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket` class
+   metadata (e.g. ``fs.files``). The :phpclass:`MongoDB\GridFS\Bucket` class
    provides an interface around these collections for working with the files as
    PHP :php:`Streams `.
 
    You can construct a GridFS bucket using the driver's
    :php:`Manager ` class, or select a bucket from
-   the library's :phpclass:`MongoDB\\Database` class via the
-   :phpmethod:`selectGridFSBucket() `
+   the library's :phpclass:`MongoDB\Database` class via the
+   :phpmethod:`selectGridFSBucket() `
    method.
 
 Methods
@@ -58,25 +58,25 @@ Methods
    rename() 
    uploadFromStream() 
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::delete()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::drop()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::find()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::findOne()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getBucketName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getChunksCollection()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getChunkSizeBytes()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getDatabaseName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFilesCollection()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::rename()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::__construct()`
+- :phpmethod:`MongoDB\GridFS\Bucket::delete()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::drop()`
+- :phpmethod:`MongoDB\GridFS\Bucket::find()`
+- :phpmethod:`MongoDB\GridFS\Bucket::findOne()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getBucketName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getChunksCollection()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getChunkSizeBytes()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getDatabaseName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileDocumentForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileIdForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFilesCollection()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openUploadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::rename()`
+- :phpmethod:`MongoDB\GridFS\Bucket::uploadFromStream()`
diff --git a/source/reference/class/MongoDBInsertManyResult.txt b/source/reference/class/MongoDBInsertManyResult.txt
index 16d9b482..f7f79c8c 100644
--- a/source/reference/class/MongoDBInsertManyResult.txt
+++ b/source/reference/class/MongoDBInsertManyResult.txt
@@ -5,12 +5,11 @@ MongoDB\\InsertManyResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\InsertManyResult
+.. phpclass:: MongoDB\InsertManyResult
 
    This class contains information about an executed bulk insert operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::insertMany()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::insertMany()`.
 
 Methods
 -------
@@ -22,6 +21,6 @@ Methods
    getInsertedIds() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\InsertManyResult::getInsertedCount()`
-- :phpmethod:`MongoDB\\InsertManyResult::getInsertedIds()`
-- :phpmethod:`MongoDB\\InsertManyResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\InsertManyResult::getInsertedCount()`
+- :phpmethod:`MongoDB\InsertManyResult::getInsertedIds()`
+- :phpmethod:`MongoDB\InsertManyResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBInsertOneResult.txt b/source/reference/class/MongoDBInsertOneResult.txt
index 19454d22..09e0a35b 100644
--- a/source/reference/class/MongoDBInsertOneResult.txt
+++ b/source/reference/class/MongoDBInsertOneResult.txt
@@ -5,12 +5,11 @@ MongoDB\\InsertOneResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\InsertOneResult
+.. phpclass:: MongoDB\InsertOneResult
 
    This class contains information about an executed insert operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::insertOne()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::insertOne()`.
 
 Methods
 -------
@@ -22,6 +21,6 @@ Methods
    getInsertedId() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\InsertOneResult::getInsertedCount()`
-- :phpmethod:`MongoDB\\InsertOneResult::getInsertedId()`
-- :phpmethod:`MongoDB\\InsertOneResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\InsertOneResult::getInsertedCount()`
+- :phpmethod:`MongoDB\InsertOneResult::getInsertedId()`
+- :phpmethod:`MongoDB\InsertOneResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBMapReduceResult.txt b/source/reference/class/MongoDBMapReduceResult.txt
index 601f6f82..8f27cce9 100644
--- a/source/reference/class/MongoDBMapReduceResult.txt
+++ b/source/reference/class/MongoDBMapReduceResult.txt
@@ -7,11 +7,11 @@ MongoDB\\MapReduceResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\MapReduceResult
+.. phpclass:: MongoDB\MapReduceResult
 
    This class extends PHP's :php:`IteratorAggregate `
    interface. An instance of this class is returned by
-   :phpmethod:`MongoDB\\Collection::mapReduce()`.
+   :phpmethod:`MongoDB\Collection::mapReduce()`.
 
    This class allows for iteration of map-reduce results irrespective of the
    output method (e.g. inline, collection). It also provides access to command
@@ -28,7 +28,7 @@ Methods
    getIterator() 
    getTiming() 
 
-- :phpmethod:`MongoDB\\MapReduceResult::getCounts()`
-- :phpmethod:`MongoDB\\MapReduceResult::getExecutionTimeMS()`
-- :phpmethod:`MongoDB\\MapReduceResult::getIterator()`
-- :phpmethod:`MongoDB\\MapReduceResult::getTiming()`
\ No newline at end of file
+- :phpmethod:`MongoDB\MapReduceResult::getCounts()`
+- :phpmethod:`MongoDB\MapReduceResult::getExecutionTimeMS()`
+- :phpmethod:`MongoDB\MapReduceResult::getIterator()`
+- :phpmethod:`MongoDB\MapReduceResult::getTiming()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelCollectionInfo.txt b/source/reference/class/MongoDBModelCollectionInfo.txt
index 17807095..76b9af35 100644
--- a/source/reference/class/MongoDBModelCollectionInfo.txt
+++ b/source/reference/class/MongoDBModelCollectionInfo.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\CollectionInfo Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\CollectionInfo
+.. phpclass:: MongoDB\Model\CollectionInfo
 
    This class models information about a collection. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Database::listCollections()`.
+   returned by traversing a :phpclass:`MongoDB\Model\CollectionInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\Database::listCollections()`.
 
 .. versionchanged:: 1.4
 
@@ -20,9 +20,9 @@ Definition
 
    .. note::
 
-      The :phpclass:`MongoDB\\Model\\CollectionInfo` class is immutable. Attempting
+      The :phpclass:`MongoDB\Model\CollectionInfo` class is immutable. Attempting
       to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+      result in a :phpclass:`MongoDB\Exception\BadMethodCallException`.
 
 Methods
 -------
@@ -39,11 +39,11 @@ Methods
    getType() 
    isCapped() 
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getIdIndex()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getInfo()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getName()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getType()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getIdIndex()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getInfo()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getName()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getOptions()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getType()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::isCapped()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelCollectionInfoIterator.txt b/source/reference/class/MongoDBModelCollectionInfoIterator.txt
index 5358f213..fca6da62 100644
--- a/source/reference/class/MongoDBModelCollectionInfoIterator.txt
+++ b/source/reference/class/MongoDBModelCollectionInfoIterator.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\CollectionInfoIterator Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\CollectionInfoIterator
+.. phpclass:: MongoDB\Model\CollectionInfoIterator
 
    This interface extends PHP's :php:`Iterator `
    interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Database::listCollections()`.
+   :phpmethod:`MongoDB\Database::listCollections()`.
 
 Methods
 -------
@@ -17,4 +17,4 @@ Methods
 This interface adds no new methods to :php:`Iterator
 `, but specifies that :php:`current()
 ` will return an instance of
-:phpclass:`MongoDB\\Model\\CollectionInfo`.
\ No newline at end of file
+:phpclass:`MongoDB\Model\CollectionInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelDatabaseInfo.txt b/source/reference/class/MongoDBModelDatabaseInfo.txt
index e0f45852..a8d18cd6 100644
--- a/source/reference/class/MongoDBModelDatabaseInfo.txt
+++ b/source/reference/class/MongoDBModelDatabaseInfo.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\DatabaseInfo Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\DatabaseInfo
+.. phpclass:: MongoDB\Model\DatabaseInfo
 
    This class models information about a database. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`.
+   returned by traversing a :phpclass:`MongoDB\Model\DatabaseInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\Client::listDatabases()`.
 
 .. versionchanged:: 1.4
 
@@ -20,9 +20,9 @@ Definition
 
    .. note::
 
-      The :phpclass:`MongoDB\\Model\\DatabaseInfo` class is immutable. Attempting
+      The :phpclass:`MongoDB\Model\DatabaseInfo` class is immutable. Attempting
       to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+      result in a :phpclass:`MongoDB\Exception\BadMethodCallException`.
 
 Methods
 -------
@@ -34,6 +34,6 @@ Methods
    getSizeOnDisk() 
    isEmpty() 
 
-- :phpmethod:`MongoDB\\Model\\DatabaseInfo::getName()`
-- :phpmethod:`MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()`
-- :phpmethod:`MongoDB\\Model\\DatabaseInfo::isEmpty()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Model\DatabaseInfo::getName()`
+- :phpmethod:`MongoDB\Model\DatabaseInfo::getSizeOnDisk()`
+- :phpmethod:`MongoDB\Model\DatabaseInfo::isEmpty()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelDatabaseInfoIterator.txt b/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
index 960ca256..ba36ef2e 100644
--- a/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
+++ b/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\DatabaseInfoIterator Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\DatabaseInfoIterator
+.. phpclass:: MongoDB\Model\DatabaseInfoIterator
 
    This interface extends PHP's :php:`Iterator `
    interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Client::listDatabases()`.
+   :phpmethod:`MongoDB\Client::listDatabases()`.
 
 Methods
 -------
@@ -17,4 +17,4 @@ Methods
 This interface adds no new methods to :php:`Iterator
 `, but specifies that :php:`current()
 ` will return an instance of
-:phpclass:`MongoDB\\Model\\DatabaseInfo`.
\ No newline at end of file
+:phpclass:`MongoDB\Model\DatabaseInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelIndexInfo.txt b/source/reference/class/MongoDBModelIndexInfo.txt
index 8b9c42c8..4d017e5d 100644
--- a/source/reference/class/MongoDBModelIndexInfo.txt
+++ b/source/reference/class/MongoDBModelIndexInfo.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\IndexInfo Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\IndexInfo
+.. phpclass:: MongoDB\Model\IndexInfo
 
    This class models information about an index. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\IndexInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Collection::listIndexes()`.
+   returned by traversing a :phpclass:`MongoDB\Model\IndexInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\Collection::listIndexes()`.
 
    This class implements PHP's :php:`ArrayAccess ` interface. This
    provides a mechanism for accessing index fields for which there exists no
@@ -18,9 +18,9 @@ Definition
 
    .. note::
 
-      The :phpclass:`MongoDB\\Model\\IndexInfo` class is immutable. Attempting
+      The :phpclass:`MongoDB\Model\IndexInfo` class is immutable. Attempting
       to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+      result in a :phpclass:`MongoDB\Exception\BadMethodCallException`.
 
 Methods
 -------
@@ -39,13 +39,13 @@ Methods
    isTtl() 
    isUnique() 
 
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getKey()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getName()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getNamespace()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getVersion()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::is2dSphere()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isGeoHaystack()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isSparse()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isText()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isTtl()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isUnique()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Model\IndexInfo::getKey()`
+- :phpmethod:`MongoDB\Model\IndexInfo::getName()`
+- :phpmethod:`MongoDB\Model\IndexInfo::getNamespace()`
+- :phpmethod:`MongoDB\Model\IndexInfo::getVersion()`
+- :phpmethod:`MongoDB\Model\IndexInfo::is2dSphere()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isGeoHaystack()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isSparse()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isText()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isTtl()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isUnique()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelIndexInfoIterator.txt b/source/reference/class/MongoDBModelIndexInfoIterator.txt
index 2b154706..0fae59c2 100644
--- a/source/reference/class/MongoDBModelIndexInfoIterator.txt
+++ b/source/reference/class/MongoDBModelIndexInfoIterator.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\IndexInfoIterator Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\IndexInfoIterator
+.. phpclass:: MongoDB\Model\IndexInfoIterator
 
    This interface extends PHP's :php:`Iterator `
    interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Collection::listIndexes()`.
+   :phpmethod:`MongoDB\Collection::listIndexes()`.
 
 Methods
 -------
@@ -17,4 +17,4 @@ Methods
 This interface adds no new methods to :php:`Iterator
 `, but specifies that :php:`current()
 ` will return an instance of
-:phpclass:`MongoDB\\Model\\IndexInfo`.
\ No newline at end of file
+:phpclass:`MongoDB\Model\IndexInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBUpdateResult.txt b/source/reference/class/MongoDBUpdateResult.txt
index 0534980d..52561e59 100644
--- a/source/reference/class/MongoDBUpdateResult.txt
+++ b/source/reference/class/MongoDBUpdateResult.txt
@@ -5,14 +5,14 @@ MongoDB\\UpdateResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\UpdateResult
+.. phpclass:: MongoDB\UpdateResult
 
    This class contains information about an executed update or replace
-   operation. It encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   operation. It encapsulates a :php:`MongoDB\Driver\WriteResult
    ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::replaceOne()`,
-   :phpmethod:`MongoDB\\Collection::updateMany()`, or
-   :phpmethod:`MongoDB\\Collection::updateOne()`.
+   :phpmethod:`MongoDB\Collection::replaceOne()`,
+   :phpmethod:`MongoDB\Collection::updateMany()`, or
+   :phpmethod:`MongoDB\Collection::updateOne()`.
 
 Methods
 -------
@@ -26,8 +26,8 @@ Methods
    getUpsertedId() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\UpdateResult::getMatchedCount()`
-- :phpmethod:`MongoDB\\UpdateResult::getModifiedCount()`
-- :phpmethod:`MongoDB\\UpdateResult::getUpsertedCount()`
-- :phpmethod:`MongoDB\\UpdateResult::getUpsertedId()`
-- :phpmethod:`MongoDB\\UpdateResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\UpdateResult::getMatchedCount()`
+- :phpmethod:`MongoDB\UpdateResult::getModifiedCount()`
+- :phpmethod:`MongoDB\UpdateResult::getUpsertedCount()`
+- :phpmethod:`MongoDB\UpdateResult::getUpsertedId()`
+- :phpmethod:`MongoDB\UpdateResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/exception-classes.txt b/source/reference/exception-classes.txt
index 20ae7067..584c55d5 100644
--- a/source/reference/exception-classes.txt
+++ b/source/reference/exception-classes.txt
@@ -13,56 +13,56 @@ Exception Classes
 MongoDB\\Exception\\BadMethodCallException
 ------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\BadMethodCallException
+.. phpclass:: MongoDB\Exception\BadMethodCallException
 
    This exception is thrown when an unsupported method is invoked on an object.
 
    For example, using an unacknowledged write concern with
-   :phpmethod:`MongoDB\\Collection::insertMany()` will return a
-   :phpclass:`MongoDB\\InsertManyResult` object. It is a logical error to call
-   :phpmethod:`MongoDB\\InsertManyResult::getInsertedCount()`, since the number
+   :phpmethod:`MongoDB\Collection::insertMany()` will return a
+   :phpclass:`MongoDB\InsertManyResult` object. It is a logical error to call
+   :phpmethod:`MongoDB\InsertManyResult::getInsertedCount()`, since the number
    of inserted documents can only be determined from the response of an
    acknowledged write operation.
 
    This class extends PHP's :php:`BadMethodCallException
    ` class and implements the library's
-   :phpclass:`Exception ` interface.
+   :phpclass:`Exception ` interface.
 
 ----
 
 MongoDB\\Exception\\CreateEncryptedCollectionException
 ------------------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\CreateEncryptedCollectionException
+.. phpclass:: MongoDB\Exception\CreateEncryptedCollectionException
 
-   Thrown by :phpmethod:`MongoDB\\Database::createEncryptedCollection()` if any
+   Thrown by :phpmethod:`MongoDB\Database::createEncryptedCollection()` if any
    error is encountered while creating data keys or creating the collection. The
    original exception and modified ``encryptedFields`` option can be accessed
    via the ``getPrevious()`` and ``getEncryptedFields()`` methods, respectively.
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
 ----
 
 MongoDB\\Exception\\InvalidArgumentException
 --------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\InvalidArgumentException
+.. phpclass:: MongoDB\Exception\InvalidArgumentException
 
    Thrown for errors related to the parsing of parameters or options within the
    library.
 
    This class extends the driver's :php:`InvalidArgumentException
    ` class and implements the
-   library's :phpclass:`Exception ` interface.
+   library's :phpclass:`Exception ` interface.
 
 ----
 
 MongoDB\\Exception\\UnexpectedValueException
 --------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\UnexpectedValueException
+.. phpclass:: MongoDB\Exception\UnexpectedValueException
 
    This exception is thrown when a command response from the server is
    malformed or not what the library expected. This exception means that an
@@ -72,26 +72,26 @@ MongoDB\\Exception\\UnexpectedValueException
 
    This class extends the driver's :php:`UnexpectedValueException
    ` class and implements the
-   library's :phpclass:`Exception ` interface.
+   library's :phpclass:`Exception ` interface.
 
 ----
 
 MongoDB\\Exception\\UnsupportedException
 ----------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\UnsupportedException
+.. phpclass:: MongoDB\Exception\UnsupportedException
 
    This exception is thrown if an option is used and not supported by the
    selected server. It is used sparingly in cases where silently ignoring the
    unsupported option might otherwise lead to unexpected behavior.
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
    .. note::
 
       Unlike :phpclass:`InvalidArgumentException
-      `, which may be thrown when
+      `, which may be thrown when
       an operation's parameters and options are parsed during construction, the
       selected server is not known until an operation is executed.
 
@@ -100,7 +100,7 @@ MongoDB\\Exception\\UnsupportedException
 MongoDB\\GridFS\\Exception\\CorruptFileException
 ------------------------------------------------
 
-.. phpclass:: MongoDB\\GridFS\\Exception\\CorruptFileException
+.. phpclass:: MongoDB\GridFS\Exception\CorruptFileException
 
    This exception is thrown if a GridFS file's metadata or chunk documents
    contain unexpected or invalid data.
@@ -111,27 +111,27 @@ MongoDB\\GridFS\\Exception\\CorruptFileException
    sequence or its binary data's length out of range.
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
 ----
 
 MongoDB\\GridFS\\Exception\\FileNotFoundException
 -------------------------------------------------
 
-.. phpclass:: MongoDB\\GridFS\\Exception\\FileNotFoundException
+.. phpclass:: MongoDB\GridFS\Exception\FileNotFoundException
 
    This exception is thrown if no GridFS file was found for the selection
    criteria (e.g. ``id``, ``filename``).
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
 ----
 
 MongoDB\\Exception\\Exception
 -----------------------------
 
-.. phpclass:: MongoDB\\Exception\\Exception
+.. phpclass:: MongoDB\Exception\Exception
 
    This interface extends the driver's :php:`Exception
    ` interface and is implemented by all
@@ -142,7 +142,7 @@ MongoDB\\Exception\\Exception
 MongoDB\\Exception\\RuntimeException
 ------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\RuntimeException
+.. phpclass:: MongoDB\Exception\RuntimeException
 
    This class extends the driver's :php:`RuntimeException
    ` class, which in turn extends
diff --git a/source/reference/function/with_transaction.txt b/source/reference/function/with_transaction.txt
index 438ea7a1..b759025e 100644
--- a/source/reference/function/with_transaction.txt
+++ b/source/reference/function/with_transaction.txt
@@ -15,7 +15,7 @@ MongoDB\\with_transaction()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\with_transaction()
+.. phpmethod:: MongoDB\with_transaction()
 
    Execute a callback within a transaction using the given client session
 
@@ -30,17 +30,17 @@ Definition
 Parameters
 ----------
 
-``$session`` : :php:`MongoDB\\Driver\\Session `
+``$session`` : :php:`MongoDB\Driver\Session `
   A client session used to execute the transaction.
 
 ``$callback`` : :php:`callable `
   A callback that will be run inside the transaction. The callback must accept a
-  :php:`MongoDB\\Driver\\Session ` object as its first
+  :php:`MongoDB\Driver\Session ` object as its first
   argument.
 
 ``$transactionOptions`` : array
   Transaction options, which will be passed to
-  :php:`MongoDB\\Driver\\Session::startTransaction `.
+  :php:`MongoDB\Driver\Session::startTransaction `.
   See the extension documentation for a list of supported options.
 
 Behavior
@@ -50,7 +50,7 @@ This function is responsible for starting a transaction, invoking a callback,
 and committing a transaction. It also applies logic to retry this process after
 certain errors within a preset time limit. The callback is expected to execute
 one or more operations within the transactionby passing the callback's
-:php:`MongoDB\\Driver\\Session ` argument as an option to
+:php:`MongoDB\Driver\Session ` argument as an option to
 those operations; however, that is not enforced.
 
 .. note::
@@ -89,7 +89,7 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Session::startTransaction `
-- :php:`MongoDB\\Driver\\Session::commitTransaction `
+- :php:`MongoDB\Driver\Session::startTransaction `
+- :php:`MongoDB\Driver\Session::commitTransaction `
 - :manual:`Transactions: Drivers API ` documentation in the MongoDB manual
 - `Convenient API for Transactions `_ specification
diff --git a/source/reference/functions.txt b/source/reference/functions.txt
index ca1aadf3..0ee5966e 100644
--- a/source/reference/functions.txt
+++ b/source/reference/functions.txt
@@ -15,4 +15,4 @@ Functions
 
    with_transaction() 
 
-- :phpmethod:`MongoDB\\with_transaction()`
+- :phpmethod:`MongoDB\with_transaction()`
diff --git a/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
index d0501d3f..8dbe98d5 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getDeletedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getDeletedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getDeletedCount()
 
    Return the total number of documents that were deleted by all delete
    operations in the bulk write.
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getDeletedCount()
+- :php:`MongoDB\Driver\WriteResult::getDeletedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
index 6eb1b5de..8d9a4ed8 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getInsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getInsertedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getInsertedCount()
 
    Return the total number of documents that were inserted by all insert
    operations in the bulk write.
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getInsertedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt b/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
index bcbcd536..bb6752ff 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getInsertedIds()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getInsertedIds()
+.. phpmethod:: MongoDB\BulkWriteResult::getInsertedIds()
 
    Return a map of IDs (i.e. ``_id`` field values) for documents that were
    inserted by all insert operations in the bulk write.
@@ -34,5 +34,5 @@ insert operations in the bulk write.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to inserting (i.e. the driver did
 not generate an ID), the index will contain its ``_id`` field value. Any
-driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
+driver-generated ID will be a :php:`MongoDB\BSON\ObjectId
 ` instance.
diff --git a/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
index af1ad98f..02341bed 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getMatchedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getMatchedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getMatchedCount()
 
    Return the total number of documents that were matched by all update and
    replace operations in the bulk write.
@@ -30,7 +30,7 @@ Definition
       (e.g. setting the value of a field to its current value), the matched
       count may be greater than the value returned by
       :phpmethod:`getModifiedCount()
-      `.
+      `.
 
 Return Values
 -------------
@@ -46,6 +46,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\BulkWriteResult::getModifiedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getMatchedCount()
+- :phpmethod:`MongoDB\BulkWriteResult::getModifiedCount()`
+- :php:`MongoDB\Driver\WriteResult::getMatchedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
index da115c5f..6f179bd8 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getModifiedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getModifiedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getModifiedCount()
 
    Return the total number of documents that were modified by all update and
    replace operations in the bulk write.
@@ -29,7 +29,7 @@ Definition
       If an update/replace operation results in no change to the document
       (e.g. setting the value of a field to its current value), the modified
       count may be less than the value returned by :phpmethod:`getMatchedCount()
-      `.
+      `.
 
 Return Values
 -------------
@@ -45,6 +45,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\BulkWriteResult::getMatchedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getModifiedCount()
+- :phpmethod:`MongoDB\BulkWriteResult::getMatchedCount()`
+- :php:`MongoDB\Driver\WriteResult::getModifiedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
index 1f0dff2b..00f1ff1f 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getUpsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getUpsertedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getUpsertedCount()
 
    Return the total number of documents that were upserted by all update and
    replace operations in the bulk write.
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt b/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
index 6abad98f..df0b1fbb 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getUpsertedIds()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getUpsertedIds()
+.. phpmethod:: MongoDB\BulkWriteResult::getUpsertedIds()
 
    Return a map of IDs (i.e. ``_id`` field values) for documents that were
    upserted by all update and replace operations in the bulk write.
@@ -31,7 +31,7 @@ update and replace operations in the bulk write.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to upserting (i.e. the server did
 not generate an ID), the index will contain its ``_id`` field value. Any
-server-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
+server-generated ID will be a :php:`MongoDB\BSON\ObjectId
 ` instance.
 
 Errors/Exceptions
@@ -42,5 +42,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedIds()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedIds()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt b/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
index 1a857caa..611f9fa7 100644
--- a/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::isAcknowledged()
+.. phpmethod:: MongoDB\BulkWriteResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-current.txt b/source/reference/method/MongoDBChangeStream-current.txt
index a8578607..ccff68e0 100644
--- a/source/reference/method/MongoDBChangeStream-current.txt
+++ b/source/reference/method/MongoDBChangeStream-current.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::current()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::current()
+.. phpmethod:: MongoDB\ChangeStream::current()
 
    Returns the current event in the change stream.
 
@@ -29,9 +29,9 @@ Return Values
 -------------
 
 An array or object for the current event in the change stream, or ``null`` if
-there is no current event (i.e. :phpmethod:`MongoDB\\ChangeStream::valid()`
+there is no current event (i.e. :phpmethod:`MongoDB\ChangeStream::valid()`
 returns ``false``). The return type will depend on the ``typeMap`` option for
-:phpmethod:`MongoDB\\Collection::watch()`.
+:phpmethod:`MongoDB\Collection::watch()`.
 
 Examples
 --------
@@ -96,9 +96,9 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::current() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-getCursorId.txt b/source/reference/method/MongoDBChangeStream-getCursorId.txt
index e7004f44..066930e1 100644
--- a/source/reference/method/MongoDBChangeStream-getCursorId.txt
+++ b/source/reference/method/MongoDBChangeStream-getCursorId.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::getCursorId()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::getCursorId()
+.. phpmethod:: MongoDB\ChangeStream::getCursorId()
 
    Returns the change stream cursor's ID.
 
@@ -24,7 +24,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\CursorId ` object.
+A :php:`MongoDB\Driver\CursorId ` object.
 
 Examples
 --------
@@ -55,8 +55,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
-- :php:`MongoDB\\Driver\\CursorId `
-- :php:`MongoDB\\Driver\\Cursor::getId() `
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
+- :php:`MongoDB\Driver\CursorId `
+- :php:`MongoDB\Driver\Cursor::getId() `
diff --git a/source/reference/method/MongoDBChangeStream-getResumeToken.txt b/source/reference/method/MongoDBChangeStream-getResumeToken.txt
index 0930d45c..873e29bb 100644
--- a/source/reference/method/MongoDBChangeStream-getResumeToken.txt
+++ b/source/reference/method/MongoDBChangeStream-getResumeToken.txt
@@ -15,7 +15,7 @@ MongoDB\\ChangeStream::getResumeToken()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::getResumeToken()
+.. phpmethod:: MongoDB\ChangeStream::getResumeToken()
 
    Returns the cached resume token that will be used to resume the change
    stream.
@@ -68,8 +68,8 @@ the ``startAfter`` option.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :manual:`Resume a Change Stream `
   documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-key.txt b/source/reference/method/MongoDBChangeStream-key.txt
index de4754b4..8b35616f 100644
--- a/source/reference/method/MongoDBChangeStream-key.txt
+++ b/source/reference/method/MongoDBChangeStream-key.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::key()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::key()
+.. phpmethod:: MongoDB\ChangeStream::key()
 
    Returns the index of the current event in the change stream.
 
@@ -28,7 +28,7 @@ Return Values
 -------------
 
 The index of the current event in the change stream, or ``null`` if there is no
-current event (i.e. :phpmethod:`MongoDB\\ChangeStream::valid()` returns
+current event (i.e. :phpmethod:`MongoDB\ChangeStream::valid()` returns
 ``false``).
 
 Examples
@@ -68,9 +68,9 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::key() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-next.txt b/source/reference/method/MongoDBChangeStream-next.txt
index c25f039b..559ae4cb 100644
--- a/source/reference/method/MongoDBChangeStream-next.txt
+++ b/source/reference/method/MongoDBChangeStream-next.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::next()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::next()
+.. phpmethod:: MongoDB\ChangeStream::next()
 
    Advances the change stream and attempts to load the next event.
 
@@ -25,7 +25,7 @@ Definition
 
       Advancing the change stream does not guarantee that there will be a
       current event to access. You should still call
-      :phpmethod:`MongoDB\\ChangeStream::valid()` to check for a current event
+      :phpmethod:`MongoDB\ChangeStream::valid()` to check for a current event
       at each step of iteration.
 
 Errors/Exceptions
@@ -36,9 +36,9 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::next() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-rewind.txt b/source/reference/method/MongoDBChangeStream-rewind.txt
index e59a1399..066e99aa 100644
--- a/source/reference/method/MongoDBChangeStream-rewind.txt
+++ b/source/reference/method/MongoDBChangeStream-rewind.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::rewind()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::rewind()
+.. phpmethod:: MongoDB\ChangeStream::rewind()
 
    Rewinds the change stream and attempts to load the first event.
 
@@ -27,18 +27,18 @@ Definition
 
       Rewinding the change stream does not guarantee that there will be a
       current event to access. You should still call
-      :phpmethod:`MongoDB\\ChangeStream::valid()` to check for a current event
+      :phpmethod:`MongoDB\ChangeStream::valid()` to check for a current event
       at each step of iteration. After initially rewinding the change stream,
-      :phpmethod:`MongoDB\\ChangeStream::next()` should be used to iterate
+      :phpmethod:`MongoDB\ChangeStream::next()` should be used to iterate
       further.
 
 Errors/Exceptions
 -----------------
 
-:php:`MongoDB\\Driver\\Exception\\LogicException
+:php:`MongoDB\Driver\Exception\LogicException
 ` if this method is called after a call
-to :phpmethod:`MongoDB\\ChangeStream::next()` (i.e. the underlying
-:php:`MongoDB\\Driver\\Cursor ` has already been
+to :phpmethod:`MongoDB\ChangeStream::next()` (i.e. the underlying
+:php:`MongoDB\Driver\Cursor ` has already been
 advanced).
 
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
@@ -46,9 +46,9 @@ advanced).
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::rewind() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-valid.txt b/source/reference/method/MongoDBChangeStream-valid.txt
index 69ea1cd6..bab45f1f 100644
--- a/source/reference/method/MongoDBChangeStream-valid.txt
+++ b/source/reference/method/MongoDBChangeStream-valid.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::valid()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::valid()
+.. phpmethod:: MongoDB\ChangeStream::valid()
 
    Returns whether there is a current event in the change stream.
 
@@ -23,8 +23,8 @@ Definition
 
    When manually iterating the change stream using
    :php:`Iterator ` methods, this method should
-   be used to determine if :phpmethod:`MongoDB\\ChangeStream::current()` and
-   :phpmethod:`MongoDB\\ChangeStream::key()` can be called.
+   be used to determine if :phpmethod:`MongoDB\ChangeStream::current()` and
+   :phpmethod:`MongoDB\ChangeStream::key()` can be called.
 
 Return Values
 -------------
@@ -34,9 +34,9 @@ A boolean indicating whether there is a current event in the change stream.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::valid() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-createClientEncryption.txt b/source/reference/method/MongoDBClient-createClientEncryption.txt
index 0dd925cd..ef0d2529 100644
--- a/source/reference/method/MongoDBClient-createClientEncryption.txt
+++ b/source/reference/method/MongoDBClient-createClientEncryption.txt
@@ -13,9 +13,9 @@ MongoDB\\Client::createClientEncryption()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::createClientEncryption()
+.. phpmethod:: MongoDB\Client::createClientEncryption()
 
-   Returns a :php:`MongoDB\\Driver\\ClientEncryption `
+   Returns a :php:`MongoDB\Driver\ClientEncryption `
    object for manual encryption and decryption of values.
 
    .. code-block:: php
@@ -27,18 +27,18 @@ Parameters
 
 ``$options`` : array
   An array specifying the desired options. Refer to the
-  :php:`MongoDB\\Driver\\Manager::createClientEncryption() `
+  :php:`MongoDB\Driver\Manager::createClientEncryption() `
   extension documentation for a list of supported options.
 
-  If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+  If a :phpclass:`MongoDB\Client` is provided for the ``keyVaultClient``
   option, it will be unwrapped into a
-  :php:`MongoDB\\Driver\\Manager ` for the
+  :php:`MongoDB\Driver\Manager ` for the
   extension.
 
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ClientEncryption `
+A :php:`MongoDB\Driver\ClientEncryption `
 instance which can be used to encrypt and decrypt values.
 
 Errors/Exceptions
@@ -50,5 +50,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Manager::createClientEncryption()
+- :php:`MongoDB\Driver\Manager::createClientEncryption()
   `
diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index 5a268765..9545ed49 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::dropDatabase()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::dropDatabase()
+.. phpmethod:: MongoDB\Client::dropDatabase()
 
    Drop a database on the server.
 
@@ -47,7 +47,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -59,7 +59,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/client-option-writeConcern.rst
 
 Return Values
@@ -108,6 +108,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::drop()`
+- :phpmethod:`MongoDB\Database::drop()`
 - :manual:`dropDatabase ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-getManager.txt b/source/reference/method/MongoDBClient-getManager.txt
index c320595d..9618beca 100644
--- a/source/reference/method/MongoDBClient-getManager.txt
+++ b/source/reference/method/MongoDBClient-getManager.txt
@@ -13,11 +13,11 @@ MongoDB\\Client::getManager()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getManager()
+.. phpmethod:: MongoDB\Client::getManager()
 
    Accessor for the
-   :php:`MongoDB\\Driver\\Manager ` used by this
-   :phpclass:`Client `.
+   :php:`MongoDB\Driver\Manager ` used by this
+   :phpclass:`Client `.
 
    .. code-block:: php
 
@@ -26,10 +26,10 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\Driver\Manager ` object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getManager()`
-- :phpmethod:`MongoDB\\Database::getManager()`
+- :phpmethod:`MongoDB\Collection::getManager()`
+- :phpmethod:`MongoDB\Database::getManager()`
diff --git a/source/reference/method/MongoDBClient-getReadConcern.txt b/source/reference/method/MongoDBClient-getReadConcern.txt
index 64f2b3d4..89643bd5 100644
--- a/source/reference/method/MongoDBClient-getReadConcern.txt
+++ b/source/reference/method/MongoDBClient-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getReadConcern()
+.. phpmethod:: MongoDB\Client::getReadConcern()
 
    Returns the read concern for this client.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -54,7 +54,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBClient-getReadPreference.txt b/source/reference/method/MongoDBClient-getReadPreference.txt
index cd00f206..564d108f 100644
--- a/source/reference/method/MongoDBClient-getReadPreference.txt
+++ b/source/reference/method/MongoDBClient-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getReadPreference()
+.. phpmethod:: MongoDB\Client::getReadPreference()
 
    Returns the read preference for this client.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -55,6 +55,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBClient-getTypeMap.txt b/source/reference/method/MongoDBClient-getTypeMap.txt
index 138444f0..89c620af 100644
--- a/source/reference/method/MongoDBClient-getTypeMap.txt
+++ b/source/reference/method/MongoDBClient-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getTypeMap()
+.. phpmethod:: MongoDB\Client::getTypeMap()
 
    Returns the type map for this client.
 
@@ -62,6 +62,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBClient-getWriteConcern.txt b/source/reference/method/MongoDBClient-getWriteConcern.txt
index 7a3e561c..270707f0 100644
--- a/source/reference/method/MongoDBClient-getWriteConcern.txt
+++ b/source/reference/method/MongoDBClient-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getWriteConcern()
+.. phpmethod:: MongoDB\Client::getWriteConcern()
 
    Returns the write concern for this client.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -55,7 +55,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBClient-listDatabaseNames.txt b/source/reference/method/MongoDBClient-listDatabaseNames.txt
index cac7d22c..bdb7e095 100644
--- a/source/reference/method/MongoDBClient-listDatabaseNames.txt
+++ b/source/reference/method/MongoDBClient-listDatabaseNames.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::listDatabaseNames()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::listDatabaseNames()
+.. phpmethod:: MongoDB\Client::listDatabaseNames()
 
    Returns names for all databases on the server.
 
@@ -69,7 +69,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -112,7 +112,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::listDatabases()`
+- :phpmethod:`MongoDB\Client::listDatabases()`
 - :manual:`listDatabases ` command reference
   in the MongoDB manual
 - `Enumerating Databases
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index dd6b2da8..93a4d65a 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::listDatabases()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::listDatabases()
+.. phpmethod:: MongoDB\Client::listDatabases()
 
    Returns information for all databases on the server.
 
@@ -67,7 +67,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -77,8 +77,8 @@ Parameters
 Return Values
 -------------
 
-A traversable :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`, which contains
-a :phpclass:`MongoDB\\Model\\DatabaseInfo` object for each database on the
+A traversable :phpclass:`MongoDB\Model\DatabaseInfoIterator`, which contains
+a :phpclass:`MongoDB\Model\DatabaseInfo` object for each database on the
 server.
 
 Errors/Exceptions
@@ -127,7 +127,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::listDatabaseNames()`
+- :phpmethod:`MongoDB\Client::listDatabaseNames()`
 - :manual:`listDatabases ` command reference
   in the MongoDB manual
 - `Enumerating Databases
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 6700f023..e7e58e86 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::selectCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::selectCollection()
+.. phpmethod:: MongoDB\Client::selectCollection()
 
    Selects a collection on the server.
 
@@ -46,12 +46,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the client's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the client's read preference.
 
@@ -61,14 +61,14 @@ Parameters
          client's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults to
          the client's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Errors/Exceptions
 -----------------
@@ -79,7 +79,7 @@ Behavior
 --------
 
 The selected collection inherits options such as read preference and type
-mapping from the :phpclass:`Client ` object. Options may be
+mapping from the :phpclass:`Client ` object. Options may be
 overridden via the ``$options`` parameter.
 
 Example
@@ -115,5 +115,5 @@ with a custom read preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::__construct()`
-- :phpmethod:`MongoDB\\Database::selectCollection()`
+- :phpmethod:`MongoDB\Collection::__construct()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index b1814516..33c7ec32 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::selectDatabase()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::selectDatabase()
+.. phpmethod:: MongoDB\Client::selectDatabase()
 
    Selects a database on the server.
 
@@ -42,12 +42,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for database operations. Defaults to
          the client's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for database operations. Defaults to
          the client's read preference.
 
@@ -57,14 +57,14 @@ Parameters
          client's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for database operations. Defaults to
          the client's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\Database` object.
 
 Errors/Exceptions
 -----------------
@@ -75,7 +75,7 @@ Behavior
 --------
 
 The selected database inherits options such as read preference and type mapping
-from the :phpclass:`Client ` object. Options may be overridden
+from the :phpclass:`Client ` object. Options may be overridden
 via the ``$options`` parameter.
 
 Example
@@ -110,5 +110,5 @@ preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::__get()`
-- :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\Client::__get()`
+- :phpmethod:`MongoDB\Database::__construct()`
diff --git a/source/reference/method/MongoDBClient-startSession.txt b/source/reference/method/MongoDBClient-startSession.txt
index 8de00ee0..0e3d8eb1 100644
--- a/source/reference/method/MongoDBClient-startSession.txt
+++ b/source/reference/method/MongoDBClient-startSession.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::startSession()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::startSession()
+.. phpmethod:: MongoDB\Client::startSession()
 
    Start a new client session for use with this client.
 
@@ -28,7 +28,7 @@ Parameters
 
 ``$options`` : array
   An array specifying the desired options. Refer to the
-  :php:`MongoDB\\Driver\\Manager::startSession() `
+  :php:`MongoDB\Driver\Manager::startSession() `
   extension documentation for a list of supported options.
 
 Return Values
@@ -83,6 +83,6 @@ The output would then resemble:
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Manager::startSession()
+- :php:`MongoDB\Driver\Manager::startSession()
   `
 - :ref:`Causal Consistency ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-watch.txt b/source/reference/method/MongoDBClient-watch.txt
index 2977475a..1cee5f01 100644
--- a/source/reference/method/MongoDBClient-watch.txt
+++ b/source/reference/method/MongoDBClient-watch.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::watch()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::watch()
+.. phpmethod:: MongoDB\Client::watch()
 
    Executes a :manual:`change stream ` operation on the client.
    The change stream can be watched for cluster-level changes.
@@ -73,11 +73,11 @@ Parameters
        - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/client-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/client-option-readPreference.rst
 
          This is used for both the initial change stream aggregation and for
@@ -88,7 +88,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-resumeAfter.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - showExpandedEvents
@@ -100,7 +100,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-startAfter.rst
 
      * - startAtOperationTime
-       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - :php:`MongoDB\BSON\TimestampInterface `
        - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
      * - typeMap
@@ -110,7 +110,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+A :phpclass:`MongoDB\ChangeStream` object, which allows for iteration of
 events in the change stream via the :php:`Iterator ` interface.
 
 Errors/Exceptions
@@ -189,8 +189,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index 1134df67..a0f14770 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\Client::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::__construct()
+.. phpmethod:: MongoDB\Client::__construct()
 
-   Constructs a new :phpclass:`Client ` instance.
+   Constructs a new :phpclass:`Client ` instance.
 
    .. code-block:: php
 
@@ -49,7 +49,7 @@ Parameters
   over any analogous options present in the ``$uri`` string and do not need to
   be encoded according to `RFC 3986 `_.
 
-  Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
+  Refer to the :php:`MongoDB\Driver\Manager::__construct()
   ` extension documentation for a list of
   supported options.
 
@@ -75,9 +75,9 @@ Parameters
          :php:`extension documentation `
          for a list of supported encryption options.
 
-         If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+         If a :phpclass:`MongoDB\Client` is provided for the ``keyVaultClient``
          option, it will be unwrapped into a
-         :php:`MongoDB\\Driver\\Manager ` for the
+         :php:`MongoDB\Driver\Manager ` for the
          extension.
 
          .. versionadded:: 1.6
@@ -106,7 +106,7 @@ Parameters
          .. versionadded:: 1.7
 
      * - serverApi
-       - :php:`MongoDB\\Driver\\ServerApi `
+       - :php:`MongoDB\Driver\ServerApi `
        - Used to declare an API version on the client. Refer to
          :manual:`Stable API tutorial ` for additional
          information.
@@ -219,10 +219,10 @@ Errors/Exceptions
 Behavior
 --------
 
-A :php:`MongoDB\\Driver\\Manager ` is constructed
+A :php:`MongoDB\Driver\Manager ` is constructed
 internally. Per the `Server Discovery and Monitoring
 `_
-specification, :php:`MongoDB\\Driver\\Manager::__construct()
+specification, :php:`MongoDB\Driver\Manager::__construct()
 ` performs no I/O. Connections will be
 initialized on demand, when the first operation is executed.
 
@@ -237,7 +237,7 @@ Connecting to a Standalone server
 If you do not specify a ``$uri`` value, the driver connects to a standalone
 :program:`mongod` on ``127.0.0.1`` via port ``27017``. To connect to a different
 server, pass the corresponding connection string as the first parameter when
-creating the :phpclass:`Client ` instance:
+creating the :phpclass:`Client ` instance:
 
 .. code-block:: php
 
@@ -298,7 +298,7 @@ specified in the constructor's ``$uriOptions`` parameter:
 The driver supports additional :php:`SSL options
 `,
 which may be specified in the constructor's ``$driverOptions`` parameter. Those
-options are covered in the :php:`MongoDB\\Driver\\Manager::__construct()
+options are covered in the :php:`MongoDB\Driver\Manager::__construct()
 ` documentation.
 
 .. end-connecting-include
@@ -307,8 +307,8 @@ Specifying a Custom Type Map
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 By default, the |php-library| deserializes BSON documents and arrays
-as :phpclass:`MongoDB\\Model\\BSONDocument` and
-:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The following
+as :phpclass:`MongoDB\Model\BSONDocument` and
+:phpclass:`MongoDB\Model\BSONArray` objects, respectively. The following
 example demonstrates how to have the library unserialize everything as a PHP
 array, as was done in the legacy ``mongo`` extension.
 
@@ -331,7 +331,7 @@ array, as was done in the legacy ``mongo`` extension.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Manager::__construct()
+- :php:`MongoDB\Driver\Manager::__construct()
   `
 - :manual:`Connection String URI Format ` in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
index 88de4725..d391b12a 100644
--- a/source/reference/method/MongoDBClient__get.txt
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -13,11 +13,11 @@ MongoDB\\Client::__get()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::__get()
+.. phpmethod:: MongoDB\Client::__get()
 
    Selects a database on the server. This :php:`magic method ` is
    an alias for the :phpmethod:`selectDatabase()
-   ` method.
+   ` method.
 
    .. code-block:: php
 
@@ -32,21 +32,21 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\Database` object.
 
 Behavior
 --------
 
 The selected database inherits options such as read preference and type mapping
-from the :phpclass:`Client ` object. If you wish to override
-any options, use the :phpmethod:`MongoDB\\Client::selectDatabase()` method.
+from the :phpclass:`Client ` object. If you wish to override
+any options, use the :phpmethod:`MongoDB\Client::selectDatabase()` method.
 
 .. note::
 
    To select databases whose names contain special characters, such as
    ``-``, use complex syntax, as in ``$client->{'that-database'}``.
 
-   Alternatively, :phpmethod:`MongoDB\\Client::selectDatabase()` supports
+   Alternatively, :phpmethod:`MongoDB\Client::selectDatabase()` supports
    selecting databases whose names contain special characters.
 
 Examples
@@ -66,6 +66,6 @@ The following example selects the ``test`` and ``another-app`` databases:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::selectDatabase()`
-- :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\Client::selectDatabase()`
+- :phpmethod:`MongoDB\Database::__construct()`
 - :php:`Property Overloading ` in the PHP Manual
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index ddb66889..ef3f6411 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::aggregate()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::aggregate()
+.. phpmethod:: MongoDB\Collection::aggregate()
 
    Executes an :manual:`aggregation framework pipeline
    ` operation on the collection.
@@ -107,17 +107,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -127,7 +127,7 @@ Parameters
        - .. include:: /includes/extracts/collection-option-typeMap.rst
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -138,7 +138,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` or
+A :php:`MongoDB\Driver\Cursor ` or
 :php:`ArrayIterator ` object. In both cases, the return value
 will be :php:`Traversable `.
 
@@ -155,9 +155,9 @@ Errors/Exceptions
 Behavior
 --------
 
-:phpmethod:`MongoDB\\Collection::aggregate()`'s return value depends on the
+:phpmethod:`MongoDB\Collection::aggregate()`'s return value depends on the
 MongoDB server version and whether the ``useCursor`` option is specified. If
-``useCursor`` is ``true``, a :php:`MongoDB\\Driver\\Cursor
+``useCursor`` is ``true``, a :php:`MongoDB\Driver\Cursor
 ` object is returned. If ``useCursor`` is
 ``false``, an :php:`ArrayIterator ` is returned that wraps the
 ``result`` array from the command response document. In both cases, the return
@@ -186,7 +186,7 @@ group, and sorts the results by name.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::aggregate()`
+- :phpmethod:`MongoDB\Database::aggregate()`
 - :manual:`aggregate ` command reference in the
   MongoDB manual
 - :manual:`Aggregation Pipeline ` documentation in
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index a86e9cc6..f76d6ca6 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::bulkWrite()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::bulkWrite()
+.. phpmethod:: MongoDB\Collection::bulkWrite()
 
    Executes multiple write operations.
 
@@ -29,13 +29,13 @@ Parameters
 
 ``$operations`` : array
   An array containing the write operations to perform.
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` supports
-  :phpmethod:`deleteMany() `,
-  :phpmethod:`deleteOne() `,
-  :phpmethod:`insertOne() `,
-  :phpmethod:`replaceOne() `,
-  :phpmethod:`updateMany() `, and
-  :phpmethod:`updateOne() ` operations in the
+  :phpmethod:`MongoDB\Collection::bulkWrite()` supports
+  :phpmethod:`deleteMany() `,
+  :phpmethod:`deleteOne() `,
+  :phpmethod:`insertOne() `,
+  :phpmethod:`replaceOne() `,
+  :phpmethod:`updateMany() `, and
+  :phpmethod:`updateOne() ` operations in the
   following array structure:
 
   .. code-block:: php
@@ -51,7 +51,7 @@ Parameters
 
   Arguments correspond to the respective operation methods. However, the
   ``writeConcern`` option is specified as a top-level option to
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
+  :phpmethod:`MongoDB\Collection::bulkWrite()` instead of each individual
   operation.
 
 ``$options`` : array
@@ -95,13 +95,13 @@ Parameters
          The default is ``true``.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -109,8 +109,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\BulkWriteResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\BulkWriteResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -131,11 +131,11 @@ Behavior
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::deleteMany()`
-- :phpmethod:`MongoDB\\Collection::deleteOne()`
-- :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::deleteMany()`
+- :phpmethod:`MongoDB\Collection::deleteOne()`
+- :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
 - :doc:`/tutorial/crud`
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 0048703f..388f5bda 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::count()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::count()
+.. phpmethod:: MongoDB\Collection::count()
 
    Count the number of documents that match the filter criteria.
 
@@ -74,17 +74,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -117,7 +117,7 @@ is provided, the ``count`` command provides an estimate using collection
 metadata. Even when provided with a query filter the ``count`` command can
 return inaccurate results with a sharded cluster if orphaned documents exist or
 if a chunk migration is in progress. The
-:phpmethod:`MongoDB\\Collection::countDocuments()` method avoids these sharded
+:phpmethod:`MongoDB\Collection::countDocuments()` method avoids these sharded
 cluster problems entirely.
 
 .. include:: /includes/extracts/note-bson-comparison.rst
@@ -127,5 +127,5 @@ See Also
 
 - :manual:`count ` command reference in the MongoDB
   manual
-- :phpmethod:`MongoDB\\Collection::countDocuments()`
-- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
+- :phpmethod:`MongoDB\Collection::countDocuments()`
+- :phpmethod:`MongoDB\Collection::estimatedDocumentCount()`
diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt
index dc62b1d6..dc344f2d 100644
--- a/source/reference/method/MongoDBCollection-countDocuments.txt
+++ b/source/reference/method/MongoDBCollection-countDocuments.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::countDocuments()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::countDocuments()
+.. phpmethod:: MongoDB\Collection::countDocuments()
 
    Count the number of documents that match the filter criteria.
 
@@ -63,17 +63,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - skip
@@ -105,12 +105,12 @@ added between ``$match`` and ``group`` if present in the options.
 
    This method counts documents on the server side. To obtain an approximate
    total number of documents without filters, the
-   :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()` method can be
+   :phpmethod:`MongoDB\Collection::estimatedDocumentCount()` method can be
    used. This method estimates the number of documents based on collection
    metadata, thus sacrificing accuracy for performance.
 
 Since this method uses an aggregation pipeline, some query operators accepted
-within a :phpmethod:`MongoDB\\Collection::count()` ``filter`` cannot be used.
+within a :phpmethod:`MongoDB\Collection::count()` ``filter`` cannot be used.
 Consider the following alternatives to these restricted operators:
 
 .. list-table::
@@ -135,4 +135,4 @@ Consider the following alternatives to these restricted operators:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
+- :phpmethod:`MongoDB\Collection::estimatedDocumentCount()`
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index 7f8aca41..6a74a5bd 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::createIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::createIndex()
+.. phpmethod:: MongoDB\Collection::createIndex()
 
    Create an index for the collection.
 
@@ -117,13 +117,13 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -200,7 +200,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndexes()`
 - :doc:`/tutorial/indexes`
 - :manual:`createIndexes ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index efb740ea..85318b2d 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::createIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::createIndexes()
+.. phpmethod:: MongoDB\Collection::createIndexes()
 
    Create one or more indexes for the collection.
 
@@ -81,13 +81,13 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -113,9 +113,9 @@ Behavior
 The ``$indexes`` parameter is an array of index specification documents. Each
 element in ``$indexes`` must itself be an array or object with a ``key`` field,
 which corresponds to the ``$key`` parameter of :phpmethod:`createIndex()
-`. The array or object may include other
+`. The array or object may include other
 fields that correspond to index options accepted by :phpmethod:`createIndex()
-`. For a full list of the supported index
+`. For a full list of the supported index
 creation options, refer to the
 :manual:`createIndexes ` command reference
 in the MongoDB manual.
@@ -166,7 +166,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :doc:`/tutorial/indexes`
 - :manual:`createIndexes ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index ccb5e37d..b82b1c6b 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::deleteMany()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::deleteMany()
+.. phpmethod:: MongoDB\Collection::deleteMany()
 
    Deletes all documents that match the filter criteria.
 
@@ -68,13 +68,13 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -82,8 +82,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\DeleteResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -127,8 +127,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::deleteOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::deleteOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`delete ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index 0c659891..43209ebd 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::deleteOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::deleteOne()
+.. phpmethod:: MongoDB\Collection::deleteOne()
 
    Deletes at most one document that matches the filter criteria. If multiple
    documents match the filter criteria, only the :term:`first `
@@ -70,13 +70,13 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -84,8 +84,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\DeleteResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -129,8 +129,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::deleteMany()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::deleteMany()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`delete ` command reference  in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index 42eae068..f8bcd4b0 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::distinct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::distinct()
+.. phpmethod:: MongoDB\Collection::distinct()
 
    Finds the distinct values for a specified field across the collection.
 
@@ -63,17 +63,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index 0704ff6a..93b6a17c 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::drop()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::drop()
+.. phpmethod:: MongoDB\Collection::drop()
 
    Drop the collection.
 
@@ -64,7 +64,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -76,7 +76,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -132,6 +132,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::dropCollection()`
+- :phpmethod:`MongoDB\Database::dropCollection()`
 - :manual:`drop ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index 07a18145..67ba427e 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::dropIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::dropIndex()
+.. phpmethod:: MongoDB\Collection::dropIndex()
 
    Drop an index from the collection.
 
@@ -27,10 +27,10 @@ Definition
 Parameters
 ----------
 
-``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+``$indexName`` : string| :phpclass:`MongoDB\Model\IndexInfo`
   The name or model object of the index to drop. View the existing indexes on
   the collection using the :phpmethod:`listIndexes()
-  ` method.
+  ` method.
 
 ``$options`` : array
   An array specifying the desired options.
@@ -58,7 +58,7 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -70,7 +70,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -122,7 +122,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::dropIndexes()`
+- :phpmethod:`MongoDB\Collection::dropIndexes()`
 - :doc:`/tutorial/indexes`
 - :manual:`dropIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index 41fda6e4..52595c71 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::dropIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::dropIndexes()
+.. phpmethod:: MongoDB\Collection::dropIndexes()
 
    Drop all indexes in the collection, except for the required index on the
    ``_id`` field.
@@ -25,10 +25,10 @@ Definition
 Parameters
 ----------
 
-``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+``$indexName`` : string| :phpclass:`MongoDB\Model\IndexInfo`
   The name or model object of the index to drop. View the existing indexes on
   the collection using the :phpmethod:`listIndexes()
-  ` method.
+  ` method.
 
 ``$options`` : array
   An array specifying the desired options.
@@ -56,7 +56,7 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -68,7 +68,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -122,7 +122,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::dropIndex()`
+- :phpmethod:`MongoDB\Collection::dropIndex()`
 - :doc:`/tutorial/indexes`
 - :manual:`dropIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
index 59a7b212..1dd1d2a6 100644
--- a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
+++ b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::estimatedDocumentCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::estimatedDocumentCount()
+.. phpmethod:: MongoDB\Collection::estimatedDocumentCount()
 
    Gets an estimated number of documents in the collection using collection metadata.
 
@@ -50,17 +50,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
@@ -97,4 +97,4 @@ See Also
 
 - :manual:`count ` command reference in the MongoDB
   manual
-- :phpmethod:`MongoDB\\Collection::countDocuments()`
+- :phpmethod:`MongoDB\Collection::countDocuments()`
diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt
index ad63ec56..4c604944 100644
--- a/source/reference/method/MongoDBCollection-explain.txt
+++ b/source/reference/method/MongoDBCollection-explain.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::explain()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::explain()
+.. phpmethod:: MongoDB\Collection::explain()
 
    Explain the given command.
 
@@ -29,7 +29,7 @@ Definition
 Parameters
 ----------
 
-``$explainable`` : :phpclass:`MongoDB\\Operation\\Explainable`
+``$explainable`` : :phpclass:`MongoDB\Operation\\Explainable`
   The command to explain.
 
 ``$options`` : array
@@ -54,7 +54,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - typeMap
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 8c0ce7c2..25cca009 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::find()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::find()
+.. phpmethod:: MongoDB\Collection::find()
 
    Finds documents matching the query.
 
@@ -156,7 +156,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -171,13 +171,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - returnKey
@@ -187,7 +187,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -222,7 +222,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\Driver\Cursor ` object.
 
 Errors/Exceptions
 -----------------
@@ -357,6 +357,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOne()`
+- :phpmethod:`MongoDB\Collection::findOne()`
 - :manual:`find ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index c5230c6c..d00c5866 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOne()
+.. phpmethod:: MongoDB\Collection::findOne()
 
    Finds a single document matching the query.
 
@@ -113,7 +113,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -128,13 +128,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - returnKey
@@ -144,7 +144,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -199,7 +199,7 @@ In the following example, documents in the ``restaurants`` collection use an
 :manual:`ObjectId ` for their identifier (the default)
 and documents in the ``zips`` collection use a string. Since ObjectId is a
 special BSON type, the query criteria for selecting a restaurant must use the
-:php:`MongoDB\\BSON\\ObjectId ` class.
+:php:`MongoDB\BSON\ObjectId ` class.
 
 .. code-block:: php
 
@@ -267,6 +267,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::find()`
+- :phpmethod:`MongoDB\Collection::find()`
 - :manual:`find ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index b34bd578..9a7066b7 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOneAndDelete()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndDelete()
+.. phpmethod:: MongoDB\Collection::findOneAndDelete()
 
    Finds a single document matching the query and deletes it.
 
@@ -80,7 +80,7 @@ Parameters
          the MongoDB manual.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -96,7 +96,7 @@ Parameters
          This will be used for the returned result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -169,7 +169,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
-- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+- :phpmethod:`MongoDB\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 - :manual:`findAndModify ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 697e7371..48f6df29 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOneAndReplace()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndReplace()
+.. phpmethod:: MongoDB\Collection::findOneAndReplace()
 
    Finds a single document matching the query and replaces it.
 
@@ -97,7 +97,7 @@ Parameters
          - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -119,7 +119,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -242,7 +242,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
-- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+- :phpmethod:`MongoDB\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 - :manual:`findAndModify ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index cbfbad16..f4077b34 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOneAndUpdate()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndUpdate()
+.. phpmethod:: MongoDB\Collection::findOneAndUpdate()
 
    Finds a single document matching the query and updates it.
 
@@ -108,7 +108,7 @@ Parameters
          - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -130,7 +130,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -220,7 +220,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
-- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\Collection::findOneAndReplace()`
 - :manual:`findAndModify ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-getCollectionName.txt b/source/reference/method/MongoDBCollection-getCollectionName.txt
index 70be8a8a..9b629232 100644
--- a/source/reference/method/MongoDBCollection-getCollectionName.txt
+++ b/source/reference/method/MongoDBCollection-getCollectionName.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::getCollectionName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getCollectionName()
+.. phpmethod:: MongoDB\Collection::getCollectionName()
 
    Returns the name of this collection.
 
@@ -49,5 +49,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
diff --git a/source/reference/method/MongoDBCollection-getDatabaseName.txt b/source/reference/method/MongoDBCollection-getDatabaseName.txt
index f83632ba..5cb4902c 100644
--- a/source/reference/method/MongoDBCollection-getDatabaseName.txt
+++ b/source/reference/method/MongoDBCollection-getDatabaseName.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::getDatabaseName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getDatabaseName()
+.. phpmethod:: MongoDB\Collection::getDatabaseName()
 
    Returns the name of the database containing this collection.
 
@@ -49,6 +49,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
 
diff --git a/source/reference/method/MongoDBCollection-getManager.txt b/source/reference/method/MongoDBCollection-getManager.txt
index e0bbea08..427ed29e 100644
--- a/source/reference/method/MongoDBCollection-getManager.txt
+++ b/source/reference/method/MongoDBCollection-getManager.txt
@@ -13,11 +13,11 @@ MongoDB\\Collection::getManager()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getManager()
+.. phpmethod:: MongoDB\Collection::getManager()
 
    Accessor for the
-   :php:`MongoDB\\Driver\\Manager ` used by this
-   :phpclass:`Collection `.
+   :php:`MongoDB\Driver\Manager ` used by this
+   :phpclass:`Collection `.
 
    .. code-block:: php
 
@@ -26,10 +26,10 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\Driver\Manager ` object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::getManager()`
-- :phpmethod:`MongoDB\\Database::getManager()`
+- :phpmethod:`MongoDB\Client::getManager()`
+- :phpmethod:`MongoDB\Database::getManager()`
diff --git a/source/reference/method/MongoDBCollection-getNamespace.txt b/source/reference/method/MongoDBCollection-getNamespace.txt
index 78e2484b..4003fbd8 100644
--- a/source/reference/method/MongoDBCollection-getNamespace.txt
+++ b/source/reference/method/MongoDBCollection-getNamespace.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::getNamespace()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getNamespace()
+.. phpmethod:: MongoDB\Collection::getNamespace()
 
    Returns the :term:`namespace` of the collection. A namespace is the canonical
    name of an index or collection in MongoDB.
@@ -50,5 +50,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
-- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getDatabaseName()`
diff --git a/source/reference/method/MongoDBCollection-getReadConcern.txt b/source/reference/method/MongoDBCollection-getReadConcern.txt
index 37873d0f..0ce0b482 100644
--- a/source/reference/method/MongoDBCollection-getReadConcern.txt
+++ b/source/reference/method/MongoDBCollection-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getReadConcern()
+.. phpmethod:: MongoDB\Collection::getReadConcern()
 
    Returns the read concern for this collection.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -54,7 +54,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBCollection-getReadPreference.txt b/source/reference/method/MongoDBCollection-getReadPreference.txt
index 622701e5..b14980ae 100644
--- a/source/reference/method/MongoDBCollection-getReadPreference.txt
+++ b/source/reference/method/MongoDBCollection-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getReadPreference()
+.. phpmethod:: MongoDB\Collection::getReadPreference()
 
    Returns the read preference for this collection.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -55,6 +55,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBCollection-getTypeMap.txt b/source/reference/method/MongoDBCollection-getTypeMap.txt
index 50cd91da..8cd9240c 100644
--- a/source/reference/method/MongoDBCollection-getTypeMap.txt
+++ b/source/reference/method/MongoDBCollection-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getTypeMap()
+.. phpmethod:: MongoDB\Collection::getTypeMap()
 
    Returns the type map for this collection.
 
@@ -62,6 +62,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBCollection-getWriteConcern.txt b/source/reference/method/MongoDBCollection-getWriteConcern.txt
index a7ad354d..cc3e5d94 100644
--- a/source/reference/method/MongoDBCollection-getWriteConcern.txt
+++ b/source/reference/method/MongoDBCollection-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getWriteConcern()
+.. phpmethod:: MongoDB\Collection::getWriteConcern()
 
    Returns the write concern for this collection.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -57,7 +57,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 6ff516e7..37f7d82f 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::insertMany()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::insertMany()
+.. phpmethod:: MongoDB\Collection::insertMany()
 
    Insert multiple documents.
 
@@ -65,13 +65,13 @@ Parameters
          The default is ``true``.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -79,8 +79,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\InsertManyResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\InsertManyResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -149,8 +149,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`insert ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index ce6f0484..7a638bdc 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::insertOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::insertOne()
+.. phpmethod:: MongoDB\Collection::insertOne()
 
    Insert one document.
 
@@ -55,13 +55,13 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -69,8 +69,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\InsertOneResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\InsertOneResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -123,8 +123,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`insert ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index 84ee74b3..b65b228b 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::listIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::listIndexes()
+.. phpmethod:: MongoDB\Collection::listIndexes()
 
    Returns information for all indexes for this collection.
 
@@ -48,7 +48,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -56,8 +56,8 @@ Parameters
 Return Values
 -------------
 
-A traversable :phpclass:`MongoDB\\Model\\IndexInfoIterator`, which contains a
-:phpclass:`MongoDB\\Model\\IndexInfo` object for each index for the collection.
+A traversable :phpclass:`MongoDB\Model\IndexInfoIterator`, which contains a
+:phpclass:`MongoDB\Model\IndexInfo` object for each index for the collection.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
index 9081c36c..afb57373 100644
--- a/source/reference/method/MongoDBCollection-mapReduce.txt
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -17,7 +17,7 @@ MongoDB\\Collection::mapReduce()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::mapReduce()
+.. phpmethod:: MongoDB\Collection::mapReduce()
 
    The :manual:`mapReduce ` command allows you to
    run map-reduce aggregation operations over a collection.
@@ -34,7 +34,7 @@ Definition
 Parameters
 ----------
 
-``$map`` : :php:`MongoDB\\BSON\\Javascript `
+``$map`` : :php:`MongoDB\BSON\Javascript `
   A JavaScript function that associates or "maps" a value with a key and emits
   the key and value pair.
 
@@ -43,7 +43,7 @@ Parameters
      Passing a Javascript instance with a scope is deprecated. Put all scope
      variables in the ``scope`` option of the MapReduce operation.
 
-``$reduce`` : :php:`MongoDB\\BSON\\Javascript `
+``$reduce`` : :php:`MongoDB\BSON\Javascript `
   A JavaScript function that "reduces" to a single object all the values
   associated with a particular key.
 
@@ -89,7 +89,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - finalize
-       - :php:`MongoDB\\BSON\\Javascript `
+       - :php:`MongoDB\BSON\Javascript `
        - Follows the reduce method and modifies the output.
 
          .. note::
@@ -117,13 +117,13 @@ Parameters
          the documents input to the map function.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
          This option will be ignored when results are output to a collection.
@@ -134,7 +134,7 @@ Parameters
          finalize functions.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -153,7 +153,7 @@ Parameters
          information.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -161,7 +161,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\MapReduceResult` object, which allows for iteration of
+A :phpclass:`MongoDB\MapReduceResult` object, which allows for iteration of
 map-reduce results irrespective of the output method (e.g. inline, collection)
 via the :php:`IteratorAggregate ` interface. It also
 provides access to command statistics.
diff --git a/source/reference/method/MongoDBCollection-rename.txt b/source/reference/method/MongoDBCollection-rename.txt
index 2b617de9..347c205b 100644
--- a/source/reference/method/MongoDBCollection-rename.txt
+++ b/source/reference/method/MongoDBCollection-rename.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::rename()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::rename()
+.. phpmethod:: MongoDB\Collection::rename()
 
    Rename the collection.
 
@@ -64,7 +64,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -74,7 +74,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -124,6 +124,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::renameCollection()`
+- :phpmethod:`MongoDB\Database::renameCollection()`
 - :manual:`renameCollection ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index 94395eff..f9bfb1b8 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::replaceOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::replaceOne()
+.. phpmethod:: MongoDB\Collection::replaceOne()
 
    Replace at most one document that matches the filter criteria. If multiple
    documents match the filter criteria, only the :term:`first `
@@ -79,7 +79,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -91,7 +91,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -99,8 +99,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\UpdateResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -152,9 +152,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`update ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 07f29211..2b077220 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::updateMany()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::updateMany()
+.. phpmethod:: MongoDB\Collection::updateMany()
 
    Update all documents that match the filter criteria.
 
@@ -88,7 +88,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -100,7 +100,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -108,8 +108,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\UpdateResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -155,9 +155,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`update ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index 2a981cb2..321103c2 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::updateOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::updateOne()
+.. phpmethod:: MongoDB\Collection::updateOne()
 
    Update at most one document that matches the filter criteria. If multiple
    documents match the filter criteria, only the :term:`first `
@@ -90,7 +90,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -102,7 +102,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -110,8 +110,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\UpdateResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -157,9 +157,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`update ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
index c54123bd..0722b6d7 100644
--- a/source/reference/method/MongoDBCollection-watch.txt
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::watch()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::watch()
+.. phpmethod:: MongoDB\Collection::watch()
 
    Executes a :manual:`change stream ` operation on the
    collection. The change stream can be watched for collection-level changes.
@@ -77,11 +77,11 @@ Parameters
        - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
          This is used for both the initial change stream aggregation and for
@@ -92,7 +92,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-resumeAfter.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - showExpandedEvents
@@ -104,7 +104,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-startAfter.rst
 
      * - startAtOperationTime
-       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - :php:`MongoDB\BSON\TimestampInterface `
        - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
      * - typeMap
@@ -114,7 +114,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+A :phpclass:`MongoDB\ChangeStream` object, which allows for iteration of
 events in the change stream via the :php:`Iterator ` interface.
 
 Errors/Exceptions
@@ -193,8 +193,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index 293b093a..d942b8cc 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::withOptions()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::withOptions()
+.. phpmethod:: MongoDB\Collection::withOptions()
 
    Returns a clone of the Collection object, but with different options.
 
@@ -36,12 +36,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the original collection's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the original collection's read preference.
 
@@ -53,14 +53,14 @@ Parameters
          to PHP values. Defaults to the original collection's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults to
          the original collection's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Errors/Exceptions
 -----------------
@@ -86,4 +86,4 @@ preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::__construct()`
+- :phpmethod:`MongoDB\Collection::__construct()`
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
index 09173500..c4d2524f 100644
--- a/source/reference/method/MongoDBCollection__construct.txt
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\Collection::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::__construct()
+.. phpmethod:: MongoDB\Collection::__construct()
 
-   Constructs a new :phpclass:`Collection ` instance.
+   Constructs a new :phpclass:`Collection ` instance.
 
    .. code-block:: php
 
@@ -28,7 +28,7 @@ Definition
 
    This constructor has the following parameters:
 
-``$manager`` : :php:`MongoDB\\Driver\\Manager `
+``$manager`` : :php:`MongoDB\Driver\Manager `
   The :php:`Manager ` instance from the driver. The
   manager maintains connections between the driver and your MongoDB instances.
 
@@ -50,12 +50,12 @@ Definition
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the manager's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the manager's read preference.
 
@@ -75,7 +75,7 @@ Definition
             ]
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults
          to the manager's write concern.
 
@@ -88,9 +88,9 @@ Behavior
 --------
 
 If you construct a Collection explicitly, the Collection inherits any options
-from the :php:`MongoDB\\Driver\\Manager ` object.
-If you select the Collection from a :phpclass:`Client ` or
-:phpclass:`Database ` object, the Collection inherits its
+from the :php:`MongoDB\Driver\Manager ` object.
+If you select the Collection from a :phpclass:`Client ` or
+:phpclass:`Database ` object, the Collection inherits its
 options from that object.
 
 .. todo: add an example
@@ -98,7 +98,7 @@ options from that object.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::withOptions()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
-- :phpmethod:`MongoDB\\Database::selectCollection()`
-- :phpmethod:`MongoDB\\Database::__get()`
+- :phpmethod:`MongoDB\Collection::withOptions()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
+- :phpmethod:`MongoDB\Database::__get()`
diff --git a/source/reference/method/MongoDBDatabase-aggregate.txt b/source/reference/method/MongoDBDatabase-aggregate.txt
index 96d409ae..66546315 100644
--- a/source/reference/method/MongoDBDatabase-aggregate.txt
+++ b/source/reference/method/MongoDBDatabase-aggregate.txt
@@ -15,12 +15,12 @@ MongoDB\\Database::aggregate()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::aggregate()
+.. phpmethod:: MongoDB\Database::aggregate()
 
    Runs a specified :manual:`admin/diagnostic pipeline
    ` which does
    not require an underlying collection. For aggregations on collection data,
-   see :phpmethod:`MongoDB\\Collection::aggregate()`.
+   see :phpmethod:`MongoDB\Collection::aggregate()`.
 
    .. code-block:: php
 
@@ -105,15 +105,15 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/database-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/database-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -121,13 +121,13 @@ Parameters
        - .. include:: /includes/extracts/database-option-typeMap.rst
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` or
+A :php:`MongoDB\Driver\Cursor ` or
 :php:`ArrayIterator ` object. In both cases, the return value
 will be :php:`Traversable `.
 
@@ -164,7 +164,7 @@ running command operations.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::aggregate()`
+- :phpmethod:`MongoDB\Collection::aggregate()`
 - :manual:`aggregate ` command reference in the
   MongoDB manual
 - :manual:`Aggregation Pipeline ` documentation in
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index 50ebfe79..86243d73 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::command()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::command()
+.. phpmethod:: MongoDB\Database::command()
 
    Execute a :manual:`command ` on the database. This is
    generally used to execute commands that do not have a corresponding helper
@@ -44,11 +44,11 @@ Parameters
        - Description
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/database-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -60,7 +60,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\Driver\Cursor ` object.
 
 Errors/Exceptions
 -----------------
@@ -102,7 +102,7 @@ Some database commands return a cursor with multiple results. The following
 example executes :manual:`listCollections `,
 which returns a cursor containing a result document for each collection in the
 ``test`` database. Note that this example is illustrative; applications would
-generally use :phpmethod:`MongoDB\\Database::listCollections()` in practice.
+generally use :phpmethod:`MongoDB\Database::listCollections()` in practice.
 
 .. code-block:: php
 
@@ -168,6 +168,6 @@ See Also
 
 - :doc:`/tutorial/commands`
 - :manual:`Database Commands ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\Cursor `
-- :php:`MongoDB\\Driver\\Manager::executeCommand()
+- :php:`MongoDB\Driver\Cursor `
+- :php:`MongoDB\Driver\Manager::executeCommand()
   `
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 2351f5d3..3c45debc 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::createCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::createCollection()
+.. phpmethod:: MongoDB\Database::createCollection()
 
    Explicitly creates a collection.
 
@@ -27,7 +27,7 @@ Definition
    MongoDB creates collections implicitly when you first reference the
    collection in a command, such as when inserting a document into a new
    collection. You may also explicitly create a collection with specific options
-   using the :phpmethod:`MongoDB\\Database::createCollection()` method, or using
+   using the :phpmethod:`MongoDB\Database::createCollection()` method, or using
    :manual:`db.createCollection() ` in
    the MongoDB shell.
 
@@ -195,7 +195,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -322,7 +322,7 @@ Parameters
             .. versionadded:: 1.13
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
diff --git a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
index 390f99c6..e6a266fb 100644
--- a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::createEncryptedCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::createEncryptedCollection()
+.. phpmethod:: MongoDB\Database::createEncryptedCollection()
 
    Explicitly creates an encrypted collection.
 
@@ -31,13 +31,13 @@ Definition
 
    This method will automatically create data keys for any encrypted fields
    where ``keyId`` is ``null``. Data keys will be created using
-   :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `
+   :php:`MongoDB\Driver\ClientEncryption::createDataKey() `
    and the provided ``$kmsProvider`` and ``$masterKey`` parameters. A copy of
    the modified ``encryptedFields`` option will be returned in addition to the
    result from creating the collection.
 
    This method does not affect any auto encryption settings on existing
-   :phpclass:`MongoDB\\Client` objects. Users must configure auto encryption
+   :phpclass:`MongoDB\Client` objects. Users must configure auto encryption
    after creating the encrypted collection with ``createEncryptedCollection()``.
 
 Parameters
@@ -46,18 +46,18 @@ Parameters
 ``$collectionName`` : string
   The name of the encrypted collection to create.
 
-``$clientEncryption`` : :php:`MongoDB\\Driver\\ClientEncryption `
+``$clientEncryption`` : :php:`MongoDB\Driver\ClientEncryption `
   The ClientEncryption object used to create data keys.
 
 ``$kmsProvider`` : string
   KMS provider (e.g. "local", "aws") that will be used to encrypt new data keys.
   This corresponds to the ``$kmsProvider`` parameter for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+  :php:`MongoDB\Driver\ClientEncryption::createDataKey() `.
 
 ``$masterKey`` : array|null
   KMS-specific key options that will be used to encrypt new data keys. This
   corresponds to the ``masterKey`` option for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+  :php:`MongoDB\Driver\ClientEncryption::createDataKey() `.
 
   If ``$kmsProvider`` is "local", this should be ``null``.
 
@@ -65,7 +65,7 @@ Parameters
   An array specifying the desired options.
 
   The ``$options`` parameter supports the same options as
-  :phpmethod:`MongoDB\\Database::createCollection()`. The ``encryptedFields``
+  :phpmethod:`MongoDB\Database::createCollection()`. The ``encryptedFields``
   option is required.
 
 Return Values
@@ -79,7 +79,7 @@ option.
 Errors/Exceptions
 -----------------
 
-:phpclass:`MongoDB\\Exception\\CreateEncryptedCollectionException` if any error
+:phpclass:`MongoDB\Exception\CreateEncryptedCollectionException` if any error
 is encountered creating data keys or the collection. The original exception and
 modified ``encryptedFields`` option can be accessed via the ``getPrevious()``
 and ``getEncryptedFields()`` methods, respectively.
@@ -126,11 +126,11 @@ an encrypted string field.
 If the encrypted collection was successfully created, ``$result`` will contain
 the response document from the ``create`` command and
 ``$encryptedFields['fields'][0]['keyId']`` will contain a
-:php:`MongoDB\\BSON\\Binary ` object with subtype 4
+:php:`MongoDB\BSON\Binary ` object with subtype 4
 (i.e. UUID).
 
 The modified ``encryptedFields`` option can then be used to construct a new
-:phpclass:`MongoDB\\Client` with auto encryption enabled.
+:phpclass:`MongoDB\Client` with auto encryption enabled.
 
 .. code-block:: php
 
@@ -155,8 +155,8 @@ The modified ``encryptedFields`` option can then be used to construct a new
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
-- :phpmethod:`MongoDB\\Client::createClientEncryption()`
-- :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `
+- :phpmethod:`MongoDB\Database::createCollection()`
+- :phpmethod:`MongoDB\Client::createClientEncryption()`
+- :php:`MongoDB\Driver\ClientEncryption::createDataKey() `
 - :manual:`create ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index 457fad1a..da1c8ba0 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::drop()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::drop()
+.. phpmethod:: MongoDB\Database::drop()
 
    Drop the database.
 
@@ -44,7 +44,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -56,7 +56,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
@@ -105,6 +105,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::dropDatabase()`
+- :phpmethod:`MongoDB\Client::dropDatabase()`
 - :manual:`dropDatabase ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 018f3cca..71beda83 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::dropCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::dropCollection()
+.. phpmethod:: MongoDB\Database::dropCollection()
 
    Drop a collection within the current database.
 
@@ -70,7 +70,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -82,7 +82,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
@@ -133,6 +133,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::drop()`
+- :phpmethod:`MongoDB\Collection::drop()`
 - :manual:`drop ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBDatabase-getDatabaseName.txt b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
index 6e3abd96..fcbd0ce8 100644
--- a/source/reference/method/MongoDBDatabase-getDatabaseName.txt
+++ b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::getDatabaseName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getDatabaseName()
+.. phpmethod:: MongoDB\Database::getDatabaseName()
 
    Returns the name of this database.
 
diff --git a/source/reference/method/MongoDBDatabase-getManager.txt b/source/reference/method/MongoDBDatabase-getManager.txt
index 72a2b057..91e013ae 100644
--- a/source/reference/method/MongoDBDatabase-getManager.txt
+++ b/source/reference/method/MongoDBDatabase-getManager.txt
@@ -13,11 +13,11 @@ MongoDB\\Database::getManager()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getManager()
+.. phpmethod:: MongoDB\Database::getManager()
 
    Accessor for the
-   :php:`MongoDB\\Driver\\Manager ` used by this
-   :phpclass:`Database `.
+   :php:`MongoDB\Driver\Manager ` used by this
+   :phpclass:`Database `.
 
    .. code-block:: php
 
@@ -26,10 +26,10 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\Driver\Manager ` object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::getManager()`
-- :phpmethod:`MongoDB\\Collection::getManager()`
+- :phpmethod:`MongoDB\Client::getManager()`
+- :phpmethod:`MongoDB\Collection::getManager()`
diff --git a/source/reference/method/MongoDBDatabase-getReadConcern.txt b/source/reference/method/MongoDBDatabase-getReadConcern.txt
index 56568aa4..4915fcc4 100644
--- a/source/reference/method/MongoDBDatabase-getReadConcern.txt
+++ b/source/reference/method/MongoDBDatabase-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getReadConcern()
+.. phpmethod:: MongoDB\Database::getReadConcern()
 
    Returns the read concern for this database.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -54,7 +54,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBDatabase-getReadPreference.txt b/source/reference/method/MongoDBDatabase-getReadPreference.txt
index 5001455c..633633eb 100644
--- a/source/reference/method/MongoDBDatabase-getReadPreference.txt
+++ b/source/reference/method/MongoDBDatabase-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getReadPreference()
+.. phpmethod:: MongoDB\Database::getReadPreference()
 
    Returns the read preference for this database.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -55,6 +55,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBDatabase-getTypeMap.txt b/source/reference/method/MongoDBDatabase-getTypeMap.txt
index d06c6777..a30f4f0d 100644
--- a/source/reference/method/MongoDBDatabase-getTypeMap.txt
+++ b/source/reference/method/MongoDBDatabase-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getTypeMap()
+.. phpmethod:: MongoDB\Database::getTypeMap()
 
    Returns the type map for this database.
 
@@ -62,6 +62,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBDatabase-getWriteConcern.txt b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
index 55ea09f4..40419a4b 100644
--- a/source/reference/method/MongoDBDatabase-getWriteConcern.txt
+++ b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getWriteConcern()
+.. phpmethod:: MongoDB\Database::getWriteConcern()
 
    Returns the write concern for this database.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -57,7 +57,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBDatabase-listCollectionNames.txt b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
index 53814f72..d094028d 100644
--- a/source/reference/method/MongoDBDatabase-listCollectionNames.txt
+++ b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::listCollectionNames()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::listCollectionNames()
+.. phpmethod:: MongoDB\Database::listCollectionNames()
 
    Returns names for all collections in this database.
 
@@ -68,7 +68,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
@@ -134,7 +134,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::listCollections()`
+- :phpmethod:`MongoDB\Database::listCollections()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
 - `Enumerating Collections
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index d66b6a5f..511b8995 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::listCollections()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::listCollections()
+.. phpmethod:: MongoDB\Database::listCollections()
 
    Returns information for all collections in this database.
 
@@ -66,7 +66,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -74,8 +74,8 @@ Parameters
 Return Values
 -------------
 
-A traversable :phpclass:`MongoDB\\Model\\CollectionInfoIterator`, which contains
-a :phpclass:`MongoDB\\Model\\CollectionInfo` object for each collection in the
+A traversable :phpclass:`MongoDB\Model\CollectionInfoIterator`, which contains
+a :phpclass:`MongoDB\Model\CollectionInfo` object for each collection in the
 database.
 
 Example
@@ -160,7 +160,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::listCollectionNames()`
+- :phpmethod:`MongoDB\Database::listCollectionNames()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
 - `Enumerating Collections
diff --git a/source/reference/method/MongoDBDatabase-modifyCollection.txt b/source/reference/method/MongoDBDatabase-modifyCollection.txt
index 0a756b01..6aa036ff 100644
--- a/source/reference/method/MongoDBDatabase-modifyCollection.txt
+++ b/source/reference/method/MongoDBDatabase-modifyCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::modifyCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::modifyCollection()
+.. phpmethod:: MongoDB\Database::modifyCollection()
 
    Modifies a collection or view according to the specified
    ``$collectionOptions``.
@@ -57,7 +57,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -67,7 +67,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
diff --git a/source/reference/method/MongoDBDatabase-renameCollection.txt b/source/reference/method/MongoDBDatabase-renameCollection.txt
index 778dc10a..8c07952d 100644
--- a/source/reference/method/MongoDBDatabase-renameCollection.txt
+++ b/source/reference/method/MongoDBDatabase-renameCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::renameCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::renameCollection()
+.. phpmethod:: MongoDB\Database::renameCollection()
 
    Rename a collection within the current database.
 
@@ -68,7 +68,7 @@ Parameters
          collection. The default value is ``false``.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -78,7 +78,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
@@ -126,6 +126,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::rename()`
+- :phpmethod:`MongoDB\Collection::rename()`
 - :manual:`renameCollection ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 887d4a4d..854298e0 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::selectCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::selectCollection()
+.. phpmethod:: MongoDB\Database::selectCollection()
 
    Selects a collection within the database.
 
@@ -42,12 +42,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the database's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the database's read preference.
 
@@ -57,14 +57,14 @@ Parameters
          database's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults to
          the database's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Errors/Exceptions
 -----------------
@@ -75,7 +75,7 @@ Behavior
 --------
 
 The selected collection inherits options such as read preference and type
-mapping from the :phpclass:`Database ` object. Options may be
+mapping from the :phpclass:`Database ` object. Options may be
 overridden via the ``$options`` parameter.
 
 Example
@@ -110,6 +110,6 @@ database with a custom read preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::__get()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
-- :phpmethod:`MongoDB\\Collection::__construct()`
+- :phpmethod:`MongoDB\Database::__get()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
+- :phpmethod:`MongoDB\Collection::__construct()`
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index 0d115d9b..9cebd3fc 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::selectGridFSBucket()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::selectGridFSBucket()
+.. phpmethod:: MongoDB\Database::selectGridFSBucket()
 
    Selects a GridFS bucket within the database.
 
@@ -53,12 +53,12 @@ Parameters
          .. versionadded: 1.4
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for bucket operations. Defaults to the
          database's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for bucket operations. Defaults to
          the database's read concern.
 
@@ -68,14 +68,14 @@ Parameters
          database's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for bucket operations. Defaults to the
          database's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\GridFS\\Bucket` object.
+A :phpclass:`MongoDB\GridFS\Bucket` object.
 
 Errors/Exceptions
 -----------------
@@ -86,7 +86,7 @@ Behavior
 --------
 
 The selected bucket inherits options such as read preference and type
-mapping from the :phpclass:`Database ` object. Options may be
+mapping from the :phpclass:`Database ` object. Options may be
 overridden via the ``$options`` parameter.
 
 Example
@@ -120,4 +120,4 @@ database with a custom read preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
+- :phpmethod:`MongoDB\GridFS\Bucket::__construct()`
diff --git a/source/reference/method/MongoDBDatabase-watch.txt b/source/reference/method/MongoDBDatabase-watch.txt
index c79656ec..396e5cfd 100644
--- a/source/reference/method/MongoDBDatabase-watch.txt
+++ b/source/reference/method/MongoDBDatabase-watch.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::watch()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::watch()
+.. phpmethod:: MongoDB\Database::watch()
 
    Executes a :manual:`change stream ` operation on the
    database. The change stream can be watched for database-level changes.
@@ -73,11 +73,11 @@ Parameters
        - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/database-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/database-option-readPreference.rst
 
          This is used for both the initial change stream aggregation and for
@@ -88,7 +88,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-resumeAfter.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - showExpandedEvents
@@ -100,7 +100,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-startAfter.rst
 
      * - startAtOperationTime
-       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - :php:`MongoDB\BSON\TimestampInterface `
        - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
      * - typeMap
@@ -110,7 +110,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+A :phpclass:`MongoDB\ChangeStream` object, which allows for iteration of
 events in the change stream via the :php:`Iterator ` interface.
 
 Errors/Exceptions
@@ -188,8 +188,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index fc5d88ec..f601a977 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::withOptions()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::withOptions()
+.. phpmethod:: MongoDB\Database::withOptions()
 
    Returns a clone of the Database object, but with different options.
 
@@ -36,12 +36,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for database operations. Defaults to
          the original database's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for database operations. Defaults to
          the original database's read preference.
 
@@ -53,14 +53,14 @@ Parameters
          to PHP values. Defaults to the original database's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for database operations. Defaults to
          the original database's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\Database` object.
 
 Errors/Exceptions
 -----------------
@@ -86,4 +86,4 @@ preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\Database::__construct()`
diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt
index 0a715e99..cf52a134 100644
--- a/source/reference/method/MongoDBDatabase__construct.txt
+++ b/source/reference/method/MongoDBDatabase__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\Database::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::__construct()
+.. phpmethod:: MongoDB\Database::__construct()
 
-   Constructs a new :phpclass:`Database ` instance.
+   Constructs a new :phpclass:`Database ` instance.
 
    .. code-block:: php
 
@@ -28,7 +28,7 @@ Definition
 Parameters
 ----------
 
-``$manager`` : :php:`MongoDB\\Driver\\Manager `
+``$manager`` : :php:`MongoDB\Driver\Manager `
   The :php:`Manager ` instance from the driver. The
   manager maintains connections between the driver and your MongoDB instances.
 
@@ -47,12 +47,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for database operations. Defaults to
          the manager's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for database operations. Defaults to
          the manager's read preference.
 
@@ -72,7 +72,7 @@ Parameters
             ]
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for database operations. Defaults to
          the manager's write concern.
 
@@ -85,13 +85,13 @@ Behavior
 --------
 
 If you construct a Database explicitly, the Database inherits any options from
-the :php:`MongoDB\\Driver\\Manager ` object. If
-you select the Database from a :phpclass:`Client ` object, the
+the :php:`MongoDB\Driver\Manager ` object. If
+you select the Database from a :phpclass:`Client ` object, the
 Database inherits its options from that object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::withOptions()`
-- :phpmethod:`MongoDB\\Client::selectDatabase()`
-- :phpmethod:`MongoDB\\Client::__get()`
+- :phpmethod:`MongoDB\Database::withOptions()`
+- :phpmethod:`MongoDB\Client::selectDatabase()`
+- :phpmethod:`MongoDB\Client::__get()`
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index c888a716..e71c42d4 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::__get()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::__get()
+.. phpmethod:: MongoDB\Database::__get()
 
    Select a collection within the database.
 
@@ -30,14 +30,14 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Behavior
 --------
 
 The selected collection inherits options such as read preference and type
-mapping from the :phpclass:`Database ` object. If you wish to
-override any options, use the :phpmethod:`MongoDB\\Database::selectCollection()`
+mapping from the :phpclass:`Database ` object. If you wish to
+override any options, use the :phpmethod:`MongoDB\Database::selectCollection()`
 method.
 
 .. note::
@@ -45,7 +45,7 @@ method.
    To select collections whose names contain special characters, such as
    ``.``, use complex syntax, as in ``$database->{'that.database'}``.
 
-   Alternatively, :phpmethod:`MongoDB\\Database::selectCollection()` supports
+   Alternatively, :phpmethod:`MongoDB\Database::selectCollection()` supports
    selecting collections whose names contain special characters.
 
 Examples
@@ -66,6 +66,6 @@ collections from the ``test`` database:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::selectCollection()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
 - :php:`Property Overloading ` in the PHP Manual
diff --git a/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt b/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
index dcda2574..02810569 100644
--- a/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
+++ b/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\DeleteResult::getDeletedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\DeleteResult::getDeletedCount()
+.. phpmethod:: MongoDB\DeleteResult::getDeletedCount()
 
    Return the number of documents that were deleted.
 
@@ -36,5 +36,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getDeletedCount()
+- :php:`MongoDB\Driver\WriteResult::getDeletedCount()
   `
diff --git a/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt b/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
index a82fa523..5e3cbb4e 100644
--- a/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\DeleteResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\DeleteResult::isAcknowledged()
+.. phpmethod:: MongoDB\DeleteResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBGridFSBucket-delete.txt b/source/reference/method/MongoDBGridFSBucket-delete.txt
index 731fb4e4..9c876c60 100644
--- a/source/reference/method/MongoDBGridFSBucket-delete.txt
+++ b/source/reference/method/MongoDBGridFSBucket-delete.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::delete()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::delete()
+.. phpmethod:: MongoDB\GridFS\Bucket::delete()
 
    Delete a file and its chunks from the GridFS bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
index 917f03b5..217fc262 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::downloadToStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::downloadToStream()
 
    Selects a GridFS file by its ``_id`` and copies its contents to a writable
    stream.
@@ -68,6 +68,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index 8bd4a1d6..d520793a 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::downloadToStreamByName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStreamByName()
+.. phpmethod:: MongoDB\GridFS\Bucket::downloadToStreamByName()
 
    Selects a GridFS file by its ``filename`` and copies its contents to a
    writable stream.
@@ -99,6 +99,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-drop.txt b/source/reference/method/MongoDBGridFSBucket-drop.txt
index 53a10091..324db854 100644
--- a/source/reference/method/MongoDBGridFSBucket-drop.txt
+++ b/source/reference/method/MongoDBGridFSBucket-drop.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::drop()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::drop()
+.. phpmethod:: MongoDB\GridFS\Bucket::drop()
 
    Drops the files and chunks collections associated with this GridFS bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index d112dd66..bfd57089 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::find()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::find()
+.. phpmethod:: MongoDB\GridFS\Bucket::find()
 
    Finds documents from the GridFS bucket's files collection matching the query.
 
@@ -156,7 +156,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -171,13 +171,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/bucket-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/bucket-option-readPreference.rst
 
      * - returnKey
@@ -187,7 +187,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -222,7 +222,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\Driver\Cursor ` object.
 
 Errors/Exceptions
 -----------------
@@ -285,5 +285,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::find()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::findOne()`
+- :phpmethod:`MongoDB\Collection::find()`
+- :phpmethod:`MongoDB\GridFS\Bucket::findOne()`
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
index 1ff9f258..89877e3a 100644
--- a/source/reference/method/MongoDBGridFSBucket-findOne.txt
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::findOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::findOne()
+.. phpmethod:: MongoDB\GridFS\Bucket::findOne()
 
    Finds a single document from the GridFS bucket's files collection matching
    the query.
@@ -114,7 +114,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -129,13 +129,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/bucket-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/bucket-option-readPreference.rst
 
      * - returnKey
@@ -145,7 +145,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -236,5 +236,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOne()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::find()`
+- :phpmethod:`MongoDB\Collection::findOne()`
+- :phpmethod:`MongoDB\GridFS\Bucket::find()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
index 52ea9249..96a61c4d 100644
--- a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getBucketName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getBucketName()
+.. phpmethod:: MongoDB\GridFS\Bucket::getBucketName()
 
    Returns the name of this bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
index 16116e56..2a9ff6da 100644
--- a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getChunkSizeBytes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getChunkSizeBytes()
+.. phpmethod:: MongoDB\GridFS\Bucket::getChunkSizeBytes()
 
    Returns the chunk size of this bucket in bytes.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
index 36dbd8a5..ce1c97b9 100644
--- a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getChunksCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getChunksCollection()
+.. phpmethod:: MongoDB\GridFS\Bucket::getChunksCollection()
 
    Returns the chunks collection used by the bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object for the chunks collection.
+A :phpclass:`MongoDB\Collection` object for the chunks collection.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
index 0b6dd8e0..22703fdd 100644
--- a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getDatabaseName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getDatabaseName()
+.. phpmethod:: MongoDB\GridFS\Bucket::getDatabaseName()
 
    Returns the name of the database containing this bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index fa8625f9..9dc275ca 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getFileDocumentForStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileDocumentForStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::getFileDocumentForStream()
 
    Gets the file document of the GridFS file associated with a stream.
 
@@ -78,4 +78,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileIdForStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index b42ab19b..0107b3d8 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getFileIdForStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileIdForStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::getFileIdForStream()
 
    Gets the file document's ID of the GridFS file associated with a stream.
 
@@ -69,4 +69,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileDocumentForStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
index 57813ad6..510cfad1 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getFilesCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getFilesCollection()
+.. phpmethod:: MongoDB\GridFS\Bucket::getFilesCollection()
 
    Returns the files collection used by the bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object for the files collection.
+A :phpclass:`MongoDB\Collection` object for the files collection.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
index 7b12c051..d1d4c610 100644
--- a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getReadConcern()
+.. phpmethod:: MongoDB\GridFS\Bucket::getReadConcern()
 
    Returns the read concern for this GridFS bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -55,7 +55,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
index 532a6e23..6843cc93 100644
--- a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getReadPreference()
+.. phpmethod:: MongoDB\GridFS\Bucket::getReadPreference()
 
    Returns the read preference for this GridFS bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -56,6 +56,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
index 7d9a309a..1005f2a2 100644
--- a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getTypeMap()
+.. phpmethod:: MongoDB\GridFS\Bucket::getTypeMap()
 
    Returns the type map for this GridFS bucket.
 
@@ -63,6 +63,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
index 77303b92..21e535af 100644
--- a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getWriteConcern()
+.. phpmethod:: MongoDB\GridFS\Bucket::getWriteConcern()
 
    Returns the write concern for this GridFS bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -58,7 +58,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
index 9118cecc..bfabc282 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::openDownloadStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::openDownloadStream()
 
    Selects a GridFS file by its ``_id`` and opens it as a readable stream.
 
@@ -66,6 +66,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
index 4c0b525d..287cf4b5 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::openDownloadStreamByName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStreamByName()
+.. phpmethod:: MongoDB\GridFS\Bucket::openDownloadStreamByName()
 
    Selects a GridFS file by its ``filename`` and opens it as a readable stream.
 
@@ -94,6 +94,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 2870b544..24baebde 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::openUploadStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::openUploadStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::openUploadStream()
 
    Opens a writable stream for a new GridFS file.
 
@@ -44,7 +44,7 @@ Parameters
      * - _id
        - mixed
        - Value to use as the file document identifier. Defaults to a new
-         :php:`MongoDB\\BSON\\ObjectId ` object.
+         :php:`MongoDB\BSON\ObjectId ` object.
 
      * - chunkSizeBytes
        - integer
@@ -100,4 +100,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::uploadFromStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt
index 20d9c1d7..75545a8a 100644
--- a/source/reference/method/MongoDBGridFSBucket-rename.txt
+++ b/source/reference/method/MongoDBGridFSBucket-rename.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::rename()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::rename()
+.. phpmethod:: MongoDB\GridFS\Bucket::rename()
 
    Selects a GridFS file by its ``_id`` and alters its ``filename``.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index 89cb8d2f..0ba54e9f 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::uploadFromStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::uploadFromStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::uploadFromStream()
 
    Creates a new GridFS file and copies the contents of a readable stream to it.
 
@@ -48,7 +48,7 @@ Parameters
      * - _id
        - mixed
        - Value to use as the file document identifier. Defaults to a new
-         :php:`MongoDB\\BSON\\ObjectId ` object.
+         :php:`MongoDB\BSON\ObjectId ` object.
 
      * - chunkSizeBytes
        - integer
@@ -73,7 +73,7 @@ Return Values
 
 The ``_id`` field of the metadata document associated with the newly created
 GridFS file. If the ``_id`` option is not specified, a new
-:php:`MongoDB\\BSON\\ObjectId ` object will be used
+:php:`MongoDB\BSON\ObjectId ` object will be used
 by default.
 
 Errors/Exceptions
@@ -111,4 +111,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openUploadStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index 25271e0c..766e8650 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\GridFS\\Bucket::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::__construct()
+.. phpmethod:: MongoDB\GridFS\Bucket::__construct()
 
-   Constructs a new :phpclass:`Bucket ` instance.
+   Constructs a new :phpclass:`Bucket ` instance.
 
    .. code-block:: php
 
@@ -28,7 +28,7 @@ Definition
 Parameters
 ----------
 
-``$manager`` : :php:`MongoDB\\Driver\\Manager `
+``$manager`` : :php:`MongoDB\Driver\Manager `
   The :php:`Manager ` instance from the driver. The
   manager maintains connections between the driver and your MongoDB instances.
 
@@ -64,12 +64,12 @@ Parameters
          .. versionadded: 1.4
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for bucket operations. Defaults to the
          manager's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for bucket operations. Defaults to
          the manager's read preference.
 
@@ -89,7 +89,7 @@ Parameters
             ]
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for bucket operations. Defaults to the
          manager's write concern.
 
@@ -102,8 +102,8 @@ Behavior
 --------
 
 If you construct a Bucket explicitly, the Bucket inherits any options
-from the :php:`MongoDB\\Driver\\Manager ` object.
-If you select the Bucket from a :phpclass:`Database ` object,
+from the :php:`MongoDB\Driver\Manager ` object.
+If you select the Bucket from a :phpclass:`Database ` object,
 the Bucket inherits its options from that object.
 
 Examples
@@ -131,4 +131,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::selectGridFSBucket()`
+- :phpmethod:`MongoDB\Database::selectGridFSBucket()`
diff --git a/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt b/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
index 9297008b..f114b456 100644
--- a/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
+++ b/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertManyResult::getInsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertManyResult::getInsertedCount()
+.. phpmethod:: MongoDB\InsertManyResult::getInsertedCount()
 
    Return the number of documents that were inserted.
 
@@ -36,5 +36,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getInsertedCount()
   `
diff --git a/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt b/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
index 75c63870..bf30e28b 100644
--- a/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
+++ b/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertManyResult::getInsertedIds()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertManyResult::getInsertedIds()
+.. phpmethod:: MongoDB\InsertManyResult::getInsertedIds()
 
    Return a map of IDs (i.e. ``_id`` field values) for the inserted documents.
 
@@ -32,5 +32,5 @@ A map of IDs (i.e. ``_id`` field values) for the inserted documents.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to inserting (i.e. the driver did
 not generate an ID), the index will contain its ``_id`` field value. Any
-driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
+driver-generated ID will be a :php:`MongoDB\BSON\ObjectId
 ` instance.
diff --git a/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt b/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
index db376e5f..2589edb4 100644
--- a/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertManyResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertManyResult::isAcknowledged()
+.. phpmethod:: MongoDB\InsertManyResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt b/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
index 35508015..d6ba1279 100644
--- a/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
+++ b/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertOneResult::getInsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertOneResult::getInsertedCount()
+.. phpmethod:: MongoDB\InsertOneResult::getInsertedCount()
 
    Return the number of documents that were inserted.
 
@@ -37,5 +37,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getInsertedCount()
   `
diff --git a/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt b/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
index 8d4a01dd..e3cef55d 100644
--- a/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
+++ b/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertOneResult::getInsertedId()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertOneResult::getInsertedId()
+.. phpmethod:: MongoDB\InsertOneResult::getInsertedId()
 
    Return the ID (i.e. ``_id`` field value) for the inserted document.
 
@@ -31,5 +31,5 @@ The ID (i.e. ``_id`` field value) of the inserted document.
 
 If the document had an ID prior to inserting (i.e. the driver did not need to
 generate an ID), this will contain its ``_id`` field value. Any driver-generated
-ID will be a :php:`MongoDB\\BSON\\ObjectId `
+ID will be a :php:`MongoDB\BSON\ObjectId `
 instance.
diff --git a/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt b/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
index 921e3a61..3e4505cd 100644
--- a/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertOneResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertOneResult::isAcknowledged()
+.. phpmethod:: MongoDB\InsertOneResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBMapReduceResult-getCounts.txt b/source/reference/method/MongoDBMapReduceResult-getCounts.txt
index 35c738dd..50cae3ef 100644
--- a/source/reference/method/MongoDBMapReduceResult-getCounts.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getCounts.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getCounts()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getCounts()
+.. phpmethod:: MongoDB\MapReduceResult::getCounts()
 
    Returns count statistics for the map-reduce operation.
 
@@ -63,6 +63,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :manual:`mapReduce ` command reference in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt b/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
index 05b6bbc1..fd094fed 100644
--- a/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getExecutionTimeMS()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getExecutionTimeMS()
+.. phpmethod:: MongoDB\MapReduceResult::getExecutionTimeMS()
 
    Returns the execution time in milliseconds of the map-reduce operation.
 
@@ -55,6 +55,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :manual:`mapReduce ` command reference in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBMapReduceResult-getIterator.txt b/source/reference/method/MongoDBMapReduceResult-getIterator.txt
index cb459cde..9de94895 100644
--- a/source/reference/method/MongoDBMapReduceResult-getIterator.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getIterator.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getIterator()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getIterator()
+.. phpmethod:: MongoDB\MapReduceResult::getIterator()
 
    Returns a :php:`Traversable `, which may be used to iterate
    through the results of the map-reduce operation.
@@ -81,5 +81,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :php:`IteratorAggregate::getIterator() `
diff --git a/source/reference/method/MongoDBMapReduceResult-getTiming.txt b/source/reference/method/MongoDBMapReduceResult-getTiming.txt
index 0492b3be..98268285 100644
--- a/source/reference/method/MongoDBMapReduceResult-getTiming.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getTiming.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getTiming()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getTiming()
+.. phpmethod:: MongoDB\MapReduceResult::getTiming()
 
    Returns timing statistics for the map-reduce operation.
 
@@ -22,7 +22,7 @@ Definition
       function getTiming(): array
 
    Timing statistics will only be available if the ``verbose`` option was
-   specified for :phpmethod:`MongoDB\\Collection::mapReduce()`.
+   specified for :phpmethod:`MongoDB\Collection::mapReduce()`.
 
 Return Values
 -------------
@@ -34,7 +34,7 @@ Examples
 --------
 
 This example specifies the ``verbose`` option for
-:phpmethod:`MongoDB\\Collection::mapReduce()` and reports the timing statistics
+:phpmethod:`MongoDB\Collection::mapReduce()` and reports the timing statistics
 for a map-reduce operation.
 
 .. code-block:: php
@@ -71,6 +71,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :manual:`mapReduce ` command reference in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
index dcd8e703..0b86f350 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
@@ -15,10 +15,10 @@ MongoDB\\Model\\CollectionInfo::getCappedMax()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedMax()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getCappedMax()
 
    Return the document limit for the capped collection. This correlates with the
-   ``max`` option for :phpmethod:`MongoDB\\Database::createCollection()`.
+   ``max`` option for :phpmethod:`MongoDB\Database::createCollection()`.
 
    .. code-block:: php
 
@@ -31,7 +31,7 @@ The document limit for the capped collection. If the collection is not capped,
 ``null`` will be returned.
 
 This method is deprecated in favor of using
-:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the
+:phpmethod:`MongoDB\Model\CollectionInfo::getOptions()` and accessing the
 ``max`` key.
 
 Examples
@@ -61,9 +61,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::isCapped()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`Capped Collections ` in the MongoDB manual
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
index 62732aa4..9b0101aa 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
@@ -15,11 +15,11 @@ MongoDB\\Model\\CollectionInfo::getCappedSize()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedSize()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getCappedSize()
 
    Return the size limit for the capped collection in bytes. This correlates
    with the ``size`` option for
-   :phpmethod:`MongoDB\\Database::createCollection()`.
+   :phpmethod:`MongoDB\Database::createCollection()`.
 
    .. code-block:: php
 
@@ -32,7 +32,7 @@ The size limit for the capped collection in bytes. If the collection is not
 capped, ``null`` will be returned.
 
 This method is deprecated in favor of using
-:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the
+:phpmethod:`MongoDB\Model\CollectionInfo::getOptions()` and accessing the
 ``size`` key.
 
 Examples
@@ -61,9 +61,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::isCapped()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`Capped Collections ` in the MongoDB manual
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt b/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt
index 4fa22dc0..73f47668 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::getIdIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getIdIndex()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getIdIndex()
 
    Returns information about the ``_id`` field index.
 
@@ -70,6 +70,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt b/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt
index 4d4f19ff..efdc1182 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::getInfo()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getInfo()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getInfo()
 
    Returns additional information about the collection.
 
@@ -56,6 +56,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getName.txt b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
index d3104af8..83a74b2b 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getName.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\CollectionInfo::getName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getName()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getName()
 
    Return the collection name.
 
@@ -47,6 +47,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
index 3ffac1db..d438b44b 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
@@ -13,10 +13,10 @@ MongoDB\\Model\\CollectionInfo::getOptions()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getOptions()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getOptions()
 
    Return the collection options. This correlates with the options for
-   :phpmethod:`MongoDB\\Database::createCollection()`, but may include
+   :phpmethod:`MongoDB\Database::createCollection()`, but may include
    additional fields set by the server.
 
    .. code-block:: php
@@ -60,6 +60,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getType.txt b/source/reference/method/MongoDBModelCollectionInfo-getType.txt
index 9fdf5c99..39a6c442 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getType.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getType.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::getType()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getType()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getType()
 
    Return the collection type.
 
@@ -49,6 +49,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
index a6067e0a..aa70df80 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::isCapped()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::isCapped()
+.. phpmethod:: MongoDB\Model\CollectionInfo::isCapped()
 
    Return whether the collection is a :manual:`capped collection
    `.
@@ -30,7 +30,7 @@ Return Values
 A boolean indicating whether the collection is a capped collection.
 
 This method is deprecated in favor of using
-:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the
+:phpmethod:`MongoDB\Model\CollectionInfo::getOptions()` and accessing the
 ``capped`` key.
 
 Examples
@@ -59,8 +59,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedSize()`
 - :manual:`Capped Collections ` in the MongoDB manual
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
index 6f82a77a..4ef37321 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\DatabaseInfo::getName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getName()
+.. phpmethod:: MongoDB\Model\DatabaseInfo::getName()
 
    Return the database name.
 
@@ -46,6 +46,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::getDatabaseName()`
+- :phpmethod:`MongoDB\Database::getDatabaseName()`
 - :manual:`listDatabases ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
index 8c3a0b0b..3af6ef48 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()
+.. phpmethod:: MongoDB\Model\DatabaseInfo::getSizeOnDisk()
 
    Return the total size of the database file on disk in bytes.
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
index 1c68299e..72849b8e 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\DatabaseInfo::isEmpty()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\DatabaseInfo::isEmpty()
+.. phpmethod:: MongoDB\Model\DatabaseInfo::isEmpty()
 
    Return whether the database has any data.
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getKey.txt b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
index ff416f91..0925428f 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getKey.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::getKey()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getKey()
+.. phpmethod:: MongoDB\Model\IndexInfo::getKey()
 
    Return the index specification (i.e. indexed field(s) and order). This
    correlates with the ``$key`` parameter for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -53,6 +53,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getName.txt b/source/reference/method/MongoDBModelIndexInfo-getName.txt
index b37c6621..4404964d 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getName.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getName.txt
@@ -13,10 +13,10 @@ MongoDB\\Model\\IndexInfo::getName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getName()
+.. phpmethod:: MongoDB\Model\IndexInfo::getName()
 
    Return the index name. This correlates with the return value of
-   :phpmethod:`MongoDB\\Collection::createIndex()`. An index name may be derived
+   :phpmethod:`MongoDB\Collection::createIndex()`. An index name may be derived
    from the ``$key`` parameter or explicitly specified via the ``name`` option.
 
    .. code-block:: php
@@ -50,6 +50,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
index f4bb7a59..099a1830 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\IndexInfo::getNamespace()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getNamespace()
+.. phpmethod:: MongoDB\Model\IndexInfo::getNamespace()
 
    Return the index namespace, which is the namespace of the collection
    containing the index.
@@ -49,7 +49,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
index 96a22770..cd0d1bb4 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\IndexInfo::getVersion()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getVersion()
+.. phpmethod:: MongoDB\Model\IndexInfo::getVersion()
 
    Return the index version.
 
@@ -48,6 +48,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt b/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
index 017e6e7b..27fd3f9a 100644
--- a/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\IndexInfo::is2dSphere()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::is2dSphere()
+.. phpmethod:: MongoDB\Model\IndexInfo::is2dSphere()
 
    Return whether the index is a :manual:`2dsphere `
    index.
@@ -55,7 +55,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
 - :manual:`2dsphere Indexes ` reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
index f6c2007d..87b7a53d 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
@@ -18,7 +18,7 @@ MongoDB\\Model\\IndexInfo::isGeoHaystack()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isGeoHaystack()
+.. phpmethod:: MongoDB\Model\IndexInfo::isGeoHaystack()
 
    Return whether the index is a :manual:`geoHaystack `
    index.
@@ -58,7 +58,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
 - :manual:`geoHaystack Indexes ` reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
index 533793c9..22c307ab 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::isSparse()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isSparse()
+.. phpmethod:: MongoDB\Model\IndexInfo::isSparse()
 
    Return whether the index is a :manual:`sparse index `.
    This correlates with the ``sparse`` option for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -50,7 +50,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
 - :manual:`Sparse Indexes ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isText.txt b/source/reference/method/MongoDBModelIndexInfo-isText.txt
index 7e0488f5..b600ebdd 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isText.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isText.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\IndexInfo::isText()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isText()
+.. phpmethod:: MongoDB\Model\IndexInfo::isText()
 
    Return whether the index is a :manual:`text ` index.
 
@@ -54,7 +54,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
 - :manual:`Text Indexes ` reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
index a33a22b9..ef417942 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::isTtl()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isTtl()
+.. phpmethod:: MongoDB\Model\IndexInfo::isTtl()
 
    Return whether the index is a :manual:`TTL index `. This
    correlates with the ``expireAfterSeconds`` option for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -50,7 +50,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
 - :manual:`TTL Indexes ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
index ef61e7c3..12d8b45c 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::isUnique()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isUnique()
+.. phpmethod:: MongoDB\Model\IndexInfo::isUnique()
 
    Return whether the index is a :manual:`unique index `.
    This correlates with the ``unique`` option for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -50,7 +50,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
 - :manual:`Unique Indexes ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt b/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
index f347a8cf..077cddd8 100644
--- a/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
+++ b/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getMatchedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getMatchedCount()
+.. phpmethod:: MongoDB\UpdateResult::getMatchedCount()
 
    Return the number of documents that were matched.
 
@@ -44,6 +44,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\UpdateResult::getModifiedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getMatchedCount()
+- :phpmethod:`MongoDB\UpdateResult::getModifiedCount()`
+- :php:`MongoDB\Driver\WriteResult::getMatchedCount()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt b/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
index 3e2a7a6e..5c8bfe73 100644
--- a/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
+++ b/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getModifiedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getModifiedCount()
+.. phpmethod:: MongoDB\UpdateResult::getModifiedCount()
 
    Return the number of documents that were modified.
 
@@ -28,7 +28,7 @@ Definition
       If an update/replace operation results in no change to the document
       (e.g. setting the value of a field to its current value), the modified
       count may be less than the value returned by :phpmethod:`getMatchedCount()
-      `.
+      `.
 
 Return Values
 -------------
@@ -43,6 +43,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\UpdateResult::getMatchedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getModifiedCount()
+- :phpmethod:`MongoDB\UpdateResult::getMatchedCount()`
+- :php:`MongoDB\Driver\WriteResult::getModifiedCount()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt b/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
index 0bbb39fb..7074696e 100644
--- a/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
+++ b/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getUpsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getUpsertedCount()
+.. phpmethod:: MongoDB\UpdateResult::getUpsertedCount()
 
    Return the number of documents that were upserted.
 
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedCount()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt b/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
index 52498708..d9200778 100644
--- a/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
+++ b/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getUpsertedId()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getUpsertedId()
+.. phpmethod:: MongoDB\UpdateResult::getUpsertedId()
 
    Return the ID (i.e. ``_id`` field value) of the upserted document.
 
@@ -29,7 +29,7 @@ upserted, ``null`` will be returned.
 
 If the document had an ID prior to upserting (i.e. the server did not need to
 generate an ID), this will contain its ``_id`` field value. Any server-generated
-ID will be a :php:`MongoDB\\BSON\\ObjectId `
+ID will be a :php:`MongoDB\BSON\ObjectId `
 instance.
 
 Errors/Exceptions
@@ -40,5 +40,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedIds()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedIds()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt b/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
index af15d1f1..2e7c7b05 100644
--- a/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::isAcknowledged()
+.. phpmethod:: MongoDB\UpdateResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/tutorial/client-side-encryption.txt b/source/tutorial/client-side-encryption.txt
index efff2e7d..2b5aca6c 100644
--- a/source/tutorial/client-side-encryption.txt
+++ b/source/tutorial/client-side-encryption.txt
@@ -23,7 +23,7 @@ Creating an Encryption Key
    such as AWS KMS are also an option. This master key is used to encrypt data
    keys that are stored locally. It is important that you keep this key secure.
 
-To create an encryption key, create a :php:`MongoDB\\Driver\\ClientEncryption `
+To create an encryption key, create a :php:`MongoDB\Driver\ClientEncryption `
 instance with encryption options and create a new data key. The method will
 return the key ID which can be used to reference the key later. You can also
 pass multiple alternate names for this key and reference the key by these names
diff --git a/source/tutorial/collation.txt b/source/tutorial/collation.txt
index 28225db0..172b934a 100644
--- a/source/tutorial/collation.txt
+++ b/source/tutorial/collation.txt
@@ -196,7 +196,7 @@ A collection called ``names`` contains the following documents:
    { "_id" : 4, "first_name" : "Jürgen" }
 
 The following :phpmethod:`findOneAndUpdate()
-` operation on the collection does not
+` operation on the collection does not
 specify a collation.
 
 .. code-block:: php
@@ -214,7 +214,7 @@ Because ``Gunter`` is lexically first in the collection, the above operation
 returns no results and updates no documents.
 
 Consider the same :phpmethod:`findOneAndUpdate()
-` operation but with a collation
+` operation but with a collation
 specified, which uses the locale ``de@collation=phonebook``.
 
 .. note::
@@ -349,7 +349,7 @@ Aggregation
 ~~~~~~~~~~~
 
 To use collation with an :phpmethod:`aggregate()
-` operation, specify a collation in the
+` operation, specify a collation in the
 aggregation options.
 
 The following aggregation example uses a collection called ``names`` and groups
diff --git a/source/tutorial/commands.txt b/source/tutorial/commands.txt
index bccf7462..3efa999e 100644
--- a/source/tutorial/commands.txt
+++ b/source/tutorial/commands.txt
@@ -14,14 +14,14 @@ Overview
 --------
 
 The |php-library| provides helper methods across the :phpclass:`Client
-`, :phpclass:`Database `, and
-:phpclass:`Collection ` classes for common
+`, :phpclass:`Database `, and
+:phpclass:`Collection ` classes for common
 :manual:`database commands `. In addition, the
-:phpmethod:`MongoDB\\Database::command()` method may be used to run database
+:phpmethod:`MongoDB\Database::command()` method may be used to run database
 commands that do not have a helper method.
 
-The :phpmethod:`MongoDB\\Database::command()` method always returns a
-:php:`MongoDB\\Driver\\Cursor ` object, since it must
+The :phpmethod:`MongoDB\Database::command()` method always returns a
+:php:`MongoDB\Driver\Cursor ` object, since it must
 support execution of commands that return single result documents *and* multiple
 results via a command cursor.
 
@@ -63,7 +63,7 @@ example executes :manual:`listCollections `,
 which returns a cursor containing a result document for each collection in the
 ``test`` database, and iterates through the results using a ``foreach`` loop.
 Note that this example is illustrative; applications would generally use
-:phpmethod:`MongoDB\\Database::listCollections()` in practice.
+:phpmethod:`MongoDB\Database::listCollections()` in practice.
 
 .. code-block:: php
 
@@ -103,8 +103,8 @@ Specifying a Custom Read Preference
 Write commands, such as :manual:`createUser `,
 can only be executed on a writable server (e.g. :term:`primary` replica set
 member). Command helper methods in the |php-library|, such as
-:phpmethod:`MongoDB\\Database::drop()`, know to apply their own :term:`read
-preference` if necessary. However, the :phpmethod:`MongoDB\\Database::command()`
+:phpmethod:`MongoDB\Database::drop()`, know to apply their own :term:`read
+preference` if necessary. However, the :phpmethod:`MongoDB\Database::command()`
 method is a generic method and defaults to the read preference of the Database
 object on which it is invoked. When necessary, the ``readPreference`` option may
 be used to override the default read preference.
diff --git a/source/tutorial/connecting.txt b/source/tutorial/connecting.txt
index c964362a..cffd19ef 100644
--- a/source/tutorial/connecting.txt
+++ b/source/tutorial/connecting.txt
@@ -22,4 +22,4 @@ Specifying connection options
 
 Connection options can be passed via the ``$uri`` parameter, or through the
 ``$options`` and ``$driverOptions`` parameters. The available options are
-documented in the :phpmethod:`MongoDB\\Client::__construct()` reference.
+documented in the :phpmethod:`MongoDB\Client::__construct()` reference.
diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index 3abbf579..a69ec662 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -12,7 +12,7 @@ CRUD Operations
 
 
 CRUD operations *create*, *read*, *update*, and *delete* documents. The
-|php-library|'s :phpclass:`MongoDB\\Collection` class implements MongoDB's
+|php-library|'s :phpclass:`MongoDB\Collection` class implements MongoDB's
 cross-driver `CRUD specification
 `_,
 providing access to methods for inserting, finding, updating, and deleting
@@ -29,9 +29,9 @@ Insert Documents
 Insert One Document
 ~~~~~~~~~~~~~~~~~~~
 
-The :phpmethod:`MongoDB\\Collection::insertOne()` method inserts a single
+The :phpmethod:`MongoDB\Collection::insertOne()` method inserts a single
 document into MongoDB and returns an instance of
-:phpclass:`MongoDB\\InsertOneResult`, which you can use to access the ID of the
+:phpclass:`MongoDB\InsertOneResult`, which you can use to access the ID of the
 inserted document.
 
 .. this uses the insertOne example from the method reference:
@@ -70,14 +70,14 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::insertOne()`
+   :phpmethod:`MongoDB\Collection::insertOne()`
 
 Insert Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-The :phpmethod:`MongoDB\\Collection::insertMany()` method allows you to insert
+The :phpmethod:`MongoDB\Collection::insertMany()` method allows you to insert
 multiple documents in one write operation and returns an instance of
-:phpclass:`MongoDB\\InsertManyResult`, which you can use to access the IDs of
+:phpclass:`MongoDB\InsertManyResult`, which you can use to access the IDs of
 the inserted documents.
 
 .. this uses the insertMany example from the method reference:
@@ -88,14 +88,14 @@ the inserted documents.
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::insertMany()`
+   :phpmethod:`MongoDB\Collection::insertMany()`
 
 Query Documents
 ---------------
 
-The |php-library| provides the :phpmethod:`MongoDB\\Collection::findOne()` and
-:phpmethod:`MongoDB\\Collection::find()` methods for querying documents and the
-:phpmethod:`MongoDB\\Collection::aggregate()` method for performing
+The |php-library| provides the :phpmethod:`MongoDB\Collection::findOne()` and
+:phpmethod:`MongoDB\Collection::find()` methods for querying documents and the
+:phpmethod:`MongoDB\Collection::aggregate()` method for performing
 :manual:`aggregation operations `.
 
 .. include:: /includes/extracts/note-bson-comparison.rst
@@ -103,7 +103,7 @@ The |php-library| provides the :phpmethod:`MongoDB\\Collection::findOne()` and
 Find One Document
 ~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::findOne()` returns the :term:`first document
+:phpmethod:`MongoDB\Collection::findOne()` returns the :term:`first document
 ` that matches the query or ``null`` if no document matches the
 query.
 
@@ -153,21 +153,21 @@ The output would then resemble:
    ``"94301"``. The same criteria would not have matched a document with an
    integer value of ``94301`` due to MongoDB's :manual:`comparison rules for
    BSON types `. Similarly, users should
-   use a :php:`MongoDB\\BSON\\ObjectId ` object
+   use a :php:`MongoDB\BSON\ObjectId ` object
    when matching an ``_id`` with an :manual:`ObjectId `
    value, as strings and ObjectIds are not directly comparable.
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::findOne()`
+   :phpmethod:`MongoDB\Collection::findOne()`
 
 .. _php-find-many-documents:
 
 Find Many Documents
 ~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::find()` returns a
-:php:`MongoDB\\Driver\\Cursor ` object, which you can
+:phpmethod:`MongoDB\Collection::find()` returns a
+:php:`MongoDB\Driver\Cursor ` object, which you can
 iterate upon to access all matched documents.
 
 The following example lists the documents in the ``zips`` collection with the
@@ -198,7 +198,7 @@ The output would resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::find()`
+   :phpmethod:`MongoDB\Collection::find()`
 
 .. _php-query-projection:
 
@@ -355,7 +355,7 @@ Regular Expressions
 ~~~~~~~~~~~~~~~~~~~
 
 Filter criteria may include regular expressions, either by using the
-:php:`MongoDB\\BSON\\Regex ` class directory or the
+:php:`MongoDB\BSON\Regex ` class directory or the
 :query:`$regex` operator.
 
 The following example lists documents in the ``zips`` collection where the city
@@ -421,10 +421,10 @@ Complex Queries with Aggregation
 
 MongoDB's :manual:`Aggregation Framework ` allows
 you to issue complex queries that filter, transform, and group collection data.
-The |php-library|\'s :phpmethod:`MongoDB\\Collection::aggregate()` method
+The |php-library|\'s :phpmethod:`MongoDB\Collection::aggregate()` method
 returns a :php:`Traversable ` object, which you can iterate upon to
 access the results of the aggregation operation. Refer to the
-:phpmethod:`MongoDB\\Collection::aggregate()` method's :ref:`behavior
+:phpmethod:`MongoDB\Collection::aggregate()` method's :ref:`behavior
 reference ` for more about the method's output.
 
 The following example lists the 5 US states with the most zip codes associated
@@ -458,7 +458,7 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::aggregate()`
+   :phpmethod:`MongoDB\Collection::aggregate()`
 
 Update Documents
 ----------------
@@ -466,18 +466,18 @@ Update Documents
 Update One Document
 ~~~~~~~~~~~~~~~~~~~
 
-Use the :phpmethod:`MongoDB\\Collection::updateOne()` method to update a single
-document matching a filter. :phpmethod:`MongoDB\\Collection::updateOne()`
-returns a :phpclass:`MongoDB\\UpdateResult` object, which you can use to access
+Use the :phpmethod:`MongoDB\Collection::updateOne()` method to update a single
+document matching a filter. :phpmethod:`MongoDB\Collection::updateOne()`
+returns a :phpclass:`MongoDB\UpdateResult` object, which you can use to access
 statistics about the update operation.
 
 Update methods have two required parameters: the query filter that identifies
 the document or documents to update, and an update document that specifies what
-updates to perform. The :phpmethod:`MongoDB\\Collection::updateOne()` reference
+updates to perform. The :phpmethod:`MongoDB\Collection::updateOne()` reference
 describes each parameter in detail.
 
 The following example inserts two documents into an empty ``users`` collection
-in the ``test`` database using the :phpmethod:`MongoDB\\Collection::insertOne()`
+in the ``test`` database using the :phpmethod:`MongoDB\Collection::insertOne()`
 method, and then updates the documents where the value for the ``state`` field
 is ``"ny"`` to include a ``country`` field set to ``"us"``:
 
@@ -499,7 +499,7 @@ is ``"ny"`` to include a ``country`` field set to ``"us"``:
    printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
 
 Since the update operation uses the
-:phpmethod:`MongoDB\\Collection::updateOne()` method, which updates the first
+:phpmethod:`MongoDB\Collection::updateOne()` method, which updates the first
 document to match the filter criteria, the results would then resemble:
 
 .. code-block:: none
@@ -537,19 +537,19 @@ therefore not be equal, and the output from the operation would resemble:
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::updateOne()`
-   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+   - :phpmethod:`MongoDB\Collection::updateOne()`
+   - :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 
 Update Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::updateMany()` updates one or more documents
-matching the filter criteria and returns a :phpclass:`MongoDB\\UpdateResult`
+:phpmethod:`MongoDB\Collection::updateMany()` updates one or more documents
+matching the filter criteria and returns a :phpclass:`MongoDB\UpdateResult`
 object, which you can use to access statistics about the update operation.
 
 Update methods have two required parameters: the query filter that identifies
 the document or documents to update, and an update document that specifies what
-updates to perform. The :phpmethod:`MongoDB\\Collection::updateMany()` reference
+updates to perform. The :phpmethod:`MongoDB\Collection::updateMany()` reference
 describes each parameter in detail.
 
 The following example inserts three documents into an empty ``users`` collection
@@ -588,7 +588,7 @@ operation therefore resembles:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::updateMany()`
+   :phpmethod:`MongoDB\Collection::updateMany()`
 
 Replace Documents
 ~~~~~~~~~~~~~~~~~
@@ -598,23 +598,23 @@ a document to include new fields or new field values, a replacement operation
 replaces the entire document with a new document, but retains the original
 document's ``_id`` value.
 
-The :phpmethod:`MongoDB\\Collection::replaceOne()` method replaces a single
+The :phpmethod:`MongoDB\Collection::replaceOne()` method replaces a single
 document that matches the filter criteria and returns an instance of
-:phpclass:`MongoDB\\UpdateResult`, which you can use to access statistics about
+:phpclass:`MongoDB\UpdateResult`, which you can use to access statistics about
 the replacement operation.
 
-:phpmethod:`MongoDB\\Collection::replaceOne()` has two required parameters: the
+:phpmethod:`MongoDB\Collection::replaceOne()` has two required parameters: the
 query filter that identifies the document or documents to replace, and a
 replacement document that will replace the original document in MongoDB. The
-:phpmethod:`MongoDB\\Collection::replaceOne()` reference describes each
+:phpmethod:`MongoDB\Collection::replaceOne()` reference describes each
 parameter in detail.
 
 .. important::
 
    Replacement operations replace all of the fields in a document except the
    ``_id`` value. To avoid accidentally overwriting or deleting desired fields,
-   use the :phpmethod:`MongoDB\\Collection::updateOne()` or
-   :phpmethod:`MongoDB\\Collection::updateMany()` methods to update individual
+   use the :phpmethod:`MongoDB\Collection::updateOne()` or
+   :phpmethod:`MongoDB\Collection::updateMany()` methods to update individual
    fields in a document rather than replacing the entire document.
 
 The following example inserts one document into an empty ``users`` collection in
@@ -645,8 +645,8 @@ The output would then resemble:
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::replaceOne()`
-   - :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+   - :phpmethod:`MongoDB\Collection::replaceOne()`
+   - :phpmethod:`MongoDB\Collection::findOneAndReplace()`
 
 Upsert
 ~~~~~~
@@ -658,9 +658,9 @@ document and inserts it. If there *are* matching documents, then the operation
 modifies or replaces the matching document or documents.
 
 When a document is upserted, the ID is accessible via
-:phpmethod:`MongoDB\\UpdateResult::getUpsertedId()`.
+:phpmethod:`MongoDB\UpdateResult::getUpsertedId()`.
 
-The following example uses :phpmethod:`MongoDB\\Collection::updateOne()` with
+The following example uses :phpmethod:`MongoDB\Collection::updateOne()` with
 the ``upsert`` option set to ``true`` and an empty ``users`` collection in the
 ``test`` database, therefore inserting the document into the database:
 
@@ -715,18 +715,18 @@ Delete Documents
 Delete One Document
 ~~~~~~~~~~~~~~~~~~~
 
-The :phpmethod:`MongoDB\\Collection::deleteOne()` method deletes a single
+The :phpmethod:`MongoDB\Collection::deleteOne()` method deletes a single
 document that matches the filter criteria and returns a
-:phpclass:`MongoDB\\DeleteResult`, which you can use to access statistics about
+:phpclass:`MongoDB\DeleteResult`, which you can use to access statistics about
 the delete operation.
 
 If multiple documents match the filter criteria,
-:phpmethod:`MongoDB\\Collection::deleteOne()` deletes the :term:`first
+:phpmethod:`MongoDB\Collection::deleteOne()` deletes the :term:`first
 ` matching document.
 
-:phpmethod:`MongoDB\\Collection::deleteOne()` has one required parameter: a
+:phpmethod:`MongoDB\Collection::deleteOne()` has one required parameter: a
 query filter that specifies the document to delete. Refer to the
-:phpmethod:`MongoDB\\Collection::deleteOne()` reference for full method
+:phpmethod:`MongoDB\Collection::deleteOne()` reference for full method
 documentation.
 
 The following operation deletes the first document where the ``state`` field's
@@ -753,18 +753,18 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::deleteOne()`
+   :phpmethod:`MongoDB\Collection::deleteOne()`
 
 Delete Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::deleteMany()` deletes all of the documents that
-match the filter criteria and returns a :phpclass:`MongoDB\\DeleteResult`, which
+:phpmethod:`MongoDB\Collection::deleteMany()` deletes all of the documents that
+match the filter criteria and returns a :phpclass:`MongoDB\DeleteResult`, which
 you can use to access statistics about the delete operation.
 
-:phpmethod:`MongoDB\\Collection::deleteMany()` has one required parameter: a
+:phpmethod:`MongoDB\Collection::deleteMany()` has one required parameter: a
 query filter that specifies the document to delete. Refer to the
-:phpmethod:`MongoDB\\Collection::deleteMany()` reference for full method
+:phpmethod:`MongoDB\Collection::deleteMany()` reference for full method
 documentation.
 
 The following operation deletes all of the documents where the ``state`` field's
@@ -791,4 +791,4 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::deleteMany()`
+   :phpmethod:`MongoDB\Collection::deleteMany()`
diff --git a/source/tutorial/custom-types.txt b/source/tutorial/custom-types.txt
index 5fa5880f..87cb3e08 100644
--- a/source/tutorial/custom-types.txt
+++ b/source/tutorial/custom-types.txt
@@ -15,7 +15,7 @@ communicates to the server, and deserializes BSON back into PHP variables when
 it receives data from the server.
 
 It is possible to influence the behavior by implementing the
-:php:`MongoDB\\BSON\\Persistable ` interface.
+:php:`MongoDB\BSON\Persistable ` interface.
 If a class implements this interface, then upon serialization the
 :php:`bsonSerialize ` method is
 called. This method is responsible for returning an array or stdClass object
@@ -23,7 +23,7 @@ to convert to BSON and store in the database. That data will later be used to
 reconstruct the object upon reading from the database.
 
 As an example we present the ``LocalDateTime`` class. This class wraps around
-the :php:`MongoDB\\BSON\\UTCDateTime ` data
+the :php:`MongoDB\BSON\UTCDateTime ` data
 type and a time zone.
 
 .. code-block:: php
@@ -45,7 +45,7 @@ type and a time zone.
         }
     ?>
 
-As it implements the :php:`MongoDB\\BSON\\Persistable
+As it implements the :php:`MongoDB\BSON\Persistable
 ` interface, the
 class is required to implement the :php:`bsonSerialize
 ` and :php:`bsonUnserialize
@@ -53,7 +53,7 @@ class is required to implement the :php:`bsonSerialize
 :php:`bsonSerialize ` method, we
 return an array with the two values that we need to persist: the point in time
 in milliseconds since the Epoch, represented by a
-:php:`MongoDB\\BSON\\UTCDateTime ` object, and
+:php:`MongoDB\BSON\UTCDateTime ` object, and
 a string containing the Olson time zone identifier:
 
 .. code-block:: php
@@ -75,7 +75,7 @@ stored object.
 
 When the document is read from the database, the driver detects whether a
 ``__pclass`` field is present and then executes
-:php:`MongoDB\\BSON\\Persistable::bsonUnserialize
+:php:`MongoDB\BSON\Persistable::bsonUnserialize
 ` method which is
 responsible for restoring the object's original state.
 
@@ -102,25 +102,25 @@ properties.
     ?>
 
 You may have noticed that the class also implements the
-:php:`MongoDB\\BSON\\UTCDateTimeInterface
+:php:`MongoDB\BSON\UTCDateTimeInterface
 ` interface. This interface defines
-the two non-constructor methods of the :php:`MongoDB\\BSON\\UTCDateTime
+the two non-constructor methods of the :php:`MongoDB\BSON\UTCDateTime
 ` class.
 
 It is recommended that wrappers around existing BSON classes implement their
-respective interface (i.e. :php:`MongoDB\\BSON\\UTCDateTimeInterface
+respective interface (i.e. :php:`MongoDB\BSON\UTCDateTimeInterface
 `) so that the wrapper objects can be
 used in the same context as their original unwrapped version. It is also
 recommended that you always type-hint against the interface (i.e.
-:php:`MongoDB\\BSON\\UTCDateTimeInterface
+:php:`MongoDB\BSON\UTCDateTimeInterface
 `) and never against the concrete
-class (i.e. :php:`MongoDB\\BSON\\UTCDateTime
+class (i.e. :php:`MongoDB\BSON\UTCDateTime
 `), as this would prevent wrapped objects from
 being accepted into methods.
 
 In our new ``toDateTime`` method we return a :php:`DateTime `
 object with the local time zone set, instead of the UTC time zone that
-:php:`MongoDB\\BSON\\UTCDateTime ` normally uses
+:php:`MongoDB\BSON\UTCDateTime ` normally uses
 in its return value.
 
 .. code-block:: php
diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt
index 4eb7e156..4688aefb 100644
--- a/source/tutorial/gridfs.txt
+++ b/source/tutorial/gridfs.txt
@@ -13,7 +13,7 @@ GridFS
 :manual:`GridFS ` is a specification for storing and retrieving
 files in MongoDB. GridFS uses two collections to store files. One collection
 stores the file chunks (e.g. ``fs.chunks``), and the other stores file metadata
-(e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket` class provides an
+(e.g. ``fs.files``). The :phpclass:`MongoDB\GridFS\Bucket` class provides an
 interface around these collections for working with the files as PHP
 :php:`Streams `.
 
@@ -21,9 +21,9 @@ Creating a GridFS Bucket
 ------------------------
 
 You can construct a GridFS bucket using the PHP extension's
-:php:`MongoDB\\Driver\\Manager ` class, or select
-a bucket from the |php-library|'s :phpclass:`MongoDB\\Database` class via the
-:phpmethod:`selectGridFSBucket() `
+:php:`MongoDB\Driver\Manager ` class, or select
+a bucket from the |php-library|'s :phpclass:`MongoDB\Database` class via the
+:phpmethod:`selectGridFSBucket() `
 method.
 
 The bucket can be constructed with various options:
@@ -35,7 +35,7 @@ The bucket can be constructed with various options:
   needed. The default size is ``261120`` (i.e. 255 KiB).
 - ``readConcern``, ``readPreference`` and ``writeConcern`` options can be used
   to specify defaults for read and write operations, much like the
-  :phpclass:`MongoDB\\GridFS\\Collection` options.
+  :phpclass:`MongoDB\GridFS\Collection` options.
 
 Uploading Files with Writable Streams
 -------------------------------------
@@ -112,9 +112,9 @@ number. Revision numbers are used to distinguish between files sharing the same
 ``filename`` metadata field, ordered by date of upload (i.e. the ``uploadDate``
 metadata field). The ``revision`` option accepted by
 :phpmethod:`openDownloadStreamByName()
-` and
+` and
 :phpmethod:`downloadToStreamByName()
-` can be positive or negative.
+` can be positive or negative.
 
 A positive ``revision`` number may be used to select files in order of the
 oldest upload date. A revision of ``0`` would denote the file with the oldest
@@ -157,7 +157,7 @@ You can delete a GridFS file by its ``_id``.
 Finding File Metadata
 ---------------------
 
-The :phpmethod:`find() ` method allows you to
+The :phpmethod:`find() ` method allows you to
 retrieve documents from the GridFS files collection, which contain metadata
 about the GridFS files.
 
@@ -173,7 +173,7 @@ Accessing File Metadata for an Existing Stream
 ----------------------------------------------
 
 The :phpmethod:`getFileDocumentForStream()
-` method may be used to get
+` method may be used to get
 the file document for an existing readable or writable GridFS stream.
 
 .. code-block:: php
@@ -193,16 +193,16 @@ the file document for an existing readable or writable GridFS stream.
    Since the file document for a writable stream is not committed to MongoDB
    until the stream is closed,
    :phpmethod:`getFileDocumentForStream()
-   ` can only return an
+   ` can only return an
    in-memory document, which will be missing some fields (e.g. ``length``,
    ``md5``).
 
 The :phpmethod:`getFileIdForStream()
-` method may be used to get the
+` method may be used to get the
 ``_id`` for an existing readable or writable GridFS stream. This is a
 convenience for accessing the ``_id`` property of the object returned by
 :phpmethod:`getFileDocumentForStream()
-`.
+`.
 
 .. code-block:: php
 
diff --git a/source/tutorial/indexes.txt b/source/tutorial/indexes.txt
index e04d4365..51d2d3f7 100644
--- a/source/tutorial/indexes.txt
+++ b/source/tutorial/indexes.txt
@@ -11,7 +11,7 @@ appropriate index exists for a query, MongoDB can use the index to limit the
 number of documents it must inspect.
 
 The PHP driver supports managing indexes through the
-:phpclass:`MongoDB\\Collection` class, which implements MongoDB's
+:phpclass:`MongoDB\Collection` class, which implements MongoDB's
 cross-driver `Index Management
 `_
 and `Enumerating Indexes
@@ -26,12 +26,12 @@ MongoDB.
 Create Indexes
 --------------
 
-Create indexes with the :phpmethod:`MongoDB\\Collection::createIndex()` or
-:phpmethod:`MongoDB\\Collection::createIndexes()` methods. Refer to the method
+Create indexes with the :phpmethod:`MongoDB\Collection::createIndex()` or
+:phpmethod:`MongoDB\Collection::createIndexes()` methods. Refer to the method
 reference for more details about each method.
 
 The following example creates an ascending index on the ``state`` field using
-the :phpmethod:`createIndex() ` method:
+the :phpmethod:`createIndex() ` method:
 
 .. code-block:: php
 
@@ -54,10 +54,10 @@ similar to:
 List Indexes
 ------------
 
-The :phpmethod:`MongoDB\\Collection::listIndexes()` method provides information
+The :phpmethod:`MongoDB\Collection::listIndexes()` method provides information
 about the indexes in a collection. The
-:phpmethod:`MongoDB\\Collection::listIndexes()` method returns an iterator of
-:phpclass:`MongoDB\\Model\\IndexInfo` objects, which you can use to view
+:phpmethod:`MongoDB\Collection::listIndexes()` method returns an iterator of
+:phpclass:`MongoDB\Model\IndexInfo` objects, which you can use to view
 information about each index. Refer to the method reference for more details.
 
 The following example lists all indexes in the ``zips`` collection in the
@@ -107,8 +107,8 @@ The output would resemble:
 Drop Indexes
 ------------
 
-The :phpmethod:`MongoDB\\Collection::dropIndex()` method lets you drop a single
-index while :phpmethod:`MongoDB\\Collection::dropIndexes()` drops all of the
+The :phpmethod:`MongoDB\Collection::dropIndex()` method lets you drop a single
+index while :phpmethod:`MongoDB\Collection::dropIndexes()` drops all of the
 indexes on a collection. Refer to the method reference for more details about
 each method.
 
diff --git a/source/tutorial/modeling-bson-data.txt b/source/tutorial/modeling-bson-data.txt
index 46ab3cf9..56f0217a 100644
--- a/source/tutorial/modeling-bson-data.txt
+++ b/source/tutorial/modeling-bson-data.txt
@@ -17,13 +17,13 @@ Type Maps
 
 Most methods that read data from MongoDB support a ``typeMap`` option, which
 allows control over how BSON is converted to PHP. Additionally,
-the :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
-:phpclass:`MongoDB\\Collection` classes accept a ``typeMap`` option, which can
+the :phpclass:`MongoDB\Client`, :phpclass:`MongoDB\Database`, and
+:phpclass:`MongoDB\Collection` classes accept a ``typeMap`` option, which can
 be used to specify a default type map to apply to any supporting methods and
-selected classes (e.g. :phpmethod:`MongoDB\\Client::selectDatabase()`).
+selected classes (e.g. :phpmethod:`MongoDB\Client::selectDatabase()`).
 
-The :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
-:phpclass:`MongoDB\\Collection` classes use the following type map by
+The :phpclass:`MongoDB\Client`, :phpclass:`MongoDB\Database`, and
+:phpclass:`MongoDB\Collection` classes use the following type map by
 default:
 
 .. code-block:: php
@@ -35,13 +35,13 @@ default:
    ]
 
 The type map above will convert BSON documents and arrays to
-:phpclass:`MongoDB\\Model\\BSONDocument` and
-:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The ``root`` and
+:phpclass:`MongoDB\Model\BSONDocument` and
+:phpclass:`MongoDB\Model\BSONArray` objects, respectively. The ``root`` and
 ``document`` keys are used to distinguish the top-level BSON document from
 embedded documents, respectively.
 
 A type map may specify any class that implements
-:php:`MongoDB\\BSON\\Unserializable ` as well as
+:php:`MongoDB\BSON\Unserializable ` as well as
 ``"array"``, ``"stdClass``", and ``"object"`` (``"stdClass``" and ``"object"``
 are aliases of one another).
 
@@ -54,7 +54,7 @@ Persistable Classes
 -------------------
 
 The driver's :php:`persistence specification ` outlines how
-classes implementing its :php:`MongoDB\\BSON\\Persistable
+classes implementing its :php:`MongoDB\BSON\Persistable
 ` interface are serialized to and deserialized from
 BSON. The :php:`Persistable ` interface is analogous
 to PHP's :php:`Serializable interface `.
@@ -156,7 +156,7 @@ The same document in the MongoDB shell might display as:
 
 .. note::
 
-   :php:`MongoDB\\BSON\\Persistable ` may only be used
+   :php:`MongoDB\BSON\Persistable ` may only be used
    for root and embedded BSON documents. It may not be used for BSON arrays.
 
 Working with Enums
@@ -208,10 +208,10 @@ enum is responsible for converting the value back to an enum case:
    }
 
 Enums are prohibited from implementing
-:php:`MongoDB\\BSON\\Unserializable ` and
-:php:`MongoDB\\BSON\\Persistable `, since enum cases
+:php:`MongoDB\BSON\Unserializable ` and
+:php:`MongoDB\BSON\Persistable `, since enum cases
 have no state and cannot be instantiated like ordinary objects. Pure and backed
 enums can, however, implement
-:php:`MongoDB\\BSON\\Serializable `, which can be
+:php:`MongoDB\BSON\Serializable `, which can be
 used to overcome the default behavior whereby backed enums are serialized as
 their case value and pure enums cannot be serialized.
diff --git a/source/tutorial/stable-api.txt b/source/tutorial/stable-api.txt
index 1220f032..d018162a 100644
--- a/source/tutorial/stable-api.txt
+++ b/source/tutorial/stable-api.txt
@@ -15,7 +15,7 @@ Declaring an API Version
 
 To declare an API version, pass a ``serverApi`` driver option when creating your
 client. The value is a
-:php:`MongoDB\\Driver\\ServerApi ` instance that
+:php:`MongoDB\Driver\ServerApi ` instance that
 contains API version information. This feature is introduced in MongoDB 5.0,
 which will initially support only API version "1". Additional versions may be
 introduced in future versions of the server.
@@ -46,7 +46,7 @@ By default, declaring an API version guarantees behavior for commands that are
 part of the stable API, but does not forbid using commands that are not part
 of the API version. To only allow commands and options that are part of the
 stable API, specify the ``strict`` option when creating the
-:php:`MongoDB\\Driver\\ServerApi ` instance:
+:php:`MongoDB\Driver\ServerApi ` instance:
 
 .. code-block:: php
 
@@ -85,9 +85,9 @@ testing to ensure a smooth transition to a future API version.
 Usage with the Command Helper
 -----------------------------
 
-When using the :phpmethod:`MongoDB\\Database::command()` method to run arbitrary
+When using the :phpmethod:`MongoDB\Database::command()` method to run arbitrary
 commands, the API version declared to the client is automatically appended to
 the command document. Setting any of the ``apiVersion``, ``apiStrict``, or
 ``apiDeprecationErrors`` command options in the command document and calling
-:phpmethod:`MongoDB\\Database::command()` from a client with a declared API
+:phpmethod:`MongoDB\Database::command()` from a client with a declared API
 version is not supported and will lead to undefined behavior.
diff --git a/source/tutorial/tailable-cursor.txt b/source/tutorial/tailable-cursor.txt
index 370a642a..6f250321 100644
--- a/source/tutorial/tailable-cursor.txt
+++ b/source/tutorial/tailable-cursor.txt
@@ -17,7 +17,7 @@ Overview
 
 When the driver executes a query or command (e.g.
 :manual:`aggregate `), results from the operation
-are returned via a :php:`MongoDB\\Driver\\Cursor `
+are returned via a :php:`MongoDB\Driver\Cursor `
 object. The Cursor class implements PHP's :php:`Iterator `
 interface, which allows it to be iterated with ``foreach`` and interface with
 any PHP functions that work with :php:`iterables `. Similar to
@@ -108,7 +108,7 @@ Iterating a Tailable Cursor
 
 In order to demonstrate a tailable cursor in action, we'll need two scripts: a
 "producer" and a "consumer". The producer script will create a new capped
-collection using :phpmethod:`MongoDB\\Database::createCollection()` and proceed
+collection using :phpmethod:`MongoDB\Database::createCollection()` and proceed
 to insert a new document into that collection each second.
 
 .. code-block:: php
@@ -131,7 +131,7 @@ to insert a new document into that collection each second.
 
 With the producer script still running, we will now execute a consumer script to
 read the inserted documents using a tailable cursor, indicated by the
-``cursorType`` option to :phpmethod:`MongoDB\\Collection::find()`. We'll start
+``cursorType`` option to :phpmethod:`MongoDB\Collection::find()`. We'll start
 by using ``foreach`` to illustrate its shortcomings:
 
 .. code-block:: php
@@ -187,4 +187,4 @@ to check if there is actually data available to read at each step.
 Since we've elected to use a ``TAILABLE_AWAIT`` cursor, the server will delay
 its response to the driver for a set amount of time. In this example, we've
 requested that the server block for approximately 100 milliseconds by specifying
-the ``maxAwaitTimeMS`` option to :phpmethod:`MongoDB\\Collection::find()`.
+the ``maxAwaitTimeMS`` option to :phpmethod:`MongoDB\Collection::find()`.
diff --git a/source/upgrade.txt b/source/upgrade.txt
index 50da6f2f..c31c9d9d 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -31,7 +31,7 @@ Type Classes
 
 When upgrading from the legacy driver, type classes such as MongoId must be
 replaced with classes in the
-`MongoDB\\BSON namespace `_. The
+`MongoDB\BSON namespace `_. The
 new driver also introduces interfaces for its BSON types, which should be
 preferred if applications need to type hint against BSON values.
 
@@ -46,31 +46,31 @@ the new driver.
      - BSON type interface
 
    * - MongoId
-     - :php:`MongoDB\\BSON\\ObjectId `
-     - :php:`MongoDB\\BSON\\ObjectIdInterface `
+     - :php:`MongoDB\BSON\ObjectId `
+     - :php:`MongoDB\BSON\ObjectIdInterface `
 
    * - MongoCode
-     - :php:`MongoDB\\BSON\\Javascript `
-     - :php:`MongoDB\\BSON\\JavascriptInterface `
+     - :php:`MongoDB\BSON\Javascript `
+     - :php:`MongoDB\BSON\JavascriptInterface `
 
    * - MongoDate
-     - :php:`MongoDB\\BSON\\UTCDateTime `
-     - :php:`MongoDB\\BSON\\UTCDateTimeInterface `
+     - :php:`MongoDB\BSON\UTCDateTime `
+     - :php:`MongoDB\BSON\UTCDateTimeInterface `
 
    * - MongoRegex
-     - :php:`MongoDB\\BSON\\Regex `
-     - :php:`MongoDB\\BSON\\RegexInterface `
+     - :php:`MongoDB\BSON\Regex `
+     - :php:`MongoDB\BSON\RegexInterface `
 
    * - MongoBinData
-     - :php:`MongoDB\\BSON\\Binary `
-     - :php:`MongoDB\\BSON\\BinaryInterface `
+     - :php:`MongoDB\BSON\Binary `
+     - :php:`MongoDB\BSON\BinaryInterface `
 
    * - MongoInt32
      - Not implemented. [1]_
      -
 
    * - MongoInt64
-     - :php:`MongoDB\\BSON\\Int64 `
+     - :php:`MongoDB\BSON\Int64 `
      - Not implemented. [2]_
 
    * - MongoDBRef
@@ -78,23 +78,23 @@ the new driver.
      -
 
    * - MongoMinKey
-     - :php:`MongoDB\\BSON\\MinKey `
-     - :php:`MongoDB\\BSON\\MinKeyInterface `
+     - :php:`MongoDB\BSON\MinKey `
+     - :php:`MongoDB\BSON\MinKeyInterface `
 
    * - MongoMaxKey
-     - :php:`MongoDB\\BSON\\MaxKey `
-     - :php:`MongoDB\\BSON\\MaxKeyInterface `
+     - :php:`MongoDB\BSON\MaxKey `
+     - :php:`MongoDB\BSON\MaxKeyInterface `
 
    * - MongoTimestamp
-     - :php:`MongoDB\\BSON\\Timestamp `
-     - :php:`MongoDB\\BSON\\TimestampInterface `
+     - :php:`MongoDB\BSON\Timestamp `
+     - :php:`MongoDB\BSON\TimestampInterface `
 
 .. [1] The new driver does not implement an equivalent class for MongoInt32.
    When decoding BSON, 32-bit integers will always be represented as a PHP
    integer. When encoding BSON, PHP integers will encode as either a 32-bit or
    64-bit integer depending on their value.
 
-.. [2] :php:`MongoDB\\BSON\\Int64 ` does not have an
+.. [2] :php:`MongoDB\BSON\Int64 ` does not have an
    interface defined. The new driver does not allow applications to instantiate
    this type (i.e. its constructor is private) and it is only created during
    BSON decoding when a 64-bit integer cannot be represented as a PHP integer on
@@ -121,8 +121,8 @@ problematic:
   was a gap in their key sequence. Such gaps were caused by unsetting a key to
   remove an element and forgetting to numerically reindex the array.
 
-The |php-library|'s :phpclass:`BSONDocument ` and
-:phpclass:`BSONArray ` classes address these concerns
+The |php-library|'s :phpclass:`BSONDocument ` and
+:phpclass:`BSONArray ` classes address these concerns
 by preserving the BSON type information during serialization and
 deserialization; however, some users may still prefer the legacy behavior. If
 desired, you can use the ``typeMap`` option to have the library return
@@ -173,7 +173,7 @@ The above example would output something similar to:
 Collection API
 --------------
 
-This library's :phpclass:`MongoDB\\Collection` class implements MongoDB's
+This library's :phpclass:`MongoDB\Collection` class implements MongoDB's
 cross-driver `CRUD
 `_
 and `Index Management
@@ -197,102 +197,102 @@ equivalent method(s) in the new driver.
    :header-rows: 1
 
    * - MongoCollection method
-     - :phpclass:`MongoDB\\Collection` method(s)
+     - :phpclass:`MongoDB\Collection` method(s)
 
    * - ``MongoCollection::aggregate()``
-     - :phpmethod:`MongoDB\\Collection::aggregate()`
+     - :phpmethod:`MongoDB\Collection::aggregate()`
 
    * - ``MongoCollection::aggregateCursor()``
-     - :phpmethod:`MongoDB\\Collection::aggregate()`
+     - :phpmethod:`MongoDB\Collection::aggregate()`
 
    * - ``MongoCollection::batchInsert()``
-     - :phpmethod:`MongoDB\\Collection::insertMany()`
+     - :phpmethod:`MongoDB\Collection::insertMany()`
 
    * - ``MongoCollection::count()``
-     - :phpmethod:`MongoDB\\Collection::count()`
+     - :phpmethod:`MongoDB\Collection::count()`
 
    * - ``MongoCollection::createDBRef()``
      - Not yet implemented. [3]_
 
    * - ``MongoCollection::createIndex()``
-     - :phpmethod:`MongoDB\\Collection::createIndex()`
+     - :phpmethod:`MongoDB\Collection::createIndex()`
 
    * - ``MongoCollection::deleteIndex()``
-     - :phpmethod:`MongoDB\\Collection::dropIndex()`
+     - :phpmethod:`MongoDB\Collection::dropIndex()`
 
    * - ``MongoCollection::deleteIndexes()``
-     - :phpmethod:`MongoDB\\Collection::dropIndexes()`
+     - :phpmethod:`MongoDB\Collection::dropIndexes()`
 
    * - ``MongoCollection::drop()``
-     - :phpmethod:`MongoDB\\Collection::drop()`
+     - :phpmethod:`MongoDB\Collection::drop()`
 
    * - ``MongoCollection::distinct()``
-     - :phpmethod:`MongoDB\\Collection::distinct()`
+     - :phpmethod:`MongoDB\Collection::distinct()`
 
    * - ``MongoCollection::ensureIndex()``
-     - :phpmethod:`MongoDB\\Collection::createIndex()`
+     - :phpmethod:`MongoDB\Collection::createIndex()`
 
    * - ``MongoCollection::find()``
-     - :phpmethod:`MongoDB\\Collection::find()`
+     - :phpmethod:`MongoDB\Collection::find()`
 
    * - ``MongoCollection::findAndModify()``
-     - :phpmethod:`MongoDB\\Collection::findOneAndDelete()`,
-       :phpmethod:`MongoDB\\Collection::findOneAndReplace()`, and
-       :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+     - :phpmethod:`MongoDB\Collection::findOneAndDelete()`,
+       :phpmethod:`MongoDB\Collection::findOneAndReplace()`, and
+       :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 
    * - ``MongoCollection::findOne()``
-     - :phpmethod:`MongoDB\\Collection::findOne()`
+     - :phpmethod:`MongoDB\Collection::findOne()`
 
    * - ``MongoCollection::getDBRef()``
      - Not implemented. [3]_
 
    * - ``MongoCollection::getIndexInfo()``
-     - :phpmethod:`MongoDB\\Collection::listIndexes()`
+     - :phpmethod:`MongoDB\Collection::listIndexes()`
 
    * - ``MongoCollection::getName()``
-     - :phpmethod:`MongoDB\\Collection::getCollectionName()`
+     - :phpmethod:`MongoDB\Collection::getCollectionName()`
 
    * - ``MongoCollection::getReadPreference()``
-     - :phpmethod:`MongoDB\\Collection::getReadPreference()`
+     - :phpmethod:`MongoDB\Collection::getReadPreference()`
 
    * - ``MongoCollection::getSlaveOkay()``
      - Not implemented.
 
    * - ``MongoCollection::getWriteConcern()``
-     - :phpmethod:`MongoDB\\Collection::getWriteConcern()`
+     - :phpmethod:`MongoDB\Collection::getWriteConcern()`
 
    * - ``MongoCollection::group()``
-     - Not implemented. Use :phpmethod:`MongoDB\\Database::command()`. See
+     - Not implemented. Use :phpmethod:`MongoDB\Database::command()`. See
        :ref:`Group Command Helper ` for an example.
 
    * - ``MongoCollection::insert()``
-     - :phpmethod:`MongoDB\\Collection::insertOne()`
+     - :phpmethod:`MongoDB\Collection::insertOne()`
 
    * - ``MongoCollection::parallelCollectionScan()``
      - Not implemented.
 
    * - ``MongoCollection::remove()``
-     - :phpmethod:`MongoDB\\Collection::deleteMany()` and
-       :phpmethod:`MongoDB\\Collection::deleteOne()`
+     - :phpmethod:`MongoDB\Collection::deleteMany()` and
+       :phpmethod:`MongoDB\Collection::deleteOne()`
 
    * - ``MongoCollection::save()``
-     - :phpmethod:`MongoDB\\Collection::insertOne()` or
-       :phpmethod:`MongoDB\\Collection::replaceOne()` with the ``upsert``
+     - :phpmethod:`MongoDB\Collection::insertOne()` or
+       :phpmethod:`MongoDB\Collection::replaceOne()` with the ``upsert``
        option.
 
    * - ``MongoCollection::setReadPreference()``
-     - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`.
+     - Not implemented. Use :phpmethod:`MongoDB\Collection::withOptions()`.
 
    * - ``MongoCollection::setSlaveOkay()``
      - Not implemented.
 
    * - ``MongoCollection::setWriteConcern()``
-     - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`.
+     - Not implemented. Use :phpmethod:`MongoDB\Collection::withOptions()`.
 
    * - ``MongoCollection::update()``
-     - :phpmethod:`MongoDB\\Collection::replaceOne()`,
-       :phpmethod:`MongoDB\\Collection::updateMany()`, and
-       :phpmethod:`MongoDB\\Collection::updateOne()`.
+     - :phpmethod:`MongoDB\Collection::replaceOne()`,
+       :phpmethod:`MongoDB\Collection::updateMany()`, and
+       :phpmethod:`MongoDB\Collection::updateOne()`.
 
    * - ``MongoCollection::validate()``
      - Not implemented.
@@ -312,18 +312,18 @@ longer done in the new driver and library.
 IDs of inserted documents (whether generated or not) may be accessed through the
 following methods on the write result objects:
 
-- :phpmethod:`MongoDB\\InsertOneResult::getInsertedId()` for
-  :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\InsertManyResult::getInsertedIds()` for
-  :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedIds()` for
-  :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\InsertOneResult::getInsertedId()` for
+  :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\InsertManyResult::getInsertedIds()` for
+  :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\BulkWriteResult::getInsertedIds()` for
+  :phpmethod:`MongoDB\Collection::bulkWrite()`
 
 Bulk Write Operations
 ~~~~~~~~~~~~~~~~~~~~~
 
 The legacy driver's MongoWriteBatch classes have been replaced with a
-general-purpose :phpmethod:`MongoDB\\Collection::bulkWrite()` method. Whereas
+general-purpose :phpmethod:`MongoDB\Collection::bulkWrite()` method. Whereas
 the legacy driver only allowed bulk operations of the same type, the new method
 allows operations to be mixed (e.g. inserts, updates, and deletes).
 
@@ -332,16 +332,16 @@ MongoCollection::save() Removed
 
 ``MongoCollection::save()``, which was syntactic sugar for an insert or upsert
 operation, has been removed in favor of explicitly using
-:phpmethod:`MongoDB\\Collection::insertOne()` or
-:phpmethod:`MongoDB\\Collection::replaceOne()` (with the ``upsert`` option).
+:phpmethod:`MongoDB\Collection::insertOne()` or
+:phpmethod:`MongoDB\Collection::replaceOne()` (with the ``upsert`` option).
 
 While the ``save`` method does have its uses for interactive environments, such
 as the MongoDB shell, it was intentionally excluded from the
 `CRUD specification `_
 for language drivers. Generally, application code should know if the document
 has an identifier and be able to explicitly insert or replace the document and
-handle the returned :phpclass:`MongoDB\\InsertOneResult` or
-:phpclass:`MongoDB\\UpdateResult`, respectively. This also helps avoid
+handle the returned :phpclass:`MongoDB\InsertOneResult` or
+:phpclass:`MongoDB\UpdateResult`, respectively. This also helps avoid
 inadvertent and potentially dangerous :manual:`full-document replacements
 `.
 
@@ -350,10 +350,10 @@ inadvertent and potentially dangerous :manual:`full-document replacements
 Group Command Helper
 ~~~~~~~~~~~~~~~~~~~~
 
-:phpclass:`MongoDB\\Collection` does not have a helper method for the
+:phpclass:`MongoDB\Collection` does not have a helper method for the
 :manual:`group ` command. The following example
 demonstrates how to execute a group command using the
-:phpmethod:`MongoDB\\Database::command()` method:
+:phpmethod:`MongoDB\Database::command()` method:
 
 .. code-block:: php
 

From 85e1396c86359d31dc297a2aae93ef3188fb0da7 Mon Sep 17 00:00:00 2001
From: Nora Reidy 
Date: Mon, 4 Mar 2024 12:42:54 -0500
Subject: [PATCH 305/321] DOCSP-36627: More backslash fixes (#1244)

---
 source/reference/method/MongoDBCollection-explain.txt           | 2 +-
 source/reference/method/MongoDBUpdateResult-getMatchedCount.txt | 2 +-
 source/tutorial/tailable-cursor.txt                             | 2 +-
 source/upgrade.txt                                              | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt
index 4c604944..592f717e 100644
--- a/source/reference/method/MongoDBCollection-explain.txt
+++ b/source/reference/method/MongoDBCollection-explain.txt
@@ -29,7 +29,7 @@ Definition
 Parameters
 ----------
 
-``$explainable`` : :phpclass:`MongoDB\Operation\\Explainable`
+``$explainable`` : :phpclass:`MongoDB\Operation\Explainable`
   The command to explain.
 
 ``$options`` : array
diff --git a/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt b/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
index 077cddd8..f668fe12 100644
--- a/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
+++ b/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
@@ -29,7 +29,7 @@ Definition
       (e.g. setting the value of a field to its current value), the matched
       count may be greater than the value returned by
       :phpmethod:`getModifiedCount()
-      `.
+      `.
 
 Return Values
 -------------
diff --git a/source/tutorial/tailable-cursor.txt b/source/tutorial/tailable-cursor.txt
index 6f250321..6285676e 100644
--- a/source/tutorial/tailable-cursor.txt
+++ b/source/tutorial/tailable-cursor.txt
@@ -99,7 +99,7 @@ preceding example to use the Iterator methods directly:
    throw an exception, since all results on the cursor have been exhausted.
 
 The purpose of this example is to demonstrate the functional equivalence between
-``foreach`` and manual iteration with PHP's :php:`Iterator `API.
+``foreach`` and manual iteration with PHP's :php:`Iterator ` API.
 For normal cursors, there is little reason to manually iterate results instead
 of a concise ``foreach`` loop.
 
diff --git a/source/upgrade.txt b/source/upgrade.txt
index c31c9d9d..58d34eb1 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -31,7 +31,7 @@ Type Classes
 
 When upgrading from the legacy driver, type classes such as MongoId must be
 replaced with classes in the
-`MongoDB\BSON namespace `_. The
+`MongoDB\\BSON namespace `_. The
 new driver also introduces interfaces for its BSON types, which should be
 preferred if applications need to type hint against BSON values.
 

From 419946ff19e242f3f6681e11c22731153310e936 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 5 Mar 2024 11:27:39 -0500
Subject: [PATCH 306/321] DOCSP-36627: Additional double backslash fixes for
 v1.17 (#1243)

Co-authored-by: Nora Reidy 
---
 source/faq.txt                                |   2 +-
 .../includes/extracts-bulkwriteexception.yaml |   4 +-
 source/includes/extracts-error.yaml           |  18 +--
 source/includes/extracts-note.yaml            |   4 +-
 source/index.txt                              |   2 +-
 source/reference/bson.txt                     |  16 +--
 .../class/MongoDBBulkWriteResult.txt          |  23 ++--
 .../reference/class/MongoDBChangeStream.txt   |  22 +--
 source/reference/class/MongoDBClient.txt      |  36 ++---
 source/reference/class/MongoDBCollection.txt  | 118 ++++++++--------
 source/reference/class/MongoDBDatabase.txt    |  62 ++++-----
 .../reference/class/MongoDBDeleteResult.txt   |  13 +-
 .../reference/class/MongoDBGridFSBucket.txt   |  52 +++----
 .../class/MongoDBInsertManyResult.txt         |  13 +-
 .../class/MongoDBInsertOneResult.txt          |  13 +-
 .../class/MongoDBMapReduceResult.txt          |  12 +-
 .../class/MongoDBModelCollectionInfo.txt      |  26 ++--
 .../MongoDBModelCollectionInfoIterator.txt    |   6 +-
 .../class/MongoDBModelDatabaseInfo.txt        |  16 +--
 .../MongoDBModelDatabaseInfoIterator.txt      |   6 +-
 .../reference/class/MongoDBModelIndexInfo.txt |  30 ++--
 .../class/MongoDBModelIndexInfoIterator.txt   |   6 +-
 .../reference/class/MongoDBUpdateResult.txt   |  20 +--
 source/reference/exception-classes.txt        |  42 +++---
 source/reference/function/add_logger.txt      |   4 +-
 source/reference/function/remove_logger.txt   |   6 +-
 .../reference/function/with_transaction.txt   |  14 +-
 source/reference/functions.txt                |   6 +-
 ...MongoDBBulkWriteResult-getDeletedCount.txt |   4 +-
 ...ongoDBBulkWriteResult-getInsertedCount.txt |   4 +-
 .../MongoDBBulkWriteResult-getInsertedIds.txt |   4 +-
 ...MongoDBBulkWriteResult-getMatchedCount.txt |   8 +-
 ...ongoDBBulkWriteResult-getModifiedCount.txt |   8 +-
 ...ongoDBBulkWriteResult-getUpsertedCount.txt |   4 +-
 .../MongoDBBulkWriteResult-getUpsertedIds.txt |   6 +-
 .../MongoDBBulkWriteResult-isAcknowledged.txt |   4 +-
 .../method/MongoDBChangeStream-current.txt    |  12 +-
 .../MongoDBChangeStream-getCursorId.txt       |  14 +-
 .../MongoDBChangeStream-getResumeToken.txt    |   8 +-
 .../method/MongoDBChangeStream-key.txt        |  10 +-
 .../method/MongoDBChangeStream-next.txt       |  10 +-
 .../method/MongoDBChangeStream-rewind.txt     |  18 +--
 .../method/MongoDBChangeStream-valid.txt      |  12 +-
 .../MongoDBClient-createClientEncryption.txt  |  14 +-
 .../method/MongoDBClient-dropDatabase.txt     |   8 +-
 .../method/MongoDBClient-getManager.txt       |  12 +-
 .../method/MongoDBClient-getReadConcern.txt   |  12 +-
 .../MongoDBClient-getReadPreference.txt       |  10 +-
 .../method/MongoDBClient-getTypeMap.txt       |   8 +-
 .../method/MongoDBClient-getWriteConcern.txt  |  12 +-
 .../MongoDBClient-listDatabaseNames.txt       |   6 +-
 .../method/MongoDBClient-listDatabases.txt    |  10 +-
 .../method/MongoDBClient-selectCollection.txt |  16 +--
 .../method/MongoDBClient-selectDatabase.txt   |  16 +--
 .../method/MongoDBClient-startSession.txt     |   6 +-
 .../reference/method/MongoDBClient-watch.txt  |  16 +--
 .../method/MongoDBClient__construct.txt       |  26 ++--
 .../reference/method/MongoDBClient__get.txt   |  16 +--
 .../method/MongoDBCollection-aggregate.txt    |  18 +--
 .../method/MongoDBCollection-bulkWrite.txt    |  40 +++---
 .../method/MongoDBCollection-count.txt        |  14 +-
 .../MongoDBCollection-countDocuments.txt      |  14 +-
 .../method/MongoDBCollection-createIndex.txt  |   8 +-
 .../MongoDBCollection-createIndexes.txt       |  12 +-
 .../MongoDBCollection-createSearchIndex.txt   |  10 +-
 .../MongoDBCollection-createSearchIndexes.txt |  10 +-
 .../method/MongoDBCollection-deleteMany.txt   |  14 +-
 .../method/MongoDBCollection-deleteOne.txt    |  14 +-
 .../method/MongoDBCollection-distinct.txt     |   8 +-
 .../method/MongoDBCollection-drop.txt         |   8 +-
 .../method/MongoDBCollection-dropIndex.txt    |  12 +-
 .../method/MongoDBCollection-dropIndexes.txt  |  12 +-
 .../MongoDBCollection-dropSearchIndex.txt     |  10 +-
 ...ngoDBCollection-estimatedDocumentCount.txt |  10 +-
 .../method/MongoDBCollection-explain.txt      |   6 +-
 .../method/MongoDBCollection-find.txt         |  14 +-
 .../method/MongoDBCollection-findOne.txt      |  14 +-
 .../MongoDBCollection-findOneAndDelete.txt    |  10 +-
 .../MongoDBCollection-findOneAndReplace.txt   |  10 +-
 .../MongoDBCollection-findOneAndUpdate.txt    |  10 +-
 .../MongoDBCollection-getCollectionName.txt   |   6 +-
 .../MongoDBCollection-getDatabaseName.txt     |   6 +-
 .../method/MongoDBCollection-getManager.txt   |  12 +-
 .../method/MongoDBCollection-getNamespace.txt |   6 +-
 .../MongoDBCollection-getReadConcern.txt      |  12 +-
 .../MongoDBCollection-getReadPreference.txt   |  10 +-
 .../method/MongoDBCollection-getTypeMap.txt   |   8 +-
 .../MongoDBCollection-getWriteConcern.txt     |  12 +-
 .../method/MongoDBCollection-insertMany.txt   |  14 +-
 .../method/MongoDBCollection-insertOne.txt    |  14 +-
 .../method/MongoDBCollection-listIndexes.txt  |   8 +-
 .../MongoDBCollection-listSearchIndexes.txt   |  16 +--
 .../method/MongoDBCollection-mapReduce.txt    |  18 +--
 .../method/MongoDBCollection-rename.txt       |   8 +-
 .../method/MongoDBCollection-replaceOne.txt   |  16 +--
 .../method/MongoDBCollection-updateMany.txt   |  16 +--
 .../method/MongoDBCollection-updateOne.txt    |  16 +--
 .../MongoDBCollection-updateSearchIndex.txt   |  10 +-
 .../method/MongoDBCollection-watch.txt        |  16 +--
 .../method/MongoDBCollection-withOptions.txt  |  12 +-
 .../method/MongoDBCollection__construct.txt   |  26 ++--
 .../method/MongoDBDatabase-aggregate.txt      |  16 +--
 .../method/MongoDBDatabase-command.txt        |  14 +-
 .../MongoDBDatabase-createCollection.txt      |   8 +-
 ...goDBDatabase-createEncryptedCollection.txt |  26 ++--
 .../reference/method/MongoDBDatabase-drop.txt |   8 +-
 .../method/MongoDBDatabase-dropCollection.txt |   8 +-
 .../MongoDBDatabase-getDatabaseName.txt       |   2 +-
 .../method/MongoDBDatabase-getManager.txt     |  12 +-
 .../method/MongoDBDatabase-getReadConcern.txt |  12 +-
 .../MongoDBDatabase-getReadPreference.txt     |  10 +-
 .../method/MongoDBDatabase-getTypeMap.txt     |   8 +-
 .../MongoDBDatabase-getWriteConcern.txt       |  12 +-
 .../MongoDBDatabase-listCollectionNames.txt   |   6 +-
 .../MongoDBDatabase-listCollections.txt       |  10 +-
 .../MongoDBDatabase-modifyCollection.txt      |   6 +-
 .../MongoDBDatabase-renameCollection.txt      |   8 +-
 .../MongoDBDatabase-selectCollection.txt      |  18 +--
 .../MongoDBDatabase-selectGridFSBucket.txt    |  14 +-
 .../method/MongoDBDatabase-watch.txt          |  16 +--
 .../method/MongoDBDatabase-withOptions.txt    |  12 +-
 .../method/MongoDBDatabase__construct.txt     |  22 +--
 .../reference/method/MongoDBDatabase__get.txt |  14 +-
 .../MongoDBDeleteResult-getDeletedCount.txt   |   4 +-
 .../MongoDBDeleteResult-isAcknowledged.txt    |   4 +-
 .../method/MongoDBGridFSBucket-delete.txt     |   2 +-
 .../MongoDBGridFSBucket-downloadToStream.txt  |   8 +-
 ...oDBGridFSBucket-downloadToStreamByName.txt |   8 +-
 .../method/MongoDBGridFSBucket-drop.txt       |   2 +-
 .../method/MongoDBGridFSBucket-find.txt       |  16 +--
 .../method/MongoDBGridFSBucket-findOne.txt    |  14 +-
 .../MongoDBGridFSBucket-getBucketName.txt     |   2 +-
 .../MongoDBGridFSBucket-getChunkSizeBytes.txt |   2 +-
 ...ongoDBGridFSBucket-getChunksCollection.txt |   4 +-
 .../MongoDBGridFSBucket-getDatabaseName.txt   |   2 +-
 ...BGridFSBucket-getFileDocumentForStream.txt |   4 +-
 ...MongoDBGridFSBucket-getFileIdForStream.txt |   4 +-
 ...MongoDBGridFSBucket-getFilesCollection.txt |   4 +-
 .../MongoDBGridFSBucket-getReadConcern.txt    |  12 +-
 .../MongoDBGridFSBucket-getReadPreference.txt |  10 +-
 .../method/MongoDBGridFSBucket-getTypeMap.txt |   8 +-
 .../MongoDBGridFSBucket-getWriteConcern.txt   |  12 +-
 ...MongoDBGridFSBucket-openDownloadStream.txt |   8 +-
 ...BGridFSBucket-openDownloadStreamByName.txt |   8 +-
 .../MongoDBGridFSBucket-openUploadStream.txt  |   6 +-
 .../method/MongoDBGridFSBucket-rename.txt     |   2 +-
 .../MongoDBGridFSBucket-uploadFromStream.txt  |   8 +-
 .../method/MongoDBGridFSBucket__construct.txt |  18 +--
 ...ngoDBInsertManyResult-getInsertedCount.txt |   4 +-
 ...MongoDBInsertManyResult-getInsertedIds.txt |   4 +-
 ...MongoDBInsertManyResult-isAcknowledged.txt |   4 +-
 ...ongoDBInsertOneResult-getInsertedCount.txt |   4 +-
 .../MongoDBInsertOneResult-getInsertedId.txt  |   4 +-
 .../MongoDBInsertOneResult-isAcknowledged.txt |   4 +-
 .../MongoDBMapReduceResult-getCounts.txt      |   4 +-
 ...goDBMapReduceResult-getExecutionTimeMS.txt |   4 +-
 .../MongoDBMapReduceResult-getIterator.txt    |   4 +-
 .../MongoDBMapReduceResult-getTiming.txt      |   8 +-
 ...ongoDBModelCollectionInfo-getCappedMax.txt |  12 +-
 ...ngoDBModelCollectionInfo-getCappedSize.txt |  12 +-
 .../MongoDBModelCollectionInfo-getIdIndex.txt |   4 +-
 .../MongoDBModelCollectionInfo-getInfo.txt    |   4 +-
 .../MongoDBModelCollectionInfo-getName.txt    |   4 +-
 .../MongoDBModelCollectionInfo-getOptions.txt |   6 +-
 .../MongoDBModelCollectionInfo-getType.txt    |   4 +-
 .../MongoDBModelCollectionInfo-isCapped.txt   |   8 +-
 .../MongoDBModelDatabaseInfo-getName.txt      |   4 +-
 ...MongoDBModelDatabaseInfo-getSizeOnDisk.txt |   2 +-
 .../MongoDBModelDatabaseInfo-isEmpty.txt      |   2 +-
 .../method/MongoDBModelIndexInfo-getKey.txt   |   6 +-
 .../method/MongoDBModelIndexInfo-getName.txt  |   6 +-
 .../MongoDBModelIndexInfo-getNamespace.txt    |   6 +-
 .../MongoDBModelIndexInfo-getVersion.txt      |   4 +-
 .../MongoDBModelIndexInfo-is2dSphere.txt      |   6 +-
 .../MongoDBModelIndexInfo-isGeoHaystack.txt   |   6 +-
 .../method/MongoDBModelIndexInfo-isSparse.txt |   6 +-
 .../method/MongoDBModelIndexInfo-isText.txt   |   6 +-
 .../method/MongoDBModelIndexInfo-isTtl.txt    |   6 +-
 .../method/MongoDBModelIndexInfo-isUnique.txt |   6 +-
 .../MongoDBUpdateResult-getMatchedCount.txt   |   8 +-
 .../MongoDBUpdateResult-getModifiedCount.txt  |   8 +-
 .../MongoDBUpdateResult-getUpsertedCount.txt  |   4 +-
 .../MongoDBUpdateResult-getUpsertedId.txt     |   6 +-
 .../MongoDBUpdateResult-isAcknowledged.txt    |   4 +-
 source/tutorial/codecs.txt                    |   2 +-
 source/tutorial/collation.txt                 |   6 +-
 source/tutorial/commands.txt                  |  16 +--
 source/tutorial/connecting.txt                |   2 +-
 source/tutorial/crud.txt                      | 106 +++++++-------
 source/tutorial/custom-types.txt              |  24 ++--
 source/tutorial/encryption.txt                |   6 +-
 source/tutorial/gridfs.txt                    |  24 ++--
 source/tutorial/indexes.txt                   |  18 +--
 source/tutorial/modeling-bson-data.txt        |  26 ++--
 source/tutorial/stable-api.txt                |   8 +-
 source/tutorial/tailable-cursor.txt           |  10 +-
 source/upgrade.txt                            | 130 +++++++++---------
 197 files changed, 1224 insertions(+), 1228 deletions(-)

diff --git a/source/faq.txt b/source/faq.txt
index 9cdd9a25..fef32264 100644
--- a/source/faq.txt
+++ b/source/faq.txt
@@ -124,7 +124,7 @@ The following are all examples of
     [TLS handshake failed: certificate verify failed (64): IP address mismatch calling hello on 'b.example.com:27017']
 
 These errors typically manifest as a
-:php:`MongoDB\\Driver\\Exception\\ConnectionTimeoutException `
+:php:`MongoDB\Driver\Exception\ConnectionTimeoutException `
 exception from the driver. The actual exception messages originate from
 libmongoc, which is the underlying library used by the PHP driver. Since these
 messages can take many forms, it's helpful to break down the structure of the
diff --git a/source/includes/extracts-bulkwriteexception.yaml b/source/includes/extracts-bulkwriteexception.yaml
index f002063f..6276458e 100644
--- a/source/includes/extracts-bulkwriteexception.yaml
+++ b/source/includes/extracts-bulkwriteexception.yaml
@@ -1,9 +1,9 @@
 ref: bulkwriteexception-result
 content: |
-  If a :php:`MongoDB\\Driver\\Exception\\BulkWriteException
+  If a :php:`MongoDB\Driver\Exception\BulkWriteException
   ` is thrown, users should call
   :php:`getWriteResult() ` and
-  inspect the returned :php:`MongoDB\\Driver\\WriteResult
+  inspect the returned :php:`MongoDB\Driver\WriteResult
   ` object to determine the nature of the error.
 
   For example, a write operation may have been successfully applied to the
diff --git a/source/includes/extracts-error.yaml b/source/includes/extracts-error.yaml
index cfada049..1a41843a 100644
--- a/source/includes/extracts-error.yaml
+++ b/source/includes/extracts-error.yaml
@@ -1,6 +1,6 @@
 ref: error-driver-bulkwriteexception
 content: |
-  :php:`MongoDB\\Driver\\Exception\\BulkWriteException
+  :php:`MongoDB\Driver\Exception\BulkWriteException
   ` for errors related to the write
   operation. Users should inspect the value returned by :php:`getWriteResult()
   ` to determine the nature of the
@@ -8,45 +8,45 @@ content: |
 ---
 ref: error-driver-invalidargumentexception
 content: |
-  :php:`MongoDB\\Driver\\Exception\\InvalidArgumentException
+  :php:`MongoDB\Driver\Exception\InvalidArgumentException
   ` for errors related to the
   parsing of parameters or options at the driver level.
 ---
 ref: error-driver-runtimeexception
 content: |
-  :php:`MongoDB\\Driver\\Exception\\RuntimeException
+  :php:`MongoDB\Driver\Exception\RuntimeException
   ` for other errors at the driver
   level (e.g. connection errors).
 ---
 ref: error-badmethodcallexception-write-result
 content: |
-  :phpclass:`MongoDB\\Exception\\BadMethodCallException` if this method is
+  :phpclass:`MongoDB\Exception\BadMethodCallException` if this method is
   called and the write operation used an unacknowledged :manual:`write concern
   `.
 ---
 ref: error-invalidargumentexception
 content: |
-  :phpclass:`MongoDB\\Exception\\InvalidArgumentException` for errors related to
+  :phpclass:`MongoDB\Exception\InvalidArgumentException` for errors related to
   the parsing of parameters or options.
 ---
 ref: error-unexpectedvalueexception
 content: |
-  :phpclass:`MongoDB\\Exception\\UnexpectedValueException` if the command
+  :phpclass:`MongoDB\Exception\UnexpectedValueException` if the command
   response from the server was malformed.
 ---
 ref: error-unsupportedexception
 content: |
-  :phpclass:`MongoDB\\Exception\\UnsupportedException` if options are used and
+  :phpclass:`MongoDB\Exception\UnsupportedException` if options are used and
   not supported by the selected server (e.g. ``collation``, ``readConcern``,
   ``writeConcern``).
 ---
 ref: error-gridfs-filenotfoundexception
 content: |
-  :phpclass:`MongoDB\\GridFS\\Exception\\FileNotFoundException` if no file was
+  :phpclass:`MongoDB\GridFS\Exception\FileNotFoundException` if no file was
   found for the selection criteria.
 ---
 ref: error-gridfs-corruptfileexception
 content: |
-  :phpclass:`MongoDB\\GridFS\\Exception\\CorruptFileException` if the file's
+  :phpclass:`MongoDB\GridFS\Exception\CorruptFileException` if the file's
   metadata or chunk documents contain unexpected or invalid data.
 ...
diff --git a/source/includes/extracts-note.yaml b/source/includes/extracts-note.yaml
index d2130910..620a7ac3 100644
--- a/source/includes/extracts-note.yaml
+++ b/source/includes/extracts-note.yaml
@@ -7,7 +7,7 @@ content: |
   ` rules. When matching a special
   BSON type the query criteria should use the respective :php:`BSON class
   ` in the driver (e.g. use
-  :php:`MongoDB\\BSON\\ObjectId ` to match an
+  :php:`MongoDB\BSON\ObjectId ` to match an
   :manual:`ObjectId `).
 ---
 ref: note-atlas-search-requirement
@@ -22,7 +22,7 @@ ref: note-atlas-search-async
 content: |
   Atlas Search indexes are managed asynchronously. After creating or updating an
   index, you can periodically execute
-  :phpmethod:`MongoDB\\Collection::listSearchIndexes()` and check the
+  :phpmethod:`MongoDB\Collection::listSearchIndexes()` and check the
   ``queryable`` :manual:`output field  `
   to determine whether it is ready to be used.
 ...
diff --git a/source/index.txt b/source/index.txt
index 5cbf328a..7e76323f 100644
--- a/source/index.txt
+++ b/source/index.txt
@@ -12,7 +12,7 @@ The ``mongodb`` extension provides a limited API to connect to the database and
 execute generic commands, queries, and write operations. In contrast, the
 |php-library| provides a full-featured API and models client, database, and
 collection objects. Each of those classes provide various helper methods for
-performing operations in context. For example, :phpclass:`MongoDB\\Collection`
+performing operations in context. For example, :phpclass:`MongoDB\Collection`
 implements methods for executing CRUD operations and managing indexes on the
 collection, among other things.
 
diff --git a/source/reference/bson.txt b/source/reference/bson.txt
index b9fbbaa2..30753247 100644
--- a/source/reference/bson.txt
+++ b/source/reference/bson.txt
@@ -18,18 +18,18 @@ of JSON documents, though it contains more data types than JSON. For the BSON
 spec, see `bsonspec.org `_.
 
 By default, the |php-library| returns BSON documents as
-:phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as
-:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively.
+:phpclass:`MongoDB\Model\BSONDocument` objects and BSON arrays as
+:phpclass:`MongoDB\Model\BSONArray` objects, respectively.
 
 Classes
 -------
 
-.. phpclass:: MongoDB\\Model\\BSONArray
+.. phpclass:: MongoDB\Model\BSONArray
 
    This class extends PHP's :php:`ArrayObject ` class. It also
    implements PHP's :php:`JsonSerializable ` interface and the
-   driver's :php:`MongoDB\\BSON\\Serializable ` and
-   :php:`MongoDB\\BSON\\Unserializable `
+   driver's :php:`MongoDB\BSON\Serializable ` and
+   :php:`MongoDB\BSON\Unserializable `
    interfaces.
 
    By default, the library will deserialize BSON arrays as instances of this
@@ -37,12 +37,12 @@ Classes
    serialize as an array type (:php:`array_values() ` is used
    internally to numerically reindex the array).
 
-.. phpclass:: MongoDB\\Model\\BSONDocument
+.. phpclass:: MongoDB\Model\BSONDocument
 
    This class extends PHP's :php:`ArrayObject ` class. It also
    implements PHP's :php:`JsonSerializable ` interface and the
-   driver's :php:`MongoDB\\BSON\\Serializable ` and
-   :php:`MongoDB\\BSON\\Unserializable `
+   driver's :php:`MongoDB\BSON\Serializable ` and
+   :php:`MongoDB\BSON\Unserializable `
    interfaces.
 
    By default, the library will deserialize BSON documents as instances of this
diff --git a/source/reference/class/MongoDBBulkWriteResult.txt b/source/reference/class/MongoDBBulkWriteResult.txt
index f33b036d..2e8c78cf 100644
--- a/source/reference/class/MongoDBBulkWriteResult.txt
+++ b/source/reference/class/MongoDBBulkWriteResult.txt
@@ -5,12 +5,11 @@ MongoDB\\BulkWriteResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\BulkWriteResult
+.. phpclass:: MongoDB\BulkWriteResult
 
    This class contains information about an executed bulk write operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::bulkWrite()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::bulkWrite()`.
 
 Methods
 -------
@@ -27,11 +26,11 @@ Methods
    getUpsertedIds() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\BulkWriteResult::getDeletedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedIds()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getMatchedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getModifiedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getUpsertedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getUpsertedIds()`
-- :phpmethod:`MongoDB\\BulkWriteResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\BulkWriteResult::getDeletedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getInsertedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getInsertedIds()`
+- :phpmethod:`MongoDB\BulkWriteResult::getMatchedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getModifiedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getUpsertedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getUpsertedIds()`
+- :phpmethod:`MongoDB\BulkWriteResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBChangeStream.txt b/source/reference/class/MongoDBChangeStream.txt
index 3142aeec..bd82c5e0 100644
--- a/source/reference/class/MongoDBChangeStream.txt
+++ b/source/reference/class/MongoDBChangeStream.txt
@@ -7,13 +7,13 @@ MongoDB\\ChangeStream Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\ChangeStream
+.. phpclass:: MongoDB\ChangeStream
 
    This class extends PHP's :php:`Iterator `
    interface. An instance of this class is returned by
-   :phpmethod:`MongoDB\\Client::watch()`,
-   :phpmethod:`MongoDB\\Database::watch()`, and
-   :phpmethod:`MongoDB\\Collection::watch()`.
+   :phpmethod:`MongoDB\Client::watch()`,
+   :phpmethod:`MongoDB\Database::watch()`, and
+   :phpmethod:`MongoDB\Collection::watch()`.
 
    This class allows for iteration of events in a change stream. It also allows
    iteration to automatically resume after certain errors, such as a replica set
@@ -33,10 +33,10 @@ Methods
    rewind() 
    valid() 
 
-- :phpmethod:`MongoDB\\ChangeStream::current()`
-- :phpmethod:`MongoDB\\ChangeStream::getCursorId()`
-- :phpmethod:`MongoDB\\ChangeStream::getResumeToken()`
-- :phpmethod:`MongoDB\\ChangeStream::key()`
-- :phpmethod:`MongoDB\\ChangeStream::next()`
-- :phpmethod:`MongoDB\\ChangeStream::rewind()`
-- :phpmethod:`MongoDB\\ChangeStream::valid()`
\ No newline at end of file
+- :phpmethod:`MongoDB\ChangeStream::current()`
+- :phpmethod:`MongoDB\ChangeStream::getCursorId()`
+- :phpmethod:`MongoDB\ChangeStream::getResumeToken()`
+- :phpmethod:`MongoDB\ChangeStream::key()`
+- :phpmethod:`MongoDB\ChangeStream::next()`
+- :phpmethod:`MongoDB\ChangeStream::rewind()`
+- :phpmethod:`MongoDB\ChangeStream::valid()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
index 75739252..b1710507 100644
--- a/source/reference/class/MongoDBClient.txt
+++ b/source/reference/class/MongoDBClient.txt
@@ -13,13 +13,13 @@ MongoDB\\Client Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Client
+.. phpclass:: MongoDB\Client
 
    This class serves as an entry point for the |php-library|. It is the
    preferred class for connecting to a MongoDB server or cluster of servers and
    acts as a gateway for accessing individual databases and collections.
-   :phpclass:`MongoDB\\Client` is analogous to the driver's
-   :php:`MongoDB\\Driver\\Manager ` class, which it
+   :phpclass:`MongoDB\Client` is analogous to the driver's
+   :php:`MongoDB\Driver\Manager ` class, which it
    `composes `_.
 
 Methods
@@ -44,18 +44,18 @@ Methods
    startSession() 
    watch() 
 
-- :phpmethod:`MongoDB\\Client::__construct()`
-- :phpmethod:`MongoDB\\Client::__get()`
-- :phpmethod:`MongoDB\\Client::createClientEncryption()`
-- :phpmethod:`MongoDB\\Client::dropDatabase()`
-- :phpmethod:`MongoDB\\Client::getManager()`
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Client::listDatabaseNames()`
-- :phpmethod:`MongoDB\\Client::listDatabases()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
-- :phpmethod:`MongoDB\\Client::selectDatabase()`
-- :phpmethod:`MongoDB\\Client::startSession()`
-- :phpmethod:`MongoDB\\Client::watch()`
+- :phpmethod:`MongoDB\Client::__construct()`
+- :phpmethod:`MongoDB\Client::__get()`
+- :phpmethod:`MongoDB\Client::createClientEncryption()`
+- :phpmethod:`MongoDB\Client::dropDatabase()`
+- :phpmethod:`MongoDB\Client::getManager()`
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Client::listDatabaseNames()`
+- :phpmethod:`MongoDB\Client::listDatabases()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
+- :phpmethod:`MongoDB\Client::selectDatabase()`
+- :phpmethod:`MongoDB\Client::startSession()`
+- :phpmethod:`MongoDB\Client::watch()`
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index e4bfb03c..2f23ae01 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -13,29 +13,28 @@ MongoDB\\Collection Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Collection
+.. phpclass:: MongoDB\Collection
 
    Provides methods for common operations on collections and documents,
    including CRUD operations and index management.
 
    You can construct collections directly using the driver's
-   :php:`MongoDB\\Driver\\Manager ` class or
-   select a collection from the library's :phpclass:`MongoDB\\Client` or
-   :phpclass:`MongoDB\\Database` classes. A collection may also be cloned from
-   an existing :phpclass:`MongoDB\\Collection` object via the
-   :phpmethod:`withOptions() ` method.
+   :php:`MongoDB\Driver\Manager ` class or
+   select a collection from the library's :phpclass:`MongoDB\Client` or
+   :phpclass:`MongoDB\Database` classes. A collection may also be cloned from
+   an existing :phpclass:`MongoDB\Collection` object via the
+   :phpmethod:`withOptions() ` method.
 
-   :phpclass:`MongoDB\\Collection` supports the :php:`readConcern
+   :phpclass:`MongoDB\Collection` supports the :php:`readConcern
    `, :php:`readPreference
    `, :php:`typeMap
    `,
    and :php:`writeConcern ` options. If you omit an
    option, the collection inherits the value from the :php:`Manager
-   ` constructor argument or the :phpclass:`Client
-   ` or :phpclass:`Database ` object used to
-   select the collection.
+   ` constructor argument or the :phpclass:`Client `
+   or :phpclass:`Database ` object used to select the collection.
 
-   Operations within the :phpclass:`MongoDB\\Collection` class inherit the
+   Operations within the :phpclass:`MongoDB\Collection` class inherit the
    collection's options.
 
 Type Map Limitations
@@ -45,11 +44,11 @@ The :manual:`aggregate ` (when not using a
 cursor), :manual:`distinct `, and
 :manual:`findAndModify ` helpers do not
 support a ``typeMap`` option due to a driver limitation. The
-:phpmethod:`aggregate() `,
-:phpmethod:`distinct() `,
-:phpmethod:`findOneAndReplace() `,
-:phpmethod:`findOneAndUpdate() `, and
-:phpmethod:`findOneAndDelete() `
+:phpmethod:`aggregate() `,
+:phpmethod:`distinct() `,
+:phpmethod:`findOneAndReplace() `,
+:phpmethod:`findOneAndUpdate() `, and
+:phpmethod:`findOneAndDelete() `
 methods return BSON documents as ``stdClass`` objects and BSON arrays as arrays.
 
 Methods
@@ -102,46 +101,47 @@ Methods
    watch() 
    withOptions() 
 
-- :phpmethod:`MongoDB\\Collection::__construct()`
-- :phpmethod:`MongoDB\\Collection::aggregate()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
-- :phpmethod:`MongoDB\\Collection::count()`
-- :phpmethod:`MongoDB\\Collection::countDocuments()`
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::createIndexes()`
-- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::deleteMany()`
-- :phpmethod:`MongoDB\\Collection::deleteOne()`
-- :phpmethod:`MongoDB\\Collection::distinct()`
-- :phpmethod:`MongoDB\\Collection::drop()`
-- :phpmethod:`MongoDB\\Collection::dropIndex()`
-- :phpmethod:`MongoDB\\Collection::dropIndexes()`
-- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
-- :phpmethod:`MongoDB\\Collection::explain()`
-- :phpmethod:`MongoDB\\Collection::find()`
-- :phpmethod:`MongoDB\\Collection::findOne()`
-- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
-- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
-- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
-- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
-- :phpmethod:`MongoDB\\Collection::getManager()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
-- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
-- :phpmethod:`MongoDB\\Collection::rename()`
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
-- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Collection::withOptions()`
+- :phpmethod:`MongoDB\Collection::__construct()`
+- :phpmethod:`MongoDB\Collection::aggregate()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::count()`
+- :phpmethod:`MongoDB\Collection::countDocuments()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndexes()`
+- :phpmethod:`MongoDB\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::deleteMany()`
+- :phpmethod:`MongoDB\Collection::deleteOne()`
+- :phpmethod:`MongoDB\Collection::distinct()`
+- :phpmethod:`MongoDB\Collection::drop()`
+- :phpmethod:`MongoDB\Collection::dropIndex()`
+- :phpmethod:`MongoDB\Collection::dropIndexes()`
+- :phpmethod:`MongoDB\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\Collection::estimatedDocumentCount()`
+- :phpmethod:`MongoDB\Collection::explain()`
+- :phpmethod:`MongoDB\Collection::find()`
+- :phpmethod:`MongoDB\Collection::findOne()`
+- :phpmethod:`MongoDB\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\Collection::getManager()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::rename()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::updateSearchIndex()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Collection::withOptions()`
+
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index f92d2314..c5a5b3a5 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -13,28 +13,28 @@ MongoDB\\Database Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Database
+.. phpclass:: MongoDB\Database
 
    Provides methods for common operations on a database, such as executing
    database commands and managing collections.
 
    You can construct a database directly using the driver's
-   :php:`MongoDB\\Driver\\Manager ` class or
-   select a database from the library's :phpclass:`MongoDB\\Client` class. A
-   database may also be cloned from an existing :phpclass:`MongoDB\\Database`
-   object via the :phpmethod:`withOptions() `
+   :php:`MongoDB\Driver\Manager ` class or
+   select a database from the library's :phpclass:`MongoDB\Client` class. A
+   database may also be cloned from an existing :phpclass:`MongoDB\Database`
+   object via the :phpmethod:`withOptions() `
    method.
 
-   :phpclass:`MongoDB\\Database` supports the :php:`readConcern
+   :phpclass:`MongoDB\Database` supports the :php:`readConcern
    `, :php:`readPreference
    `, :php:`typeMap
    `,
    and :php:`writeConcern ` options. If you omit an
    option, the database inherits the value from the :php:`Manager
-   ` constructor argument or the :phpclass:`Client
-   ` object used to select the database.
+   ` constructor argument or the :phpclass:`Client `
+   object used to select the database.
 
-   Operations within the :phpclass:`MongoDB\\Database` class inherit the
+   Operations within the :phpclass:`MongoDB\Database` class inherit the
    Database's options.
 
 Methods
@@ -66,25 +66,25 @@ Methods
    watch() 
    withOptions() 
 
-- :phpmethod:`MongoDB\\Database::__construct()`
-- :phpmethod:`MongoDB\\Database::__get()`
-- :phpmethod:`MongoDB\\Database::aggregate()`
-- :phpmethod:`MongoDB\\Database::command()`
-- :phpmethod:`MongoDB\\Database::createCollection()`
-- :phpmethod:`MongoDB\\Database::createEncryptedCollection()`
-- :phpmethod:`MongoDB\\Database::drop()`
-- :phpmethod:`MongoDB\\Database::dropCollection()`
-- :phpmethod:`MongoDB\\Database::getDatabaseName()`
-- :phpmethod:`MongoDB\\Database::getManager()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::listCollectionNames()`
-- :phpmethod:`MongoDB\\Database::listCollections()`
-- :phpmethod:`MongoDB\\Database::modifyCollection()`
-- :phpmethod:`MongoDB\\Database::renameCollection()`
-- :phpmethod:`MongoDB\\Database::selectCollection()`
-- :phpmethod:`MongoDB\\Database::selectGridFSBucket()`
-- :phpmethod:`MongoDB\\Database::watch()`
-- :phpmethod:`MongoDB\\Database::withOptions()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Database::__construct()`
+- :phpmethod:`MongoDB\Database::__get()`
+- :phpmethod:`MongoDB\Database::aggregate()`
+- :phpmethod:`MongoDB\Database::command()`
+- :phpmethod:`MongoDB\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createEncryptedCollection()`
+- :phpmethod:`MongoDB\Database::drop()`
+- :phpmethod:`MongoDB\Database::dropCollection()`
+- :phpmethod:`MongoDB\Database::getDatabaseName()`
+- :phpmethod:`MongoDB\Database::getManager()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::listCollectionNames()`
+- :phpmethod:`MongoDB\Database::listCollections()`
+- :phpmethod:`MongoDB\Database::modifyCollection()`
+- :phpmethod:`MongoDB\Database::renameCollection()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
+- :phpmethod:`MongoDB\Database::selectGridFSBucket()`
+- :phpmethod:`MongoDB\Database::watch()`
+- :phpmethod:`MongoDB\Database::withOptions()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBDeleteResult.txt b/source/reference/class/MongoDBDeleteResult.txt
index 02c2c8c1..cd4aa2bc 100644
--- a/source/reference/class/MongoDBDeleteResult.txt
+++ b/source/reference/class/MongoDBDeleteResult.txt
@@ -5,13 +5,12 @@ MongoDB\\DeleteResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\DeleteResult
+.. phpclass:: MongoDB\DeleteResult
 
    This class contains information about an executed delete operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::deleteMany()` or
-   :phpmethod:`MongoDB\\Collection::deleteOne()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::deleteMany()` or
+   :phpmethod:`MongoDB\Collection::deleteOne()`.
 
 Methods
 -------
@@ -22,5 +21,5 @@ Methods
    getDeletedCount() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\DeleteResult::getDeletedCount()`
-- :phpmethod:`MongoDB\\DeleteResult::isAcknowledged()`
+- :phpmethod:`MongoDB\DeleteResult::getDeletedCount()`
+- :phpmethod:`MongoDB\DeleteResult::isAcknowledged()`
diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 7703a678..0a83a32e 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -13,19 +13,19 @@ MongoDB\\GridFS\\Bucket Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\GridFS\\Bucket
+.. phpclass:: MongoDB\GridFS\Bucket
 
    :manual:`GridFS ` is a specification for storing and retrieving
    files in MongoDB. GridFS uses two collections to store files. One collection
    stores the file chunks (e.g. ``fs.chunks``), and the other stores file
-   metadata (e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket` class
+   metadata (e.g. ``fs.files``). The :phpclass:`MongoDB\GridFS\Bucket` class
    provides an interface around these collections for working with the files as
    PHP :php:`Streams `.
 
    You can construct a GridFS bucket using the driver's
    :php:`Manager ` class, or select a bucket from
-   the library's :phpclass:`MongoDB\\Database` class via the
-   :phpmethod:`selectGridFSBucket() `
+   the library's :phpclass:`MongoDB\Database` class via the
+   :phpmethod:`selectGridFSBucket() `
    method.
 
 Methods
@@ -58,25 +58,25 @@ Methods
    rename() 
    uploadFromStream() 
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::delete()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::drop()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::find()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::findOne()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getBucketName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getChunksCollection()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getChunkSizeBytes()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getDatabaseName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFilesCollection()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::rename()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::__construct()`
+- :phpmethod:`MongoDB\GridFS\Bucket::delete()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::drop()`
+- :phpmethod:`MongoDB\GridFS\Bucket::find()`
+- :phpmethod:`MongoDB\GridFS\Bucket::findOne()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getBucketName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getChunksCollection()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getChunkSizeBytes()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getDatabaseName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileDocumentForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileIdForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFilesCollection()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openUploadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::rename()`
+- :phpmethod:`MongoDB\GridFS\Bucket::uploadFromStream()`
diff --git a/source/reference/class/MongoDBInsertManyResult.txt b/source/reference/class/MongoDBInsertManyResult.txt
index 16d9b482..f7f79c8c 100644
--- a/source/reference/class/MongoDBInsertManyResult.txt
+++ b/source/reference/class/MongoDBInsertManyResult.txt
@@ -5,12 +5,11 @@ MongoDB\\InsertManyResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\InsertManyResult
+.. phpclass:: MongoDB\InsertManyResult
 
    This class contains information about an executed bulk insert operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::insertMany()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::insertMany()`.
 
 Methods
 -------
@@ -22,6 +21,6 @@ Methods
    getInsertedIds() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\InsertManyResult::getInsertedCount()`
-- :phpmethod:`MongoDB\\InsertManyResult::getInsertedIds()`
-- :phpmethod:`MongoDB\\InsertManyResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\InsertManyResult::getInsertedCount()`
+- :phpmethod:`MongoDB\InsertManyResult::getInsertedIds()`
+- :phpmethod:`MongoDB\InsertManyResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBInsertOneResult.txt b/source/reference/class/MongoDBInsertOneResult.txt
index 19454d22..09e0a35b 100644
--- a/source/reference/class/MongoDBInsertOneResult.txt
+++ b/source/reference/class/MongoDBInsertOneResult.txt
@@ -5,12 +5,11 @@ MongoDB\\InsertOneResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\InsertOneResult
+.. phpclass:: MongoDB\InsertOneResult
 
    This class contains information about an executed insert operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::insertOne()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::insertOne()`.
 
 Methods
 -------
@@ -22,6 +21,6 @@ Methods
    getInsertedId() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\InsertOneResult::getInsertedCount()`
-- :phpmethod:`MongoDB\\InsertOneResult::getInsertedId()`
-- :phpmethod:`MongoDB\\InsertOneResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\InsertOneResult::getInsertedCount()`
+- :phpmethod:`MongoDB\InsertOneResult::getInsertedId()`
+- :phpmethod:`MongoDB\InsertOneResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBMapReduceResult.txt b/source/reference/class/MongoDBMapReduceResult.txt
index 601f6f82..8f27cce9 100644
--- a/source/reference/class/MongoDBMapReduceResult.txt
+++ b/source/reference/class/MongoDBMapReduceResult.txt
@@ -7,11 +7,11 @@ MongoDB\\MapReduceResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\MapReduceResult
+.. phpclass:: MongoDB\MapReduceResult
 
    This class extends PHP's :php:`IteratorAggregate `
    interface. An instance of this class is returned by
-   :phpmethod:`MongoDB\\Collection::mapReduce()`.
+   :phpmethod:`MongoDB\Collection::mapReduce()`.
 
    This class allows for iteration of map-reduce results irrespective of the
    output method (e.g. inline, collection). It also provides access to command
@@ -28,7 +28,7 @@ Methods
    getIterator() 
    getTiming() 
 
-- :phpmethod:`MongoDB\\MapReduceResult::getCounts()`
-- :phpmethod:`MongoDB\\MapReduceResult::getExecutionTimeMS()`
-- :phpmethod:`MongoDB\\MapReduceResult::getIterator()`
-- :phpmethod:`MongoDB\\MapReduceResult::getTiming()`
\ No newline at end of file
+- :phpmethod:`MongoDB\MapReduceResult::getCounts()`
+- :phpmethod:`MongoDB\MapReduceResult::getExecutionTimeMS()`
+- :phpmethod:`MongoDB\MapReduceResult::getIterator()`
+- :phpmethod:`MongoDB\MapReduceResult::getTiming()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelCollectionInfo.txt b/source/reference/class/MongoDBModelCollectionInfo.txt
index 17807095..76b9af35 100644
--- a/source/reference/class/MongoDBModelCollectionInfo.txt
+++ b/source/reference/class/MongoDBModelCollectionInfo.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\CollectionInfo Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\CollectionInfo
+.. phpclass:: MongoDB\Model\CollectionInfo
 
    This class models information about a collection. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Database::listCollections()`.
+   returned by traversing a :phpclass:`MongoDB\Model\CollectionInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\Database::listCollections()`.
 
 .. versionchanged:: 1.4
 
@@ -20,9 +20,9 @@ Definition
 
    .. note::
 
-      The :phpclass:`MongoDB\\Model\\CollectionInfo` class is immutable. Attempting
+      The :phpclass:`MongoDB\Model\CollectionInfo` class is immutable. Attempting
       to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+      result in a :phpclass:`MongoDB\Exception\BadMethodCallException`.
 
 Methods
 -------
@@ -39,11 +39,11 @@ Methods
    getType() 
    isCapped() 
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getIdIndex()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getInfo()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getName()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getType()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getIdIndex()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getInfo()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getName()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getOptions()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getType()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::isCapped()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelCollectionInfoIterator.txt b/source/reference/class/MongoDBModelCollectionInfoIterator.txt
index 5358f213..fca6da62 100644
--- a/source/reference/class/MongoDBModelCollectionInfoIterator.txt
+++ b/source/reference/class/MongoDBModelCollectionInfoIterator.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\CollectionInfoIterator Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\CollectionInfoIterator
+.. phpclass:: MongoDB\Model\CollectionInfoIterator
 
    This interface extends PHP's :php:`Iterator `
    interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Database::listCollections()`.
+   :phpmethod:`MongoDB\Database::listCollections()`.
 
 Methods
 -------
@@ -17,4 +17,4 @@ Methods
 This interface adds no new methods to :php:`Iterator
 `, but specifies that :php:`current()
 ` will return an instance of
-:phpclass:`MongoDB\\Model\\CollectionInfo`.
\ No newline at end of file
+:phpclass:`MongoDB\Model\CollectionInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelDatabaseInfo.txt b/source/reference/class/MongoDBModelDatabaseInfo.txt
index e0f45852..a8d18cd6 100644
--- a/source/reference/class/MongoDBModelDatabaseInfo.txt
+++ b/source/reference/class/MongoDBModelDatabaseInfo.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\DatabaseInfo Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\DatabaseInfo
+.. phpclass:: MongoDB\Model\DatabaseInfo
 
    This class models information about a database. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`.
+   returned by traversing a :phpclass:`MongoDB\Model\DatabaseInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\Client::listDatabases()`.
 
 .. versionchanged:: 1.4
 
@@ -20,9 +20,9 @@ Definition
 
    .. note::
 
-      The :phpclass:`MongoDB\\Model\\DatabaseInfo` class is immutable. Attempting
+      The :phpclass:`MongoDB\Model\DatabaseInfo` class is immutable. Attempting
       to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+      result in a :phpclass:`MongoDB\Exception\BadMethodCallException`.
 
 Methods
 -------
@@ -34,6 +34,6 @@ Methods
    getSizeOnDisk() 
    isEmpty() 
 
-- :phpmethod:`MongoDB\\Model\\DatabaseInfo::getName()`
-- :phpmethod:`MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()`
-- :phpmethod:`MongoDB\\Model\\DatabaseInfo::isEmpty()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Model\DatabaseInfo::getName()`
+- :phpmethod:`MongoDB\Model\DatabaseInfo::getSizeOnDisk()`
+- :phpmethod:`MongoDB\Model\DatabaseInfo::isEmpty()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelDatabaseInfoIterator.txt b/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
index 960ca256..ba36ef2e 100644
--- a/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
+++ b/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\DatabaseInfoIterator Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\DatabaseInfoIterator
+.. phpclass:: MongoDB\Model\DatabaseInfoIterator
 
    This interface extends PHP's :php:`Iterator `
    interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Client::listDatabases()`.
+   :phpmethod:`MongoDB\Client::listDatabases()`.
 
 Methods
 -------
@@ -17,4 +17,4 @@ Methods
 This interface adds no new methods to :php:`Iterator
 `, but specifies that :php:`current()
 ` will return an instance of
-:phpclass:`MongoDB\\Model\\DatabaseInfo`.
\ No newline at end of file
+:phpclass:`MongoDB\Model\DatabaseInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelIndexInfo.txt b/source/reference/class/MongoDBModelIndexInfo.txt
index 8b9c42c8..4d017e5d 100644
--- a/source/reference/class/MongoDBModelIndexInfo.txt
+++ b/source/reference/class/MongoDBModelIndexInfo.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\IndexInfo Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\IndexInfo
+.. phpclass:: MongoDB\Model\IndexInfo
 
    This class models information about an index. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\IndexInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Collection::listIndexes()`.
+   returned by traversing a :phpclass:`MongoDB\Model\IndexInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\Collection::listIndexes()`.
 
    This class implements PHP's :php:`ArrayAccess ` interface. This
    provides a mechanism for accessing index fields for which there exists no
@@ -18,9 +18,9 @@ Definition
 
    .. note::
 
-      The :phpclass:`MongoDB\\Model\\IndexInfo` class is immutable. Attempting
+      The :phpclass:`MongoDB\Model\IndexInfo` class is immutable. Attempting
       to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+      result in a :phpclass:`MongoDB\Exception\BadMethodCallException`.
 
 Methods
 -------
@@ -39,13 +39,13 @@ Methods
    isTtl() 
    isUnique() 
 
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getKey()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getName()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getNamespace()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getVersion()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::is2dSphere()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isGeoHaystack()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isSparse()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isText()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isTtl()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isUnique()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Model\IndexInfo::getKey()`
+- :phpmethod:`MongoDB\Model\IndexInfo::getName()`
+- :phpmethod:`MongoDB\Model\IndexInfo::getNamespace()`
+- :phpmethod:`MongoDB\Model\IndexInfo::getVersion()`
+- :phpmethod:`MongoDB\Model\IndexInfo::is2dSphere()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isGeoHaystack()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isSparse()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isText()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isTtl()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isUnique()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelIndexInfoIterator.txt b/source/reference/class/MongoDBModelIndexInfoIterator.txt
index 2b154706..0fae59c2 100644
--- a/source/reference/class/MongoDBModelIndexInfoIterator.txt
+++ b/source/reference/class/MongoDBModelIndexInfoIterator.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\IndexInfoIterator Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\IndexInfoIterator
+.. phpclass:: MongoDB\Model\IndexInfoIterator
 
    This interface extends PHP's :php:`Iterator `
    interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Collection::listIndexes()`.
+   :phpmethod:`MongoDB\Collection::listIndexes()`.
 
 Methods
 -------
@@ -17,4 +17,4 @@ Methods
 This interface adds no new methods to :php:`Iterator
 `, but specifies that :php:`current()
 ` will return an instance of
-:phpclass:`MongoDB\\Model\\IndexInfo`.
\ No newline at end of file
+:phpclass:`MongoDB\Model\IndexInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBUpdateResult.txt b/source/reference/class/MongoDBUpdateResult.txt
index 0534980d..52561e59 100644
--- a/source/reference/class/MongoDBUpdateResult.txt
+++ b/source/reference/class/MongoDBUpdateResult.txt
@@ -5,14 +5,14 @@ MongoDB\\UpdateResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\UpdateResult
+.. phpclass:: MongoDB\UpdateResult
 
    This class contains information about an executed update or replace
-   operation. It encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   operation. It encapsulates a :php:`MongoDB\Driver\WriteResult
    ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::replaceOne()`,
-   :phpmethod:`MongoDB\\Collection::updateMany()`, or
-   :phpmethod:`MongoDB\\Collection::updateOne()`.
+   :phpmethod:`MongoDB\Collection::replaceOne()`,
+   :phpmethod:`MongoDB\Collection::updateMany()`, or
+   :phpmethod:`MongoDB\Collection::updateOne()`.
 
 Methods
 -------
@@ -26,8 +26,8 @@ Methods
    getUpsertedId() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\UpdateResult::getMatchedCount()`
-- :phpmethod:`MongoDB\\UpdateResult::getModifiedCount()`
-- :phpmethod:`MongoDB\\UpdateResult::getUpsertedCount()`
-- :phpmethod:`MongoDB\\UpdateResult::getUpsertedId()`
-- :phpmethod:`MongoDB\\UpdateResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\UpdateResult::getMatchedCount()`
+- :phpmethod:`MongoDB\UpdateResult::getModifiedCount()`
+- :phpmethod:`MongoDB\UpdateResult::getUpsertedCount()`
+- :phpmethod:`MongoDB\UpdateResult::getUpsertedId()`
+- :phpmethod:`MongoDB\UpdateResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/exception-classes.txt b/source/reference/exception-classes.txt
index 20ae7067..584c55d5 100644
--- a/source/reference/exception-classes.txt
+++ b/source/reference/exception-classes.txt
@@ -13,56 +13,56 @@ Exception Classes
 MongoDB\\Exception\\BadMethodCallException
 ------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\BadMethodCallException
+.. phpclass:: MongoDB\Exception\BadMethodCallException
 
    This exception is thrown when an unsupported method is invoked on an object.
 
    For example, using an unacknowledged write concern with
-   :phpmethod:`MongoDB\\Collection::insertMany()` will return a
-   :phpclass:`MongoDB\\InsertManyResult` object. It is a logical error to call
-   :phpmethod:`MongoDB\\InsertManyResult::getInsertedCount()`, since the number
+   :phpmethod:`MongoDB\Collection::insertMany()` will return a
+   :phpclass:`MongoDB\InsertManyResult` object. It is a logical error to call
+   :phpmethod:`MongoDB\InsertManyResult::getInsertedCount()`, since the number
    of inserted documents can only be determined from the response of an
    acknowledged write operation.
 
    This class extends PHP's :php:`BadMethodCallException
    ` class and implements the library's
-   :phpclass:`Exception ` interface.
+   :phpclass:`Exception ` interface.
 
 ----
 
 MongoDB\\Exception\\CreateEncryptedCollectionException
 ------------------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\CreateEncryptedCollectionException
+.. phpclass:: MongoDB\Exception\CreateEncryptedCollectionException
 
-   Thrown by :phpmethod:`MongoDB\\Database::createEncryptedCollection()` if any
+   Thrown by :phpmethod:`MongoDB\Database::createEncryptedCollection()` if any
    error is encountered while creating data keys or creating the collection. The
    original exception and modified ``encryptedFields`` option can be accessed
    via the ``getPrevious()`` and ``getEncryptedFields()`` methods, respectively.
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
 ----
 
 MongoDB\\Exception\\InvalidArgumentException
 --------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\InvalidArgumentException
+.. phpclass:: MongoDB\Exception\InvalidArgumentException
 
    Thrown for errors related to the parsing of parameters or options within the
    library.
 
    This class extends the driver's :php:`InvalidArgumentException
    ` class and implements the
-   library's :phpclass:`Exception ` interface.
+   library's :phpclass:`Exception ` interface.
 
 ----
 
 MongoDB\\Exception\\UnexpectedValueException
 --------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\UnexpectedValueException
+.. phpclass:: MongoDB\Exception\UnexpectedValueException
 
    This exception is thrown when a command response from the server is
    malformed or not what the library expected. This exception means that an
@@ -72,26 +72,26 @@ MongoDB\\Exception\\UnexpectedValueException
 
    This class extends the driver's :php:`UnexpectedValueException
    ` class and implements the
-   library's :phpclass:`Exception ` interface.
+   library's :phpclass:`Exception ` interface.
 
 ----
 
 MongoDB\\Exception\\UnsupportedException
 ----------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\UnsupportedException
+.. phpclass:: MongoDB\Exception\UnsupportedException
 
    This exception is thrown if an option is used and not supported by the
    selected server. It is used sparingly in cases where silently ignoring the
    unsupported option might otherwise lead to unexpected behavior.
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
    .. note::
 
       Unlike :phpclass:`InvalidArgumentException
-      `, which may be thrown when
+      `, which may be thrown when
       an operation's parameters and options are parsed during construction, the
       selected server is not known until an operation is executed.
 
@@ -100,7 +100,7 @@ MongoDB\\Exception\\UnsupportedException
 MongoDB\\GridFS\\Exception\\CorruptFileException
 ------------------------------------------------
 
-.. phpclass:: MongoDB\\GridFS\\Exception\\CorruptFileException
+.. phpclass:: MongoDB\GridFS\Exception\CorruptFileException
 
    This exception is thrown if a GridFS file's metadata or chunk documents
    contain unexpected or invalid data.
@@ -111,27 +111,27 @@ MongoDB\\GridFS\\Exception\\CorruptFileException
    sequence or its binary data's length out of range.
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
 ----
 
 MongoDB\\GridFS\\Exception\\FileNotFoundException
 -------------------------------------------------
 
-.. phpclass:: MongoDB\\GridFS\\Exception\\FileNotFoundException
+.. phpclass:: MongoDB\GridFS\Exception\FileNotFoundException
 
    This exception is thrown if no GridFS file was found for the selection
    criteria (e.g. ``id``, ``filename``).
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
 ----
 
 MongoDB\\Exception\\Exception
 -----------------------------
 
-.. phpclass:: MongoDB\\Exception\\Exception
+.. phpclass:: MongoDB\Exception\Exception
 
    This interface extends the driver's :php:`Exception
    ` interface and is implemented by all
@@ -142,7 +142,7 @@ MongoDB\\Exception\\Exception
 MongoDB\\Exception\\RuntimeException
 ------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\RuntimeException
+.. phpclass:: MongoDB\Exception\RuntimeException
 
    This class extends the driver's :php:`RuntimeException
    ` class, which in turn extends
diff --git a/source/reference/function/add_logger.txt b/source/reference/function/add_logger.txt
index f00039df..ea105a9f 100644
--- a/source/reference/function/add_logger.txt
+++ b/source/reference/function/add_logger.txt
@@ -15,7 +15,7 @@ MongoDB\\add_logger()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\add_logger()
+.. phpmethod:: MongoDB\add_logger()
 
    Registers a PSR logger to receive log messages from the driver.
 
@@ -58,6 +58,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\remove_logger()`
+- :phpmethod:`MongoDB\remove_logger()`
 - `PSR-3: Logger Interface `__
 - `libmongoc: Logging `__
diff --git a/source/reference/function/remove_logger.txt b/source/reference/function/remove_logger.txt
index 5ced6f0a..099b1c02 100644
--- a/source/reference/function/remove_logger.txt
+++ b/source/reference/function/remove_logger.txt
@@ -15,7 +15,7 @@ MongoDB\\remove_logger()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\remove_logger()
+.. phpmethod:: MongoDB\remove_logger()
 
    Unregisters a PSR logger to no longer receive log messages from the driver.
 
@@ -26,7 +26,7 @@ Definition
 Parameters
 ----------
 
-``$logger`` : Psr\\Log\\LoggerInterface
+``$logger`` : Psr\Log\LoggerInterface
   A logger to unregister.
 
   If the logger is not registered, the method will have no effect.
@@ -39,6 +39,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\add_logger()`
+- :phpmethod:`MongoDB\add_logger()`
 - `PSR-3: Logger Interface `__
 - `libmongoc: Logging `__
diff --git a/source/reference/function/with_transaction.txt b/source/reference/function/with_transaction.txt
index 438ea7a1..b759025e 100644
--- a/source/reference/function/with_transaction.txt
+++ b/source/reference/function/with_transaction.txt
@@ -15,7 +15,7 @@ MongoDB\\with_transaction()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\with_transaction()
+.. phpmethod:: MongoDB\with_transaction()
 
    Execute a callback within a transaction using the given client session
 
@@ -30,17 +30,17 @@ Definition
 Parameters
 ----------
 
-``$session`` : :php:`MongoDB\\Driver\\Session `
+``$session`` : :php:`MongoDB\Driver\Session `
   A client session used to execute the transaction.
 
 ``$callback`` : :php:`callable `
   A callback that will be run inside the transaction. The callback must accept a
-  :php:`MongoDB\\Driver\\Session ` object as its first
+  :php:`MongoDB\Driver\Session ` object as its first
   argument.
 
 ``$transactionOptions`` : array
   Transaction options, which will be passed to
-  :php:`MongoDB\\Driver\\Session::startTransaction `.
+  :php:`MongoDB\Driver\Session::startTransaction `.
   See the extension documentation for a list of supported options.
 
 Behavior
@@ -50,7 +50,7 @@ This function is responsible for starting a transaction, invoking a callback,
 and committing a transaction. It also applies logic to retry this process after
 certain errors within a preset time limit. The callback is expected to execute
 one or more operations within the transactionby passing the callback's
-:php:`MongoDB\\Driver\\Session ` argument as an option to
+:php:`MongoDB\Driver\Session ` argument as an option to
 those operations; however, that is not enforced.
 
 .. note::
@@ -89,7 +89,7 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Session::startTransaction `
-- :php:`MongoDB\\Driver\\Session::commitTransaction `
+- :php:`MongoDB\Driver\Session::startTransaction `
+- :php:`MongoDB\Driver\Session::commitTransaction `
 - :manual:`Transactions: Drivers API ` documentation in the MongoDB manual
 - `Convenient API for Transactions `_ specification
diff --git a/source/reference/functions.txt b/source/reference/functions.txt
index 7d269c2e..a5130b8f 100644
--- a/source/reference/functions.txt
+++ b/source/reference/functions.txt
@@ -17,6 +17,6 @@ Functions
    remove_logger() 
    with_transaction() 
 
-- :phpmethod:`MongoDB\\add_logger()`
-- :phpmethod:`MongoDB\\remove_logger()`
-- :phpmethod:`MongoDB\\with_transaction()`
+- :phpmethod:`MongoDB\add_logger()`
+- :phpmethod:`MongoDB\remove_logger()`
+- :phpmethod:`MongoDB\with_transaction()`
diff --git a/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
index d0501d3f..8dbe98d5 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getDeletedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getDeletedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getDeletedCount()
 
    Return the total number of documents that were deleted by all delete
    operations in the bulk write.
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getDeletedCount()
+- :php:`MongoDB\Driver\WriteResult::getDeletedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
index 6eb1b5de..8d9a4ed8 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getInsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getInsertedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getInsertedCount()
 
    Return the total number of documents that were inserted by all insert
    operations in the bulk write.
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getInsertedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt b/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
index bcbcd536..bb6752ff 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getInsertedIds()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getInsertedIds()
+.. phpmethod:: MongoDB\BulkWriteResult::getInsertedIds()
 
    Return a map of IDs (i.e. ``_id`` field values) for documents that were
    inserted by all insert operations in the bulk write.
@@ -34,5 +34,5 @@ insert operations in the bulk write.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to inserting (i.e. the driver did
 not generate an ID), the index will contain its ``_id`` field value. Any
-driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
+driver-generated ID will be a :php:`MongoDB\BSON\ObjectId
 ` instance.
diff --git a/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
index af1ad98f..02341bed 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getMatchedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getMatchedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getMatchedCount()
 
    Return the total number of documents that were matched by all update and
    replace operations in the bulk write.
@@ -30,7 +30,7 @@ Definition
       (e.g. setting the value of a field to its current value), the matched
       count may be greater than the value returned by
       :phpmethod:`getModifiedCount()
-      `.
+      `.
 
 Return Values
 -------------
@@ -46,6 +46,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\BulkWriteResult::getModifiedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getMatchedCount()
+- :phpmethod:`MongoDB\BulkWriteResult::getModifiedCount()`
+- :php:`MongoDB\Driver\WriteResult::getMatchedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
index da115c5f..6f179bd8 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getModifiedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getModifiedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getModifiedCount()
 
    Return the total number of documents that were modified by all update and
    replace operations in the bulk write.
@@ -29,7 +29,7 @@ Definition
       If an update/replace operation results in no change to the document
       (e.g. setting the value of a field to its current value), the modified
       count may be less than the value returned by :phpmethod:`getMatchedCount()
-      `.
+      `.
 
 Return Values
 -------------
@@ -45,6 +45,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\BulkWriteResult::getMatchedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getModifiedCount()
+- :phpmethod:`MongoDB\BulkWriteResult::getMatchedCount()`
+- :php:`MongoDB\Driver\WriteResult::getModifiedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
index 1f0dff2b..00f1ff1f 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getUpsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getUpsertedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getUpsertedCount()
 
    Return the total number of documents that were upserted by all update and
    replace operations in the bulk write.
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt b/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
index 6abad98f..df0b1fbb 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getUpsertedIds()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getUpsertedIds()
+.. phpmethod:: MongoDB\BulkWriteResult::getUpsertedIds()
 
    Return a map of IDs (i.e. ``_id`` field values) for documents that were
    upserted by all update and replace operations in the bulk write.
@@ -31,7 +31,7 @@ update and replace operations in the bulk write.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to upserting (i.e. the server did
 not generate an ID), the index will contain its ``_id`` field value. Any
-server-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
+server-generated ID will be a :php:`MongoDB\BSON\ObjectId
 ` instance.
 
 Errors/Exceptions
@@ -42,5 +42,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedIds()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedIds()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt b/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
index 1a857caa..611f9fa7 100644
--- a/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::isAcknowledged()
+.. phpmethod:: MongoDB\BulkWriteResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-current.txt b/source/reference/method/MongoDBChangeStream-current.txt
index a8578607..ccff68e0 100644
--- a/source/reference/method/MongoDBChangeStream-current.txt
+++ b/source/reference/method/MongoDBChangeStream-current.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::current()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::current()
+.. phpmethod:: MongoDB\ChangeStream::current()
 
    Returns the current event in the change stream.
 
@@ -29,9 +29,9 @@ Return Values
 -------------
 
 An array or object for the current event in the change stream, or ``null`` if
-there is no current event (i.e. :phpmethod:`MongoDB\\ChangeStream::valid()`
+there is no current event (i.e. :phpmethod:`MongoDB\ChangeStream::valid()`
 returns ``false``). The return type will depend on the ``typeMap`` option for
-:phpmethod:`MongoDB\\Collection::watch()`.
+:phpmethod:`MongoDB\Collection::watch()`.
 
 Examples
 --------
@@ -96,9 +96,9 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::current() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-getCursorId.txt b/source/reference/method/MongoDBChangeStream-getCursorId.txt
index e7004f44..066930e1 100644
--- a/source/reference/method/MongoDBChangeStream-getCursorId.txt
+++ b/source/reference/method/MongoDBChangeStream-getCursorId.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::getCursorId()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::getCursorId()
+.. phpmethod:: MongoDB\ChangeStream::getCursorId()
 
    Returns the change stream cursor's ID.
 
@@ -24,7 +24,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\CursorId ` object.
+A :php:`MongoDB\Driver\CursorId ` object.
 
 Examples
 --------
@@ -55,8 +55,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
-- :php:`MongoDB\\Driver\\CursorId `
-- :php:`MongoDB\\Driver\\Cursor::getId() `
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
+- :php:`MongoDB\Driver\CursorId `
+- :php:`MongoDB\Driver\Cursor::getId() `
diff --git a/source/reference/method/MongoDBChangeStream-getResumeToken.txt b/source/reference/method/MongoDBChangeStream-getResumeToken.txt
index 0930d45c..873e29bb 100644
--- a/source/reference/method/MongoDBChangeStream-getResumeToken.txt
+++ b/source/reference/method/MongoDBChangeStream-getResumeToken.txt
@@ -15,7 +15,7 @@ MongoDB\\ChangeStream::getResumeToken()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::getResumeToken()
+.. phpmethod:: MongoDB\ChangeStream::getResumeToken()
 
    Returns the cached resume token that will be used to resume the change
    stream.
@@ -68,8 +68,8 @@ the ``startAfter`` option.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :manual:`Resume a Change Stream `
   documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-key.txt b/source/reference/method/MongoDBChangeStream-key.txt
index de4754b4..8b35616f 100644
--- a/source/reference/method/MongoDBChangeStream-key.txt
+++ b/source/reference/method/MongoDBChangeStream-key.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::key()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::key()
+.. phpmethod:: MongoDB\ChangeStream::key()
 
    Returns the index of the current event in the change stream.
 
@@ -28,7 +28,7 @@ Return Values
 -------------
 
 The index of the current event in the change stream, or ``null`` if there is no
-current event (i.e. :phpmethod:`MongoDB\\ChangeStream::valid()` returns
+current event (i.e. :phpmethod:`MongoDB\ChangeStream::valid()` returns
 ``false``).
 
 Examples
@@ -68,9 +68,9 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::key() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-next.txt b/source/reference/method/MongoDBChangeStream-next.txt
index c25f039b..559ae4cb 100644
--- a/source/reference/method/MongoDBChangeStream-next.txt
+++ b/source/reference/method/MongoDBChangeStream-next.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::next()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::next()
+.. phpmethod:: MongoDB\ChangeStream::next()
 
    Advances the change stream and attempts to load the next event.
 
@@ -25,7 +25,7 @@ Definition
 
       Advancing the change stream does not guarantee that there will be a
       current event to access. You should still call
-      :phpmethod:`MongoDB\\ChangeStream::valid()` to check for a current event
+      :phpmethod:`MongoDB\ChangeStream::valid()` to check for a current event
       at each step of iteration.
 
 Errors/Exceptions
@@ -36,9 +36,9 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::next() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-rewind.txt b/source/reference/method/MongoDBChangeStream-rewind.txt
index e59a1399..066e99aa 100644
--- a/source/reference/method/MongoDBChangeStream-rewind.txt
+++ b/source/reference/method/MongoDBChangeStream-rewind.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::rewind()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::rewind()
+.. phpmethod:: MongoDB\ChangeStream::rewind()
 
    Rewinds the change stream and attempts to load the first event.
 
@@ -27,18 +27,18 @@ Definition
 
       Rewinding the change stream does not guarantee that there will be a
       current event to access. You should still call
-      :phpmethod:`MongoDB\\ChangeStream::valid()` to check for a current event
+      :phpmethod:`MongoDB\ChangeStream::valid()` to check for a current event
       at each step of iteration. After initially rewinding the change stream,
-      :phpmethod:`MongoDB\\ChangeStream::next()` should be used to iterate
+      :phpmethod:`MongoDB\ChangeStream::next()` should be used to iterate
       further.
 
 Errors/Exceptions
 -----------------
 
-:php:`MongoDB\\Driver\\Exception\\LogicException
+:php:`MongoDB\Driver\Exception\LogicException
 ` if this method is called after a call
-to :phpmethod:`MongoDB\\ChangeStream::next()` (i.e. the underlying
-:php:`MongoDB\\Driver\\Cursor ` has already been
+to :phpmethod:`MongoDB\ChangeStream::next()` (i.e. the underlying
+:php:`MongoDB\Driver\Cursor ` has already been
 advanced).
 
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
@@ -46,9 +46,9 @@ advanced).
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::rewind() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-valid.txt b/source/reference/method/MongoDBChangeStream-valid.txt
index 69ea1cd6..bab45f1f 100644
--- a/source/reference/method/MongoDBChangeStream-valid.txt
+++ b/source/reference/method/MongoDBChangeStream-valid.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::valid()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::valid()
+.. phpmethod:: MongoDB\ChangeStream::valid()
 
    Returns whether there is a current event in the change stream.
 
@@ -23,8 +23,8 @@ Definition
 
    When manually iterating the change stream using
    :php:`Iterator ` methods, this method should
-   be used to determine if :phpmethod:`MongoDB\\ChangeStream::current()` and
-   :phpmethod:`MongoDB\\ChangeStream::key()` can be called.
+   be used to determine if :phpmethod:`MongoDB\ChangeStream::current()` and
+   :phpmethod:`MongoDB\ChangeStream::key()` can be called.
 
 Return Values
 -------------
@@ -34,9 +34,9 @@ A boolean indicating whether there is a current event in the change stream.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::valid() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-createClientEncryption.txt b/source/reference/method/MongoDBClient-createClientEncryption.txt
index 0dd925cd..ef0d2529 100644
--- a/source/reference/method/MongoDBClient-createClientEncryption.txt
+++ b/source/reference/method/MongoDBClient-createClientEncryption.txt
@@ -13,9 +13,9 @@ MongoDB\\Client::createClientEncryption()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::createClientEncryption()
+.. phpmethod:: MongoDB\Client::createClientEncryption()
 
-   Returns a :php:`MongoDB\\Driver\\ClientEncryption `
+   Returns a :php:`MongoDB\Driver\ClientEncryption `
    object for manual encryption and decryption of values.
 
    .. code-block:: php
@@ -27,18 +27,18 @@ Parameters
 
 ``$options`` : array
   An array specifying the desired options. Refer to the
-  :php:`MongoDB\\Driver\\Manager::createClientEncryption() `
+  :php:`MongoDB\Driver\Manager::createClientEncryption() `
   extension documentation for a list of supported options.
 
-  If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+  If a :phpclass:`MongoDB\Client` is provided for the ``keyVaultClient``
   option, it will be unwrapped into a
-  :php:`MongoDB\\Driver\\Manager ` for the
+  :php:`MongoDB\Driver\Manager ` for the
   extension.
 
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ClientEncryption `
+A :php:`MongoDB\Driver\ClientEncryption `
 instance which can be used to encrypt and decrypt values.
 
 Errors/Exceptions
@@ -50,5 +50,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Manager::createClientEncryption()
+- :php:`MongoDB\Driver\Manager::createClientEncryption()
   `
diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index 5a268765..9545ed49 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::dropDatabase()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::dropDatabase()
+.. phpmethod:: MongoDB\Client::dropDatabase()
 
    Drop a database on the server.
 
@@ -47,7 +47,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -59,7 +59,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/client-option-writeConcern.rst
 
 Return Values
@@ -108,6 +108,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::drop()`
+- :phpmethod:`MongoDB\Database::drop()`
 - :manual:`dropDatabase ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-getManager.txt b/source/reference/method/MongoDBClient-getManager.txt
index c320595d..9618beca 100644
--- a/source/reference/method/MongoDBClient-getManager.txt
+++ b/source/reference/method/MongoDBClient-getManager.txt
@@ -13,11 +13,11 @@ MongoDB\\Client::getManager()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getManager()
+.. phpmethod:: MongoDB\Client::getManager()
 
    Accessor for the
-   :php:`MongoDB\\Driver\\Manager ` used by this
-   :phpclass:`Client `.
+   :php:`MongoDB\Driver\Manager ` used by this
+   :phpclass:`Client `.
 
    .. code-block:: php
 
@@ -26,10 +26,10 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\Driver\Manager ` object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getManager()`
-- :phpmethod:`MongoDB\\Database::getManager()`
+- :phpmethod:`MongoDB\Collection::getManager()`
+- :phpmethod:`MongoDB\Database::getManager()`
diff --git a/source/reference/method/MongoDBClient-getReadConcern.txt b/source/reference/method/MongoDBClient-getReadConcern.txt
index 64f2b3d4..89643bd5 100644
--- a/source/reference/method/MongoDBClient-getReadConcern.txt
+++ b/source/reference/method/MongoDBClient-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getReadConcern()
+.. phpmethod:: MongoDB\Client::getReadConcern()
 
    Returns the read concern for this client.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -54,7 +54,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBClient-getReadPreference.txt b/source/reference/method/MongoDBClient-getReadPreference.txt
index cd00f206..564d108f 100644
--- a/source/reference/method/MongoDBClient-getReadPreference.txt
+++ b/source/reference/method/MongoDBClient-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getReadPreference()
+.. phpmethod:: MongoDB\Client::getReadPreference()
 
    Returns the read preference for this client.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -55,6 +55,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBClient-getTypeMap.txt b/source/reference/method/MongoDBClient-getTypeMap.txt
index 138444f0..89c620af 100644
--- a/source/reference/method/MongoDBClient-getTypeMap.txt
+++ b/source/reference/method/MongoDBClient-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getTypeMap()
+.. phpmethod:: MongoDB\Client::getTypeMap()
 
    Returns the type map for this client.
 
@@ -62,6 +62,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBClient-getWriteConcern.txt b/source/reference/method/MongoDBClient-getWriteConcern.txt
index 7a3e561c..270707f0 100644
--- a/source/reference/method/MongoDBClient-getWriteConcern.txt
+++ b/source/reference/method/MongoDBClient-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getWriteConcern()
+.. phpmethod:: MongoDB\Client::getWriteConcern()
 
    Returns the write concern for this client.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -55,7 +55,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBClient-listDatabaseNames.txt b/source/reference/method/MongoDBClient-listDatabaseNames.txt
index cac7d22c..bdb7e095 100644
--- a/source/reference/method/MongoDBClient-listDatabaseNames.txt
+++ b/source/reference/method/MongoDBClient-listDatabaseNames.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::listDatabaseNames()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::listDatabaseNames()
+.. phpmethod:: MongoDB\Client::listDatabaseNames()
 
    Returns names for all databases on the server.
 
@@ -69,7 +69,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -112,7 +112,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::listDatabases()`
+- :phpmethod:`MongoDB\Client::listDatabases()`
 - :manual:`listDatabases ` command reference
   in the MongoDB manual
 - `Enumerating Databases
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index dd6b2da8..93a4d65a 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::listDatabases()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::listDatabases()
+.. phpmethod:: MongoDB\Client::listDatabases()
 
    Returns information for all databases on the server.
 
@@ -67,7 +67,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -77,8 +77,8 @@ Parameters
 Return Values
 -------------
 
-A traversable :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`, which contains
-a :phpclass:`MongoDB\\Model\\DatabaseInfo` object for each database on the
+A traversable :phpclass:`MongoDB\Model\DatabaseInfoIterator`, which contains
+a :phpclass:`MongoDB\Model\DatabaseInfo` object for each database on the
 server.
 
 Errors/Exceptions
@@ -127,7 +127,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::listDatabaseNames()`
+- :phpmethod:`MongoDB\Client::listDatabaseNames()`
 - :manual:`listDatabases ` command reference
   in the MongoDB manual
 - `Enumerating Databases
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 6700f023..e7e58e86 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::selectCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::selectCollection()
+.. phpmethod:: MongoDB\Client::selectCollection()
 
    Selects a collection on the server.
 
@@ -46,12 +46,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the client's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the client's read preference.
 
@@ -61,14 +61,14 @@ Parameters
          client's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults to
          the client's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Errors/Exceptions
 -----------------
@@ -79,7 +79,7 @@ Behavior
 --------
 
 The selected collection inherits options such as read preference and type
-mapping from the :phpclass:`Client ` object. Options may be
+mapping from the :phpclass:`Client ` object. Options may be
 overridden via the ``$options`` parameter.
 
 Example
@@ -115,5 +115,5 @@ with a custom read preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::__construct()`
-- :phpmethod:`MongoDB\\Database::selectCollection()`
+- :phpmethod:`MongoDB\Collection::__construct()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index b1814516..33c7ec32 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::selectDatabase()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::selectDatabase()
+.. phpmethod:: MongoDB\Client::selectDatabase()
 
    Selects a database on the server.
 
@@ -42,12 +42,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for database operations. Defaults to
          the client's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for database operations. Defaults to
          the client's read preference.
 
@@ -57,14 +57,14 @@ Parameters
          client's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for database operations. Defaults to
          the client's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\Database` object.
 
 Errors/Exceptions
 -----------------
@@ -75,7 +75,7 @@ Behavior
 --------
 
 The selected database inherits options such as read preference and type mapping
-from the :phpclass:`Client ` object. Options may be overridden
+from the :phpclass:`Client ` object. Options may be overridden
 via the ``$options`` parameter.
 
 Example
@@ -110,5 +110,5 @@ preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::__get()`
-- :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\Client::__get()`
+- :phpmethod:`MongoDB\Database::__construct()`
diff --git a/source/reference/method/MongoDBClient-startSession.txt b/source/reference/method/MongoDBClient-startSession.txt
index 8de00ee0..0e3d8eb1 100644
--- a/source/reference/method/MongoDBClient-startSession.txt
+++ b/source/reference/method/MongoDBClient-startSession.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::startSession()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::startSession()
+.. phpmethod:: MongoDB\Client::startSession()
 
    Start a new client session for use with this client.
 
@@ -28,7 +28,7 @@ Parameters
 
 ``$options`` : array
   An array specifying the desired options. Refer to the
-  :php:`MongoDB\\Driver\\Manager::startSession() `
+  :php:`MongoDB\Driver\Manager::startSession() `
   extension documentation for a list of supported options.
 
 Return Values
@@ -83,6 +83,6 @@ The output would then resemble:
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Manager::startSession()
+- :php:`MongoDB\Driver\Manager::startSession()
   `
 - :ref:`Causal Consistency ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-watch.txt b/source/reference/method/MongoDBClient-watch.txt
index 2977475a..1cee5f01 100644
--- a/source/reference/method/MongoDBClient-watch.txt
+++ b/source/reference/method/MongoDBClient-watch.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::watch()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::watch()
+.. phpmethod:: MongoDB\Client::watch()
 
    Executes a :manual:`change stream ` operation on the client.
    The change stream can be watched for cluster-level changes.
@@ -73,11 +73,11 @@ Parameters
        - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/client-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/client-option-readPreference.rst
 
          This is used for both the initial change stream aggregation and for
@@ -88,7 +88,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-resumeAfter.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - showExpandedEvents
@@ -100,7 +100,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-startAfter.rst
 
      * - startAtOperationTime
-       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - :php:`MongoDB\BSON\TimestampInterface `
        - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
      * - typeMap
@@ -110,7 +110,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+A :phpclass:`MongoDB\ChangeStream` object, which allows for iteration of
 events in the change stream via the :php:`Iterator ` interface.
 
 Errors/Exceptions
@@ -189,8 +189,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index 17c213ff..79e5daa8 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\Client::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::__construct()
+.. phpmethod:: MongoDB\Client::__construct()
 
-   Constructs a new :phpclass:`Client ` instance.
+   Constructs a new :phpclass:`Client ` instance.
 
    .. code-block:: php
 
@@ -49,7 +49,7 @@ Parameters
   over any analogous options present in the ``$uri`` string and do not need to
   be encoded according to `RFC 3986 `_.
 
-  Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
+  Refer to the :php:`MongoDB\Driver\Manager::__construct()
   ` extension documentation for a list of
   supported options.
 
@@ -75,9 +75,9 @@ Parameters
          :php:`extension documentation `
          for a list of supported encryption options.
 
-         If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+         If a :phpclass:`MongoDB\Client` is provided for the ``keyVaultClient``
          option, it will be unwrapped into a
-         :php:`MongoDB\\Driver\\Manager ` for the
+         :php:`MongoDB\Driver\Manager ` for the
          extension.
 
          .. versionadded:: 1.6
@@ -106,7 +106,7 @@ Parameters
          .. versionadded:: 1.7
 
      * - serverApi
-       - :php:`MongoDB\\Driver\\ServerApi `
+       - :php:`MongoDB\Driver\ServerApi `
        - Used to declare an API version on the client. Refer to the
          :manual:`Stable API ` page in the Server manual for
          additional information.
@@ -219,10 +219,10 @@ Errors/Exceptions
 Behavior
 --------
 
-A :php:`MongoDB\\Driver\\Manager ` is constructed
+A :php:`MongoDB\Driver\Manager ` is constructed
 internally. Per the `Server Discovery and Monitoring
 `_
-specification, :php:`MongoDB\\Driver\\Manager::__construct()
+specification, :php:`MongoDB\Driver\Manager::__construct()
 ` performs no I/O. Connections will be
 initialized on demand, when the first operation is executed.
 
@@ -237,7 +237,7 @@ Connecting to a Standalone server
 If you do not specify a ``$uri`` value, the driver connects to a standalone
 :program:`mongod` on ``127.0.0.1`` via port ``27017``. To connect to a different
 server, pass the corresponding connection string as the first parameter when
-creating the :phpclass:`Client ` instance:
+creating the :phpclass:`Client ` instance:
 
 .. code-block:: php
 
@@ -298,7 +298,7 @@ specified in the constructor's ``$uriOptions`` parameter:
 The driver supports additional :php:`SSL options
 `,
 which may be specified in the constructor's ``$driverOptions`` parameter. Those
-options are covered in the :php:`MongoDB\\Driver\\Manager::__construct()
+options are covered in the :php:`MongoDB\Driver\Manager::__construct()
 ` documentation.
 
 .. end-connecting-include
@@ -307,8 +307,8 @@ Specifying a Custom Type Map
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 By default, the |php-library| deserializes BSON documents and arrays
-as :phpclass:`MongoDB\\Model\\BSONDocument` and
-:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The following
+as :phpclass:`MongoDB\Model\BSONDocument` and
+:phpclass:`MongoDB\Model\BSONArray` objects, respectively. The following
 example demonstrates how to have the library unserialize everything as a PHP
 array, as was done in the legacy ``mongo`` extension.
 
@@ -331,7 +331,7 @@ array, as was done in the legacy ``mongo`` extension.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Manager::__construct()
+- :php:`MongoDB\Driver\Manager::__construct()
   `
 - :manual:`Connection String URI Format ` in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
index 88de4725..d391b12a 100644
--- a/source/reference/method/MongoDBClient__get.txt
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -13,11 +13,11 @@ MongoDB\\Client::__get()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::__get()
+.. phpmethod:: MongoDB\Client::__get()
 
    Selects a database on the server. This :php:`magic method ` is
    an alias for the :phpmethod:`selectDatabase()
-   ` method.
+   ` method.
 
    .. code-block:: php
 
@@ -32,21 +32,21 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\Database` object.
 
 Behavior
 --------
 
 The selected database inherits options such as read preference and type mapping
-from the :phpclass:`Client ` object. If you wish to override
-any options, use the :phpmethod:`MongoDB\\Client::selectDatabase()` method.
+from the :phpclass:`Client ` object. If you wish to override
+any options, use the :phpmethod:`MongoDB\Client::selectDatabase()` method.
 
 .. note::
 
    To select databases whose names contain special characters, such as
    ``-``, use complex syntax, as in ``$client->{'that-database'}``.
 
-   Alternatively, :phpmethod:`MongoDB\\Client::selectDatabase()` supports
+   Alternatively, :phpmethod:`MongoDB\Client::selectDatabase()` supports
    selecting databases whose names contain special characters.
 
 Examples
@@ -66,6 +66,6 @@ The following example selects the ``test`` and ``another-app`` databases:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::selectDatabase()`
-- :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\Client::selectDatabase()`
+- :phpmethod:`MongoDB\Database::__construct()`
 - :php:`Property Overloading ` in the PHP Manual
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index 11f9d19b..4566b92b 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::aggregate()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::aggregate()
+.. phpmethod:: MongoDB\Collection::aggregate()
 
    Executes an :manual:`aggregation framework pipeline
    ` operation on the collection.
@@ -107,17 +107,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -127,7 +127,7 @@ Parameters
        - .. include:: /includes/extracts/collection-option-typeMap.rst
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -138,7 +138,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` or
+A :php:`MongoDB\Driver\Cursor ` or
 :php:`ArrayIterator ` object. In both cases, the return value
 will be :php:`Traversable `.
 
@@ -155,8 +155,8 @@ Errors/Exceptions
 Behavior
 --------
 
-:phpmethod:`MongoDB\\Collection::aggregate()`'s returns a
-:php:`MongoDB\\Driver\\Cursor ` object.
+:phpmethod:`MongoDB\Collection::aggregate()`'s returns a
+:php:`MongoDB\Driver\Cursor ` object.
 
 Examples
 --------
@@ -181,7 +181,7 @@ group, and sorts the results by name.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::aggregate()`
+- :phpmethod:`MongoDB\Database::aggregate()`
 - :manual:`aggregate ` command reference in the
   MongoDB manual
 - :manual:`Aggregation Pipeline ` documentation in
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index a86e9cc6..f76d6ca6 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::bulkWrite()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::bulkWrite()
+.. phpmethod:: MongoDB\Collection::bulkWrite()
 
    Executes multiple write operations.
 
@@ -29,13 +29,13 @@ Parameters
 
 ``$operations`` : array
   An array containing the write operations to perform.
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` supports
-  :phpmethod:`deleteMany() `,
-  :phpmethod:`deleteOne() `,
-  :phpmethod:`insertOne() `,
-  :phpmethod:`replaceOne() `,
-  :phpmethod:`updateMany() `, and
-  :phpmethod:`updateOne() ` operations in the
+  :phpmethod:`MongoDB\Collection::bulkWrite()` supports
+  :phpmethod:`deleteMany() `,
+  :phpmethod:`deleteOne() `,
+  :phpmethod:`insertOne() `,
+  :phpmethod:`replaceOne() `,
+  :phpmethod:`updateMany() `, and
+  :phpmethod:`updateOne() ` operations in the
   following array structure:
 
   .. code-block:: php
@@ -51,7 +51,7 @@ Parameters
 
   Arguments correspond to the respective operation methods. However, the
   ``writeConcern`` option is specified as a top-level option to
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
+  :phpmethod:`MongoDB\Collection::bulkWrite()` instead of each individual
   operation.
 
 ``$options`` : array
@@ -95,13 +95,13 @@ Parameters
          The default is ``true``.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -109,8 +109,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\BulkWriteResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\BulkWriteResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -131,11 +131,11 @@ Behavior
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::deleteMany()`
-- :phpmethod:`MongoDB\\Collection::deleteOne()`
-- :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::deleteMany()`
+- :phpmethod:`MongoDB\Collection::deleteOne()`
+- :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
 - :doc:`/tutorial/crud`
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 0048703f..388f5bda 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::count()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::count()
+.. phpmethod:: MongoDB\Collection::count()
 
    Count the number of documents that match the filter criteria.
 
@@ -74,17 +74,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -117,7 +117,7 @@ is provided, the ``count`` command provides an estimate using collection
 metadata. Even when provided with a query filter the ``count`` command can
 return inaccurate results with a sharded cluster if orphaned documents exist or
 if a chunk migration is in progress. The
-:phpmethod:`MongoDB\\Collection::countDocuments()` method avoids these sharded
+:phpmethod:`MongoDB\Collection::countDocuments()` method avoids these sharded
 cluster problems entirely.
 
 .. include:: /includes/extracts/note-bson-comparison.rst
@@ -127,5 +127,5 @@ See Also
 
 - :manual:`count ` command reference in the MongoDB
   manual
-- :phpmethod:`MongoDB\\Collection::countDocuments()`
-- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
+- :phpmethod:`MongoDB\Collection::countDocuments()`
+- :phpmethod:`MongoDB\Collection::estimatedDocumentCount()`
diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt
index dc62b1d6..dc344f2d 100644
--- a/source/reference/method/MongoDBCollection-countDocuments.txt
+++ b/source/reference/method/MongoDBCollection-countDocuments.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::countDocuments()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::countDocuments()
+.. phpmethod:: MongoDB\Collection::countDocuments()
 
    Count the number of documents that match the filter criteria.
 
@@ -63,17 +63,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - skip
@@ -105,12 +105,12 @@ added between ``$match`` and ``group`` if present in the options.
 
    This method counts documents on the server side. To obtain an approximate
    total number of documents without filters, the
-   :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()` method can be
+   :phpmethod:`MongoDB\Collection::estimatedDocumentCount()` method can be
    used. This method estimates the number of documents based on collection
    metadata, thus sacrificing accuracy for performance.
 
 Since this method uses an aggregation pipeline, some query operators accepted
-within a :phpmethod:`MongoDB\\Collection::count()` ``filter`` cannot be used.
+within a :phpmethod:`MongoDB\Collection::count()` ``filter`` cannot be used.
 Consider the following alternatives to these restricted operators:
 
 .. list-table::
@@ -135,4 +135,4 @@ Consider the following alternatives to these restricted operators:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
+- :phpmethod:`MongoDB\Collection::estimatedDocumentCount()`
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index 7f8aca41..6a74a5bd 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::createIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::createIndex()
+.. phpmethod:: MongoDB\Collection::createIndex()
 
    Create an index for the collection.
 
@@ -117,13 +117,13 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -200,7 +200,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndexes()`
 - :doc:`/tutorial/indexes`
 - :manual:`createIndexes ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index efb740ea..85318b2d 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::createIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::createIndexes()
+.. phpmethod:: MongoDB\Collection::createIndexes()
 
    Create one or more indexes for the collection.
 
@@ -81,13 +81,13 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -113,9 +113,9 @@ Behavior
 The ``$indexes`` parameter is an array of index specification documents. Each
 element in ``$indexes`` must itself be an array or object with a ``key`` field,
 which corresponds to the ``$key`` parameter of :phpmethod:`createIndex()
-`. The array or object may include other
+`. The array or object may include other
 fields that correspond to index options accepted by :phpmethod:`createIndex()
-`. For a full list of the supported index
+`. For a full list of the supported index
 creation options, refer to the
 :manual:`createIndexes ` command reference
 in the MongoDB manual.
@@ -166,7 +166,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :doc:`/tutorial/indexes`
 - :manual:`createIndexes ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-createSearchIndex.txt b/source/reference/method/MongoDBCollection-createSearchIndex.txt
index df947463..ae85f97f 100644
--- a/source/reference/method/MongoDBCollection-createSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-createSearchIndex.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::createSearchIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::createSearchIndex()
+.. phpmethod:: MongoDB\Collection::createSearchIndex()
 
    Create an Atlas Search index for the collection.
 
@@ -107,10 +107,10 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::updateSearchIndex()`
 - :manual:`createSearchIndexes ` command
   reference in the MongoDB manual
 - `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-createSearchIndexes.txt b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
index a3081e60..85d27d84 100644
--- a/source/reference/method/MongoDBCollection-createSearchIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::createSearchIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::createSearchIndexes()
+.. phpmethod:: MongoDB\Collection::createSearchIndexes()
 
    Create one or more Atlas Search indexes for the collection.
 
@@ -114,10 +114,10 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::updateSearchIndex()`
 - :manual:`createSearchIndexes ` command
   reference in the MongoDB manual
 - `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index ccb5e37d..b82b1c6b 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::deleteMany()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::deleteMany()
+.. phpmethod:: MongoDB\Collection::deleteMany()
 
    Deletes all documents that match the filter criteria.
 
@@ -68,13 +68,13 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -82,8 +82,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\DeleteResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -127,8 +127,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::deleteOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::deleteOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`delete ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index 0c659891..43209ebd 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::deleteOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::deleteOne()
+.. phpmethod:: MongoDB\Collection::deleteOne()
 
    Deletes at most one document that matches the filter criteria. If multiple
    documents match the filter criteria, only the :term:`first `
@@ -70,13 +70,13 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -84,8 +84,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\DeleteResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -129,8 +129,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::deleteMany()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::deleteMany()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`delete ` command reference  in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index 42eae068..f8bcd4b0 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::distinct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::distinct()
+.. phpmethod:: MongoDB\Collection::distinct()
 
    Finds the distinct values for a specified field across the collection.
 
@@ -63,17 +63,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index 0704ff6a..93b6a17c 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::drop()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::drop()
+.. phpmethod:: MongoDB\Collection::drop()
 
    Drop the collection.
 
@@ -64,7 +64,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -76,7 +76,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -132,6 +132,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::dropCollection()`
+- :phpmethod:`MongoDB\Database::dropCollection()`
 - :manual:`drop ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index 07a18145..67ba427e 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::dropIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::dropIndex()
+.. phpmethod:: MongoDB\Collection::dropIndex()
 
    Drop an index from the collection.
 
@@ -27,10 +27,10 @@ Definition
 Parameters
 ----------
 
-``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+``$indexName`` : string| :phpclass:`MongoDB\Model\IndexInfo`
   The name or model object of the index to drop. View the existing indexes on
   the collection using the :phpmethod:`listIndexes()
-  ` method.
+  ` method.
 
 ``$options`` : array
   An array specifying the desired options.
@@ -58,7 +58,7 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -70,7 +70,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -122,7 +122,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::dropIndexes()`
+- :phpmethod:`MongoDB\Collection::dropIndexes()`
 - :doc:`/tutorial/indexes`
 - :manual:`dropIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index 41fda6e4..52595c71 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::dropIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::dropIndexes()
+.. phpmethod:: MongoDB\Collection::dropIndexes()
 
    Drop all indexes in the collection, except for the required index on the
    ``_id`` field.
@@ -25,10 +25,10 @@ Definition
 Parameters
 ----------
 
-``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+``$indexName`` : string| :phpclass:`MongoDB\Model\IndexInfo`
   The name or model object of the index to drop. View the existing indexes on
   the collection using the :phpmethod:`listIndexes()
-  ` method.
+  ` method.
 
 ``$options`` : array
   An array specifying the desired options.
@@ -56,7 +56,7 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -68,7 +68,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -122,7 +122,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::dropIndex()`
+- :phpmethod:`MongoDB\Collection::dropIndex()`
 - :doc:`/tutorial/indexes`
 - :manual:`dropIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-dropSearchIndex.txt b/source/reference/method/MongoDBCollection-dropSearchIndex.txt
index f3499273..fb6be0e0 100644
--- a/source/reference/method/MongoDBCollection-dropSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropSearchIndex.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::dropSearchIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::dropSearchIndex()
+.. phpmethod:: MongoDB\Collection::dropSearchIndex()
 
    Drop an Atlas Search index for the collection.
 
@@ -56,10 +56,10 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::updateSearchIndex()`
 - :manual:`dropSearchIndex ` command
   reference in the MongoDB manual
 - `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
index 59a7b212..1dd1d2a6 100644
--- a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
+++ b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::estimatedDocumentCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::estimatedDocumentCount()
+.. phpmethod:: MongoDB\Collection::estimatedDocumentCount()
 
    Gets an estimated number of documents in the collection using collection metadata.
 
@@ -50,17 +50,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
@@ -97,4 +97,4 @@ See Also
 
 - :manual:`count ` command reference in the MongoDB
   manual
-- :phpmethod:`MongoDB\\Collection::countDocuments()`
+- :phpmethod:`MongoDB\Collection::countDocuments()`
diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt
index ad63ec56..592f717e 100644
--- a/source/reference/method/MongoDBCollection-explain.txt
+++ b/source/reference/method/MongoDBCollection-explain.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::explain()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::explain()
+.. phpmethod:: MongoDB\Collection::explain()
 
    Explain the given command.
 
@@ -29,7 +29,7 @@ Definition
 Parameters
 ----------
 
-``$explainable`` : :phpclass:`MongoDB\\Operation\\Explainable`
+``$explainable`` : :phpclass:`MongoDB\Operation\Explainable`
   The command to explain.
 
 ``$options`` : array
@@ -54,7 +54,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - typeMap
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 8c0ce7c2..25cca009 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::find()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::find()
+.. phpmethod:: MongoDB\Collection::find()
 
    Finds documents matching the query.
 
@@ -156,7 +156,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -171,13 +171,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - returnKey
@@ -187,7 +187,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -222,7 +222,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\Driver\Cursor ` object.
 
 Errors/Exceptions
 -----------------
@@ -357,6 +357,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOne()`
+- :phpmethod:`MongoDB\Collection::findOne()`
 - :manual:`find ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index c5230c6c..d00c5866 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOne()
+.. phpmethod:: MongoDB\Collection::findOne()
 
    Finds a single document matching the query.
 
@@ -113,7 +113,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -128,13 +128,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - returnKey
@@ -144,7 +144,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -199,7 +199,7 @@ In the following example, documents in the ``restaurants`` collection use an
 :manual:`ObjectId ` for their identifier (the default)
 and documents in the ``zips`` collection use a string. Since ObjectId is a
 special BSON type, the query criteria for selecting a restaurant must use the
-:php:`MongoDB\\BSON\\ObjectId ` class.
+:php:`MongoDB\BSON\ObjectId ` class.
 
 .. code-block:: php
 
@@ -267,6 +267,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::find()`
+- :phpmethod:`MongoDB\Collection::find()`
 - :manual:`find ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index b34bd578..9a7066b7 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOneAndDelete()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndDelete()
+.. phpmethod:: MongoDB\Collection::findOneAndDelete()
 
    Finds a single document matching the query and deletes it.
 
@@ -80,7 +80,7 @@ Parameters
          the MongoDB manual.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -96,7 +96,7 @@ Parameters
          This will be used for the returned result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -169,7 +169,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
-- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+- :phpmethod:`MongoDB\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 - :manual:`findAndModify ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 697e7371..48f6df29 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOneAndReplace()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndReplace()
+.. phpmethod:: MongoDB\Collection::findOneAndReplace()
 
    Finds a single document matching the query and replaces it.
 
@@ -97,7 +97,7 @@ Parameters
          - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -119,7 +119,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -242,7 +242,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
-- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+- :phpmethod:`MongoDB\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 - :manual:`findAndModify ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index cbfbad16..f4077b34 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOneAndUpdate()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndUpdate()
+.. phpmethod:: MongoDB\Collection::findOneAndUpdate()
 
    Finds a single document matching the query and updates it.
 
@@ -108,7 +108,7 @@ Parameters
          - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -130,7 +130,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -220,7 +220,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
-- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\Collection::findOneAndReplace()`
 - :manual:`findAndModify ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-getCollectionName.txt b/source/reference/method/MongoDBCollection-getCollectionName.txt
index 70be8a8a..9b629232 100644
--- a/source/reference/method/MongoDBCollection-getCollectionName.txt
+++ b/source/reference/method/MongoDBCollection-getCollectionName.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::getCollectionName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getCollectionName()
+.. phpmethod:: MongoDB\Collection::getCollectionName()
 
    Returns the name of this collection.
 
@@ -49,5 +49,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
diff --git a/source/reference/method/MongoDBCollection-getDatabaseName.txt b/source/reference/method/MongoDBCollection-getDatabaseName.txt
index f83632ba..5cb4902c 100644
--- a/source/reference/method/MongoDBCollection-getDatabaseName.txt
+++ b/source/reference/method/MongoDBCollection-getDatabaseName.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::getDatabaseName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getDatabaseName()
+.. phpmethod:: MongoDB\Collection::getDatabaseName()
 
    Returns the name of the database containing this collection.
 
@@ -49,6 +49,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
 
diff --git a/source/reference/method/MongoDBCollection-getManager.txt b/source/reference/method/MongoDBCollection-getManager.txt
index e0bbea08..427ed29e 100644
--- a/source/reference/method/MongoDBCollection-getManager.txt
+++ b/source/reference/method/MongoDBCollection-getManager.txt
@@ -13,11 +13,11 @@ MongoDB\\Collection::getManager()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getManager()
+.. phpmethod:: MongoDB\Collection::getManager()
 
    Accessor for the
-   :php:`MongoDB\\Driver\\Manager ` used by this
-   :phpclass:`Collection `.
+   :php:`MongoDB\Driver\Manager ` used by this
+   :phpclass:`Collection `.
 
    .. code-block:: php
 
@@ -26,10 +26,10 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\Driver\Manager ` object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::getManager()`
-- :phpmethod:`MongoDB\\Database::getManager()`
+- :phpmethod:`MongoDB\Client::getManager()`
+- :phpmethod:`MongoDB\Database::getManager()`
diff --git a/source/reference/method/MongoDBCollection-getNamespace.txt b/source/reference/method/MongoDBCollection-getNamespace.txt
index 78e2484b..4003fbd8 100644
--- a/source/reference/method/MongoDBCollection-getNamespace.txt
+++ b/source/reference/method/MongoDBCollection-getNamespace.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::getNamespace()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getNamespace()
+.. phpmethod:: MongoDB\Collection::getNamespace()
 
    Returns the :term:`namespace` of the collection. A namespace is the canonical
    name of an index or collection in MongoDB.
@@ -50,5 +50,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
-- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getDatabaseName()`
diff --git a/source/reference/method/MongoDBCollection-getReadConcern.txt b/source/reference/method/MongoDBCollection-getReadConcern.txt
index 37873d0f..0ce0b482 100644
--- a/source/reference/method/MongoDBCollection-getReadConcern.txt
+++ b/source/reference/method/MongoDBCollection-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getReadConcern()
+.. phpmethod:: MongoDB\Collection::getReadConcern()
 
    Returns the read concern for this collection.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -54,7 +54,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBCollection-getReadPreference.txt b/source/reference/method/MongoDBCollection-getReadPreference.txt
index 622701e5..b14980ae 100644
--- a/source/reference/method/MongoDBCollection-getReadPreference.txt
+++ b/source/reference/method/MongoDBCollection-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getReadPreference()
+.. phpmethod:: MongoDB\Collection::getReadPreference()
 
    Returns the read preference for this collection.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -55,6 +55,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBCollection-getTypeMap.txt b/source/reference/method/MongoDBCollection-getTypeMap.txt
index 50cd91da..8cd9240c 100644
--- a/source/reference/method/MongoDBCollection-getTypeMap.txt
+++ b/source/reference/method/MongoDBCollection-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getTypeMap()
+.. phpmethod:: MongoDB\Collection::getTypeMap()
 
    Returns the type map for this collection.
 
@@ -62,6 +62,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBCollection-getWriteConcern.txt b/source/reference/method/MongoDBCollection-getWriteConcern.txt
index a7ad354d..cc3e5d94 100644
--- a/source/reference/method/MongoDBCollection-getWriteConcern.txt
+++ b/source/reference/method/MongoDBCollection-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getWriteConcern()
+.. phpmethod:: MongoDB\Collection::getWriteConcern()
 
    Returns the write concern for this collection.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -57,7 +57,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 6ff516e7..37f7d82f 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::insertMany()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::insertMany()
+.. phpmethod:: MongoDB\Collection::insertMany()
 
    Insert multiple documents.
 
@@ -65,13 +65,13 @@ Parameters
          The default is ``true``.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -79,8 +79,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\InsertManyResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\InsertManyResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -149,8 +149,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`insert ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index ce6f0484..7a638bdc 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::insertOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::insertOne()
+.. phpmethod:: MongoDB\Collection::insertOne()
 
    Insert one document.
 
@@ -55,13 +55,13 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -69,8 +69,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\InsertOneResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\InsertOneResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -123,8 +123,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`insert ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index 84ee74b3..b65b228b 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::listIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::listIndexes()
+.. phpmethod:: MongoDB\Collection::listIndexes()
 
    Returns information for all indexes for this collection.
 
@@ -48,7 +48,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -56,8 +56,8 @@ Parameters
 Return Values
 -------------
 
-A traversable :phpclass:`MongoDB\\Model\\IndexInfoIterator`, which contains a
-:phpclass:`MongoDB\\Model\\IndexInfo` object for each index for the collection.
+A traversable :phpclass:`MongoDB\Model\IndexInfoIterator`, which contains a
+:phpclass:`MongoDB\Model\IndexInfo` object for each index for the collection.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBCollection-listSearchIndexes.txt b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
index e8db9521..cc0f840a 100644
--- a/source/reference/method/MongoDBCollection-listSearchIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::listSearchIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::listSearchIndexes()
+.. phpmethod:: MongoDB\Collection::listSearchIndexes()
 
    Gets index information for one or more search indexes in the collection.
 
@@ -72,17 +72,17 @@ Parameters
          will be returned.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -107,10 +107,10 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\Collection::updateSearchIndex()`
 - :manual:`$listSearchIndexes `
   aggregation pipeline stage reference in the MongoDB manual
 - `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
index 9081c36c..afb57373 100644
--- a/source/reference/method/MongoDBCollection-mapReduce.txt
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -17,7 +17,7 @@ MongoDB\\Collection::mapReduce()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::mapReduce()
+.. phpmethod:: MongoDB\Collection::mapReduce()
 
    The :manual:`mapReduce ` command allows you to
    run map-reduce aggregation operations over a collection.
@@ -34,7 +34,7 @@ Definition
 Parameters
 ----------
 
-``$map`` : :php:`MongoDB\\BSON\\Javascript `
+``$map`` : :php:`MongoDB\BSON\Javascript `
   A JavaScript function that associates or "maps" a value with a key and emits
   the key and value pair.
 
@@ -43,7 +43,7 @@ Parameters
      Passing a Javascript instance with a scope is deprecated. Put all scope
      variables in the ``scope`` option of the MapReduce operation.
 
-``$reduce`` : :php:`MongoDB\\BSON\\Javascript `
+``$reduce`` : :php:`MongoDB\BSON\Javascript `
   A JavaScript function that "reduces" to a single object all the values
   associated with a particular key.
 
@@ -89,7 +89,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - finalize
-       - :php:`MongoDB\\BSON\\Javascript `
+       - :php:`MongoDB\BSON\Javascript `
        - Follows the reduce method and modifies the output.
 
          .. note::
@@ -117,13 +117,13 @@ Parameters
          the documents input to the map function.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
          This option will be ignored when results are output to a collection.
@@ -134,7 +134,7 @@ Parameters
          finalize functions.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -153,7 +153,7 @@ Parameters
          information.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -161,7 +161,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\MapReduceResult` object, which allows for iteration of
+A :phpclass:`MongoDB\MapReduceResult` object, which allows for iteration of
 map-reduce results irrespective of the output method (e.g. inline, collection)
 via the :php:`IteratorAggregate ` interface. It also
 provides access to command statistics.
diff --git a/source/reference/method/MongoDBCollection-rename.txt b/source/reference/method/MongoDBCollection-rename.txt
index 2b617de9..347c205b 100644
--- a/source/reference/method/MongoDBCollection-rename.txt
+++ b/source/reference/method/MongoDBCollection-rename.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::rename()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::rename()
+.. phpmethod:: MongoDB\Collection::rename()
 
    Rename the collection.
 
@@ -64,7 +64,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -74,7 +74,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -124,6 +124,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::renameCollection()`
+- :phpmethod:`MongoDB\Database::renameCollection()`
 - :manual:`renameCollection ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index 94395eff..f9bfb1b8 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::replaceOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::replaceOne()
+.. phpmethod:: MongoDB\Collection::replaceOne()
 
    Replace at most one document that matches the filter criteria. If multiple
    documents match the filter criteria, only the :term:`first `
@@ -79,7 +79,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -91,7 +91,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -99,8 +99,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\UpdateResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -152,9 +152,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`update ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 07f29211..2b077220 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::updateMany()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::updateMany()
+.. phpmethod:: MongoDB\Collection::updateMany()
 
    Update all documents that match the filter criteria.
 
@@ -88,7 +88,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -100,7 +100,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -108,8 +108,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\UpdateResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -155,9 +155,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`update ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index 2a981cb2..321103c2 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::updateOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::updateOne()
+.. phpmethod:: MongoDB\Collection::updateOne()
 
    Update at most one document that matches the filter criteria. If multiple
    documents match the filter criteria, only the :term:`first `
@@ -90,7 +90,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -102,7 +102,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -110,8 +110,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\UpdateResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -157,9 +157,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`update ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-updateSearchIndex.txt b/source/reference/method/MongoDBCollection-updateSearchIndex.txt
index bf165910..63b62167 100644
--- a/source/reference/method/MongoDBCollection-updateSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-updateSearchIndex.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::updateSearchIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::updateSearchIndex()
+.. phpmethod:: MongoDB\Collection::updateSearchIndex()
 
    Update an Atlas Search index for the collection.
 
@@ -71,10 +71,10 @@ Behavior
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\Collection::listSearchIndexes()`
 - :manual:`updateSearchIndex ` command
   reference in the MongoDB manual
 - `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
index c54123bd..0722b6d7 100644
--- a/source/reference/method/MongoDBCollection-watch.txt
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::watch()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::watch()
+.. phpmethod:: MongoDB\Collection::watch()
 
    Executes a :manual:`change stream ` operation on the
    collection. The change stream can be watched for collection-level changes.
@@ -77,11 +77,11 @@ Parameters
        - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
          This is used for both the initial change stream aggregation and for
@@ -92,7 +92,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-resumeAfter.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - showExpandedEvents
@@ -104,7 +104,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-startAfter.rst
 
      * - startAtOperationTime
-       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - :php:`MongoDB\BSON\TimestampInterface `
        - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
      * - typeMap
@@ -114,7 +114,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+A :phpclass:`MongoDB\ChangeStream` object, which allows for iteration of
 events in the change stream via the :php:`Iterator ` interface.
 
 Errors/Exceptions
@@ -193,8 +193,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index 293b093a..d942b8cc 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::withOptions()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::withOptions()
+.. phpmethod:: MongoDB\Collection::withOptions()
 
    Returns a clone of the Collection object, but with different options.
 
@@ -36,12 +36,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the original collection's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the original collection's read preference.
 
@@ -53,14 +53,14 @@ Parameters
          to PHP values. Defaults to the original collection's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults to
          the original collection's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Errors/Exceptions
 -----------------
@@ -86,4 +86,4 @@ preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::__construct()`
+- :phpmethod:`MongoDB\Collection::__construct()`
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
index 09173500..c4d2524f 100644
--- a/source/reference/method/MongoDBCollection__construct.txt
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\Collection::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::__construct()
+.. phpmethod:: MongoDB\Collection::__construct()
 
-   Constructs a new :phpclass:`Collection ` instance.
+   Constructs a new :phpclass:`Collection ` instance.
 
    .. code-block:: php
 
@@ -28,7 +28,7 @@ Definition
 
    This constructor has the following parameters:
 
-``$manager`` : :php:`MongoDB\\Driver\\Manager `
+``$manager`` : :php:`MongoDB\Driver\Manager `
   The :php:`Manager ` instance from the driver. The
   manager maintains connections between the driver and your MongoDB instances.
 
@@ -50,12 +50,12 @@ Definition
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the manager's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the manager's read preference.
 
@@ -75,7 +75,7 @@ Definition
             ]
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults
          to the manager's write concern.
 
@@ -88,9 +88,9 @@ Behavior
 --------
 
 If you construct a Collection explicitly, the Collection inherits any options
-from the :php:`MongoDB\\Driver\\Manager ` object.
-If you select the Collection from a :phpclass:`Client ` or
-:phpclass:`Database ` object, the Collection inherits its
+from the :php:`MongoDB\Driver\Manager ` object.
+If you select the Collection from a :phpclass:`Client ` or
+:phpclass:`Database ` object, the Collection inherits its
 options from that object.
 
 .. todo: add an example
@@ -98,7 +98,7 @@ options from that object.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::withOptions()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
-- :phpmethod:`MongoDB\\Database::selectCollection()`
-- :phpmethod:`MongoDB\\Database::__get()`
+- :phpmethod:`MongoDB\Collection::withOptions()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
+- :phpmethod:`MongoDB\Database::__get()`
diff --git a/source/reference/method/MongoDBDatabase-aggregate.txt b/source/reference/method/MongoDBDatabase-aggregate.txt
index 96d409ae..66546315 100644
--- a/source/reference/method/MongoDBDatabase-aggregate.txt
+++ b/source/reference/method/MongoDBDatabase-aggregate.txt
@@ -15,12 +15,12 @@ MongoDB\\Database::aggregate()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::aggregate()
+.. phpmethod:: MongoDB\Database::aggregate()
 
    Runs a specified :manual:`admin/diagnostic pipeline
    ` which does
    not require an underlying collection. For aggregations on collection data,
-   see :phpmethod:`MongoDB\\Collection::aggregate()`.
+   see :phpmethod:`MongoDB\Collection::aggregate()`.
 
    .. code-block:: php
 
@@ -105,15 +105,15 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/database-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/database-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -121,13 +121,13 @@ Parameters
        - .. include:: /includes/extracts/database-option-typeMap.rst
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` or
+A :php:`MongoDB\Driver\Cursor ` or
 :php:`ArrayIterator ` object. In both cases, the return value
 will be :php:`Traversable `.
 
@@ -164,7 +164,7 @@ running command operations.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::aggregate()`
+- :phpmethod:`MongoDB\Collection::aggregate()`
 - :manual:`aggregate ` command reference in the
   MongoDB manual
 - :manual:`Aggregation Pipeline ` documentation in
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index 50ebfe79..86243d73 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::command()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::command()
+.. phpmethod:: MongoDB\Database::command()
 
    Execute a :manual:`command ` on the database. This is
    generally used to execute commands that do not have a corresponding helper
@@ -44,11 +44,11 @@ Parameters
        - Description
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/database-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -60,7 +60,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\Driver\Cursor ` object.
 
 Errors/Exceptions
 -----------------
@@ -102,7 +102,7 @@ Some database commands return a cursor with multiple results. The following
 example executes :manual:`listCollections `,
 which returns a cursor containing a result document for each collection in the
 ``test`` database. Note that this example is illustrative; applications would
-generally use :phpmethod:`MongoDB\\Database::listCollections()` in practice.
+generally use :phpmethod:`MongoDB\Database::listCollections()` in practice.
 
 .. code-block:: php
 
@@ -168,6 +168,6 @@ See Also
 
 - :doc:`/tutorial/commands`
 - :manual:`Database Commands ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\Cursor `
-- :php:`MongoDB\\Driver\\Manager::executeCommand()
+- :php:`MongoDB\Driver\Cursor `
+- :php:`MongoDB\Driver\Manager::executeCommand()
   `
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 2351f5d3..3c45debc 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::createCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::createCollection()
+.. phpmethod:: MongoDB\Database::createCollection()
 
    Explicitly creates a collection.
 
@@ -27,7 +27,7 @@ Definition
    MongoDB creates collections implicitly when you first reference the
    collection in a command, such as when inserting a document into a new
    collection. You may also explicitly create a collection with specific options
-   using the :phpmethod:`MongoDB\\Database::createCollection()` method, or using
+   using the :phpmethod:`MongoDB\Database::createCollection()` method, or using
    :manual:`db.createCollection() ` in
    the MongoDB shell.
 
@@ -195,7 +195,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -322,7 +322,7 @@ Parameters
             .. versionadded:: 1.13
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
diff --git a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
index 390f99c6..e6a266fb 100644
--- a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::createEncryptedCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::createEncryptedCollection()
+.. phpmethod:: MongoDB\Database::createEncryptedCollection()
 
    Explicitly creates an encrypted collection.
 
@@ -31,13 +31,13 @@ Definition
 
    This method will automatically create data keys for any encrypted fields
    where ``keyId`` is ``null``. Data keys will be created using
-   :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `
+   :php:`MongoDB\Driver\ClientEncryption::createDataKey() `
    and the provided ``$kmsProvider`` and ``$masterKey`` parameters. A copy of
    the modified ``encryptedFields`` option will be returned in addition to the
    result from creating the collection.
 
    This method does not affect any auto encryption settings on existing
-   :phpclass:`MongoDB\\Client` objects. Users must configure auto encryption
+   :phpclass:`MongoDB\Client` objects. Users must configure auto encryption
    after creating the encrypted collection with ``createEncryptedCollection()``.
 
 Parameters
@@ -46,18 +46,18 @@ Parameters
 ``$collectionName`` : string
   The name of the encrypted collection to create.
 
-``$clientEncryption`` : :php:`MongoDB\\Driver\\ClientEncryption `
+``$clientEncryption`` : :php:`MongoDB\Driver\ClientEncryption `
   The ClientEncryption object used to create data keys.
 
 ``$kmsProvider`` : string
   KMS provider (e.g. "local", "aws") that will be used to encrypt new data keys.
   This corresponds to the ``$kmsProvider`` parameter for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+  :php:`MongoDB\Driver\ClientEncryption::createDataKey() `.
 
 ``$masterKey`` : array|null
   KMS-specific key options that will be used to encrypt new data keys. This
   corresponds to the ``masterKey`` option for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+  :php:`MongoDB\Driver\ClientEncryption::createDataKey() `.
 
   If ``$kmsProvider`` is "local", this should be ``null``.
 
@@ -65,7 +65,7 @@ Parameters
   An array specifying the desired options.
 
   The ``$options`` parameter supports the same options as
-  :phpmethod:`MongoDB\\Database::createCollection()`. The ``encryptedFields``
+  :phpmethod:`MongoDB\Database::createCollection()`. The ``encryptedFields``
   option is required.
 
 Return Values
@@ -79,7 +79,7 @@ option.
 Errors/Exceptions
 -----------------
 
-:phpclass:`MongoDB\\Exception\\CreateEncryptedCollectionException` if any error
+:phpclass:`MongoDB\Exception\CreateEncryptedCollectionException` if any error
 is encountered creating data keys or the collection. The original exception and
 modified ``encryptedFields`` option can be accessed via the ``getPrevious()``
 and ``getEncryptedFields()`` methods, respectively.
@@ -126,11 +126,11 @@ an encrypted string field.
 If the encrypted collection was successfully created, ``$result`` will contain
 the response document from the ``create`` command and
 ``$encryptedFields['fields'][0]['keyId']`` will contain a
-:php:`MongoDB\\BSON\\Binary ` object with subtype 4
+:php:`MongoDB\BSON\Binary ` object with subtype 4
 (i.e. UUID).
 
 The modified ``encryptedFields`` option can then be used to construct a new
-:phpclass:`MongoDB\\Client` with auto encryption enabled.
+:phpclass:`MongoDB\Client` with auto encryption enabled.
 
 .. code-block:: php
 
@@ -155,8 +155,8 @@ The modified ``encryptedFields`` option can then be used to construct a new
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
-- :phpmethod:`MongoDB\\Client::createClientEncryption()`
-- :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `
+- :phpmethod:`MongoDB\Database::createCollection()`
+- :phpmethod:`MongoDB\Client::createClientEncryption()`
+- :php:`MongoDB\Driver\ClientEncryption::createDataKey() `
 - :manual:`create ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index 457fad1a..da1c8ba0 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::drop()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::drop()
+.. phpmethod:: MongoDB\Database::drop()
 
    Drop the database.
 
@@ -44,7 +44,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -56,7 +56,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
@@ -105,6 +105,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::dropDatabase()`
+- :phpmethod:`MongoDB\Client::dropDatabase()`
 - :manual:`dropDatabase ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 018f3cca..71beda83 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::dropCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::dropCollection()
+.. phpmethod:: MongoDB\Database::dropCollection()
 
    Drop a collection within the current database.
 
@@ -70,7 +70,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -82,7 +82,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
@@ -133,6 +133,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::drop()`
+- :phpmethod:`MongoDB\Collection::drop()`
 - :manual:`drop ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBDatabase-getDatabaseName.txt b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
index 6e3abd96..fcbd0ce8 100644
--- a/source/reference/method/MongoDBDatabase-getDatabaseName.txt
+++ b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::getDatabaseName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getDatabaseName()
+.. phpmethod:: MongoDB\Database::getDatabaseName()
 
    Returns the name of this database.
 
diff --git a/source/reference/method/MongoDBDatabase-getManager.txt b/source/reference/method/MongoDBDatabase-getManager.txt
index 72a2b057..91e013ae 100644
--- a/source/reference/method/MongoDBDatabase-getManager.txt
+++ b/source/reference/method/MongoDBDatabase-getManager.txt
@@ -13,11 +13,11 @@ MongoDB\\Database::getManager()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getManager()
+.. phpmethod:: MongoDB\Database::getManager()
 
    Accessor for the
-   :php:`MongoDB\\Driver\\Manager ` used by this
-   :phpclass:`Database `.
+   :php:`MongoDB\Driver\Manager ` used by this
+   :phpclass:`Database `.
 
    .. code-block:: php
 
@@ -26,10 +26,10 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\Driver\Manager ` object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::getManager()`
-- :phpmethod:`MongoDB\\Collection::getManager()`
+- :phpmethod:`MongoDB\Client::getManager()`
+- :phpmethod:`MongoDB\Collection::getManager()`
diff --git a/source/reference/method/MongoDBDatabase-getReadConcern.txt b/source/reference/method/MongoDBDatabase-getReadConcern.txt
index 56568aa4..4915fcc4 100644
--- a/source/reference/method/MongoDBDatabase-getReadConcern.txt
+++ b/source/reference/method/MongoDBDatabase-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getReadConcern()
+.. phpmethod:: MongoDB\Database::getReadConcern()
 
    Returns the read concern for this database.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -54,7 +54,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBDatabase-getReadPreference.txt b/source/reference/method/MongoDBDatabase-getReadPreference.txt
index 5001455c..633633eb 100644
--- a/source/reference/method/MongoDBDatabase-getReadPreference.txt
+++ b/source/reference/method/MongoDBDatabase-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getReadPreference()
+.. phpmethod:: MongoDB\Database::getReadPreference()
 
    Returns the read preference for this database.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -55,6 +55,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBDatabase-getTypeMap.txt b/source/reference/method/MongoDBDatabase-getTypeMap.txt
index d06c6777..a30f4f0d 100644
--- a/source/reference/method/MongoDBDatabase-getTypeMap.txt
+++ b/source/reference/method/MongoDBDatabase-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getTypeMap()
+.. phpmethod:: MongoDB\Database::getTypeMap()
 
    Returns the type map for this database.
 
@@ -62,6 +62,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBDatabase-getWriteConcern.txt b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
index 55ea09f4..40419a4b 100644
--- a/source/reference/method/MongoDBDatabase-getWriteConcern.txt
+++ b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getWriteConcern()
+.. phpmethod:: MongoDB\Database::getWriteConcern()
 
    Returns the write concern for this database.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -57,7 +57,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBDatabase-listCollectionNames.txt b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
index 53814f72..d094028d 100644
--- a/source/reference/method/MongoDBDatabase-listCollectionNames.txt
+++ b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::listCollectionNames()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::listCollectionNames()
+.. phpmethod:: MongoDB\Database::listCollectionNames()
 
    Returns names for all collections in this database.
 
@@ -68,7 +68,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
@@ -134,7 +134,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::listCollections()`
+- :phpmethod:`MongoDB\Database::listCollections()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
 - `Enumerating Collections
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index d66b6a5f..511b8995 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::listCollections()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::listCollections()
+.. phpmethod:: MongoDB\Database::listCollections()
 
    Returns information for all collections in this database.
 
@@ -66,7 +66,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -74,8 +74,8 @@ Parameters
 Return Values
 -------------
 
-A traversable :phpclass:`MongoDB\\Model\\CollectionInfoIterator`, which contains
-a :phpclass:`MongoDB\\Model\\CollectionInfo` object for each collection in the
+A traversable :phpclass:`MongoDB\Model\CollectionInfoIterator`, which contains
+a :phpclass:`MongoDB\Model\CollectionInfo` object for each collection in the
 database.
 
 Example
@@ -160,7 +160,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::listCollectionNames()`
+- :phpmethod:`MongoDB\Database::listCollectionNames()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
 - `Enumerating Collections
diff --git a/source/reference/method/MongoDBDatabase-modifyCollection.txt b/source/reference/method/MongoDBDatabase-modifyCollection.txt
index 0a756b01..6aa036ff 100644
--- a/source/reference/method/MongoDBDatabase-modifyCollection.txt
+++ b/source/reference/method/MongoDBDatabase-modifyCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::modifyCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::modifyCollection()
+.. phpmethod:: MongoDB\Database::modifyCollection()
 
    Modifies a collection or view according to the specified
    ``$collectionOptions``.
@@ -57,7 +57,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -67,7 +67,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
diff --git a/source/reference/method/MongoDBDatabase-renameCollection.txt b/source/reference/method/MongoDBDatabase-renameCollection.txt
index 778dc10a..8c07952d 100644
--- a/source/reference/method/MongoDBDatabase-renameCollection.txt
+++ b/source/reference/method/MongoDBDatabase-renameCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::renameCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::renameCollection()
+.. phpmethod:: MongoDB\Database::renameCollection()
 
    Rename a collection within the current database.
 
@@ -68,7 +68,7 @@ Parameters
          collection. The default value is ``false``.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -78,7 +78,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
@@ -126,6 +126,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::rename()`
+- :phpmethod:`MongoDB\Collection::rename()`
 - :manual:`renameCollection ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 887d4a4d..854298e0 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::selectCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::selectCollection()
+.. phpmethod:: MongoDB\Database::selectCollection()
 
    Selects a collection within the database.
 
@@ -42,12 +42,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the database's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the database's read preference.
 
@@ -57,14 +57,14 @@ Parameters
          database's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults to
          the database's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Errors/Exceptions
 -----------------
@@ -75,7 +75,7 @@ Behavior
 --------
 
 The selected collection inherits options such as read preference and type
-mapping from the :phpclass:`Database ` object. Options may be
+mapping from the :phpclass:`Database ` object. Options may be
 overridden via the ``$options`` parameter.
 
 Example
@@ -110,6 +110,6 @@ database with a custom read preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::__get()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
-- :phpmethod:`MongoDB\\Collection::__construct()`
+- :phpmethod:`MongoDB\Database::__get()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
+- :phpmethod:`MongoDB\Collection::__construct()`
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index 0d115d9b..9cebd3fc 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::selectGridFSBucket()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::selectGridFSBucket()
+.. phpmethod:: MongoDB\Database::selectGridFSBucket()
 
    Selects a GridFS bucket within the database.
 
@@ -53,12 +53,12 @@ Parameters
          .. versionadded: 1.4
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for bucket operations. Defaults to the
          database's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for bucket operations. Defaults to
          the database's read concern.
 
@@ -68,14 +68,14 @@ Parameters
          database's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for bucket operations. Defaults to the
          database's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\GridFS\\Bucket` object.
+A :phpclass:`MongoDB\GridFS\Bucket` object.
 
 Errors/Exceptions
 -----------------
@@ -86,7 +86,7 @@ Behavior
 --------
 
 The selected bucket inherits options such as read preference and type
-mapping from the :phpclass:`Database ` object. Options may be
+mapping from the :phpclass:`Database ` object. Options may be
 overridden via the ``$options`` parameter.
 
 Example
@@ -120,4 +120,4 @@ database with a custom read preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
+- :phpmethod:`MongoDB\GridFS\Bucket::__construct()`
diff --git a/source/reference/method/MongoDBDatabase-watch.txt b/source/reference/method/MongoDBDatabase-watch.txt
index c79656ec..396e5cfd 100644
--- a/source/reference/method/MongoDBDatabase-watch.txt
+++ b/source/reference/method/MongoDBDatabase-watch.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::watch()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::watch()
+.. phpmethod:: MongoDB\Database::watch()
 
    Executes a :manual:`change stream ` operation on the
    database. The change stream can be watched for database-level changes.
@@ -73,11 +73,11 @@ Parameters
        - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/database-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/database-option-readPreference.rst
 
          This is used for both the initial change stream aggregation and for
@@ -88,7 +88,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-resumeAfter.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - showExpandedEvents
@@ -100,7 +100,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-startAfter.rst
 
      * - startAtOperationTime
-       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - :php:`MongoDB\BSON\TimestampInterface `
        - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
      * - typeMap
@@ -110,7 +110,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+A :phpclass:`MongoDB\ChangeStream` object, which allows for iteration of
 events in the change stream via the :php:`Iterator ` interface.
 
 Errors/Exceptions
@@ -188,8 +188,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index fc5d88ec..f601a977 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::withOptions()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::withOptions()
+.. phpmethod:: MongoDB\Database::withOptions()
 
    Returns a clone of the Database object, but with different options.
 
@@ -36,12 +36,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for database operations. Defaults to
          the original database's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for database operations. Defaults to
          the original database's read preference.
 
@@ -53,14 +53,14 @@ Parameters
          to PHP values. Defaults to the original database's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for database operations. Defaults to
          the original database's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\Database` object.
 
 Errors/Exceptions
 -----------------
@@ -86,4 +86,4 @@ preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\Database::__construct()`
diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt
index 0a715e99..cf52a134 100644
--- a/source/reference/method/MongoDBDatabase__construct.txt
+++ b/source/reference/method/MongoDBDatabase__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\Database::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::__construct()
+.. phpmethod:: MongoDB\Database::__construct()
 
-   Constructs a new :phpclass:`Database ` instance.
+   Constructs a new :phpclass:`Database ` instance.
 
    .. code-block:: php
 
@@ -28,7 +28,7 @@ Definition
 Parameters
 ----------
 
-``$manager`` : :php:`MongoDB\\Driver\\Manager `
+``$manager`` : :php:`MongoDB\Driver\Manager `
   The :php:`Manager ` instance from the driver. The
   manager maintains connections between the driver and your MongoDB instances.
 
@@ -47,12 +47,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for database operations. Defaults to
          the manager's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for database operations. Defaults to
          the manager's read preference.
 
@@ -72,7 +72,7 @@ Parameters
             ]
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for database operations. Defaults to
          the manager's write concern.
 
@@ -85,13 +85,13 @@ Behavior
 --------
 
 If you construct a Database explicitly, the Database inherits any options from
-the :php:`MongoDB\\Driver\\Manager ` object. If
-you select the Database from a :phpclass:`Client ` object, the
+the :php:`MongoDB\Driver\Manager ` object. If
+you select the Database from a :phpclass:`Client ` object, the
 Database inherits its options from that object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::withOptions()`
-- :phpmethod:`MongoDB\\Client::selectDatabase()`
-- :phpmethod:`MongoDB\\Client::__get()`
+- :phpmethod:`MongoDB\Database::withOptions()`
+- :phpmethod:`MongoDB\Client::selectDatabase()`
+- :phpmethod:`MongoDB\Client::__get()`
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index c888a716..e71c42d4 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::__get()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::__get()
+.. phpmethod:: MongoDB\Database::__get()
 
    Select a collection within the database.
 
@@ -30,14 +30,14 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Behavior
 --------
 
 The selected collection inherits options such as read preference and type
-mapping from the :phpclass:`Database ` object. If you wish to
-override any options, use the :phpmethod:`MongoDB\\Database::selectCollection()`
+mapping from the :phpclass:`Database ` object. If you wish to
+override any options, use the :phpmethod:`MongoDB\Database::selectCollection()`
 method.
 
 .. note::
@@ -45,7 +45,7 @@ method.
    To select collections whose names contain special characters, such as
    ``.``, use complex syntax, as in ``$database->{'that.database'}``.
 
-   Alternatively, :phpmethod:`MongoDB\\Database::selectCollection()` supports
+   Alternatively, :phpmethod:`MongoDB\Database::selectCollection()` supports
    selecting collections whose names contain special characters.
 
 Examples
@@ -66,6 +66,6 @@ collections from the ``test`` database:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::selectCollection()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
 - :php:`Property Overloading ` in the PHP Manual
diff --git a/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt b/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
index dcda2574..02810569 100644
--- a/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
+++ b/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\DeleteResult::getDeletedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\DeleteResult::getDeletedCount()
+.. phpmethod:: MongoDB\DeleteResult::getDeletedCount()
 
    Return the number of documents that were deleted.
 
@@ -36,5 +36,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getDeletedCount()
+- :php:`MongoDB\Driver\WriteResult::getDeletedCount()
   `
diff --git a/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt b/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
index a82fa523..5e3cbb4e 100644
--- a/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\DeleteResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\DeleteResult::isAcknowledged()
+.. phpmethod:: MongoDB\DeleteResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBGridFSBucket-delete.txt b/source/reference/method/MongoDBGridFSBucket-delete.txt
index 731fb4e4..9c876c60 100644
--- a/source/reference/method/MongoDBGridFSBucket-delete.txt
+++ b/source/reference/method/MongoDBGridFSBucket-delete.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::delete()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::delete()
+.. phpmethod:: MongoDB\GridFS\Bucket::delete()
 
    Delete a file and its chunks from the GridFS bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
index 917f03b5..217fc262 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::downloadToStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::downloadToStream()
 
    Selects a GridFS file by its ``_id`` and copies its contents to a writable
    stream.
@@ -68,6 +68,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index 8bd4a1d6..d520793a 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::downloadToStreamByName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStreamByName()
+.. phpmethod:: MongoDB\GridFS\Bucket::downloadToStreamByName()
 
    Selects a GridFS file by its ``filename`` and copies its contents to a
    writable stream.
@@ -99,6 +99,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-drop.txt b/source/reference/method/MongoDBGridFSBucket-drop.txt
index 53a10091..324db854 100644
--- a/source/reference/method/MongoDBGridFSBucket-drop.txt
+++ b/source/reference/method/MongoDBGridFSBucket-drop.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::drop()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::drop()
+.. phpmethod:: MongoDB\GridFS\Bucket::drop()
 
    Drops the files and chunks collections associated with this GridFS bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index d112dd66..bfd57089 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::find()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::find()
+.. phpmethod:: MongoDB\GridFS\Bucket::find()
 
    Finds documents from the GridFS bucket's files collection matching the query.
 
@@ -156,7 +156,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -171,13 +171,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/bucket-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/bucket-option-readPreference.rst
 
      * - returnKey
@@ -187,7 +187,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -222,7 +222,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\Driver\Cursor ` object.
 
 Errors/Exceptions
 -----------------
@@ -285,5 +285,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::find()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::findOne()`
+- :phpmethod:`MongoDB\Collection::find()`
+- :phpmethod:`MongoDB\GridFS\Bucket::findOne()`
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
index 1ff9f258..89877e3a 100644
--- a/source/reference/method/MongoDBGridFSBucket-findOne.txt
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::findOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::findOne()
+.. phpmethod:: MongoDB\GridFS\Bucket::findOne()
 
    Finds a single document from the GridFS bucket's files collection matching
    the query.
@@ -114,7 +114,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -129,13 +129,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/bucket-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/bucket-option-readPreference.rst
 
      * - returnKey
@@ -145,7 +145,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -236,5 +236,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOne()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::find()`
+- :phpmethod:`MongoDB\Collection::findOne()`
+- :phpmethod:`MongoDB\GridFS\Bucket::find()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
index 52ea9249..96a61c4d 100644
--- a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getBucketName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getBucketName()
+.. phpmethod:: MongoDB\GridFS\Bucket::getBucketName()
 
    Returns the name of this bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
index 16116e56..2a9ff6da 100644
--- a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getChunkSizeBytes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getChunkSizeBytes()
+.. phpmethod:: MongoDB\GridFS\Bucket::getChunkSizeBytes()
 
    Returns the chunk size of this bucket in bytes.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
index 36dbd8a5..ce1c97b9 100644
--- a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getChunksCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getChunksCollection()
+.. phpmethod:: MongoDB\GridFS\Bucket::getChunksCollection()
 
    Returns the chunks collection used by the bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object for the chunks collection.
+A :phpclass:`MongoDB\Collection` object for the chunks collection.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
index 0b6dd8e0..22703fdd 100644
--- a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getDatabaseName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getDatabaseName()
+.. phpmethod:: MongoDB\GridFS\Bucket::getDatabaseName()
 
    Returns the name of the database containing this bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index fa8625f9..9dc275ca 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getFileDocumentForStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileDocumentForStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::getFileDocumentForStream()
 
    Gets the file document of the GridFS file associated with a stream.
 
@@ -78,4 +78,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileIdForStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index b42ab19b..0107b3d8 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getFileIdForStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileIdForStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::getFileIdForStream()
 
    Gets the file document's ID of the GridFS file associated with a stream.
 
@@ -69,4 +69,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileDocumentForStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
index 57813ad6..510cfad1 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getFilesCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getFilesCollection()
+.. phpmethod:: MongoDB\GridFS\Bucket::getFilesCollection()
 
    Returns the files collection used by the bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object for the files collection.
+A :phpclass:`MongoDB\Collection` object for the files collection.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
index 7b12c051..d1d4c610 100644
--- a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getReadConcern()
+.. phpmethod:: MongoDB\GridFS\Bucket::getReadConcern()
 
    Returns the read concern for this GridFS bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -55,7 +55,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
index 532a6e23..6843cc93 100644
--- a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getReadPreference()
+.. phpmethod:: MongoDB\GridFS\Bucket::getReadPreference()
 
    Returns the read preference for this GridFS bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -56,6 +56,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
index 7d9a309a..1005f2a2 100644
--- a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getTypeMap()
+.. phpmethod:: MongoDB\GridFS\Bucket::getTypeMap()
 
    Returns the type map for this GridFS bucket.
 
@@ -63,6 +63,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
index 77303b92..21e535af 100644
--- a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getWriteConcern()
+.. phpmethod:: MongoDB\GridFS\Bucket::getWriteConcern()
 
    Returns the write concern for this GridFS bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -58,7 +58,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
index 9118cecc..bfabc282 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::openDownloadStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::openDownloadStream()
 
    Selects a GridFS file by its ``_id`` and opens it as a readable stream.
 
@@ -66,6 +66,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
index 4c0b525d..287cf4b5 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::openDownloadStreamByName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStreamByName()
+.. phpmethod:: MongoDB\GridFS\Bucket::openDownloadStreamByName()
 
    Selects a GridFS file by its ``filename`` and opens it as a readable stream.
 
@@ -94,6 +94,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 2870b544..24baebde 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::openUploadStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::openUploadStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::openUploadStream()
 
    Opens a writable stream for a new GridFS file.
 
@@ -44,7 +44,7 @@ Parameters
      * - _id
        - mixed
        - Value to use as the file document identifier. Defaults to a new
-         :php:`MongoDB\\BSON\\ObjectId ` object.
+         :php:`MongoDB\BSON\ObjectId ` object.
 
      * - chunkSizeBytes
        - integer
@@ -100,4 +100,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::uploadFromStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt
index 20d9c1d7..75545a8a 100644
--- a/source/reference/method/MongoDBGridFSBucket-rename.txt
+++ b/source/reference/method/MongoDBGridFSBucket-rename.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::rename()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::rename()
+.. phpmethod:: MongoDB\GridFS\Bucket::rename()
 
    Selects a GridFS file by its ``_id`` and alters its ``filename``.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index 89cb8d2f..0ba54e9f 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::uploadFromStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::uploadFromStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::uploadFromStream()
 
    Creates a new GridFS file and copies the contents of a readable stream to it.
 
@@ -48,7 +48,7 @@ Parameters
      * - _id
        - mixed
        - Value to use as the file document identifier. Defaults to a new
-         :php:`MongoDB\\BSON\\ObjectId ` object.
+         :php:`MongoDB\BSON\ObjectId ` object.
 
      * - chunkSizeBytes
        - integer
@@ -73,7 +73,7 @@ Return Values
 
 The ``_id`` field of the metadata document associated with the newly created
 GridFS file. If the ``_id`` option is not specified, a new
-:php:`MongoDB\\BSON\\ObjectId ` object will be used
+:php:`MongoDB\BSON\ObjectId ` object will be used
 by default.
 
 Errors/Exceptions
@@ -111,4 +111,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openUploadStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index 25271e0c..766e8650 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\GridFS\\Bucket::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::__construct()
+.. phpmethod:: MongoDB\GridFS\Bucket::__construct()
 
-   Constructs a new :phpclass:`Bucket ` instance.
+   Constructs a new :phpclass:`Bucket ` instance.
 
    .. code-block:: php
 
@@ -28,7 +28,7 @@ Definition
 Parameters
 ----------
 
-``$manager`` : :php:`MongoDB\\Driver\\Manager `
+``$manager`` : :php:`MongoDB\Driver\Manager `
   The :php:`Manager ` instance from the driver. The
   manager maintains connections between the driver and your MongoDB instances.
 
@@ -64,12 +64,12 @@ Parameters
          .. versionadded: 1.4
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for bucket operations. Defaults to the
          manager's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for bucket operations. Defaults to
          the manager's read preference.
 
@@ -89,7 +89,7 @@ Parameters
             ]
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for bucket operations. Defaults to the
          manager's write concern.
 
@@ -102,8 +102,8 @@ Behavior
 --------
 
 If you construct a Bucket explicitly, the Bucket inherits any options
-from the :php:`MongoDB\\Driver\\Manager ` object.
-If you select the Bucket from a :phpclass:`Database ` object,
+from the :php:`MongoDB\Driver\Manager ` object.
+If you select the Bucket from a :phpclass:`Database ` object,
 the Bucket inherits its options from that object.
 
 Examples
@@ -131,4 +131,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::selectGridFSBucket()`
+- :phpmethod:`MongoDB\Database::selectGridFSBucket()`
diff --git a/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt b/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
index 9297008b..f114b456 100644
--- a/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
+++ b/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertManyResult::getInsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertManyResult::getInsertedCount()
+.. phpmethod:: MongoDB\InsertManyResult::getInsertedCount()
 
    Return the number of documents that were inserted.
 
@@ -36,5 +36,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getInsertedCount()
   `
diff --git a/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt b/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
index 75c63870..bf30e28b 100644
--- a/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
+++ b/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertManyResult::getInsertedIds()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertManyResult::getInsertedIds()
+.. phpmethod:: MongoDB\InsertManyResult::getInsertedIds()
 
    Return a map of IDs (i.e. ``_id`` field values) for the inserted documents.
 
@@ -32,5 +32,5 @@ A map of IDs (i.e. ``_id`` field values) for the inserted documents.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to inserting (i.e. the driver did
 not generate an ID), the index will contain its ``_id`` field value. Any
-driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
+driver-generated ID will be a :php:`MongoDB\BSON\ObjectId
 ` instance.
diff --git a/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt b/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
index db376e5f..2589edb4 100644
--- a/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertManyResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertManyResult::isAcknowledged()
+.. phpmethod:: MongoDB\InsertManyResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt b/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
index 35508015..d6ba1279 100644
--- a/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
+++ b/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertOneResult::getInsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertOneResult::getInsertedCount()
+.. phpmethod:: MongoDB\InsertOneResult::getInsertedCount()
 
    Return the number of documents that were inserted.
 
@@ -37,5 +37,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getInsertedCount()
   `
diff --git a/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt b/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
index 8d4a01dd..e3cef55d 100644
--- a/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
+++ b/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertOneResult::getInsertedId()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertOneResult::getInsertedId()
+.. phpmethod:: MongoDB\InsertOneResult::getInsertedId()
 
    Return the ID (i.e. ``_id`` field value) for the inserted document.
 
@@ -31,5 +31,5 @@ The ID (i.e. ``_id`` field value) of the inserted document.
 
 If the document had an ID prior to inserting (i.e. the driver did not need to
 generate an ID), this will contain its ``_id`` field value. Any driver-generated
-ID will be a :php:`MongoDB\\BSON\\ObjectId `
+ID will be a :php:`MongoDB\BSON\ObjectId `
 instance.
diff --git a/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt b/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
index 921e3a61..3e4505cd 100644
--- a/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertOneResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertOneResult::isAcknowledged()
+.. phpmethod:: MongoDB\InsertOneResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBMapReduceResult-getCounts.txt b/source/reference/method/MongoDBMapReduceResult-getCounts.txt
index 35c738dd..50cae3ef 100644
--- a/source/reference/method/MongoDBMapReduceResult-getCounts.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getCounts.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getCounts()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getCounts()
+.. phpmethod:: MongoDB\MapReduceResult::getCounts()
 
    Returns count statistics for the map-reduce operation.
 
@@ -63,6 +63,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :manual:`mapReduce ` command reference in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt b/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
index 05b6bbc1..fd094fed 100644
--- a/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getExecutionTimeMS()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getExecutionTimeMS()
+.. phpmethod:: MongoDB\MapReduceResult::getExecutionTimeMS()
 
    Returns the execution time in milliseconds of the map-reduce operation.
 
@@ -55,6 +55,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :manual:`mapReduce ` command reference in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBMapReduceResult-getIterator.txt b/source/reference/method/MongoDBMapReduceResult-getIterator.txt
index cb459cde..9de94895 100644
--- a/source/reference/method/MongoDBMapReduceResult-getIterator.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getIterator.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getIterator()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getIterator()
+.. phpmethod:: MongoDB\MapReduceResult::getIterator()
 
    Returns a :php:`Traversable `, which may be used to iterate
    through the results of the map-reduce operation.
@@ -81,5 +81,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :php:`IteratorAggregate::getIterator() `
diff --git a/source/reference/method/MongoDBMapReduceResult-getTiming.txt b/source/reference/method/MongoDBMapReduceResult-getTiming.txt
index 0492b3be..98268285 100644
--- a/source/reference/method/MongoDBMapReduceResult-getTiming.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getTiming.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getTiming()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getTiming()
+.. phpmethod:: MongoDB\MapReduceResult::getTiming()
 
    Returns timing statistics for the map-reduce operation.
 
@@ -22,7 +22,7 @@ Definition
       function getTiming(): array
 
    Timing statistics will only be available if the ``verbose`` option was
-   specified for :phpmethod:`MongoDB\\Collection::mapReduce()`.
+   specified for :phpmethod:`MongoDB\Collection::mapReduce()`.
 
 Return Values
 -------------
@@ -34,7 +34,7 @@ Examples
 --------
 
 This example specifies the ``verbose`` option for
-:phpmethod:`MongoDB\\Collection::mapReduce()` and reports the timing statistics
+:phpmethod:`MongoDB\Collection::mapReduce()` and reports the timing statistics
 for a map-reduce operation.
 
 .. code-block:: php
@@ -71,6 +71,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :manual:`mapReduce ` command reference in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
index dcd8e703..0b86f350 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
@@ -15,10 +15,10 @@ MongoDB\\Model\\CollectionInfo::getCappedMax()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedMax()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getCappedMax()
 
    Return the document limit for the capped collection. This correlates with the
-   ``max`` option for :phpmethod:`MongoDB\\Database::createCollection()`.
+   ``max`` option for :phpmethod:`MongoDB\Database::createCollection()`.
 
    .. code-block:: php
 
@@ -31,7 +31,7 @@ The document limit for the capped collection. If the collection is not capped,
 ``null`` will be returned.
 
 This method is deprecated in favor of using
-:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the
+:phpmethod:`MongoDB\Model\CollectionInfo::getOptions()` and accessing the
 ``max`` key.
 
 Examples
@@ -61,9 +61,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::isCapped()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`Capped Collections ` in the MongoDB manual
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
index 62732aa4..9b0101aa 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
@@ -15,11 +15,11 @@ MongoDB\\Model\\CollectionInfo::getCappedSize()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedSize()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getCappedSize()
 
    Return the size limit for the capped collection in bytes. This correlates
    with the ``size`` option for
-   :phpmethod:`MongoDB\\Database::createCollection()`.
+   :phpmethod:`MongoDB\Database::createCollection()`.
 
    .. code-block:: php
 
@@ -32,7 +32,7 @@ The size limit for the capped collection in bytes. If the collection is not
 capped, ``null`` will be returned.
 
 This method is deprecated in favor of using
-:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the
+:phpmethod:`MongoDB\Model\CollectionInfo::getOptions()` and accessing the
 ``size`` key.
 
 Examples
@@ -61,9 +61,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::isCapped()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`Capped Collections ` in the MongoDB manual
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt b/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt
index 4fa22dc0..73f47668 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::getIdIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getIdIndex()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getIdIndex()
 
    Returns information about the ``_id`` field index.
 
@@ -70,6 +70,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt b/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt
index 4d4f19ff..efdc1182 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::getInfo()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getInfo()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getInfo()
 
    Returns additional information about the collection.
 
@@ -56,6 +56,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getName.txt b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
index d3104af8..83a74b2b 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getName.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\CollectionInfo::getName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getName()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getName()
 
    Return the collection name.
 
@@ -47,6 +47,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
index 3ffac1db..d438b44b 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
@@ -13,10 +13,10 @@ MongoDB\\Model\\CollectionInfo::getOptions()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getOptions()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getOptions()
 
    Return the collection options. This correlates with the options for
-   :phpmethod:`MongoDB\\Database::createCollection()`, but may include
+   :phpmethod:`MongoDB\Database::createCollection()`, but may include
    additional fields set by the server.
 
    .. code-block:: php
@@ -60,6 +60,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getType.txt b/source/reference/method/MongoDBModelCollectionInfo-getType.txt
index 9fdf5c99..39a6c442 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getType.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getType.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::getType()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getType()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getType()
 
    Return the collection type.
 
@@ -49,6 +49,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
index a6067e0a..aa70df80 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::isCapped()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::isCapped()
+.. phpmethod:: MongoDB\Model\CollectionInfo::isCapped()
 
    Return whether the collection is a :manual:`capped collection
    `.
@@ -30,7 +30,7 @@ Return Values
 A boolean indicating whether the collection is a capped collection.
 
 This method is deprecated in favor of using
-:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the
+:phpmethod:`MongoDB\Model\CollectionInfo::getOptions()` and accessing the
 ``capped`` key.
 
 Examples
@@ -59,8 +59,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedSize()`
 - :manual:`Capped Collections ` in the MongoDB manual
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
index 6f82a77a..4ef37321 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\DatabaseInfo::getName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getName()
+.. phpmethod:: MongoDB\Model\DatabaseInfo::getName()
 
    Return the database name.
 
@@ -46,6 +46,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::getDatabaseName()`
+- :phpmethod:`MongoDB\Database::getDatabaseName()`
 - :manual:`listDatabases ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
index 8c3a0b0b..3af6ef48 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()
+.. phpmethod:: MongoDB\Model\DatabaseInfo::getSizeOnDisk()
 
    Return the total size of the database file on disk in bytes.
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
index 1c68299e..72849b8e 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\DatabaseInfo::isEmpty()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\DatabaseInfo::isEmpty()
+.. phpmethod:: MongoDB\Model\DatabaseInfo::isEmpty()
 
    Return whether the database has any data.
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getKey.txt b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
index ff416f91..0925428f 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getKey.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::getKey()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getKey()
+.. phpmethod:: MongoDB\Model\IndexInfo::getKey()
 
    Return the index specification (i.e. indexed field(s) and order). This
    correlates with the ``$key`` parameter for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -53,6 +53,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getName.txt b/source/reference/method/MongoDBModelIndexInfo-getName.txt
index b37c6621..4404964d 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getName.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getName.txt
@@ -13,10 +13,10 @@ MongoDB\\Model\\IndexInfo::getName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getName()
+.. phpmethod:: MongoDB\Model\IndexInfo::getName()
 
    Return the index name. This correlates with the return value of
-   :phpmethod:`MongoDB\\Collection::createIndex()`. An index name may be derived
+   :phpmethod:`MongoDB\Collection::createIndex()`. An index name may be derived
    from the ``$key`` parameter or explicitly specified via the ``name`` option.
 
    .. code-block:: php
@@ -50,6 +50,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
index f4bb7a59..099a1830 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\IndexInfo::getNamespace()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getNamespace()
+.. phpmethod:: MongoDB\Model\IndexInfo::getNamespace()
 
    Return the index namespace, which is the namespace of the collection
    containing the index.
@@ -49,7 +49,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
index 96a22770..cd0d1bb4 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\IndexInfo::getVersion()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getVersion()
+.. phpmethod:: MongoDB\Model\IndexInfo::getVersion()
 
    Return the index version.
 
@@ -48,6 +48,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt b/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
index 017e6e7b..27fd3f9a 100644
--- a/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\IndexInfo::is2dSphere()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::is2dSphere()
+.. phpmethod:: MongoDB\Model\IndexInfo::is2dSphere()
 
    Return whether the index is a :manual:`2dsphere `
    index.
@@ -55,7 +55,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
 - :manual:`2dsphere Indexes ` reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
index f6c2007d..87b7a53d 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
@@ -18,7 +18,7 @@ MongoDB\\Model\\IndexInfo::isGeoHaystack()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isGeoHaystack()
+.. phpmethod:: MongoDB\Model\IndexInfo::isGeoHaystack()
 
    Return whether the index is a :manual:`geoHaystack `
    index.
@@ -58,7 +58,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
 - :manual:`geoHaystack Indexes ` reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
index 533793c9..22c307ab 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::isSparse()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isSparse()
+.. phpmethod:: MongoDB\Model\IndexInfo::isSparse()
 
    Return whether the index is a :manual:`sparse index `.
    This correlates with the ``sparse`` option for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -50,7 +50,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
 - :manual:`Sparse Indexes ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isText.txt b/source/reference/method/MongoDBModelIndexInfo-isText.txt
index 7e0488f5..b600ebdd 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isText.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isText.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\IndexInfo::isText()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isText()
+.. phpmethod:: MongoDB\Model\IndexInfo::isText()
 
    Return whether the index is a :manual:`text ` index.
 
@@ -54,7 +54,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
 - :manual:`Text Indexes ` reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
index a33a22b9..ef417942 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::isTtl()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isTtl()
+.. phpmethod:: MongoDB\Model\IndexInfo::isTtl()
 
    Return whether the index is a :manual:`TTL index `. This
    correlates with the ``expireAfterSeconds`` option for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -50,7 +50,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
 - :manual:`TTL Indexes ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
index ef61e7c3..12d8b45c 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::isUnique()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isUnique()
+.. phpmethod:: MongoDB\Model\IndexInfo::isUnique()
 
    Return whether the index is a :manual:`unique index `.
    This correlates with the ``unique`` option for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -50,7 +50,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
 - :manual:`Unique Indexes ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt b/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
index f347a8cf..f668fe12 100644
--- a/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
+++ b/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getMatchedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getMatchedCount()
+.. phpmethod:: MongoDB\UpdateResult::getMatchedCount()
 
    Return the number of documents that were matched.
 
@@ -29,7 +29,7 @@ Definition
       (e.g. setting the value of a field to its current value), the matched
       count may be greater than the value returned by
       :phpmethod:`getModifiedCount()
-      `.
+      `.
 
 Return Values
 -------------
@@ -44,6 +44,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\UpdateResult::getModifiedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getMatchedCount()
+- :phpmethod:`MongoDB\UpdateResult::getModifiedCount()`
+- :php:`MongoDB\Driver\WriteResult::getMatchedCount()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt b/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
index 3e2a7a6e..5c8bfe73 100644
--- a/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
+++ b/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getModifiedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getModifiedCount()
+.. phpmethod:: MongoDB\UpdateResult::getModifiedCount()
 
    Return the number of documents that were modified.
 
@@ -28,7 +28,7 @@ Definition
       If an update/replace operation results in no change to the document
       (e.g. setting the value of a field to its current value), the modified
       count may be less than the value returned by :phpmethod:`getMatchedCount()
-      `.
+      `.
 
 Return Values
 -------------
@@ -43,6 +43,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\UpdateResult::getMatchedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getModifiedCount()
+- :phpmethod:`MongoDB\UpdateResult::getMatchedCount()`
+- :php:`MongoDB\Driver\WriteResult::getModifiedCount()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt b/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
index 0bbb39fb..7074696e 100644
--- a/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
+++ b/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getUpsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getUpsertedCount()
+.. phpmethod:: MongoDB\UpdateResult::getUpsertedCount()
 
    Return the number of documents that were upserted.
 
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedCount()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt b/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
index 52498708..d9200778 100644
--- a/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
+++ b/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getUpsertedId()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getUpsertedId()
+.. phpmethod:: MongoDB\UpdateResult::getUpsertedId()
 
    Return the ID (i.e. ``_id`` field value) of the upserted document.
 
@@ -29,7 +29,7 @@ upserted, ``null`` will be returned.
 
 If the document had an ID prior to upserting (i.e. the server did not need to
 generate an ID), this will contain its ``_id`` field value. Any server-generated
-ID will be a :php:`MongoDB\\BSON\\ObjectId `
+ID will be a :php:`MongoDB\BSON\ObjectId `
 instance.
 
 Errors/Exceptions
@@ -40,5 +40,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedIds()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedIds()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt b/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
index af15d1f1..2e7c7b05 100644
--- a/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::isAcknowledged()
+.. phpmethod:: MongoDB\UpdateResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/tutorial/codecs.txt b/source/tutorial/codecs.txt
index 32669cbf..a4bb5dd6 100644
--- a/source/tutorial/codecs.txt
+++ b/source/tutorial/codecs.txt
@@ -42,7 +42,7 @@ The example above selects a collection and instructs it to use the ``PersonCodec
 When inserting data, the ``PersonCodec`` is used to encode the document. When retrieving data, the same ``PersonCodec``
 is used to decode BSON data into a ``Person`` instance. Note that while the ``PersonCodec`` could technically decode any
 BSON document that contains a name field, we wouldn't want to use it for any other documents. Document codecs are meant
-to be used with a :phpclass:`MongoDB\\Collection`, or when decoding embedded documents.
+to be used with a :phpclass:`MongoDB\Collection`, or when decoding embedded documents.
 
 When using a collection with a codec, the codec will only accept and return data of that type for certain operations.
 Insert and replace operations (e.g. ``insertOne``, ```findOneAndReplace``, and some ``bulkWrite`` operations) will
diff --git a/source/tutorial/collation.txt b/source/tutorial/collation.txt
index a867ae25..6ba335e7 100644
--- a/source/tutorial/collation.txt
+++ b/source/tutorial/collation.txt
@@ -196,7 +196,7 @@ A collection called ``names`` contains the following documents:
    { "_id" : 4, "first_name" : "Jürgen" }
 
 The following :phpmethod:`findOneAndUpdate()
-` operation on the collection does not
+` operation on the collection does not
 specify a collation.
 
 .. code-block:: php
@@ -214,7 +214,7 @@ Because ``Gunter`` is lexically first in the collection, the above operation
 returns no results and updates no documents.
 
 Consider the same :phpmethod:`findOneAndUpdate()
-` operation but with a collation
+` operation but with a collation
 specified, which uses the locale ``de@collation=phonebook``.
 
 .. note::
@@ -349,7 +349,7 @@ Aggregation
 ~~~~~~~~~~~
 
 To use collation with an :phpmethod:`aggregate()
-` operation, specify a collation in the
+` operation, specify a collation in the
 aggregation options.
 
 The following aggregation example uses a collection called ``names`` and groups
diff --git a/source/tutorial/commands.txt b/source/tutorial/commands.txt
index bccf7462..3efa999e 100644
--- a/source/tutorial/commands.txt
+++ b/source/tutorial/commands.txt
@@ -14,14 +14,14 @@ Overview
 --------
 
 The |php-library| provides helper methods across the :phpclass:`Client
-`, :phpclass:`Database `, and
-:phpclass:`Collection ` classes for common
+`, :phpclass:`Database `, and
+:phpclass:`Collection ` classes for common
 :manual:`database commands `. In addition, the
-:phpmethod:`MongoDB\\Database::command()` method may be used to run database
+:phpmethod:`MongoDB\Database::command()` method may be used to run database
 commands that do not have a helper method.
 
-The :phpmethod:`MongoDB\\Database::command()` method always returns a
-:php:`MongoDB\\Driver\\Cursor ` object, since it must
+The :phpmethod:`MongoDB\Database::command()` method always returns a
+:php:`MongoDB\Driver\Cursor ` object, since it must
 support execution of commands that return single result documents *and* multiple
 results via a command cursor.
 
@@ -63,7 +63,7 @@ example executes :manual:`listCollections `,
 which returns a cursor containing a result document for each collection in the
 ``test`` database, and iterates through the results using a ``foreach`` loop.
 Note that this example is illustrative; applications would generally use
-:phpmethod:`MongoDB\\Database::listCollections()` in practice.
+:phpmethod:`MongoDB\Database::listCollections()` in practice.
 
 .. code-block:: php
 
@@ -103,8 +103,8 @@ Specifying a Custom Read Preference
 Write commands, such as :manual:`createUser `,
 can only be executed on a writable server (e.g. :term:`primary` replica set
 member). Command helper methods in the |php-library|, such as
-:phpmethod:`MongoDB\\Database::drop()`, know to apply their own :term:`read
-preference` if necessary. However, the :phpmethod:`MongoDB\\Database::command()`
+:phpmethod:`MongoDB\Database::drop()`, know to apply their own :term:`read
+preference` if necessary. However, the :phpmethod:`MongoDB\Database::command()`
 method is a generic method and defaults to the read preference of the Database
 object on which it is invoked. When necessary, the ``readPreference`` option may
 be used to override the default read preference.
diff --git a/source/tutorial/connecting.txt b/source/tutorial/connecting.txt
index c964362a..cffd19ef 100644
--- a/source/tutorial/connecting.txt
+++ b/source/tutorial/connecting.txt
@@ -22,4 +22,4 @@ Specifying connection options
 
 Connection options can be passed via the ``$uri`` parameter, or through the
 ``$options`` and ``$driverOptions`` parameters. The available options are
-documented in the :phpmethod:`MongoDB\\Client::__construct()` reference.
+documented in the :phpmethod:`MongoDB\Client::__construct()` reference.
diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index 3abbf579..a69ec662 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -12,7 +12,7 @@ CRUD Operations
 
 
 CRUD operations *create*, *read*, *update*, and *delete* documents. The
-|php-library|'s :phpclass:`MongoDB\\Collection` class implements MongoDB's
+|php-library|'s :phpclass:`MongoDB\Collection` class implements MongoDB's
 cross-driver `CRUD specification
 `_,
 providing access to methods for inserting, finding, updating, and deleting
@@ -29,9 +29,9 @@ Insert Documents
 Insert One Document
 ~~~~~~~~~~~~~~~~~~~
 
-The :phpmethod:`MongoDB\\Collection::insertOne()` method inserts a single
+The :phpmethod:`MongoDB\Collection::insertOne()` method inserts a single
 document into MongoDB and returns an instance of
-:phpclass:`MongoDB\\InsertOneResult`, which you can use to access the ID of the
+:phpclass:`MongoDB\InsertOneResult`, which you can use to access the ID of the
 inserted document.
 
 .. this uses the insertOne example from the method reference:
@@ -70,14 +70,14 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::insertOne()`
+   :phpmethod:`MongoDB\Collection::insertOne()`
 
 Insert Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-The :phpmethod:`MongoDB\\Collection::insertMany()` method allows you to insert
+The :phpmethod:`MongoDB\Collection::insertMany()` method allows you to insert
 multiple documents in one write operation and returns an instance of
-:phpclass:`MongoDB\\InsertManyResult`, which you can use to access the IDs of
+:phpclass:`MongoDB\InsertManyResult`, which you can use to access the IDs of
 the inserted documents.
 
 .. this uses the insertMany example from the method reference:
@@ -88,14 +88,14 @@ the inserted documents.
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::insertMany()`
+   :phpmethod:`MongoDB\Collection::insertMany()`
 
 Query Documents
 ---------------
 
-The |php-library| provides the :phpmethod:`MongoDB\\Collection::findOne()` and
-:phpmethod:`MongoDB\\Collection::find()` methods for querying documents and the
-:phpmethod:`MongoDB\\Collection::aggregate()` method for performing
+The |php-library| provides the :phpmethod:`MongoDB\Collection::findOne()` and
+:phpmethod:`MongoDB\Collection::find()` methods for querying documents and the
+:phpmethod:`MongoDB\Collection::aggregate()` method for performing
 :manual:`aggregation operations `.
 
 .. include:: /includes/extracts/note-bson-comparison.rst
@@ -103,7 +103,7 @@ The |php-library| provides the :phpmethod:`MongoDB\\Collection::findOne()` and
 Find One Document
 ~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::findOne()` returns the :term:`first document
+:phpmethod:`MongoDB\Collection::findOne()` returns the :term:`first document
 ` that matches the query or ``null`` if no document matches the
 query.
 
@@ -153,21 +153,21 @@ The output would then resemble:
    ``"94301"``. The same criteria would not have matched a document with an
    integer value of ``94301`` due to MongoDB's :manual:`comparison rules for
    BSON types `. Similarly, users should
-   use a :php:`MongoDB\\BSON\\ObjectId ` object
+   use a :php:`MongoDB\BSON\ObjectId ` object
    when matching an ``_id`` with an :manual:`ObjectId `
    value, as strings and ObjectIds are not directly comparable.
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::findOne()`
+   :phpmethod:`MongoDB\Collection::findOne()`
 
 .. _php-find-many-documents:
 
 Find Many Documents
 ~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::find()` returns a
-:php:`MongoDB\\Driver\\Cursor ` object, which you can
+:phpmethod:`MongoDB\Collection::find()` returns a
+:php:`MongoDB\Driver\Cursor ` object, which you can
 iterate upon to access all matched documents.
 
 The following example lists the documents in the ``zips`` collection with the
@@ -198,7 +198,7 @@ The output would resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::find()`
+   :phpmethod:`MongoDB\Collection::find()`
 
 .. _php-query-projection:
 
@@ -355,7 +355,7 @@ Regular Expressions
 ~~~~~~~~~~~~~~~~~~~
 
 Filter criteria may include regular expressions, either by using the
-:php:`MongoDB\\BSON\\Regex ` class directory or the
+:php:`MongoDB\BSON\Regex ` class directory or the
 :query:`$regex` operator.
 
 The following example lists documents in the ``zips`` collection where the city
@@ -421,10 +421,10 @@ Complex Queries with Aggregation
 
 MongoDB's :manual:`Aggregation Framework ` allows
 you to issue complex queries that filter, transform, and group collection data.
-The |php-library|\'s :phpmethod:`MongoDB\\Collection::aggregate()` method
+The |php-library|\'s :phpmethod:`MongoDB\Collection::aggregate()` method
 returns a :php:`Traversable ` object, which you can iterate upon to
 access the results of the aggregation operation. Refer to the
-:phpmethod:`MongoDB\\Collection::aggregate()` method's :ref:`behavior
+:phpmethod:`MongoDB\Collection::aggregate()` method's :ref:`behavior
 reference ` for more about the method's output.
 
 The following example lists the 5 US states with the most zip codes associated
@@ -458,7 +458,7 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::aggregate()`
+   :phpmethod:`MongoDB\Collection::aggregate()`
 
 Update Documents
 ----------------
@@ -466,18 +466,18 @@ Update Documents
 Update One Document
 ~~~~~~~~~~~~~~~~~~~
 
-Use the :phpmethod:`MongoDB\\Collection::updateOne()` method to update a single
-document matching a filter. :phpmethod:`MongoDB\\Collection::updateOne()`
-returns a :phpclass:`MongoDB\\UpdateResult` object, which you can use to access
+Use the :phpmethod:`MongoDB\Collection::updateOne()` method to update a single
+document matching a filter. :phpmethod:`MongoDB\Collection::updateOne()`
+returns a :phpclass:`MongoDB\UpdateResult` object, which you can use to access
 statistics about the update operation.
 
 Update methods have two required parameters: the query filter that identifies
 the document or documents to update, and an update document that specifies what
-updates to perform. The :phpmethod:`MongoDB\\Collection::updateOne()` reference
+updates to perform. The :phpmethod:`MongoDB\Collection::updateOne()` reference
 describes each parameter in detail.
 
 The following example inserts two documents into an empty ``users`` collection
-in the ``test`` database using the :phpmethod:`MongoDB\\Collection::insertOne()`
+in the ``test`` database using the :phpmethod:`MongoDB\Collection::insertOne()`
 method, and then updates the documents where the value for the ``state`` field
 is ``"ny"`` to include a ``country`` field set to ``"us"``:
 
@@ -499,7 +499,7 @@ is ``"ny"`` to include a ``country`` field set to ``"us"``:
    printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
 
 Since the update operation uses the
-:phpmethod:`MongoDB\\Collection::updateOne()` method, which updates the first
+:phpmethod:`MongoDB\Collection::updateOne()` method, which updates the first
 document to match the filter criteria, the results would then resemble:
 
 .. code-block:: none
@@ -537,19 +537,19 @@ therefore not be equal, and the output from the operation would resemble:
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::updateOne()`
-   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+   - :phpmethod:`MongoDB\Collection::updateOne()`
+   - :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 
 Update Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::updateMany()` updates one or more documents
-matching the filter criteria and returns a :phpclass:`MongoDB\\UpdateResult`
+:phpmethod:`MongoDB\Collection::updateMany()` updates one or more documents
+matching the filter criteria and returns a :phpclass:`MongoDB\UpdateResult`
 object, which you can use to access statistics about the update operation.
 
 Update methods have two required parameters: the query filter that identifies
 the document or documents to update, and an update document that specifies what
-updates to perform. The :phpmethod:`MongoDB\\Collection::updateMany()` reference
+updates to perform. The :phpmethod:`MongoDB\Collection::updateMany()` reference
 describes each parameter in detail.
 
 The following example inserts three documents into an empty ``users`` collection
@@ -588,7 +588,7 @@ operation therefore resembles:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::updateMany()`
+   :phpmethod:`MongoDB\Collection::updateMany()`
 
 Replace Documents
 ~~~~~~~~~~~~~~~~~
@@ -598,23 +598,23 @@ a document to include new fields or new field values, a replacement operation
 replaces the entire document with a new document, but retains the original
 document's ``_id`` value.
 
-The :phpmethod:`MongoDB\\Collection::replaceOne()` method replaces a single
+The :phpmethod:`MongoDB\Collection::replaceOne()` method replaces a single
 document that matches the filter criteria and returns an instance of
-:phpclass:`MongoDB\\UpdateResult`, which you can use to access statistics about
+:phpclass:`MongoDB\UpdateResult`, which you can use to access statistics about
 the replacement operation.
 
-:phpmethod:`MongoDB\\Collection::replaceOne()` has two required parameters: the
+:phpmethod:`MongoDB\Collection::replaceOne()` has two required parameters: the
 query filter that identifies the document or documents to replace, and a
 replacement document that will replace the original document in MongoDB. The
-:phpmethod:`MongoDB\\Collection::replaceOne()` reference describes each
+:phpmethod:`MongoDB\Collection::replaceOne()` reference describes each
 parameter in detail.
 
 .. important::
 
    Replacement operations replace all of the fields in a document except the
    ``_id`` value. To avoid accidentally overwriting or deleting desired fields,
-   use the :phpmethod:`MongoDB\\Collection::updateOne()` or
-   :phpmethod:`MongoDB\\Collection::updateMany()` methods to update individual
+   use the :phpmethod:`MongoDB\Collection::updateOne()` or
+   :phpmethod:`MongoDB\Collection::updateMany()` methods to update individual
    fields in a document rather than replacing the entire document.
 
 The following example inserts one document into an empty ``users`` collection in
@@ -645,8 +645,8 @@ The output would then resemble:
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::replaceOne()`
-   - :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+   - :phpmethod:`MongoDB\Collection::replaceOne()`
+   - :phpmethod:`MongoDB\Collection::findOneAndReplace()`
 
 Upsert
 ~~~~~~
@@ -658,9 +658,9 @@ document and inserts it. If there *are* matching documents, then the operation
 modifies or replaces the matching document or documents.
 
 When a document is upserted, the ID is accessible via
-:phpmethod:`MongoDB\\UpdateResult::getUpsertedId()`.
+:phpmethod:`MongoDB\UpdateResult::getUpsertedId()`.
 
-The following example uses :phpmethod:`MongoDB\\Collection::updateOne()` with
+The following example uses :phpmethod:`MongoDB\Collection::updateOne()` with
 the ``upsert`` option set to ``true`` and an empty ``users`` collection in the
 ``test`` database, therefore inserting the document into the database:
 
@@ -715,18 +715,18 @@ Delete Documents
 Delete One Document
 ~~~~~~~~~~~~~~~~~~~
 
-The :phpmethod:`MongoDB\\Collection::deleteOne()` method deletes a single
+The :phpmethod:`MongoDB\Collection::deleteOne()` method deletes a single
 document that matches the filter criteria and returns a
-:phpclass:`MongoDB\\DeleteResult`, which you can use to access statistics about
+:phpclass:`MongoDB\DeleteResult`, which you can use to access statistics about
 the delete operation.
 
 If multiple documents match the filter criteria,
-:phpmethod:`MongoDB\\Collection::deleteOne()` deletes the :term:`first
+:phpmethod:`MongoDB\Collection::deleteOne()` deletes the :term:`first
 ` matching document.
 
-:phpmethod:`MongoDB\\Collection::deleteOne()` has one required parameter: a
+:phpmethod:`MongoDB\Collection::deleteOne()` has one required parameter: a
 query filter that specifies the document to delete. Refer to the
-:phpmethod:`MongoDB\\Collection::deleteOne()` reference for full method
+:phpmethod:`MongoDB\Collection::deleteOne()` reference for full method
 documentation.
 
 The following operation deletes the first document where the ``state`` field's
@@ -753,18 +753,18 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::deleteOne()`
+   :phpmethod:`MongoDB\Collection::deleteOne()`
 
 Delete Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::deleteMany()` deletes all of the documents that
-match the filter criteria and returns a :phpclass:`MongoDB\\DeleteResult`, which
+:phpmethod:`MongoDB\Collection::deleteMany()` deletes all of the documents that
+match the filter criteria and returns a :phpclass:`MongoDB\DeleteResult`, which
 you can use to access statistics about the delete operation.
 
-:phpmethod:`MongoDB\\Collection::deleteMany()` has one required parameter: a
+:phpmethod:`MongoDB\Collection::deleteMany()` has one required parameter: a
 query filter that specifies the document to delete. Refer to the
-:phpmethod:`MongoDB\\Collection::deleteMany()` reference for full method
+:phpmethod:`MongoDB\Collection::deleteMany()` reference for full method
 documentation.
 
 The following operation deletes all of the documents where the ``state`` field's
@@ -791,4 +791,4 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::deleteMany()`
+   :phpmethod:`MongoDB\Collection::deleteMany()`
diff --git a/source/tutorial/custom-types.txt b/source/tutorial/custom-types.txt
index 0b08172a..b96a0421 100644
--- a/source/tutorial/custom-types.txt
+++ b/source/tutorial/custom-types.txt
@@ -6,7 +6,7 @@ Custom Data-Types
 
 .. note::
 
-   This tutorial explains implementing custom data types using the :php:`MongoDB\\BSON\\Persistable `
+   This tutorial explains implementing custom data types using the :php:`MongoDB\BSON\Persistable `
    interface found in the MongoDB extension. Consider using a codec instead to decouple the MongoDB persistence logic
    from your business logic. See the :ref:`codec tutorial ` for an example.
 
@@ -21,7 +21,7 @@ communicates to the server, and deserializes BSON back into PHP variables when
 it receives data from the server.
 
 It is possible to influence the behavior by implementing the
-:php:`MongoDB\\BSON\\Persistable ` interface.
+:php:`MongoDB\BSON\Persistable ` interface.
 If a class implements this interface, then upon serialization the
 :php:`bsonSerialize ` method is
 called. This method is responsible for returning an array or stdClass object
@@ -29,7 +29,7 @@ to convert to BSON and store in the database. That data will later be used to
 reconstruct the object upon reading from the database.
 
 As an example we present the ``LocalDateTime`` class. This class wraps around
-the :php:`MongoDB\\BSON\\UTCDateTime ` data
+the :php:`MongoDB\BSON\UTCDateTime ` data
 type and a time zone.
 
 .. code-block:: php
@@ -51,7 +51,7 @@ type and a time zone.
         }
     ?>
 
-As it implements the :php:`MongoDB\\BSON\\Persistable
+As it implements the :php:`MongoDB\BSON\Persistable
 ` interface, the
 class is required to implement the :php:`bsonSerialize
 ` and :php:`bsonUnserialize
@@ -59,7 +59,7 @@ class is required to implement the :php:`bsonSerialize
 :php:`bsonSerialize ` method, we
 return an array with the two values that we need to persist: the point in time
 in milliseconds since the Epoch, represented by a
-:php:`MongoDB\\BSON\\UTCDateTime ` object, and
+:php:`MongoDB\BSON\UTCDateTime ` object, and
 a string containing the Olson time zone identifier:
 
 .. code-block:: php
@@ -81,7 +81,7 @@ stored object.
 
 When the document is read from the database, the driver detects whether a
 ``__pclass`` field is present and then executes
-:php:`MongoDB\\BSON\\Persistable::bsonUnserialize
+:php:`MongoDB\BSON\Persistable::bsonUnserialize
 ` method which is
 responsible for restoring the object's original state.
 
@@ -108,25 +108,25 @@ properties.
     ?>
 
 You may have noticed that the class also implements the
-:php:`MongoDB\\BSON\\UTCDateTimeInterface
+:php:`MongoDB\BSON\UTCDateTimeInterface
 ` interface. This interface defines
-the two non-constructor methods of the :php:`MongoDB\\BSON\\UTCDateTime
+the two non-constructor methods of the :php:`MongoDB\BSON\UTCDateTime
 ` class.
 
 It is recommended that wrappers around existing BSON classes implement their
-respective interface (i.e. :php:`MongoDB\\BSON\\UTCDateTimeInterface
+respective interface (i.e. :php:`MongoDB\BSON\UTCDateTimeInterface
 `) so that the wrapper objects can be
 used in the same context as their original unwrapped version. It is also
 recommended that you always type-hint against the interface (i.e.
-:php:`MongoDB\\BSON\\UTCDateTimeInterface
+:php:`MongoDB\BSON\UTCDateTimeInterface
 `) and never against the concrete
-class (i.e. :php:`MongoDB\\BSON\\UTCDateTime
+class (i.e. :php:`MongoDB\BSON\UTCDateTime
 `), as this would prevent wrapped objects from
 being accepted into methods.
 
 In our new ``toDateTime`` method we return a :php:`DateTime `
 object with the local time zone set, instead of the UTC time zone that
-:php:`MongoDB\\BSON\\UTCDateTime ` normally uses
+:php:`MongoDB\BSON\UTCDateTime ` normally uses
 in its return value.
 
 .. code-block:: php
diff --git a/source/tutorial/encryption.txt b/source/tutorial/encryption.txt
index 393fe820..3a912165 100644
--- a/source/tutorial/encryption.txt
+++ b/source/tutorial/encryption.txt
@@ -91,7 +91,7 @@ Creating an Encryption Key
    and thus it is very important that you keep this key secure.
 
 To create an encryption key, create a
-:php:`MongoDB\\Driver\\ClientEncryption `
+:php:`MongoDB\Driver\ClientEncryption `
 instance with encryption options and use the
 :php:`createDataKey() `
 method. The method will return the key ID which can be used to reference the key
@@ -157,7 +157,7 @@ specifying the ``autoEncryption``
 :php:`driver option `.
 The following examples demonstrate how to setup automatic client-side field
 level encryption and use a
-:php:`MongoDB\\Driver\\ClientEncryption `
+:php:`MongoDB\Driver\ClientEncryption `
 object to create a new encryption key.
 
 
@@ -209,7 +209,7 @@ Explicit Encryption
 
 Explicit encryption is a MongoDB community feature and does not use
 crypt_shared_ or mongocryptd_. Explicit encryption is provided by the
-:php:`MongoDB\\Driver\\ClientEncryption ` class.
+:php:`MongoDB\Driver\ClientEncryption ` class.
 
 .. literalinclude:: /examples/encryption/csfle-explicit_encryption.php
    :language: php
diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt
index 4eb7e156..4688aefb 100644
--- a/source/tutorial/gridfs.txt
+++ b/source/tutorial/gridfs.txt
@@ -13,7 +13,7 @@ GridFS
 :manual:`GridFS ` is a specification for storing and retrieving
 files in MongoDB. GridFS uses two collections to store files. One collection
 stores the file chunks (e.g. ``fs.chunks``), and the other stores file metadata
-(e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket` class provides an
+(e.g. ``fs.files``). The :phpclass:`MongoDB\GridFS\Bucket` class provides an
 interface around these collections for working with the files as PHP
 :php:`Streams `.
 
@@ -21,9 +21,9 @@ Creating a GridFS Bucket
 ------------------------
 
 You can construct a GridFS bucket using the PHP extension's
-:php:`MongoDB\\Driver\\Manager ` class, or select
-a bucket from the |php-library|'s :phpclass:`MongoDB\\Database` class via the
-:phpmethod:`selectGridFSBucket() `
+:php:`MongoDB\Driver\Manager ` class, or select
+a bucket from the |php-library|'s :phpclass:`MongoDB\Database` class via the
+:phpmethod:`selectGridFSBucket() `
 method.
 
 The bucket can be constructed with various options:
@@ -35,7 +35,7 @@ The bucket can be constructed with various options:
   needed. The default size is ``261120`` (i.e. 255 KiB).
 - ``readConcern``, ``readPreference`` and ``writeConcern`` options can be used
   to specify defaults for read and write operations, much like the
-  :phpclass:`MongoDB\\GridFS\\Collection` options.
+  :phpclass:`MongoDB\GridFS\Collection` options.
 
 Uploading Files with Writable Streams
 -------------------------------------
@@ -112,9 +112,9 @@ number. Revision numbers are used to distinguish between files sharing the same
 ``filename`` metadata field, ordered by date of upload (i.e. the ``uploadDate``
 metadata field). The ``revision`` option accepted by
 :phpmethod:`openDownloadStreamByName()
-` and
+` and
 :phpmethod:`downloadToStreamByName()
-` can be positive or negative.
+` can be positive or negative.
 
 A positive ``revision`` number may be used to select files in order of the
 oldest upload date. A revision of ``0`` would denote the file with the oldest
@@ -157,7 +157,7 @@ You can delete a GridFS file by its ``_id``.
 Finding File Metadata
 ---------------------
 
-The :phpmethod:`find() ` method allows you to
+The :phpmethod:`find() ` method allows you to
 retrieve documents from the GridFS files collection, which contain metadata
 about the GridFS files.
 
@@ -173,7 +173,7 @@ Accessing File Metadata for an Existing Stream
 ----------------------------------------------
 
 The :phpmethod:`getFileDocumentForStream()
-` method may be used to get
+` method may be used to get
 the file document for an existing readable or writable GridFS stream.
 
 .. code-block:: php
@@ -193,16 +193,16 @@ the file document for an existing readable or writable GridFS stream.
    Since the file document for a writable stream is not committed to MongoDB
    until the stream is closed,
    :phpmethod:`getFileDocumentForStream()
-   ` can only return an
+   ` can only return an
    in-memory document, which will be missing some fields (e.g. ``length``,
    ``md5``).
 
 The :phpmethod:`getFileIdForStream()
-` method may be used to get the
+` method may be used to get the
 ``_id`` for an existing readable or writable GridFS stream. This is a
 convenience for accessing the ``_id`` property of the object returned by
 :phpmethod:`getFileDocumentForStream()
-`.
+`.
 
 .. code-block:: php
 
diff --git a/source/tutorial/indexes.txt b/source/tutorial/indexes.txt
index e04d4365..51d2d3f7 100644
--- a/source/tutorial/indexes.txt
+++ b/source/tutorial/indexes.txt
@@ -11,7 +11,7 @@ appropriate index exists for a query, MongoDB can use the index to limit the
 number of documents it must inspect.
 
 The PHP driver supports managing indexes through the
-:phpclass:`MongoDB\\Collection` class, which implements MongoDB's
+:phpclass:`MongoDB\Collection` class, which implements MongoDB's
 cross-driver `Index Management
 `_
 and `Enumerating Indexes
@@ -26,12 +26,12 @@ MongoDB.
 Create Indexes
 --------------
 
-Create indexes with the :phpmethod:`MongoDB\\Collection::createIndex()` or
-:phpmethod:`MongoDB\\Collection::createIndexes()` methods. Refer to the method
+Create indexes with the :phpmethod:`MongoDB\Collection::createIndex()` or
+:phpmethod:`MongoDB\Collection::createIndexes()` methods. Refer to the method
 reference for more details about each method.
 
 The following example creates an ascending index on the ``state`` field using
-the :phpmethod:`createIndex() ` method:
+the :phpmethod:`createIndex() ` method:
 
 .. code-block:: php
 
@@ -54,10 +54,10 @@ similar to:
 List Indexes
 ------------
 
-The :phpmethod:`MongoDB\\Collection::listIndexes()` method provides information
+The :phpmethod:`MongoDB\Collection::listIndexes()` method provides information
 about the indexes in a collection. The
-:phpmethod:`MongoDB\\Collection::listIndexes()` method returns an iterator of
-:phpclass:`MongoDB\\Model\\IndexInfo` objects, which you can use to view
+:phpmethod:`MongoDB\Collection::listIndexes()` method returns an iterator of
+:phpclass:`MongoDB\Model\IndexInfo` objects, which you can use to view
 information about each index. Refer to the method reference for more details.
 
 The following example lists all indexes in the ``zips`` collection in the
@@ -107,8 +107,8 @@ The output would resemble:
 Drop Indexes
 ------------
 
-The :phpmethod:`MongoDB\\Collection::dropIndex()` method lets you drop a single
-index while :phpmethod:`MongoDB\\Collection::dropIndexes()` drops all of the
+The :phpmethod:`MongoDB\Collection::dropIndex()` method lets you drop a single
+index while :phpmethod:`MongoDB\Collection::dropIndexes()` drops all of the
 indexes on a collection. Refer to the method reference for more details about
 each method.
 
diff --git a/source/tutorial/modeling-bson-data.txt b/source/tutorial/modeling-bson-data.txt
index 46ab3cf9..56f0217a 100644
--- a/source/tutorial/modeling-bson-data.txt
+++ b/source/tutorial/modeling-bson-data.txt
@@ -17,13 +17,13 @@ Type Maps
 
 Most methods that read data from MongoDB support a ``typeMap`` option, which
 allows control over how BSON is converted to PHP. Additionally,
-the :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
-:phpclass:`MongoDB\\Collection` classes accept a ``typeMap`` option, which can
+the :phpclass:`MongoDB\Client`, :phpclass:`MongoDB\Database`, and
+:phpclass:`MongoDB\Collection` classes accept a ``typeMap`` option, which can
 be used to specify a default type map to apply to any supporting methods and
-selected classes (e.g. :phpmethod:`MongoDB\\Client::selectDatabase()`).
+selected classes (e.g. :phpmethod:`MongoDB\Client::selectDatabase()`).
 
-The :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
-:phpclass:`MongoDB\\Collection` classes use the following type map by
+The :phpclass:`MongoDB\Client`, :phpclass:`MongoDB\Database`, and
+:phpclass:`MongoDB\Collection` classes use the following type map by
 default:
 
 .. code-block:: php
@@ -35,13 +35,13 @@ default:
    ]
 
 The type map above will convert BSON documents and arrays to
-:phpclass:`MongoDB\\Model\\BSONDocument` and
-:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The ``root`` and
+:phpclass:`MongoDB\Model\BSONDocument` and
+:phpclass:`MongoDB\Model\BSONArray` objects, respectively. The ``root`` and
 ``document`` keys are used to distinguish the top-level BSON document from
 embedded documents, respectively.
 
 A type map may specify any class that implements
-:php:`MongoDB\\BSON\\Unserializable ` as well as
+:php:`MongoDB\BSON\Unserializable ` as well as
 ``"array"``, ``"stdClass``", and ``"object"`` (``"stdClass``" and ``"object"``
 are aliases of one another).
 
@@ -54,7 +54,7 @@ Persistable Classes
 -------------------
 
 The driver's :php:`persistence specification ` outlines how
-classes implementing its :php:`MongoDB\\BSON\\Persistable
+classes implementing its :php:`MongoDB\BSON\Persistable
 ` interface are serialized to and deserialized from
 BSON. The :php:`Persistable ` interface is analogous
 to PHP's :php:`Serializable interface `.
@@ -156,7 +156,7 @@ The same document in the MongoDB shell might display as:
 
 .. note::
 
-   :php:`MongoDB\\BSON\\Persistable ` may only be used
+   :php:`MongoDB\BSON\Persistable ` may only be used
    for root and embedded BSON documents. It may not be used for BSON arrays.
 
 Working with Enums
@@ -208,10 +208,10 @@ enum is responsible for converting the value back to an enum case:
    }
 
 Enums are prohibited from implementing
-:php:`MongoDB\\BSON\\Unserializable ` and
-:php:`MongoDB\\BSON\\Persistable `, since enum cases
+:php:`MongoDB\BSON\Unserializable ` and
+:php:`MongoDB\BSON\Persistable `, since enum cases
 have no state and cannot be instantiated like ordinary objects. Pure and backed
 enums can, however, implement
-:php:`MongoDB\\BSON\\Serializable `, which can be
+:php:`MongoDB\BSON\Serializable `, which can be
 used to overcome the default behavior whereby backed enums are serialized as
 their case value and pure enums cannot be serialized.
diff --git a/source/tutorial/stable-api.txt b/source/tutorial/stable-api.txt
index 1220f032..d018162a 100644
--- a/source/tutorial/stable-api.txt
+++ b/source/tutorial/stable-api.txt
@@ -15,7 +15,7 @@ Declaring an API Version
 
 To declare an API version, pass a ``serverApi`` driver option when creating your
 client. The value is a
-:php:`MongoDB\\Driver\\ServerApi ` instance that
+:php:`MongoDB\Driver\ServerApi ` instance that
 contains API version information. This feature is introduced in MongoDB 5.0,
 which will initially support only API version "1". Additional versions may be
 introduced in future versions of the server.
@@ -46,7 +46,7 @@ By default, declaring an API version guarantees behavior for commands that are
 part of the stable API, but does not forbid using commands that are not part
 of the API version. To only allow commands and options that are part of the
 stable API, specify the ``strict`` option when creating the
-:php:`MongoDB\\Driver\\ServerApi ` instance:
+:php:`MongoDB\Driver\ServerApi ` instance:
 
 .. code-block:: php
 
@@ -85,9 +85,9 @@ testing to ensure a smooth transition to a future API version.
 Usage with the Command Helper
 -----------------------------
 
-When using the :phpmethod:`MongoDB\\Database::command()` method to run arbitrary
+When using the :phpmethod:`MongoDB\Database::command()` method to run arbitrary
 commands, the API version declared to the client is automatically appended to
 the command document. Setting any of the ``apiVersion``, ``apiStrict``, or
 ``apiDeprecationErrors`` command options in the command document and calling
-:phpmethod:`MongoDB\\Database::command()` from a client with a declared API
+:phpmethod:`MongoDB\Database::command()` from a client with a declared API
 version is not supported and will lead to undefined behavior.
diff --git a/source/tutorial/tailable-cursor.txt b/source/tutorial/tailable-cursor.txt
index 370a642a..6285676e 100644
--- a/source/tutorial/tailable-cursor.txt
+++ b/source/tutorial/tailable-cursor.txt
@@ -17,7 +17,7 @@ Overview
 
 When the driver executes a query or command (e.g.
 :manual:`aggregate `), results from the operation
-are returned via a :php:`MongoDB\\Driver\\Cursor `
+are returned via a :php:`MongoDB\Driver\Cursor `
 object. The Cursor class implements PHP's :php:`Iterator `
 interface, which allows it to be iterated with ``foreach`` and interface with
 any PHP functions that work with :php:`iterables `. Similar to
@@ -99,7 +99,7 @@ preceding example to use the Iterator methods directly:
    throw an exception, since all results on the cursor have been exhausted.
 
 The purpose of this example is to demonstrate the functional equivalence between
-``foreach`` and manual iteration with PHP's :php:`Iterator `API.
+``foreach`` and manual iteration with PHP's :php:`Iterator ` API.
 For normal cursors, there is little reason to manually iterate results instead
 of a concise ``foreach`` loop.
 
@@ -108,7 +108,7 @@ Iterating a Tailable Cursor
 
 In order to demonstrate a tailable cursor in action, we'll need two scripts: a
 "producer" and a "consumer". The producer script will create a new capped
-collection using :phpmethod:`MongoDB\\Database::createCollection()` and proceed
+collection using :phpmethod:`MongoDB\Database::createCollection()` and proceed
 to insert a new document into that collection each second.
 
 .. code-block:: php
@@ -131,7 +131,7 @@ to insert a new document into that collection each second.
 
 With the producer script still running, we will now execute a consumer script to
 read the inserted documents using a tailable cursor, indicated by the
-``cursorType`` option to :phpmethod:`MongoDB\\Collection::find()`. We'll start
+``cursorType`` option to :phpmethod:`MongoDB\Collection::find()`. We'll start
 by using ``foreach`` to illustrate its shortcomings:
 
 .. code-block:: php
@@ -187,4 +187,4 @@ to check if there is actually data available to read at each step.
 Since we've elected to use a ``TAILABLE_AWAIT`` cursor, the server will delay
 its response to the driver for a set amount of time. In this example, we've
 requested that the server block for approximately 100 milliseconds by specifying
-the ``maxAwaitTimeMS`` option to :phpmethod:`MongoDB\\Collection::find()`.
+the ``maxAwaitTimeMS`` option to :phpmethod:`MongoDB\Collection::find()`.
diff --git a/source/upgrade.txt b/source/upgrade.txt
index 50da6f2f..58d34eb1 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -46,31 +46,31 @@ the new driver.
      - BSON type interface
 
    * - MongoId
-     - :php:`MongoDB\\BSON\\ObjectId `
-     - :php:`MongoDB\\BSON\\ObjectIdInterface `
+     - :php:`MongoDB\BSON\ObjectId `
+     - :php:`MongoDB\BSON\ObjectIdInterface `
 
    * - MongoCode
-     - :php:`MongoDB\\BSON\\Javascript `
-     - :php:`MongoDB\\BSON\\JavascriptInterface `
+     - :php:`MongoDB\BSON\Javascript `
+     - :php:`MongoDB\BSON\JavascriptInterface `
 
    * - MongoDate
-     - :php:`MongoDB\\BSON\\UTCDateTime `
-     - :php:`MongoDB\\BSON\\UTCDateTimeInterface `
+     - :php:`MongoDB\BSON\UTCDateTime `
+     - :php:`MongoDB\BSON\UTCDateTimeInterface `
 
    * - MongoRegex
-     - :php:`MongoDB\\BSON\\Regex `
-     - :php:`MongoDB\\BSON\\RegexInterface `
+     - :php:`MongoDB\BSON\Regex `
+     - :php:`MongoDB\BSON\RegexInterface `
 
    * - MongoBinData
-     - :php:`MongoDB\\BSON\\Binary `
-     - :php:`MongoDB\\BSON\\BinaryInterface `
+     - :php:`MongoDB\BSON\Binary `
+     - :php:`MongoDB\BSON\BinaryInterface `
 
    * - MongoInt32
      - Not implemented. [1]_
      -
 
    * - MongoInt64
-     - :php:`MongoDB\\BSON\\Int64 `
+     - :php:`MongoDB\BSON\Int64 `
      - Not implemented. [2]_
 
    * - MongoDBRef
@@ -78,23 +78,23 @@ the new driver.
      -
 
    * - MongoMinKey
-     - :php:`MongoDB\\BSON\\MinKey `
-     - :php:`MongoDB\\BSON\\MinKeyInterface `
+     - :php:`MongoDB\BSON\MinKey `
+     - :php:`MongoDB\BSON\MinKeyInterface `
 
    * - MongoMaxKey
-     - :php:`MongoDB\\BSON\\MaxKey `
-     - :php:`MongoDB\\BSON\\MaxKeyInterface `
+     - :php:`MongoDB\BSON\MaxKey `
+     - :php:`MongoDB\BSON\MaxKeyInterface `
 
    * - MongoTimestamp
-     - :php:`MongoDB\\BSON\\Timestamp `
-     - :php:`MongoDB\\BSON\\TimestampInterface `
+     - :php:`MongoDB\BSON\Timestamp `
+     - :php:`MongoDB\BSON\TimestampInterface `
 
 .. [1] The new driver does not implement an equivalent class for MongoInt32.
    When decoding BSON, 32-bit integers will always be represented as a PHP
    integer. When encoding BSON, PHP integers will encode as either a 32-bit or
    64-bit integer depending on their value.
 
-.. [2] :php:`MongoDB\\BSON\\Int64 ` does not have an
+.. [2] :php:`MongoDB\BSON\Int64 ` does not have an
    interface defined. The new driver does not allow applications to instantiate
    this type (i.e. its constructor is private) and it is only created during
    BSON decoding when a 64-bit integer cannot be represented as a PHP integer on
@@ -121,8 +121,8 @@ problematic:
   was a gap in their key sequence. Such gaps were caused by unsetting a key to
   remove an element and forgetting to numerically reindex the array.
 
-The |php-library|'s :phpclass:`BSONDocument ` and
-:phpclass:`BSONArray ` classes address these concerns
+The |php-library|'s :phpclass:`BSONDocument ` and
+:phpclass:`BSONArray ` classes address these concerns
 by preserving the BSON type information during serialization and
 deserialization; however, some users may still prefer the legacy behavior. If
 desired, you can use the ``typeMap`` option to have the library return
@@ -173,7 +173,7 @@ The above example would output something similar to:
 Collection API
 --------------
 
-This library's :phpclass:`MongoDB\\Collection` class implements MongoDB's
+This library's :phpclass:`MongoDB\Collection` class implements MongoDB's
 cross-driver `CRUD
 `_
 and `Index Management
@@ -197,102 +197,102 @@ equivalent method(s) in the new driver.
    :header-rows: 1
 
    * - MongoCollection method
-     - :phpclass:`MongoDB\\Collection` method(s)
+     - :phpclass:`MongoDB\Collection` method(s)
 
    * - ``MongoCollection::aggregate()``
-     - :phpmethod:`MongoDB\\Collection::aggregate()`
+     - :phpmethod:`MongoDB\Collection::aggregate()`
 
    * - ``MongoCollection::aggregateCursor()``
-     - :phpmethod:`MongoDB\\Collection::aggregate()`
+     - :phpmethod:`MongoDB\Collection::aggregate()`
 
    * - ``MongoCollection::batchInsert()``
-     - :phpmethod:`MongoDB\\Collection::insertMany()`
+     - :phpmethod:`MongoDB\Collection::insertMany()`
 
    * - ``MongoCollection::count()``
-     - :phpmethod:`MongoDB\\Collection::count()`
+     - :phpmethod:`MongoDB\Collection::count()`
 
    * - ``MongoCollection::createDBRef()``
      - Not yet implemented. [3]_
 
    * - ``MongoCollection::createIndex()``
-     - :phpmethod:`MongoDB\\Collection::createIndex()`
+     - :phpmethod:`MongoDB\Collection::createIndex()`
 
    * - ``MongoCollection::deleteIndex()``
-     - :phpmethod:`MongoDB\\Collection::dropIndex()`
+     - :phpmethod:`MongoDB\Collection::dropIndex()`
 
    * - ``MongoCollection::deleteIndexes()``
-     - :phpmethod:`MongoDB\\Collection::dropIndexes()`
+     - :phpmethod:`MongoDB\Collection::dropIndexes()`
 
    * - ``MongoCollection::drop()``
-     - :phpmethod:`MongoDB\\Collection::drop()`
+     - :phpmethod:`MongoDB\Collection::drop()`
 
    * - ``MongoCollection::distinct()``
-     - :phpmethod:`MongoDB\\Collection::distinct()`
+     - :phpmethod:`MongoDB\Collection::distinct()`
 
    * - ``MongoCollection::ensureIndex()``
-     - :phpmethod:`MongoDB\\Collection::createIndex()`
+     - :phpmethod:`MongoDB\Collection::createIndex()`
 
    * - ``MongoCollection::find()``
-     - :phpmethod:`MongoDB\\Collection::find()`
+     - :phpmethod:`MongoDB\Collection::find()`
 
    * - ``MongoCollection::findAndModify()``
-     - :phpmethod:`MongoDB\\Collection::findOneAndDelete()`,
-       :phpmethod:`MongoDB\\Collection::findOneAndReplace()`, and
-       :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+     - :phpmethod:`MongoDB\Collection::findOneAndDelete()`,
+       :phpmethod:`MongoDB\Collection::findOneAndReplace()`, and
+       :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 
    * - ``MongoCollection::findOne()``
-     - :phpmethod:`MongoDB\\Collection::findOne()`
+     - :phpmethod:`MongoDB\Collection::findOne()`
 
    * - ``MongoCollection::getDBRef()``
      - Not implemented. [3]_
 
    * - ``MongoCollection::getIndexInfo()``
-     - :phpmethod:`MongoDB\\Collection::listIndexes()`
+     - :phpmethod:`MongoDB\Collection::listIndexes()`
 
    * - ``MongoCollection::getName()``
-     - :phpmethod:`MongoDB\\Collection::getCollectionName()`
+     - :phpmethod:`MongoDB\Collection::getCollectionName()`
 
    * - ``MongoCollection::getReadPreference()``
-     - :phpmethod:`MongoDB\\Collection::getReadPreference()`
+     - :phpmethod:`MongoDB\Collection::getReadPreference()`
 
    * - ``MongoCollection::getSlaveOkay()``
      - Not implemented.
 
    * - ``MongoCollection::getWriteConcern()``
-     - :phpmethod:`MongoDB\\Collection::getWriteConcern()`
+     - :phpmethod:`MongoDB\Collection::getWriteConcern()`
 
    * - ``MongoCollection::group()``
-     - Not implemented. Use :phpmethod:`MongoDB\\Database::command()`. See
+     - Not implemented. Use :phpmethod:`MongoDB\Database::command()`. See
        :ref:`Group Command Helper ` for an example.
 
    * - ``MongoCollection::insert()``
-     - :phpmethod:`MongoDB\\Collection::insertOne()`
+     - :phpmethod:`MongoDB\Collection::insertOne()`
 
    * - ``MongoCollection::parallelCollectionScan()``
      - Not implemented.
 
    * - ``MongoCollection::remove()``
-     - :phpmethod:`MongoDB\\Collection::deleteMany()` and
-       :phpmethod:`MongoDB\\Collection::deleteOne()`
+     - :phpmethod:`MongoDB\Collection::deleteMany()` and
+       :phpmethod:`MongoDB\Collection::deleteOne()`
 
    * - ``MongoCollection::save()``
-     - :phpmethod:`MongoDB\\Collection::insertOne()` or
-       :phpmethod:`MongoDB\\Collection::replaceOne()` with the ``upsert``
+     - :phpmethod:`MongoDB\Collection::insertOne()` or
+       :phpmethod:`MongoDB\Collection::replaceOne()` with the ``upsert``
        option.
 
    * - ``MongoCollection::setReadPreference()``
-     - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`.
+     - Not implemented. Use :phpmethod:`MongoDB\Collection::withOptions()`.
 
    * - ``MongoCollection::setSlaveOkay()``
      - Not implemented.
 
    * - ``MongoCollection::setWriteConcern()``
-     - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`.
+     - Not implemented. Use :phpmethod:`MongoDB\Collection::withOptions()`.
 
    * - ``MongoCollection::update()``
-     - :phpmethod:`MongoDB\\Collection::replaceOne()`,
-       :phpmethod:`MongoDB\\Collection::updateMany()`, and
-       :phpmethod:`MongoDB\\Collection::updateOne()`.
+     - :phpmethod:`MongoDB\Collection::replaceOne()`,
+       :phpmethod:`MongoDB\Collection::updateMany()`, and
+       :phpmethod:`MongoDB\Collection::updateOne()`.
 
    * - ``MongoCollection::validate()``
      - Not implemented.
@@ -312,18 +312,18 @@ longer done in the new driver and library.
 IDs of inserted documents (whether generated or not) may be accessed through the
 following methods on the write result objects:
 
-- :phpmethod:`MongoDB\\InsertOneResult::getInsertedId()` for
-  :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\InsertManyResult::getInsertedIds()` for
-  :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedIds()` for
-  :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\InsertOneResult::getInsertedId()` for
+  :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\InsertManyResult::getInsertedIds()` for
+  :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\BulkWriteResult::getInsertedIds()` for
+  :phpmethod:`MongoDB\Collection::bulkWrite()`
 
 Bulk Write Operations
 ~~~~~~~~~~~~~~~~~~~~~
 
 The legacy driver's MongoWriteBatch classes have been replaced with a
-general-purpose :phpmethod:`MongoDB\\Collection::bulkWrite()` method. Whereas
+general-purpose :phpmethod:`MongoDB\Collection::bulkWrite()` method. Whereas
 the legacy driver only allowed bulk operations of the same type, the new method
 allows operations to be mixed (e.g. inserts, updates, and deletes).
 
@@ -332,16 +332,16 @@ MongoCollection::save() Removed
 
 ``MongoCollection::save()``, which was syntactic sugar for an insert or upsert
 operation, has been removed in favor of explicitly using
-:phpmethod:`MongoDB\\Collection::insertOne()` or
-:phpmethod:`MongoDB\\Collection::replaceOne()` (with the ``upsert`` option).
+:phpmethod:`MongoDB\Collection::insertOne()` or
+:phpmethod:`MongoDB\Collection::replaceOne()` (with the ``upsert`` option).
 
 While the ``save`` method does have its uses for interactive environments, such
 as the MongoDB shell, it was intentionally excluded from the
 `CRUD specification `_
 for language drivers. Generally, application code should know if the document
 has an identifier and be able to explicitly insert or replace the document and
-handle the returned :phpclass:`MongoDB\\InsertOneResult` or
-:phpclass:`MongoDB\\UpdateResult`, respectively. This also helps avoid
+handle the returned :phpclass:`MongoDB\InsertOneResult` or
+:phpclass:`MongoDB\UpdateResult`, respectively. This also helps avoid
 inadvertent and potentially dangerous :manual:`full-document replacements
 `.
 
@@ -350,10 +350,10 @@ inadvertent and potentially dangerous :manual:`full-document replacements
 Group Command Helper
 ~~~~~~~~~~~~~~~~~~~~
 
-:phpclass:`MongoDB\\Collection` does not have a helper method for the
+:phpclass:`MongoDB\Collection` does not have a helper method for the
 :manual:`group ` command. The following example
 demonstrates how to execute a group command using the
-:phpmethod:`MongoDB\\Database::command()` method:
+:phpmethod:`MongoDB\Database::command()` method:
 
 .. code-block:: php
 

From 510a242e2633d6d911f8eeeeb530679dfd95aa29 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Tue, 5 Mar 2024 14:38:40 -0500
Subject: [PATCH 307/321] DOCSP-36627: Additional double backslash fixes for
 master (#1246)

* DOCSP-36627: Additional double backslash fixes for v1.17 (#1243)

Co-authored-by: Nora Reidy 
---
 source/faq.txt                                |   2 +-
 .../includes/extracts-bulkwriteexception.yaml |   4 +-
 source/includes/extracts-error.yaml           |  18 +--
 source/includes/extracts-note.yaml            |   4 +-
 source/index.txt                              |   2 +-
 source/reference/bson.txt                     |  16 +--
 .../class/MongoDBBulkWriteResult.txt          |  23 ++--
 .../reference/class/MongoDBChangeStream.txt   |  22 +--
 source/reference/class/MongoDBClient.txt      |  40 +++---
 source/reference/class/MongoDBCollection.txt  | 118 ++++++++--------
 source/reference/class/MongoDBDatabase.txt    |  62 ++++-----
 .../reference/class/MongoDBDeleteResult.txt   |  13 +-
 .../reference/class/MongoDBGridFSBucket.txt   |  54 ++++----
 .../class/MongoDBInsertManyResult.txt         |  13 +-
 .../class/MongoDBInsertOneResult.txt          |  13 +-
 .../class/MongoDBMapReduceResult.txt          |  12 +-
 .../class/MongoDBModelCollectionInfo.txt      |  26 ++--
 .../MongoDBModelCollectionInfoIterator.txt    |   6 +-
 .../class/MongoDBModelDatabaseInfo.txt        |  16 +--
 .../MongoDBModelDatabaseInfoIterator.txt      |   6 +-
 .../reference/class/MongoDBModelIndexInfo.txt |  30 ++--
 .../class/MongoDBModelIndexInfoIterator.txt   |   6 +-
 .../reference/class/MongoDBUpdateResult.txt   |  20 +--
 source/reference/exception-classes.txt        |  42 +++---
 source/reference/function/add_logger.txt      |   4 +-
 source/reference/function/remove_logger.txt   |   6 +-
 .../reference/function/with_transaction.txt   |  14 +-
 source/reference/functions.txt                |   6 +-
 ...MongoDBBulkWriteResult-getDeletedCount.txt |   4 +-
 ...ongoDBBulkWriteResult-getInsertedCount.txt |   4 +-
 .../MongoDBBulkWriteResult-getInsertedIds.txt |   4 +-
 ...MongoDBBulkWriteResult-getMatchedCount.txt |   8 +-
 ...ongoDBBulkWriteResult-getModifiedCount.txt |   8 +-
 ...ongoDBBulkWriteResult-getUpsertedCount.txt |   4 +-
 .../MongoDBBulkWriteResult-getUpsertedIds.txt |   6 +-
 .../MongoDBBulkWriteResult-isAcknowledged.txt |   4 +-
 .../method/MongoDBChangeStream-current.txt    |  12 +-
 .../MongoDBChangeStream-getCursorId.txt       |  14 +-
 .../MongoDBChangeStream-getResumeToken.txt    |   8 +-
 .../method/MongoDBChangeStream-key.txt        |  10 +-
 .../method/MongoDBChangeStream-next.txt       |  10 +-
 .../method/MongoDBChangeStream-rewind.txt     |  18 +--
 .../method/MongoDBChangeStream-valid.txt      |  12 +-
 .../method/MongoDBClient-addSubscriber.txt    |  16 +--
 .../MongoDBClient-createClientEncryption.txt  |  14 +-
 .../method/MongoDBClient-dropDatabase.txt     |   8 +-
 .../method/MongoDBClient-getManager.txt       |  12 +-
 .../method/MongoDBClient-getReadConcern.txt   |  12 +-
 .../MongoDBClient-getReadPreference.txt       |  10 +-
 .../method/MongoDBClient-getTypeMap.txt       |   8 +-
 .../method/MongoDBClient-getWriteConcern.txt  |  12 +-
 .../MongoDBClient-listDatabaseNames.txt       |   6 +-
 .../method/MongoDBClient-listDatabases.txt    |  10 +-
 .../method/MongoDBClient-removeSubscriber.txt |   8 +-
 .../method/MongoDBClient-selectCollection.txt |  16 +--
 .../method/MongoDBClient-selectDatabase.txt   |  16 +--
 .../method/MongoDBClient-startSession.txt     |   6 +-
 .../reference/method/MongoDBClient-watch.txt  |  16 +--
 .../method/MongoDBClient__construct.txt       |  26 ++--
 .../reference/method/MongoDBClient__get.txt   |  16 +--
 .../method/MongoDBCollection-aggregate.txt    |  18 +--
 .../method/MongoDBCollection-bulkWrite.txt    |  40 +++---
 .../method/MongoDBCollection-count.txt        |  14 +-
 .../MongoDBCollection-countDocuments.txt      |  14 +-
 .../method/MongoDBCollection-createIndex.txt  |   8 +-
 .../MongoDBCollection-createIndexes.txt       |  12 +-
 .../MongoDBCollection-createSearchIndex.txt   |  10 +-
 .../MongoDBCollection-createSearchIndexes.txt |  10 +-
 .../method/MongoDBCollection-deleteMany.txt   |  14 +-
 .../method/MongoDBCollection-deleteOne.txt    |  14 +-
 .../method/MongoDBCollection-distinct.txt     |   8 +-
 .../method/MongoDBCollection-drop.txt         |   8 +-
 .../method/MongoDBCollection-dropIndex.txt    |  12 +-
 .../method/MongoDBCollection-dropIndexes.txt  |  12 +-
 .../MongoDBCollection-dropSearchIndex.txt     |  10 +-
 ...ngoDBCollection-estimatedDocumentCount.txt |  10 +-
 .../method/MongoDBCollection-explain.txt      |   6 +-
 .../method/MongoDBCollection-find.txt         |  14 +-
 .../method/MongoDBCollection-findOne.txt      |  14 +-
 .../MongoDBCollection-findOneAndDelete.txt    |  10 +-
 .../MongoDBCollection-findOneAndReplace.txt   |  10 +-
 .../MongoDBCollection-findOneAndUpdate.txt    |  10 +-
 .../MongoDBCollection-getCollectionName.txt   |   6 +-
 .../MongoDBCollection-getDatabaseName.txt     |   6 +-
 .../method/MongoDBCollection-getManager.txt   |  12 +-
 .../method/MongoDBCollection-getNamespace.txt |   6 +-
 .../MongoDBCollection-getReadConcern.txt      |  12 +-
 .../MongoDBCollection-getReadPreference.txt   |  10 +-
 .../method/MongoDBCollection-getTypeMap.txt   |   8 +-
 .../MongoDBCollection-getWriteConcern.txt     |  12 +-
 .../method/MongoDBCollection-insertMany.txt   |  14 +-
 .../method/MongoDBCollection-insertOne.txt    |  14 +-
 .../method/MongoDBCollection-listIndexes.txt  |   8 +-
 .../MongoDBCollection-listSearchIndexes.txt   |  16 +--
 .../method/MongoDBCollection-mapReduce.txt    |  18 +--
 .../method/MongoDBCollection-rename.txt       |   8 +-
 .../method/MongoDBCollection-replaceOne.txt   |  16 +--
 .../method/MongoDBCollection-updateMany.txt   |  16 +--
 .../method/MongoDBCollection-updateOne.txt    |  16 +--
 .../MongoDBCollection-updateSearchIndex.txt   |  10 +-
 .../method/MongoDBCollection-watch.txt        |  16 +--
 .../method/MongoDBCollection-withOptions.txt  |  12 +-
 .../method/MongoDBCollection__construct.txt   |  26 ++--
 .../method/MongoDBDatabase-aggregate.txt      |  16 +--
 .../method/MongoDBDatabase-command.txt        |  14 +-
 .../MongoDBDatabase-createCollection.txt      |   8 +-
 ...goDBDatabase-createEncryptedCollection.txt |  26 ++--
 .../reference/method/MongoDBDatabase-drop.txt |   8 +-
 .../method/MongoDBDatabase-dropCollection.txt |   8 +-
 .../MongoDBDatabase-getDatabaseName.txt       |   2 +-
 .../method/MongoDBDatabase-getManager.txt     |  12 +-
 .../method/MongoDBDatabase-getReadConcern.txt |  12 +-
 .../MongoDBDatabase-getReadPreference.txt     |  10 +-
 .../method/MongoDBDatabase-getTypeMap.txt     |   8 +-
 .../MongoDBDatabase-getWriteConcern.txt       |  12 +-
 .../MongoDBDatabase-listCollectionNames.txt   |   6 +-
 .../MongoDBDatabase-listCollections.txt       |  10 +-
 .../MongoDBDatabase-modifyCollection.txt      |   6 +-
 .../MongoDBDatabase-renameCollection.txt      |   8 +-
 .../MongoDBDatabase-selectCollection.txt      |  18 +--
 .../MongoDBDatabase-selectGridFSBucket.txt    |  14 +-
 .../method/MongoDBDatabase-watch.txt          |  16 +--
 .../method/MongoDBDatabase-withOptions.txt    |  12 +-
 .../method/MongoDBDatabase__construct.txt     |  22 +--
 .../reference/method/MongoDBDatabase__get.txt |  14 +-
 .../MongoDBDeleteResult-getDeletedCount.txt   |   4 +-
 .../MongoDBDeleteResult-isAcknowledged.txt    |   4 +-
 .../method/MongoDBGridFSBucket-delete.txt     |   2 +-
 .../MongoDBGridFSBucket-downloadToStream.txt  |   8 +-
 ...oDBGridFSBucket-downloadToStreamByName.txt |   8 +-
 .../method/MongoDBGridFSBucket-drop.txt       |   2 +-
 .../method/MongoDBGridFSBucket-find.txt       |  16 +--
 .../method/MongoDBGridFSBucket-findOne.txt    |  14 +-
 .../MongoDBGridFSBucket-getBucketName.txt     |   2 +-
 .../MongoDBGridFSBucket-getChunkSizeBytes.txt |   2 +-
 ...ongoDBGridFSBucket-getChunksCollection.txt |   4 +-
 .../MongoDBGridFSBucket-getDatabaseName.txt   |   2 +-
 ...BGridFSBucket-getFileDocumentForStream.txt |   4 +-
 ...MongoDBGridFSBucket-getFileIdForStream.txt |   4 +-
 ...MongoDBGridFSBucket-getFilesCollection.txt |   4 +-
 .../MongoDBGridFSBucket-getReadConcern.txt    |  12 +-
 .../MongoDBGridFSBucket-getReadPreference.txt |  10 +-
 .../method/MongoDBGridFSBucket-getTypeMap.txt |   8 +-
 .../MongoDBGridFSBucket-getWriteConcern.txt   |  12 +-
 ...MongoDBGridFSBucket-openDownloadStream.txt |   8 +-
 ...BGridFSBucket-openDownloadStreamByName.txt |   8 +-
 .../MongoDBGridFSBucket-openUploadStream.txt  |   6 +-
 ...ucket-registerGlobalStreamWrapperAlias.txt |   2 +-
 .../method/MongoDBGridFSBucket-rename.txt     |   2 +-
 .../MongoDBGridFSBucket-uploadFromStream.txt  |   8 +-
 .../method/MongoDBGridFSBucket__construct.txt |  18 +--
 ...ngoDBInsertManyResult-getInsertedCount.txt |   4 +-
 ...MongoDBInsertManyResult-getInsertedIds.txt |   4 +-
 ...MongoDBInsertManyResult-isAcknowledged.txt |   4 +-
 ...ongoDBInsertOneResult-getInsertedCount.txt |   4 +-
 .../MongoDBInsertOneResult-getInsertedId.txt  |   4 +-
 .../MongoDBInsertOneResult-isAcknowledged.txt |   4 +-
 .../MongoDBMapReduceResult-getCounts.txt      |   4 +-
 ...goDBMapReduceResult-getExecutionTimeMS.txt |   4 +-
 .../MongoDBMapReduceResult-getIterator.txt    |   4 +-
 .../MongoDBMapReduceResult-getTiming.txt      |   8 +-
 ...ongoDBModelCollectionInfo-getCappedMax.txt |  12 +-
 ...ngoDBModelCollectionInfo-getCappedSize.txt |  12 +-
 .../MongoDBModelCollectionInfo-getIdIndex.txt |   4 +-
 .../MongoDBModelCollectionInfo-getInfo.txt    |   4 +-
 .../MongoDBModelCollectionInfo-getName.txt    |   4 +-
 .../MongoDBModelCollectionInfo-getOptions.txt |   6 +-
 .../MongoDBModelCollectionInfo-getType.txt    |   4 +-
 .../MongoDBModelCollectionInfo-isCapped.txt   |   8 +-
 .../MongoDBModelDatabaseInfo-getName.txt      |   4 +-
 ...MongoDBModelDatabaseInfo-getSizeOnDisk.txt |   2 +-
 .../MongoDBModelDatabaseInfo-isEmpty.txt      |   2 +-
 .../method/MongoDBModelIndexInfo-getKey.txt   |   6 +-
 .../method/MongoDBModelIndexInfo-getName.txt  |   6 +-
 .../MongoDBModelIndexInfo-getNamespace.txt    |   6 +-
 .../MongoDBModelIndexInfo-getVersion.txt      |   4 +-
 .../MongoDBModelIndexInfo-is2dSphere.txt      |   6 +-
 .../MongoDBModelIndexInfo-isGeoHaystack.txt   |   6 +-
 .../method/MongoDBModelIndexInfo-isSparse.txt |   6 +-
 .../method/MongoDBModelIndexInfo-isText.txt   |   6 +-
 .../method/MongoDBModelIndexInfo-isTtl.txt    |   6 +-
 .../method/MongoDBModelIndexInfo-isUnique.txt |   6 +-
 .../MongoDBUpdateResult-getMatchedCount.txt   |   8 +-
 .../MongoDBUpdateResult-getModifiedCount.txt  |   8 +-
 .../MongoDBUpdateResult-getUpsertedCount.txt  |   4 +-
 .../MongoDBUpdateResult-getUpsertedId.txt     |   6 +-
 .../MongoDBUpdateResult-isAcknowledged.txt    |   4 +-
 source/tutorial/codecs.txt                    |   2 +-
 source/tutorial/collation.txt                 |   6 +-
 source/tutorial/commands.txt                  |  16 +--
 source/tutorial/connecting.txt                |   2 +-
 source/tutorial/crud.txt                      | 106 +++++++-------
 source/tutorial/custom-types.txt              |  24 ++--
 source/tutorial/encryption.txt                |   6 +-
 source/tutorial/gridfs.txt                    |  24 ++--
 source/tutorial/indexes.txt                   |  18 +--
 source/tutorial/modeling-bson-data.txt        |  26 ++--
 source/tutorial/stable-api.txt                |   8 +-
 source/tutorial/tailable-cursor.txt           |  10 +-
 source/upgrade.txt                            | 130 +++++++++---------
 200 files changed, 1240 insertions(+), 1244 deletions(-)

diff --git a/source/faq.txt b/source/faq.txt
index 9cdd9a25..fef32264 100644
--- a/source/faq.txt
+++ b/source/faq.txt
@@ -124,7 +124,7 @@ The following are all examples of
     [TLS handshake failed: certificate verify failed (64): IP address mismatch calling hello on 'b.example.com:27017']
 
 These errors typically manifest as a
-:php:`MongoDB\\Driver\\Exception\\ConnectionTimeoutException `
+:php:`MongoDB\Driver\Exception\ConnectionTimeoutException `
 exception from the driver. The actual exception messages originate from
 libmongoc, which is the underlying library used by the PHP driver. Since these
 messages can take many forms, it's helpful to break down the structure of the
diff --git a/source/includes/extracts-bulkwriteexception.yaml b/source/includes/extracts-bulkwriteexception.yaml
index f002063f..6276458e 100644
--- a/source/includes/extracts-bulkwriteexception.yaml
+++ b/source/includes/extracts-bulkwriteexception.yaml
@@ -1,9 +1,9 @@
 ref: bulkwriteexception-result
 content: |
-  If a :php:`MongoDB\\Driver\\Exception\\BulkWriteException
+  If a :php:`MongoDB\Driver\Exception\BulkWriteException
   ` is thrown, users should call
   :php:`getWriteResult() ` and
-  inspect the returned :php:`MongoDB\\Driver\\WriteResult
+  inspect the returned :php:`MongoDB\Driver\WriteResult
   ` object to determine the nature of the error.
 
   For example, a write operation may have been successfully applied to the
diff --git a/source/includes/extracts-error.yaml b/source/includes/extracts-error.yaml
index cfada049..1a41843a 100644
--- a/source/includes/extracts-error.yaml
+++ b/source/includes/extracts-error.yaml
@@ -1,6 +1,6 @@
 ref: error-driver-bulkwriteexception
 content: |
-  :php:`MongoDB\\Driver\\Exception\\BulkWriteException
+  :php:`MongoDB\Driver\Exception\BulkWriteException
   ` for errors related to the write
   operation. Users should inspect the value returned by :php:`getWriteResult()
   ` to determine the nature of the
@@ -8,45 +8,45 @@ content: |
 ---
 ref: error-driver-invalidargumentexception
 content: |
-  :php:`MongoDB\\Driver\\Exception\\InvalidArgumentException
+  :php:`MongoDB\Driver\Exception\InvalidArgumentException
   ` for errors related to the
   parsing of parameters or options at the driver level.
 ---
 ref: error-driver-runtimeexception
 content: |
-  :php:`MongoDB\\Driver\\Exception\\RuntimeException
+  :php:`MongoDB\Driver\Exception\RuntimeException
   ` for other errors at the driver
   level (e.g. connection errors).
 ---
 ref: error-badmethodcallexception-write-result
 content: |
-  :phpclass:`MongoDB\\Exception\\BadMethodCallException` if this method is
+  :phpclass:`MongoDB\Exception\BadMethodCallException` if this method is
   called and the write operation used an unacknowledged :manual:`write concern
   `.
 ---
 ref: error-invalidargumentexception
 content: |
-  :phpclass:`MongoDB\\Exception\\InvalidArgumentException` for errors related to
+  :phpclass:`MongoDB\Exception\InvalidArgumentException` for errors related to
   the parsing of parameters or options.
 ---
 ref: error-unexpectedvalueexception
 content: |
-  :phpclass:`MongoDB\\Exception\\UnexpectedValueException` if the command
+  :phpclass:`MongoDB\Exception\UnexpectedValueException` if the command
   response from the server was malformed.
 ---
 ref: error-unsupportedexception
 content: |
-  :phpclass:`MongoDB\\Exception\\UnsupportedException` if options are used and
+  :phpclass:`MongoDB\Exception\UnsupportedException` if options are used and
   not supported by the selected server (e.g. ``collation``, ``readConcern``,
   ``writeConcern``).
 ---
 ref: error-gridfs-filenotfoundexception
 content: |
-  :phpclass:`MongoDB\\GridFS\\Exception\\FileNotFoundException` if no file was
+  :phpclass:`MongoDB\GridFS\Exception\FileNotFoundException` if no file was
   found for the selection criteria.
 ---
 ref: error-gridfs-corruptfileexception
 content: |
-  :phpclass:`MongoDB\\GridFS\\Exception\\CorruptFileException` if the file's
+  :phpclass:`MongoDB\GridFS\Exception\CorruptFileException` if the file's
   metadata or chunk documents contain unexpected or invalid data.
 ...
diff --git a/source/includes/extracts-note.yaml b/source/includes/extracts-note.yaml
index d2130910..620a7ac3 100644
--- a/source/includes/extracts-note.yaml
+++ b/source/includes/extracts-note.yaml
@@ -7,7 +7,7 @@ content: |
   ` rules. When matching a special
   BSON type the query criteria should use the respective :php:`BSON class
   ` in the driver (e.g. use
-  :php:`MongoDB\\BSON\\ObjectId ` to match an
+  :php:`MongoDB\BSON\ObjectId ` to match an
   :manual:`ObjectId `).
 ---
 ref: note-atlas-search-requirement
@@ -22,7 +22,7 @@ ref: note-atlas-search-async
 content: |
   Atlas Search indexes are managed asynchronously. After creating or updating an
   index, you can periodically execute
-  :phpmethod:`MongoDB\\Collection::listSearchIndexes()` and check the
+  :phpmethod:`MongoDB\Collection::listSearchIndexes()` and check the
   ``queryable`` :manual:`output field  `
   to determine whether it is ready to be used.
 ...
diff --git a/source/index.txt b/source/index.txt
index 5cbf328a..7e76323f 100644
--- a/source/index.txt
+++ b/source/index.txt
@@ -12,7 +12,7 @@ The ``mongodb`` extension provides a limited API to connect to the database and
 execute generic commands, queries, and write operations. In contrast, the
 |php-library| provides a full-featured API and models client, database, and
 collection objects. Each of those classes provide various helper methods for
-performing operations in context. For example, :phpclass:`MongoDB\\Collection`
+performing operations in context. For example, :phpclass:`MongoDB\Collection`
 implements methods for executing CRUD operations and managing indexes on the
 collection, among other things.
 
diff --git a/source/reference/bson.txt b/source/reference/bson.txt
index b9fbbaa2..30753247 100644
--- a/source/reference/bson.txt
+++ b/source/reference/bson.txt
@@ -18,18 +18,18 @@ of JSON documents, though it contains more data types than JSON. For the BSON
 spec, see `bsonspec.org `_.
 
 By default, the |php-library| returns BSON documents as
-:phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as
-:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively.
+:phpclass:`MongoDB\Model\BSONDocument` objects and BSON arrays as
+:phpclass:`MongoDB\Model\BSONArray` objects, respectively.
 
 Classes
 -------
 
-.. phpclass:: MongoDB\\Model\\BSONArray
+.. phpclass:: MongoDB\Model\BSONArray
 
    This class extends PHP's :php:`ArrayObject ` class. It also
    implements PHP's :php:`JsonSerializable ` interface and the
-   driver's :php:`MongoDB\\BSON\\Serializable ` and
-   :php:`MongoDB\\BSON\\Unserializable `
+   driver's :php:`MongoDB\BSON\Serializable ` and
+   :php:`MongoDB\BSON\Unserializable `
    interfaces.
 
    By default, the library will deserialize BSON arrays as instances of this
@@ -37,12 +37,12 @@ Classes
    serialize as an array type (:php:`array_values() ` is used
    internally to numerically reindex the array).
 
-.. phpclass:: MongoDB\\Model\\BSONDocument
+.. phpclass:: MongoDB\Model\BSONDocument
 
    This class extends PHP's :php:`ArrayObject ` class. It also
    implements PHP's :php:`JsonSerializable ` interface and the
-   driver's :php:`MongoDB\\BSON\\Serializable ` and
-   :php:`MongoDB\\BSON\\Unserializable `
+   driver's :php:`MongoDB\BSON\Serializable ` and
+   :php:`MongoDB\BSON\Unserializable `
    interfaces.
 
    By default, the library will deserialize BSON documents as instances of this
diff --git a/source/reference/class/MongoDBBulkWriteResult.txt b/source/reference/class/MongoDBBulkWriteResult.txt
index f33b036d..2e8c78cf 100644
--- a/source/reference/class/MongoDBBulkWriteResult.txt
+++ b/source/reference/class/MongoDBBulkWriteResult.txt
@@ -5,12 +5,11 @@ MongoDB\\BulkWriteResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\BulkWriteResult
+.. phpclass:: MongoDB\BulkWriteResult
 
    This class contains information about an executed bulk write operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::bulkWrite()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::bulkWrite()`.
 
 Methods
 -------
@@ -27,11 +26,11 @@ Methods
    getUpsertedIds() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\BulkWriteResult::getDeletedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedIds()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getMatchedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getModifiedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getUpsertedCount()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getUpsertedIds()`
-- :phpmethod:`MongoDB\\BulkWriteResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\BulkWriteResult::getDeletedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getInsertedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getInsertedIds()`
+- :phpmethod:`MongoDB\BulkWriteResult::getMatchedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getModifiedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getUpsertedCount()`
+- :phpmethod:`MongoDB\BulkWriteResult::getUpsertedIds()`
+- :phpmethod:`MongoDB\BulkWriteResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBChangeStream.txt b/source/reference/class/MongoDBChangeStream.txt
index 3142aeec..bd82c5e0 100644
--- a/source/reference/class/MongoDBChangeStream.txt
+++ b/source/reference/class/MongoDBChangeStream.txt
@@ -7,13 +7,13 @@ MongoDB\\ChangeStream Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\ChangeStream
+.. phpclass:: MongoDB\ChangeStream
 
    This class extends PHP's :php:`Iterator `
    interface. An instance of this class is returned by
-   :phpmethod:`MongoDB\\Client::watch()`,
-   :phpmethod:`MongoDB\\Database::watch()`, and
-   :phpmethod:`MongoDB\\Collection::watch()`.
+   :phpmethod:`MongoDB\Client::watch()`,
+   :phpmethod:`MongoDB\Database::watch()`, and
+   :phpmethod:`MongoDB\Collection::watch()`.
 
    This class allows for iteration of events in a change stream. It also allows
    iteration to automatically resume after certain errors, such as a replica set
@@ -33,10 +33,10 @@ Methods
    rewind() 
    valid() 
 
-- :phpmethod:`MongoDB\\ChangeStream::current()`
-- :phpmethod:`MongoDB\\ChangeStream::getCursorId()`
-- :phpmethod:`MongoDB\\ChangeStream::getResumeToken()`
-- :phpmethod:`MongoDB\\ChangeStream::key()`
-- :phpmethod:`MongoDB\\ChangeStream::next()`
-- :phpmethod:`MongoDB\\ChangeStream::rewind()`
-- :phpmethod:`MongoDB\\ChangeStream::valid()`
\ No newline at end of file
+- :phpmethod:`MongoDB\ChangeStream::current()`
+- :phpmethod:`MongoDB\ChangeStream::getCursorId()`
+- :phpmethod:`MongoDB\ChangeStream::getResumeToken()`
+- :phpmethod:`MongoDB\ChangeStream::key()`
+- :phpmethod:`MongoDB\ChangeStream::next()`
+- :phpmethod:`MongoDB\ChangeStream::rewind()`
+- :phpmethod:`MongoDB\ChangeStream::valid()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt
index afbdf696..4dc6cdbe 100644
--- a/source/reference/class/MongoDBClient.txt
+++ b/source/reference/class/MongoDBClient.txt
@@ -13,13 +13,13 @@ MongoDB\\Client Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Client
+.. phpclass:: MongoDB\Client
 
    This class serves as an entry point for the |php-library|. It is the
    preferred class for connecting to a MongoDB server or cluster of servers and
    acts as a gateway for accessing individual databases and collections.
-   :phpclass:`MongoDB\\Client` is analogous to the driver's
-   :php:`MongoDB\\Driver\\Manager ` class, which it
+   :phpclass:`MongoDB\Client` is analogous to the driver's
+   :php:`MongoDB\Driver\Manager ` class, which it
    `composes `_.
 
 Methods
@@ -46,20 +46,20 @@ Methods
    startSession() 
    watch() 
 
-- :phpmethod:`MongoDB\\Client::__construct()`
-- :phpmethod:`MongoDB\\Client::__get()`
-- :phpmethod:`MongoDB\\Client::addSubscriber()`
-- :phpmethod:`MongoDB\\Client::createClientEncryption()`
-- :phpmethod:`MongoDB\\Client::dropDatabase()`
-- :phpmethod:`MongoDB\\Client::getManager()`
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Client::listDatabaseNames()`
-- :phpmethod:`MongoDB\\Client::listDatabases()`
-- :phpmethod:`MongoDB\\Client::removeSubscriber()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
-- :phpmethod:`MongoDB\\Client::selectDatabase()`
-- :phpmethod:`MongoDB\\Client::startSession()`
-- :phpmethod:`MongoDB\\Client::watch()`
+- :phpmethod:`MongoDB\Client::__construct()`
+- :phpmethod:`MongoDB\Client::__get()`
+- :phpmethod:`MongoDB\Client::addSubscriber()`
+- :phpmethod:`MongoDB\Client::createClientEncryption()`
+- :phpmethod:`MongoDB\Client::dropDatabase()`
+- :phpmethod:`MongoDB\Client::getManager()`
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Client::listDatabaseNames()`
+- :phpmethod:`MongoDB\Client::listDatabases()`
+- :phpmethod:`MongoDB\Client::removeSubscriber()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
+- :phpmethod:`MongoDB\Client::selectDatabase()`
+- :phpmethod:`MongoDB\Client::startSession()`
+- :phpmethod:`MongoDB\Client::watch()`
diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt
index e4bfb03c..2f23ae01 100644
--- a/source/reference/class/MongoDBCollection.txt
+++ b/source/reference/class/MongoDBCollection.txt
@@ -13,29 +13,28 @@ MongoDB\\Collection Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Collection
+.. phpclass:: MongoDB\Collection
 
    Provides methods for common operations on collections and documents,
    including CRUD operations and index management.
 
    You can construct collections directly using the driver's
-   :php:`MongoDB\\Driver\\Manager ` class or
-   select a collection from the library's :phpclass:`MongoDB\\Client` or
-   :phpclass:`MongoDB\\Database` classes. A collection may also be cloned from
-   an existing :phpclass:`MongoDB\\Collection` object via the
-   :phpmethod:`withOptions() ` method.
+   :php:`MongoDB\Driver\Manager ` class or
+   select a collection from the library's :phpclass:`MongoDB\Client` or
+   :phpclass:`MongoDB\Database` classes. A collection may also be cloned from
+   an existing :phpclass:`MongoDB\Collection` object via the
+   :phpmethod:`withOptions() ` method.
 
-   :phpclass:`MongoDB\\Collection` supports the :php:`readConcern
+   :phpclass:`MongoDB\Collection` supports the :php:`readConcern
    `, :php:`readPreference
    `, :php:`typeMap
    `,
    and :php:`writeConcern ` options. If you omit an
    option, the collection inherits the value from the :php:`Manager
-   ` constructor argument or the :phpclass:`Client
-   ` or :phpclass:`Database ` object used to
-   select the collection.
+   ` constructor argument or the :phpclass:`Client `
+   or :phpclass:`Database ` object used to select the collection.
 
-   Operations within the :phpclass:`MongoDB\\Collection` class inherit the
+   Operations within the :phpclass:`MongoDB\Collection` class inherit the
    collection's options.
 
 Type Map Limitations
@@ -45,11 +44,11 @@ The :manual:`aggregate ` (when not using a
 cursor), :manual:`distinct `, and
 :manual:`findAndModify ` helpers do not
 support a ``typeMap`` option due to a driver limitation. The
-:phpmethod:`aggregate() `,
-:phpmethod:`distinct() `,
-:phpmethod:`findOneAndReplace() `,
-:phpmethod:`findOneAndUpdate() `, and
-:phpmethod:`findOneAndDelete() `
+:phpmethod:`aggregate() `,
+:phpmethod:`distinct() `,
+:phpmethod:`findOneAndReplace() `,
+:phpmethod:`findOneAndUpdate() `, and
+:phpmethod:`findOneAndDelete() `
 methods return BSON documents as ``stdClass`` objects and BSON arrays as arrays.
 
 Methods
@@ -102,46 +101,47 @@ Methods
    watch() 
    withOptions() 
 
-- :phpmethod:`MongoDB\\Collection::__construct()`
-- :phpmethod:`MongoDB\\Collection::aggregate()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
-- :phpmethod:`MongoDB\\Collection::count()`
-- :phpmethod:`MongoDB\\Collection::countDocuments()`
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::createIndexes()`
-- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::deleteMany()`
-- :phpmethod:`MongoDB\\Collection::deleteOne()`
-- :phpmethod:`MongoDB\\Collection::distinct()`
-- :phpmethod:`MongoDB\\Collection::drop()`
-- :phpmethod:`MongoDB\\Collection::dropIndex()`
-- :phpmethod:`MongoDB\\Collection::dropIndexes()`
-- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
-- :phpmethod:`MongoDB\\Collection::explain()`
-- :phpmethod:`MongoDB\\Collection::find()`
-- :phpmethod:`MongoDB\\Collection::findOne()`
-- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
-- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
-- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
-- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
-- :phpmethod:`MongoDB\\Collection::getManager()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
-- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
-- :phpmethod:`MongoDB\\Collection::rename()`
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
-- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Collection::withOptions()`
+- :phpmethod:`MongoDB\Collection::__construct()`
+- :phpmethod:`MongoDB\Collection::aggregate()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::count()`
+- :phpmethod:`MongoDB\Collection::countDocuments()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndexes()`
+- :phpmethod:`MongoDB\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::deleteMany()`
+- :phpmethod:`MongoDB\Collection::deleteOne()`
+- :phpmethod:`MongoDB\Collection::distinct()`
+- :phpmethod:`MongoDB\Collection::drop()`
+- :phpmethod:`MongoDB\Collection::dropIndex()`
+- :phpmethod:`MongoDB\Collection::dropIndexes()`
+- :phpmethod:`MongoDB\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\Collection::estimatedDocumentCount()`
+- :phpmethod:`MongoDB\Collection::explain()`
+- :phpmethod:`MongoDB\Collection::find()`
+- :phpmethod:`MongoDB\Collection::findOne()`
+- :phpmethod:`MongoDB\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\Collection::getManager()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::rename()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::updateSearchIndex()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Collection::withOptions()`
+
diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt
index f92d2314..c5a5b3a5 100644
--- a/source/reference/class/MongoDBDatabase.txt
+++ b/source/reference/class/MongoDBDatabase.txt
@@ -13,28 +13,28 @@ MongoDB\\Database Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Database
+.. phpclass:: MongoDB\Database
 
    Provides methods for common operations on a database, such as executing
    database commands and managing collections.
 
    You can construct a database directly using the driver's
-   :php:`MongoDB\\Driver\\Manager ` class or
-   select a database from the library's :phpclass:`MongoDB\\Client` class. A
-   database may also be cloned from an existing :phpclass:`MongoDB\\Database`
-   object via the :phpmethod:`withOptions() `
+   :php:`MongoDB\Driver\Manager ` class or
+   select a database from the library's :phpclass:`MongoDB\Client` class. A
+   database may also be cloned from an existing :phpclass:`MongoDB\Database`
+   object via the :phpmethod:`withOptions() `
    method.
 
-   :phpclass:`MongoDB\\Database` supports the :php:`readConcern
+   :phpclass:`MongoDB\Database` supports the :php:`readConcern
    `, :php:`readPreference
    `, :php:`typeMap
    `,
    and :php:`writeConcern ` options. If you omit an
    option, the database inherits the value from the :php:`Manager
-   ` constructor argument or the :phpclass:`Client
-   ` object used to select the database.
+   ` constructor argument or the :phpclass:`Client `
+   object used to select the database.
 
-   Operations within the :phpclass:`MongoDB\\Database` class inherit the
+   Operations within the :phpclass:`MongoDB\Database` class inherit the
    Database's options.
 
 Methods
@@ -66,25 +66,25 @@ Methods
    watch() 
    withOptions() 
 
-- :phpmethod:`MongoDB\\Database::__construct()`
-- :phpmethod:`MongoDB\\Database::__get()`
-- :phpmethod:`MongoDB\\Database::aggregate()`
-- :phpmethod:`MongoDB\\Database::command()`
-- :phpmethod:`MongoDB\\Database::createCollection()`
-- :phpmethod:`MongoDB\\Database::createEncryptedCollection()`
-- :phpmethod:`MongoDB\\Database::drop()`
-- :phpmethod:`MongoDB\\Database::dropCollection()`
-- :phpmethod:`MongoDB\\Database::getDatabaseName()`
-- :phpmethod:`MongoDB\\Database::getManager()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::listCollectionNames()`
-- :phpmethod:`MongoDB\\Database::listCollections()`
-- :phpmethod:`MongoDB\\Database::modifyCollection()`
-- :phpmethod:`MongoDB\\Database::renameCollection()`
-- :phpmethod:`MongoDB\\Database::selectCollection()`
-- :phpmethod:`MongoDB\\Database::selectGridFSBucket()`
-- :phpmethod:`MongoDB\\Database::watch()`
-- :phpmethod:`MongoDB\\Database::withOptions()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Database::__construct()`
+- :phpmethod:`MongoDB\Database::__get()`
+- :phpmethod:`MongoDB\Database::aggregate()`
+- :phpmethod:`MongoDB\Database::command()`
+- :phpmethod:`MongoDB\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createEncryptedCollection()`
+- :phpmethod:`MongoDB\Database::drop()`
+- :phpmethod:`MongoDB\Database::dropCollection()`
+- :phpmethod:`MongoDB\Database::getDatabaseName()`
+- :phpmethod:`MongoDB\Database::getManager()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::listCollectionNames()`
+- :phpmethod:`MongoDB\Database::listCollections()`
+- :phpmethod:`MongoDB\Database::modifyCollection()`
+- :phpmethod:`MongoDB\Database::renameCollection()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
+- :phpmethod:`MongoDB\Database::selectGridFSBucket()`
+- :phpmethod:`MongoDB\Database::watch()`
+- :phpmethod:`MongoDB\Database::withOptions()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBDeleteResult.txt b/source/reference/class/MongoDBDeleteResult.txt
index 02c2c8c1..cd4aa2bc 100644
--- a/source/reference/class/MongoDBDeleteResult.txt
+++ b/source/reference/class/MongoDBDeleteResult.txt
@@ -5,13 +5,12 @@ MongoDB\\DeleteResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\DeleteResult
+.. phpclass:: MongoDB\DeleteResult
 
    This class contains information about an executed delete operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::deleteMany()` or
-   :phpmethod:`MongoDB\\Collection::deleteOne()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::deleteMany()` or
+   :phpmethod:`MongoDB\Collection::deleteOne()`.
 
 Methods
 -------
@@ -22,5 +21,5 @@ Methods
    getDeletedCount() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\DeleteResult::getDeletedCount()`
-- :phpmethod:`MongoDB\\DeleteResult::isAcknowledged()`
+- :phpmethod:`MongoDB\DeleteResult::getDeletedCount()`
+- :phpmethod:`MongoDB\DeleteResult::isAcknowledged()`
diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt
index 2c29cd75..51d61fce 100644
--- a/source/reference/class/MongoDBGridFSBucket.txt
+++ b/source/reference/class/MongoDBGridFSBucket.txt
@@ -13,19 +13,19 @@ MongoDB\\GridFS\\Bucket Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\GridFS\\Bucket
+.. phpclass:: MongoDB\GridFS\Bucket
 
    :manual:`GridFS ` is a specification for storing and retrieving
    files in MongoDB. GridFS uses two collections to store files. One collection
    stores the file chunks (e.g. ``fs.chunks``), and the other stores file
-   metadata (e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket` class
+   metadata (e.g. ``fs.files``). The :phpclass:`MongoDB\GridFS\Bucket` class
    provides an interface around these collections for working with the files as
    PHP :php:`Streams `.
 
    You can construct a GridFS bucket using the driver's
    :php:`Manager ` class, or select a bucket from
-   the library's :phpclass:`MongoDB\\Database` class via the
-   :phpmethod:`selectGridFSBucket() `
+   the library's :phpclass:`MongoDB\Database` class via the
+   :phpmethod:`selectGridFSBucket() `
    method.
 
 Methods
@@ -59,26 +59,26 @@ Methods
    rename() 
    uploadFromStream() 
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::delete()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::drop()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::find()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::findOne()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getBucketName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getChunksCollection()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getChunkSizeBytes()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getDatabaseName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFilesCollection()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::registerGlobalStreamWrapperAlias()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::rename()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::__construct()`
+- :phpmethod:`MongoDB\GridFS\Bucket::delete()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::drop()`
+- :phpmethod:`MongoDB\GridFS\Bucket::find()`
+- :phpmethod:`MongoDB\GridFS\Bucket::findOne()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getBucketName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getChunksCollection()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getChunkSizeBytes()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getDatabaseName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileDocumentForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileIdForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFilesCollection()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openUploadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::registerGlobalStreamWrapperAlias()`
+- :phpmethod:`MongoDB\GridFS\Bucket::rename()`
+- :phpmethod:`MongoDB\GridFS\Bucket::uploadFromStream()`
diff --git a/source/reference/class/MongoDBInsertManyResult.txt b/source/reference/class/MongoDBInsertManyResult.txt
index 16d9b482..f7f79c8c 100644
--- a/source/reference/class/MongoDBInsertManyResult.txt
+++ b/source/reference/class/MongoDBInsertManyResult.txt
@@ -5,12 +5,11 @@ MongoDB\\InsertManyResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\InsertManyResult
+.. phpclass:: MongoDB\InsertManyResult
 
    This class contains information about an executed bulk insert operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::insertMany()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::insertMany()`.
 
 Methods
 -------
@@ -22,6 +21,6 @@ Methods
    getInsertedIds() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\InsertManyResult::getInsertedCount()`
-- :phpmethod:`MongoDB\\InsertManyResult::getInsertedIds()`
-- :phpmethod:`MongoDB\\InsertManyResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\InsertManyResult::getInsertedCount()`
+- :phpmethod:`MongoDB\InsertManyResult::getInsertedIds()`
+- :phpmethod:`MongoDB\InsertManyResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBInsertOneResult.txt b/source/reference/class/MongoDBInsertOneResult.txt
index 19454d22..09e0a35b 100644
--- a/source/reference/class/MongoDBInsertOneResult.txt
+++ b/source/reference/class/MongoDBInsertOneResult.txt
@@ -5,12 +5,11 @@ MongoDB\\InsertOneResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\InsertOneResult
+.. phpclass:: MongoDB\InsertOneResult
 
    This class contains information about an executed insert operation. It
-   encapsulates a :php:`MongoDB\\Driver\\WriteResult
-   ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::insertOne()`.
+   encapsulates a :php:`MongoDB\Driver\WriteResult `
+   object and is returned from :phpmethod:`MongoDB\Collection::insertOne()`.
 
 Methods
 -------
@@ -22,6 +21,6 @@ Methods
    getInsertedId() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\InsertOneResult::getInsertedCount()`
-- :phpmethod:`MongoDB\\InsertOneResult::getInsertedId()`
-- :phpmethod:`MongoDB\\InsertOneResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\InsertOneResult::getInsertedCount()`
+- :phpmethod:`MongoDB\InsertOneResult::getInsertedId()`
+- :phpmethod:`MongoDB\InsertOneResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBMapReduceResult.txt b/source/reference/class/MongoDBMapReduceResult.txt
index 601f6f82..8f27cce9 100644
--- a/source/reference/class/MongoDBMapReduceResult.txt
+++ b/source/reference/class/MongoDBMapReduceResult.txt
@@ -7,11 +7,11 @@ MongoDB\\MapReduceResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\MapReduceResult
+.. phpclass:: MongoDB\MapReduceResult
 
    This class extends PHP's :php:`IteratorAggregate `
    interface. An instance of this class is returned by
-   :phpmethod:`MongoDB\\Collection::mapReduce()`.
+   :phpmethod:`MongoDB\Collection::mapReduce()`.
 
    This class allows for iteration of map-reduce results irrespective of the
    output method (e.g. inline, collection). It also provides access to command
@@ -28,7 +28,7 @@ Methods
    getIterator() 
    getTiming() 
 
-- :phpmethod:`MongoDB\\MapReduceResult::getCounts()`
-- :phpmethod:`MongoDB\\MapReduceResult::getExecutionTimeMS()`
-- :phpmethod:`MongoDB\\MapReduceResult::getIterator()`
-- :phpmethod:`MongoDB\\MapReduceResult::getTiming()`
\ No newline at end of file
+- :phpmethod:`MongoDB\MapReduceResult::getCounts()`
+- :phpmethod:`MongoDB\MapReduceResult::getExecutionTimeMS()`
+- :phpmethod:`MongoDB\MapReduceResult::getIterator()`
+- :phpmethod:`MongoDB\MapReduceResult::getTiming()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelCollectionInfo.txt b/source/reference/class/MongoDBModelCollectionInfo.txt
index 17807095..76b9af35 100644
--- a/source/reference/class/MongoDBModelCollectionInfo.txt
+++ b/source/reference/class/MongoDBModelCollectionInfo.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\CollectionInfo Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\CollectionInfo
+.. phpclass:: MongoDB\Model\CollectionInfo
 
    This class models information about a collection. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Database::listCollections()`.
+   returned by traversing a :phpclass:`MongoDB\Model\CollectionInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\Database::listCollections()`.
 
 .. versionchanged:: 1.4
 
@@ -20,9 +20,9 @@ Definition
 
    .. note::
 
-      The :phpclass:`MongoDB\\Model\\CollectionInfo` class is immutable. Attempting
+      The :phpclass:`MongoDB\Model\CollectionInfo` class is immutable. Attempting
       to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+      result in a :phpclass:`MongoDB\Exception\BadMethodCallException`.
 
 Methods
 -------
@@ -39,11 +39,11 @@ Methods
    getType() 
    isCapped() 
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getIdIndex()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getInfo()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getName()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getType()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getIdIndex()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getInfo()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getName()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getOptions()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getType()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::isCapped()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelCollectionInfoIterator.txt b/source/reference/class/MongoDBModelCollectionInfoIterator.txt
index 5358f213..fca6da62 100644
--- a/source/reference/class/MongoDBModelCollectionInfoIterator.txt
+++ b/source/reference/class/MongoDBModelCollectionInfoIterator.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\CollectionInfoIterator Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\CollectionInfoIterator
+.. phpclass:: MongoDB\Model\CollectionInfoIterator
 
    This interface extends PHP's :php:`Iterator `
    interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Database::listCollections()`.
+   :phpmethod:`MongoDB\Database::listCollections()`.
 
 Methods
 -------
@@ -17,4 +17,4 @@ Methods
 This interface adds no new methods to :php:`Iterator
 `, but specifies that :php:`current()
 ` will return an instance of
-:phpclass:`MongoDB\\Model\\CollectionInfo`.
\ No newline at end of file
+:phpclass:`MongoDB\Model\CollectionInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelDatabaseInfo.txt b/source/reference/class/MongoDBModelDatabaseInfo.txt
index e0f45852..a8d18cd6 100644
--- a/source/reference/class/MongoDBModelDatabaseInfo.txt
+++ b/source/reference/class/MongoDBModelDatabaseInfo.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\DatabaseInfo Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\DatabaseInfo
+.. phpclass:: MongoDB\Model\DatabaseInfo
 
    This class models information about a database. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`.
+   returned by traversing a :phpclass:`MongoDB\Model\DatabaseInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\Client::listDatabases()`.
 
 .. versionchanged:: 1.4
 
@@ -20,9 +20,9 @@ Definition
 
    .. note::
 
-      The :phpclass:`MongoDB\\Model\\DatabaseInfo` class is immutable. Attempting
+      The :phpclass:`MongoDB\Model\DatabaseInfo` class is immutable. Attempting
       to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+      result in a :phpclass:`MongoDB\Exception\BadMethodCallException`.
 
 Methods
 -------
@@ -34,6 +34,6 @@ Methods
    getSizeOnDisk() 
    isEmpty() 
 
-- :phpmethod:`MongoDB\\Model\\DatabaseInfo::getName()`
-- :phpmethod:`MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()`
-- :phpmethod:`MongoDB\\Model\\DatabaseInfo::isEmpty()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Model\DatabaseInfo::getName()`
+- :phpmethod:`MongoDB\Model\DatabaseInfo::getSizeOnDisk()`
+- :phpmethod:`MongoDB\Model\DatabaseInfo::isEmpty()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelDatabaseInfoIterator.txt b/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
index 960ca256..ba36ef2e 100644
--- a/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
+++ b/source/reference/class/MongoDBModelDatabaseInfoIterator.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\DatabaseInfoIterator Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\DatabaseInfoIterator
+.. phpclass:: MongoDB\Model\DatabaseInfoIterator
 
    This interface extends PHP's :php:`Iterator `
    interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Client::listDatabases()`.
+   :phpmethod:`MongoDB\Client::listDatabases()`.
 
 Methods
 -------
@@ -17,4 +17,4 @@ Methods
 This interface adds no new methods to :php:`Iterator
 `, but specifies that :php:`current()
 ` will return an instance of
-:phpclass:`MongoDB\\Model\\DatabaseInfo`.
\ No newline at end of file
+:phpclass:`MongoDB\Model\DatabaseInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelIndexInfo.txt b/source/reference/class/MongoDBModelIndexInfo.txt
index 8b9c42c8..4d017e5d 100644
--- a/source/reference/class/MongoDBModelIndexInfo.txt
+++ b/source/reference/class/MongoDBModelIndexInfo.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\IndexInfo Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\IndexInfo
+.. phpclass:: MongoDB\Model\IndexInfo
 
    This class models information about an index. Instances of this class are
-   returned by traversing a :phpclass:`MongoDB\\Model\\IndexInfoIterator`,
-   which is returned by :phpmethod:`MongoDB\\Collection::listIndexes()`.
+   returned by traversing a :phpclass:`MongoDB\Model\IndexInfoIterator`,
+   which is returned by :phpmethod:`MongoDB\Collection::listIndexes()`.
 
    This class implements PHP's :php:`ArrayAccess ` interface. This
    provides a mechanism for accessing index fields for which there exists no
@@ -18,9 +18,9 @@ Definition
 
    .. note::
 
-      The :phpclass:`MongoDB\\Model\\IndexInfo` class is immutable. Attempting
+      The :phpclass:`MongoDB\Model\IndexInfo` class is immutable. Attempting
       to modify it via the :php:`ArrayAccess ` interface will
-      result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
+      result in a :phpclass:`MongoDB\Exception\BadMethodCallException`.
 
 Methods
 -------
@@ -39,13 +39,13 @@ Methods
    isTtl() 
    isUnique() 
 
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getKey()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getName()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getNamespace()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::getVersion()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::is2dSphere()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isGeoHaystack()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isSparse()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isText()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isTtl()`
-- :phpmethod:`MongoDB\\Model\\IndexInfo::isUnique()`
\ No newline at end of file
+- :phpmethod:`MongoDB\Model\IndexInfo::getKey()`
+- :phpmethod:`MongoDB\Model\IndexInfo::getName()`
+- :phpmethod:`MongoDB\Model\IndexInfo::getNamespace()`
+- :phpmethod:`MongoDB\Model\IndexInfo::getVersion()`
+- :phpmethod:`MongoDB\Model\IndexInfo::is2dSphere()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isGeoHaystack()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isSparse()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isText()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isTtl()`
+- :phpmethod:`MongoDB\Model\IndexInfo::isUnique()`
\ No newline at end of file
diff --git a/source/reference/class/MongoDBModelIndexInfoIterator.txt b/source/reference/class/MongoDBModelIndexInfoIterator.txt
index 2b154706..0fae59c2 100644
--- a/source/reference/class/MongoDBModelIndexInfoIterator.txt
+++ b/source/reference/class/MongoDBModelIndexInfoIterator.txt
@@ -5,11 +5,11 @@ MongoDB\\Model\\IndexInfoIterator Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\Model\\IndexInfoIterator
+.. phpclass:: MongoDB\Model\IndexInfoIterator
 
    This interface extends PHP's :php:`Iterator `
    interface. An instance of this interface is returned by
-   :phpmethod:`MongoDB\\Collection::listIndexes()`.
+   :phpmethod:`MongoDB\Collection::listIndexes()`.
 
 Methods
 -------
@@ -17,4 +17,4 @@ Methods
 This interface adds no new methods to :php:`Iterator
 `, but specifies that :php:`current()
 ` will return an instance of
-:phpclass:`MongoDB\\Model\\IndexInfo`.
\ No newline at end of file
+:phpclass:`MongoDB\Model\IndexInfo`.
\ No newline at end of file
diff --git a/source/reference/class/MongoDBUpdateResult.txt b/source/reference/class/MongoDBUpdateResult.txt
index 0534980d..52561e59 100644
--- a/source/reference/class/MongoDBUpdateResult.txt
+++ b/source/reference/class/MongoDBUpdateResult.txt
@@ -5,14 +5,14 @@ MongoDB\\UpdateResult Class
 Definition
 ----------
 
-.. phpclass:: MongoDB\\UpdateResult
+.. phpclass:: MongoDB\UpdateResult
 
    This class contains information about an executed update or replace
-   operation. It encapsulates a :php:`MongoDB\\Driver\\WriteResult
+   operation. It encapsulates a :php:`MongoDB\Driver\WriteResult
    ` object and is returned from
-   :phpmethod:`MongoDB\\Collection::replaceOne()`,
-   :phpmethod:`MongoDB\\Collection::updateMany()`, or
-   :phpmethod:`MongoDB\\Collection::updateOne()`.
+   :phpmethod:`MongoDB\Collection::replaceOne()`,
+   :phpmethod:`MongoDB\Collection::updateMany()`, or
+   :phpmethod:`MongoDB\Collection::updateOne()`.
 
 Methods
 -------
@@ -26,8 +26,8 @@ Methods
    getUpsertedId() 
    isAcknowledged() 
 
-- :phpmethod:`MongoDB\\UpdateResult::getMatchedCount()`
-- :phpmethod:`MongoDB\\UpdateResult::getModifiedCount()`
-- :phpmethod:`MongoDB\\UpdateResult::getUpsertedCount()`
-- :phpmethod:`MongoDB\\UpdateResult::getUpsertedId()`
-- :phpmethod:`MongoDB\\UpdateResult::isAcknowledged()`
\ No newline at end of file
+- :phpmethod:`MongoDB\UpdateResult::getMatchedCount()`
+- :phpmethod:`MongoDB\UpdateResult::getModifiedCount()`
+- :phpmethod:`MongoDB\UpdateResult::getUpsertedCount()`
+- :phpmethod:`MongoDB\UpdateResult::getUpsertedId()`
+- :phpmethod:`MongoDB\UpdateResult::isAcknowledged()`
\ No newline at end of file
diff --git a/source/reference/exception-classes.txt b/source/reference/exception-classes.txt
index 20ae7067..584c55d5 100644
--- a/source/reference/exception-classes.txt
+++ b/source/reference/exception-classes.txt
@@ -13,56 +13,56 @@ Exception Classes
 MongoDB\\Exception\\BadMethodCallException
 ------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\BadMethodCallException
+.. phpclass:: MongoDB\Exception\BadMethodCallException
 
    This exception is thrown when an unsupported method is invoked on an object.
 
    For example, using an unacknowledged write concern with
-   :phpmethod:`MongoDB\\Collection::insertMany()` will return a
-   :phpclass:`MongoDB\\InsertManyResult` object. It is a logical error to call
-   :phpmethod:`MongoDB\\InsertManyResult::getInsertedCount()`, since the number
+   :phpmethod:`MongoDB\Collection::insertMany()` will return a
+   :phpclass:`MongoDB\InsertManyResult` object. It is a logical error to call
+   :phpmethod:`MongoDB\InsertManyResult::getInsertedCount()`, since the number
    of inserted documents can only be determined from the response of an
    acknowledged write operation.
 
    This class extends PHP's :php:`BadMethodCallException
    ` class and implements the library's
-   :phpclass:`Exception ` interface.
+   :phpclass:`Exception ` interface.
 
 ----
 
 MongoDB\\Exception\\CreateEncryptedCollectionException
 ------------------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\CreateEncryptedCollectionException
+.. phpclass:: MongoDB\Exception\CreateEncryptedCollectionException
 
-   Thrown by :phpmethod:`MongoDB\\Database::createEncryptedCollection()` if any
+   Thrown by :phpmethod:`MongoDB\Database::createEncryptedCollection()` if any
    error is encountered while creating data keys or creating the collection. The
    original exception and modified ``encryptedFields`` option can be accessed
    via the ``getPrevious()`` and ``getEncryptedFields()`` methods, respectively.
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
 ----
 
 MongoDB\\Exception\\InvalidArgumentException
 --------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\InvalidArgumentException
+.. phpclass:: MongoDB\Exception\InvalidArgumentException
 
    Thrown for errors related to the parsing of parameters or options within the
    library.
 
    This class extends the driver's :php:`InvalidArgumentException
    ` class and implements the
-   library's :phpclass:`Exception ` interface.
+   library's :phpclass:`Exception ` interface.
 
 ----
 
 MongoDB\\Exception\\UnexpectedValueException
 --------------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\UnexpectedValueException
+.. phpclass:: MongoDB\Exception\UnexpectedValueException
 
    This exception is thrown when a command response from the server is
    malformed or not what the library expected. This exception means that an
@@ -72,26 +72,26 @@ MongoDB\\Exception\\UnexpectedValueException
 
    This class extends the driver's :php:`UnexpectedValueException
    ` class and implements the
-   library's :phpclass:`Exception ` interface.
+   library's :phpclass:`Exception ` interface.
 
 ----
 
 MongoDB\\Exception\\UnsupportedException
 ----------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\UnsupportedException
+.. phpclass:: MongoDB\Exception\UnsupportedException
 
    This exception is thrown if an option is used and not supported by the
    selected server. It is used sparingly in cases where silently ignoring the
    unsupported option might otherwise lead to unexpected behavior.
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
    .. note::
 
       Unlike :phpclass:`InvalidArgumentException
-      `, which may be thrown when
+      `, which may be thrown when
       an operation's parameters and options are parsed during construction, the
       selected server is not known until an operation is executed.
 
@@ -100,7 +100,7 @@ MongoDB\\Exception\\UnsupportedException
 MongoDB\\GridFS\\Exception\\CorruptFileException
 ------------------------------------------------
 
-.. phpclass:: MongoDB\\GridFS\\Exception\\CorruptFileException
+.. phpclass:: MongoDB\GridFS\Exception\CorruptFileException
 
    This exception is thrown if a GridFS file's metadata or chunk documents
    contain unexpected or invalid data.
@@ -111,27 +111,27 @@ MongoDB\\GridFS\\Exception\\CorruptFileException
    sequence or its binary data's length out of range.
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
 ----
 
 MongoDB\\GridFS\\Exception\\FileNotFoundException
 -------------------------------------------------
 
-.. phpclass:: MongoDB\\GridFS\\Exception\\FileNotFoundException
+.. phpclass:: MongoDB\GridFS\Exception\FileNotFoundException
 
    This exception is thrown if no GridFS file was found for the selection
    criteria (e.g. ``id``, ``filename``).
 
    This class extends the library's :phpclass:`RuntimeException
-   ` class.
+   ` class.
 
 ----
 
 MongoDB\\Exception\\Exception
 -----------------------------
 
-.. phpclass:: MongoDB\\Exception\\Exception
+.. phpclass:: MongoDB\Exception\Exception
 
    This interface extends the driver's :php:`Exception
    ` interface and is implemented by all
@@ -142,7 +142,7 @@ MongoDB\\Exception\\Exception
 MongoDB\\Exception\\RuntimeException
 ------------------------------------
 
-.. phpclass:: MongoDB\\Exception\\RuntimeException
+.. phpclass:: MongoDB\Exception\RuntimeException
 
    This class extends the driver's :php:`RuntimeException
    ` class, which in turn extends
diff --git a/source/reference/function/add_logger.txt b/source/reference/function/add_logger.txt
index f00039df..ea105a9f 100644
--- a/source/reference/function/add_logger.txt
+++ b/source/reference/function/add_logger.txt
@@ -15,7 +15,7 @@ MongoDB\\add_logger()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\add_logger()
+.. phpmethod:: MongoDB\add_logger()
 
    Registers a PSR logger to receive log messages from the driver.
 
@@ -58,6 +58,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\remove_logger()`
+- :phpmethod:`MongoDB\remove_logger()`
 - `PSR-3: Logger Interface `__
 - `libmongoc: Logging `__
diff --git a/source/reference/function/remove_logger.txt b/source/reference/function/remove_logger.txt
index 5ced6f0a..099b1c02 100644
--- a/source/reference/function/remove_logger.txt
+++ b/source/reference/function/remove_logger.txt
@@ -15,7 +15,7 @@ MongoDB\\remove_logger()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\remove_logger()
+.. phpmethod:: MongoDB\remove_logger()
 
    Unregisters a PSR logger to no longer receive log messages from the driver.
 
@@ -26,7 +26,7 @@ Definition
 Parameters
 ----------
 
-``$logger`` : Psr\\Log\\LoggerInterface
+``$logger`` : Psr\Log\LoggerInterface
   A logger to unregister.
 
   If the logger is not registered, the method will have no effect.
@@ -39,6 +39,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\add_logger()`
+- :phpmethod:`MongoDB\add_logger()`
 - `PSR-3: Logger Interface `__
 - `libmongoc: Logging `__
diff --git a/source/reference/function/with_transaction.txt b/source/reference/function/with_transaction.txt
index 438ea7a1..b759025e 100644
--- a/source/reference/function/with_transaction.txt
+++ b/source/reference/function/with_transaction.txt
@@ -15,7 +15,7 @@ MongoDB\\with_transaction()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\with_transaction()
+.. phpmethod:: MongoDB\with_transaction()
 
    Execute a callback within a transaction using the given client session
 
@@ -30,17 +30,17 @@ Definition
 Parameters
 ----------
 
-``$session`` : :php:`MongoDB\\Driver\\Session `
+``$session`` : :php:`MongoDB\Driver\Session `
   A client session used to execute the transaction.
 
 ``$callback`` : :php:`callable `
   A callback that will be run inside the transaction. The callback must accept a
-  :php:`MongoDB\\Driver\\Session ` object as its first
+  :php:`MongoDB\Driver\Session ` object as its first
   argument.
 
 ``$transactionOptions`` : array
   Transaction options, which will be passed to
-  :php:`MongoDB\\Driver\\Session::startTransaction `.
+  :php:`MongoDB\Driver\Session::startTransaction `.
   See the extension documentation for a list of supported options.
 
 Behavior
@@ -50,7 +50,7 @@ This function is responsible for starting a transaction, invoking a callback,
 and committing a transaction. It also applies logic to retry this process after
 certain errors within a preset time limit. The callback is expected to execute
 one or more operations within the transactionby passing the callback's
-:php:`MongoDB\\Driver\\Session ` argument as an option to
+:php:`MongoDB\Driver\Session ` argument as an option to
 those operations; however, that is not enforced.
 
 .. note::
@@ -89,7 +89,7 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Session::startTransaction `
-- :php:`MongoDB\\Driver\\Session::commitTransaction `
+- :php:`MongoDB\Driver\Session::startTransaction `
+- :php:`MongoDB\Driver\Session::commitTransaction `
 - :manual:`Transactions: Drivers API ` documentation in the MongoDB manual
 - `Convenient API for Transactions `_ specification
diff --git a/source/reference/functions.txt b/source/reference/functions.txt
index 7d269c2e..a5130b8f 100644
--- a/source/reference/functions.txt
+++ b/source/reference/functions.txt
@@ -17,6 +17,6 @@ Functions
    remove_logger() 
    with_transaction() 
 
-- :phpmethod:`MongoDB\\add_logger()`
-- :phpmethod:`MongoDB\\remove_logger()`
-- :phpmethod:`MongoDB\\with_transaction()`
+- :phpmethod:`MongoDB\add_logger()`
+- :phpmethod:`MongoDB\remove_logger()`
+- :phpmethod:`MongoDB\with_transaction()`
diff --git a/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
index d0501d3f..8dbe98d5 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getDeletedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getDeletedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getDeletedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getDeletedCount()
 
    Return the total number of documents that were deleted by all delete
    operations in the bulk write.
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getDeletedCount()
+- :php:`MongoDB\Driver\WriteResult::getDeletedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
index 6eb1b5de..8d9a4ed8 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getInsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getInsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getInsertedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getInsertedCount()
 
    Return the total number of documents that were inserted by all insert
    operations in the bulk write.
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getInsertedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt b/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
index bcbcd536..bb6752ff 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getInsertedIds()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getInsertedIds()
+.. phpmethod:: MongoDB\BulkWriteResult::getInsertedIds()
 
    Return a map of IDs (i.e. ``_id`` field values) for documents that were
    inserted by all insert operations in the bulk write.
@@ -34,5 +34,5 @@ insert operations in the bulk write.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to inserting (i.e. the driver did
 not generate an ID), the index will contain its ``_id`` field value. Any
-driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
+driver-generated ID will be a :php:`MongoDB\BSON\ObjectId
 ` instance.
diff --git a/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
index af1ad98f..02341bed 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getMatchedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getMatchedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getMatchedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getMatchedCount()
 
    Return the total number of documents that were matched by all update and
    replace operations in the bulk write.
@@ -30,7 +30,7 @@ Definition
       (e.g. setting the value of a field to its current value), the matched
       count may be greater than the value returned by
       :phpmethod:`getModifiedCount()
-      `.
+      `.
 
 Return Values
 -------------
@@ -46,6 +46,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\BulkWriteResult::getModifiedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getMatchedCount()
+- :phpmethod:`MongoDB\BulkWriteResult::getModifiedCount()`
+- :php:`MongoDB\Driver\WriteResult::getMatchedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
index da115c5f..6f179bd8 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getModifiedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getModifiedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getModifiedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getModifiedCount()
 
    Return the total number of documents that were modified by all update and
    replace operations in the bulk write.
@@ -29,7 +29,7 @@ Definition
       If an update/replace operation results in no change to the document
       (e.g. setting the value of a field to its current value), the modified
       count may be less than the value returned by :phpmethod:`getMatchedCount()
-      `.
+      `.
 
 Return Values
 -------------
@@ -45,6 +45,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\BulkWriteResult::getMatchedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getModifiedCount()
+- :phpmethod:`MongoDB\BulkWriteResult::getMatchedCount()`
+- :php:`MongoDB\Driver\WriteResult::getModifiedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt b/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
index 1f0dff2b..00f1ff1f 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getUpsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getUpsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getUpsertedCount()
+.. phpmethod:: MongoDB\BulkWriteResult::getUpsertedCount()
 
    Return the total number of documents that were upserted by all update and
    replace operations in the bulk write.
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedCount()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt b/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
index 6abad98f..df0b1fbb 100644
--- a/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::getUpsertedIds()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::getUpsertedIds()
+.. phpmethod:: MongoDB\BulkWriteResult::getUpsertedIds()
 
    Return a map of IDs (i.e. ``_id`` field values) for documents that were
    upserted by all update and replace operations in the bulk write.
@@ -31,7 +31,7 @@ update and replace operations in the bulk write.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to upserting (i.e. the server did
 not generate an ID), the index will contain its ``_id`` field value. Any
-server-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
+server-generated ID will be a :php:`MongoDB\BSON\ObjectId
 ` instance.
 
 Errors/Exceptions
@@ -42,5 +42,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedIds()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedIds()
   `
diff --git a/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt b/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
index 1a857caa..611f9fa7 100644
--- a/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBBulkWriteResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\BulkWriteResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\BulkWriteResult::isAcknowledged()
+.. phpmethod:: MongoDB\BulkWriteResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-current.txt b/source/reference/method/MongoDBChangeStream-current.txt
index a8578607..ccff68e0 100644
--- a/source/reference/method/MongoDBChangeStream-current.txt
+++ b/source/reference/method/MongoDBChangeStream-current.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::current()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::current()
+.. phpmethod:: MongoDB\ChangeStream::current()
 
    Returns the current event in the change stream.
 
@@ -29,9 +29,9 @@ Return Values
 -------------
 
 An array or object for the current event in the change stream, or ``null`` if
-there is no current event (i.e. :phpmethod:`MongoDB\\ChangeStream::valid()`
+there is no current event (i.e. :phpmethod:`MongoDB\ChangeStream::valid()`
 returns ``false``). The return type will depend on the ``typeMap`` option for
-:phpmethod:`MongoDB\\Collection::watch()`.
+:phpmethod:`MongoDB\Collection::watch()`.
 
 Examples
 --------
@@ -96,9 +96,9 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::current() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-getCursorId.txt b/source/reference/method/MongoDBChangeStream-getCursorId.txt
index e7004f44..066930e1 100644
--- a/source/reference/method/MongoDBChangeStream-getCursorId.txt
+++ b/source/reference/method/MongoDBChangeStream-getCursorId.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::getCursorId()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::getCursorId()
+.. phpmethod:: MongoDB\ChangeStream::getCursorId()
 
    Returns the change stream cursor's ID.
 
@@ -24,7 +24,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\CursorId ` object.
+A :php:`MongoDB\Driver\CursorId ` object.
 
 Examples
 --------
@@ -55,8 +55,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
-- :php:`MongoDB\\Driver\\CursorId `
-- :php:`MongoDB\\Driver\\Cursor::getId() `
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
+- :php:`MongoDB\Driver\CursorId `
+- :php:`MongoDB\Driver\Cursor::getId() `
diff --git a/source/reference/method/MongoDBChangeStream-getResumeToken.txt b/source/reference/method/MongoDBChangeStream-getResumeToken.txt
index 0930d45c..873e29bb 100644
--- a/source/reference/method/MongoDBChangeStream-getResumeToken.txt
+++ b/source/reference/method/MongoDBChangeStream-getResumeToken.txt
@@ -15,7 +15,7 @@ MongoDB\\ChangeStream::getResumeToken()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::getResumeToken()
+.. phpmethod:: MongoDB\ChangeStream::getResumeToken()
 
    Returns the cached resume token that will be used to resume the change
    stream.
@@ -68,8 +68,8 @@ the ``startAfter`` option.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :manual:`Resume a Change Stream `
   documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-key.txt b/source/reference/method/MongoDBChangeStream-key.txt
index de4754b4..8b35616f 100644
--- a/source/reference/method/MongoDBChangeStream-key.txt
+++ b/source/reference/method/MongoDBChangeStream-key.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::key()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::key()
+.. phpmethod:: MongoDB\ChangeStream::key()
 
    Returns the index of the current event in the change stream.
 
@@ -28,7 +28,7 @@ Return Values
 -------------
 
 The index of the current event in the change stream, or ``null`` if there is no
-current event (i.e. :phpmethod:`MongoDB\\ChangeStream::valid()` returns
+current event (i.e. :phpmethod:`MongoDB\ChangeStream::valid()` returns
 ``false``).
 
 Examples
@@ -68,9 +68,9 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::key() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-next.txt b/source/reference/method/MongoDBChangeStream-next.txt
index c25f039b..559ae4cb 100644
--- a/source/reference/method/MongoDBChangeStream-next.txt
+++ b/source/reference/method/MongoDBChangeStream-next.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::next()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::next()
+.. phpmethod:: MongoDB\ChangeStream::next()
 
    Advances the change stream and attempts to load the next event.
 
@@ -25,7 +25,7 @@ Definition
 
       Advancing the change stream does not guarantee that there will be a
       current event to access. You should still call
-      :phpmethod:`MongoDB\\ChangeStream::valid()` to check for a current event
+      :phpmethod:`MongoDB\ChangeStream::valid()` to check for a current event
       at each step of iteration.
 
 Errors/Exceptions
@@ -36,9 +36,9 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::next() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-rewind.txt b/source/reference/method/MongoDBChangeStream-rewind.txt
index e59a1399..066e99aa 100644
--- a/source/reference/method/MongoDBChangeStream-rewind.txt
+++ b/source/reference/method/MongoDBChangeStream-rewind.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::rewind()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::rewind()
+.. phpmethod:: MongoDB\ChangeStream::rewind()
 
    Rewinds the change stream and attempts to load the first event.
 
@@ -27,18 +27,18 @@ Definition
 
       Rewinding the change stream does not guarantee that there will be a
       current event to access. You should still call
-      :phpmethod:`MongoDB\\ChangeStream::valid()` to check for a current event
+      :phpmethod:`MongoDB\ChangeStream::valid()` to check for a current event
       at each step of iteration. After initially rewinding the change stream,
-      :phpmethod:`MongoDB\\ChangeStream::next()` should be used to iterate
+      :phpmethod:`MongoDB\ChangeStream::next()` should be used to iterate
       further.
 
 Errors/Exceptions
 -----------------
 
-:php:`MongoDB\\Driver\\Exception\\LogicException
+:php:`MongoDB\Driver\Exception\LogicException
 ` if this method is called after a call
-to :phpmethod:`MongoDB\\ChangeStream::next()` (i.e. the underlying
-:php:`MongoDB\\Driver\\Cursor ` has already been
+to :phpmethod:`MongoDB\ChangeStream::next()` (i.e. the underlying
+:php:`MongoDB\Driver\Cursor ` has already been
 advanced).
 
 .. include:: /includes/extracts/error-driver-runtimeexception.rst
@@ -46,9 +46,9 @@ advanced).
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::rewind() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBChangeStream-valid.txt b/source/reference/method/MongoDBChangeStream-valid.txt
index 69ea1cd6..bab45f1f 100644
--- a/source/reference/method/MongoDBChangeStream-valid.txt
+++ b/source/reference/method/MongoDBChangeStream-valid.txt
@@ -13,7 +13,7 @@ MongoDB\\ChangeStream::valid()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\ChangeStream::valid()
+.. phpmethod:: MongoDB\ChangeStream::valid()
 
    Returns whether there is a current event in the change stream.
 
@@ -23,8 +23,8 @@ Definition
 
    When manually iterating the change stream using
    :php:`Iterator ` methods, this method should
-   be used to determine if :phpmethod:`MongoDB\\ChangeStream::current()` and
-   :phpmethod:`MongoDB\\ChangeStream::key()` can be called.
+   be used to determine if :phpmethod:`MongoDB\ChangeStream::current()` and
+   :phpmethod:`MongoDB\ChangeStream::key()` can be called.
 
 Return Values
 -------------
@@ -34,9 +34,9 @@ A boolean indicating whether there is a current event in the change stream.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :php:`Iterator::valid() `
 - :ref:`Tailable Cursor Iteration `
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-addSubscriber.txt b/source/reference/method/MongoDBClient-addSubscriber.txt
index 2bf16cd5..b85d8d99 100644
--- a/source/reference/method/MongoDBClient-addSubscriber.txt
+++ b/source/reference/method/MongoDBClient-addSubscriber.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::addSubscriber()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::addSubscriber()
+.. phpmethod:: MongoDB\Client::addSubscriber()
 
     Registers a monitoring event subscriber with this Client. The subscriber
     will be notified of all events for this Client.
@@ -27,7 +27,7 @@ Definition
 Parameters
 ----------
 
-``$subscriber`` : :php:`MongoDB\\Driver\\Monitoring\\Subscriber `
+``$subscriber`` : :php:`MongoDB\Driver\Monitoring\Subscriber `
   A monitoring event subscriber to register with this Client.
 
 Errors/Exceptions
@@ -35,10 +35,10 @@ Errors/Exceptions
 
 .. include:: /includes/extracts/error-invalidargumentexception.rst
 
-:php:`MongoDB\\Driver\\Exception\\InvalidArgumentException `
-if subscriber is a :php:`MongoDB\\Driver\\Monitoring\\LogSubscriber `,
+:php:`MongoDB\Driver\Exception\InvalidArgumentException `
+if subscriber is a :php:`MongoDB\Driver\Monitoring\LogSubscriber `,
 since loggers can only be registered globally with
-:php:`MongoDB\\Driver\\Monitoring\\addSubscriber `.
+:php:`MongoDB\Driver\Monitoring\addSubscriber `.
 
 Behavior
 --------
@@ -50,7 +50,7 @@ notified once of each event for this Client.
 Example
 -------
 
-Create a :phpclass:`MongoDB\\Driver\\Monitoring\\CommandSubscriber` that
+Create a :phpclass:`MongoDB\Driver\Monitoring\CommandSubscriber` that
 logs all events:
 
 .. code-block:: php
@@ -129,7 +129,7 @@ The above code will write the following to stderr output:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::removeSubscriber()`
+- :phpmethod:`MongoDB\Client::removeSubscriber()`
 - :php:`Application Performance Monitoring (APM) `
-- :php:`MongoDB\\Driver\\Manager::addSubscriber() `
+- :php:`MongoDB\Driver\Manager::addSubscriber() `
 - :php:`MongoDB\Driver\Monitoring\CommandSubscriber `
diff --git a/source/reference/method/MongoDBClient-createClientEncryption.txt b/source/reference/method/MongoDBClient-createClientEncryption.txt
index 0dd925cd..ef0d2529 100644
--- a/source/reference/method/MongoDBClient-createClientEncryption.txt
+++ b/source/reference/method/MongoDBClient-createClientEncryption.txt
@@ -13,9 +13,9 @@ MongoDB\\Client::createClientEncryption()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::createClientEncryption()
+.. phpmethod:: MongoDB\Client::createClientEncryption()
 
-   Returns a :php:`MongoDB\\Driver\\ClientEncryption `
+   Returns a :php:`MongoDB\Driver\ClientEncryption `
    object for manual encryption and decryption of values.
 
    .. code-block:: php
@@ -27,18 +27,18 @@ Parameters
 
 ``$options`` : array
   An array specifying the desired options. Refer to the
-  :php:`MongoDB\\Driver\\Manager::createClientEncryption() `
+  :php:`MongoDB\Driver\Manager::createClientEncryption() `
   extension documentation for a list of supported options.
 
-  If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+  If a :phpclass:`MongoDB\Client` is provided for the ``keyVaultClient``
   option, it will be unwrapped into a
-  :php:`MongoDB\\Driver\\Manager ` for the
+  :php:`MongoDB\Driver\Manager ` for the
   extension.
 
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ClientEncryption `
+A :php:`MongoDB\Driver\ClientEncryption `
 instance which can be used to encrypt and decrypt values.
 
 Errors/Exceptions
@@ -50,5 +50,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Manager::createClientEncryption()
+- :php:`MongoDB\Driver\Manager::createClientEncryption()
   `
diff --git a/source/reference/method/MongoDBClient-dropDatabase.txt b/source/reference/method/MongoDBClient-dropDatabase.txt
index 5a268765..9545ed49 100644
--- a/source/reference/method/MongoDBClient-dropDatabase.txt
+++ b/source/reference/method/MongoDBClient-dropDatabase.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::dropDatabase()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::dropDatabase()
+.. phpmethod:: MongoDB\Client::dropDatabase()
 
    Drop a database on the server.
 
@@ -47,7 +47,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -59,7 +59,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/client-option-writeConcern.rst
 
 Return Values
@@ -108,6 +108,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::drop()`
+- :phpmethod:`MongoDB\Database::drop()`
 - :manual:`dropDatabase ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-getManager.txt b/source/reference/method/MongoDBClient-getManager.txt
index c320595d..9618beca 100644
--- a/source/reference/method/MongoDBClient-getManager.txt
+++ b/source/reference/method/MongoDBClient-getManager.txt
@@ -13,11 +13,11 @@ MongoDB\\Client::getManager()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getManager()
+.. phpmethod:: MongoDB\Client::getManager()
 
    Accessor for the
-   :php:`MongoDB\\Driver\\Manager ` used by this
-   :phpclass:`Client `.
+   :php:`MongoDB\Driver\Manager ` used by this
+   :phpclass:`Client `.
 
    .. code-block:: php
 
@@ -26,10 +26,10 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\Driver\Manager ` object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getManager()`
-- :phpmethod:`MongoDB\\Database::getManager()`
+- :phpmethod:`MongoDB\Collection::getManager()`
+- :phpmethod:`MongoDB\Database::getManager()`
diff --git a/source/reference/method/MongoDBClient-getReadConcern.txt b/source/reference/method/MongoDBClient-getReadConcern.txt
index 64f2b3d4..89643bd5 100644
--- a/source/reference/method/MongoDBClient-getReadConcern.txt
+++ b/source/reference/method/MongoDBClient-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getReadConcern()
+.. phpmethod:: MongoDB\Client::getReadConcern()
 
    Returns the read concern for this client.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -54,7 +54,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBClient-getReadPreference.txt b/source/reference/method/MongoDBClient-getReadPreference.txt
index cd00f206..564d108f 100644
--- a/source/reference/method/MongoDBClient-getReadPreference.txt
+++ b/source/reference/method/MongoDBClient-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getReadPreference()
+.. phpmethod:: MongoDB\Client::getReadPreference()
 
    Returns the read preference for this client.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -55,6 +55,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBClient-getTypeMap.txt b/source/reference/method/MongoDBClient-getTypeMap.txt
index 138444f0..89c620af 100644
--- a/source/reference/method/MongoDBClient-getTypeMap.txt
+++ b/source/reference/method/MongoDBClient-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getTypeMap()
+.. phpmethod:: MongoDB\Client::getTypeMap()
 
    Returns the type map for this client.
 
@@ -62,6 +62,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBClient-getWriteConcern.txt b/source/reference/method/MongoDBClient-getWriteConcern.txt
index 7a3e561c..270707f0 100644
--- a/source/reference/method/MongoDBClient-getWriteConcern.txt
+++ b/source/reference/method/MongoDBClient-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::getWriteConcern()
+.. phpmethod:: MongoDB\Client::getWriteConcern()
 
    Returns the write concern for this client.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -55,7 +55,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBClient-listDatabaseNames.txt b/source/reference/method/MongoDBClient-listDatabaseNames.txt
index cac7d22c..bdb7e095 100644
--- a/source/reference/method/MongoDBClient-listDatabaseNames.txt
+++ b/source/reference/method/MongoDBClient-listDatabaseNames.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::listDatabaseNames()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::listDatabaseNames()
+.. phpmethod:: MongoDB\Client::listDatabaseNames()
 
    Returns names for all databases on the server.
 
@@ -69,7 +69,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -112,7 +112,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::listDatabases()`
+- :phpmethod:`MongoDB\Client::listDatabases()`
 - :manual:`listDatabases ` command reference
   in the MongoDB manual
 - `Enumerating Databases
diff --git a/source/reference/method/MongoDBClient-listDatabases.txt b/source/reference/method/MongoDBClient-listDatabases.txt
index dd6b2da8..93a4d65a 100644
--- a/source/reference/method/MongoDBClient-listDatabases.txt
+++ b/source/reference/method/MongoDBClient-listDatabases.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::listDatabases()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::listDatabases()
+.. phpmethod:: MongoDB\Client::listDatabases()
 
    Returns information for all databases on the server.
 
@@ -67,7 +67,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -77,8 +77,8 @@ Parameters
 Return Values
 -------------
 
-A traversable :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`, which contains
-a :phpclass:`MongoDB\\Model\\DatabaseInfo` object for each database on the
+A traversable :phpclass:`MongoDB\Model\DatabaseInfoIterator`, which contains
+a :phpclass:`MongoDB\Model\DatabaseInfo` object for each database on the
 server.
 
 Errors/Exceptions
@@ -127,7 +127,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::listDatabaseNames()`
+- :phpmethod:`MongoDB\Client::listDatabaseNames()`
 - :manual:`listDatabases ` command reference
   in the MongoDB manual
 - `Enumerating Databases
diff --git a/source/reference/method/MongoDBClient-removeSubscriber.txt b/source/reference/method/MongoDBClient-removeSubscriber.txt
index d0a6ac5d..9270689d 100644
--- a/source/reference/method/MongoDBClient-removeSubscriber.txt
+++ b/source/reference/method/MongoDBClient-removeSubscriber.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::removeSubscriber()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::removeSubscriber()
+.. phpmethod:: MongoDB\Client::removeSubscriber()
 
     Unregisters a monitoring event subscriber with this Client.
 
@@ -26,7 +26,7 @@ Definition
 Parameters
 ----------
 
-``$subscriber`` : :php:`MongoDB\\Driver\\Monitoring\\Subscriber `
+``$subscriber`` : :php:`MongoDB\Driver\Monitoring\Subscriber `
   A monitoring event subscriber to unregister with this Client.
 
 Errors/Exceptions
@@ -42,7 +42,7 @@ If ``$subscriber`` is not registered with this Client, this function is a no-op.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::addSubscriber()`
+- :phpmethod:`MongoDB\Client::addSubscriber()`
 - :php:`Application Performance Monitoring (APM) `
-- :php:`MongoDB\\Driver\\Manager::removeSubscriber() `
+- :php:`MongoDB\Driver\Manager::removeSubscriber() `
 - :php:`MongoDB\Driver\Monitoring\CommandSubscriber `
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index 6700f023..e7e58e86 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::selectCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::selectCollection()
+.. phpmethod:: MongoDB\Client::selectCollection()
 
    Selects a collection on the server.
 
@@ -46,12 +46,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the client's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the client's read preference.
 
@@ -61,14 +61,14 @@ Parameters
          client's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults to
          the client's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Errors/Exceptions
 -----------------
@@ -79,7 +79,7 @@ Behavior
 --------
 
 The selected collection inherits options such as read preference and type
-mapping from the :phpclass:`Client ` object. Options may be
+mapping from the :phpclass:`Client ` object. Options may be
 overridden via the ``$options`` parameter.
 
 Example
@@ -115,5 +115,5 @@ with a custom read preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::__construct()`
-- :phpmethod:`MongoDB\\Database::selectCollection()`
+- :phpmethod:`MongoDB\Collection::__construct()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
diff --git a/source/reference/method/MongoDBClient-selectDatabase.txt b/source/reference/method/MongoDBClient-selectDatabase.txt
index b1814516..33c7ec32 100644
--- a/source/reference/method/MongoDBClient-selectDatabase.txt
+++ b/source/reference/method/MongoDBClient-selectDatabase.txt
@@ -13,7 +13,7 @@ MongoDB\\Client::selectDatabase()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::selectDatabase()
+.. phpmethod:: MongoDB\Client::selectDatabase()
 
    Selects a database on the server.
 
@@ -42,12 +42,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for database operations. Defaults to
          the client's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for database operations. Defaults to
          the client's read preference.
 
@@ -57,14 +57,14 @@ Parameters
          client's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for database operations. Defaults to
          the client's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\Database` object.
 
 Errors/Exceptions
 -----------------
@@ -75,7 +75,7 @@ Behavior
 --------
 
 The selected database inherits options such as read preference and type mapping
-from the :phpclass:`Client ` object. Options may be overridden
+from the :phpclass:`Client ` object. Options may be overridden
 via the ``$options`` parameter.
 
 Example
@@ -110,5 +110,5 @@ preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::__get()`
-- :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\Client::__get()`
+- :phpmethod:`MongoDB\Database::__construct()`
diff --git a/source/reference/method/MongoDBClient-startSession.txt b/source/reference/method/MongoDBClient-startSession.txt
index 8de00ee0..0e3d8eb1 100644
--- a/source/reference/method/MongoDBClient-startSession.txt
+++ b/source/reference/method/MongoDBClient-startSession.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::startSession()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::startSession()
+.. phpmethod:: MongoDB\Client::startSession()
 
    Start a new client session for use with this client.
 
@@ -28,7 +28,7 @@ Parameters
 
 ``$options`` : array
   An array specifying the desired options. Refer to the
-  :php:`MongoDB\\Driver\\Manager::startSession() `
+  :php:`MongoDB\Driver\Manager::startSession() `
   extension documentation for a list of supported options.
 
 Return Values
@@ -83,6 +83,6 @@ The output would then resemble:
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Manager::startSession()
+- :php:`MongoDB\Driver\Manager::startSession()
   `
 - :ref:`Causal Consistency ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient-watch.txt b/source/reference/method/MongoDBClient-watch.txt
index 2977475a..1cee5f01 100644
--- a/source/reference/method/MongoDBClient-watch.txt
+++ b/source/reference/method/MongoDBClient-watch.txt
@@ -15,7 +15,7 @@ MongoDB\\Client::watch()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::watch()
+.. phpmethod:: MongoDB\Client::watch()
 
    Executes a :manual:`change stream ` operation on the client.
    The change stream can be watched for cluster-level changes.
@@ -73,11 +73,11 @@ Parameters
        - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/client-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/client-option-readPreference.rst
 
          This is used for both the initial change stream aggregation and for
@@ -88,7 +88,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-resumeAfter.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - showExpandedEvents
@@ -100,7 +100,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-startAfter.rst
 
      * - startAtOperationTime
-       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - :php:`MongoDB\BSON\TimestampInterface `
        - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
      * - typeMap
@@ -110,7 +110,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+A :phpclass:`MongoDB\ChangeStream` object, which allows for iteration of
 events in the change stream via the :php:`Iterator ` interface.
 
 Errors/Exceptions
@@ -189,8 +189,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBClient__construct.txt b/source/reference/method/MongoDBClient__construct.txt
index 17c213ff..79e5daa8 100644
--- a/source/reference/method/MongoDBClient__construct.txt
+++ b/source/reference/method/MongoDBClient__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\Client::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::__construct()
+.. phpmethod:: MongoDB\Client::__construct()
 
-   Constructs a new :phpclass:`Client ` instance.
+   Constructs a new :phpclass:`Client ` instance.
 
    .. code-block:: php
 
@@ -49,7 +49,7 @@ Parameters
   over any analogous options present in the ``$uri`` string and do not need to
   be encoded according to `RFC 3986 `_.
 
-  Refer to the :php:`MongoDB\\Driver\\Manager::__construct()
+  Refer to the :php:`MongoDB\Driver\Manager::__construct()
   ` extension documentation for a list of
   supported options.
 
@@ -75,9 +75,9 @@ Parameters
          :php:`extension documentation `
          for a list of supported encryption options.
 
-         If a :phpclass:`MongoDB\\Client` is provided for the ``keyVaultClient``
+         If a :phpclass:`MongoDB\Client` is provided for the ``keyVaultClient``
          option, it will be unwrapped into a
-         :php:`MongoDB\\Driver\\Manager ` for the
+         :php:`MongoDB\Driver\Manager ` for the
          extension.
 
          .. versionadded:: 1.6
@@ -106,7 +106,7 @@ Parameters
          .. versionadded:: 1.7
 
      * - serverApi
-       - :php:`MongoDB\\Driver\\ServerApi `
+       - :php:`MongoDB\Driver\ServerApi `
        - Used to declare an API version on the client. Refer to the
          :manual:`Stable API ` page in the Server manual for
          additional information.
@@ -219,10 +219,10 @@ Errors/Exceptions
 Behavior
 --------
 
-A :php:`MongoDB\\Driver\\Manager ` is constructed
+A :php:`MongoDB\Driver\Manager ` is constructed
 internally. Per the `Server Discovery and Monitoring
 `_
-specification, :php:`MongoDB\\Driver\\Manager::__construct()
+specification, :php:`MongoDB\Driver\Manager::__construct()
 ` performs no I/O. Connections will be
 initialized on demand, when the first operation is executed.
 
@@ -237,7 +237,7 @@ Connecting to a Standalone server
 If you do not specify a ``$uri`` value, the driver connects to a standalone
 :program:`mongod` on ``127.0.0.1`` via port ``27017``. To connect to a different
 server, pass the corresponding connection string as the first parameter when
-creating the :phpclass:`Client ` instance:
+creating the :phpclass:`Client ` instance:
 
 .. code-block:: php
 
@@ -298,7 +298,7 @@ specified in the constructor's ``$uriOptions`` parameter:
 The driver supports additional :php:`SSL options
 `,
 which may be specified in the constructor's ``$driverOptions`` parameter. Those
-options are covered in the :php:`MongoDB\\Driver\\Manager::__construct()
+options are covered in the :php:`MongoDB\Driver\Manager::__construct()
 ` documentation.
 
 .. end-connecting-include
@@ -307,8 +307,8 @@ Specifying a Custom Type Map
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 By default, the |php-library| deserializes BSON documents and arrays
-as :phpclass:`MongoDB\\Model\\BSONDocument` and
-:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The following
+as :phpclass:`MongoDB\Model\BSONDocument` and
+:phpclass:`MongoDB\Model\BSONArray` objects, respectively. The following
 example demonstrates how to have the library unserialize everything as a PHP
 array, as was done in the legacy ``mongo`` extension.
 
@@ -331,7 +331,7 @@ array, as was done in the legacy ``mongo`` extension.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\Manager::__construct()
+- :php:`MongoDB\Driver\Manager::__construct()
   `
 - :manual:`Connection String URI Format ` in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBClient__get.txt b/source/reference/method/MongoDBClient__get.txt
index 88de4725..d391b12a 100644
--- a/source/reference/method/MongoDBClient__get.txt
+++ b/source/reference/method/MongoDBClient__get.txt
@@ -13,11 +13,11 @@ MongoDB\\Client::__get()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Client::__get()
+.. phpmethod:: MongoDB\Client::__get()
 
    Selects a database on the server. This :php:`magic method ` is
    an alias for the :phpmethod:`selectDatabase()
-   ` method.
+   ` method.
 
    .. code-block:: php
 
@@ -32,21 +32,21 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\Database` object.
 
 Behavior
 --------
 
 The selected database inherits options such as read preference and type mapping
-from the :phpclass:`Client ` object. If you wish to override
-any options, use the :phpmethod:`MongoDB\\Client::selectDatabase()` method.
+from the :phpclass:`Client ` object. If you wish to override
+any options, use the :phpmethod:`MongoDB\Client::selectDatabase()` method.
 
 .. note::
 
    To select databases whose names contain special characters, such as
    ``-``, use complex syntax, as in ``$client->{'that-database'}``.
 
-   Alternatively, :phpmethod:`MongoDB\\Client::selectDatabase()` supports
+   Alternatively, :phpmethod:`MongoDB\Client::selectDatabase()` supports
    selecting databases whose names contain special characters.
 
 Examples
@@ -66,6 +66,6 @@ The following example selects the ``test`` and ``another-app`` databases:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::selectDatabase()`
-- :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\Client::selectDatabase()`
+- :phpmethod:`MongoDB\Database::__construct()`
 - :php:`Property Overloading ` in the PHP Manual
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index 11f9d19b..4566b92b 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::aggregate()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::aggregate()
+.. phpmethod:: MongoDB\Collection::aggregate()
 
    Executes an :manual:`aggregation framework pipeline
    ` operation on the collection.
@@ -107,17 +107,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -127,7 +127,7 @@ Parameters
        - .. include:: /includes/extracts/collection-option-typeMap.rst
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -138,7 +138,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` or
+A :php:`MongoDB\Driver\Cursor ` or
 :php:`ArrayIterator ` object. In both cases, the return value
 will be :php:`Traversable `.
 
@@ -155,8 +155,8 @@ Errors/Exceptions
 Behavior
 --------
 
-:phpmethod:`MongoDB\\Collection::aggregate()`'s returns a
-:php:`MongoDB\\Driver\\Cursor ` object.
+:phpmethod:`MongoDB\Collection::aggregate()`'s returns a
+:php:`MongoDB\Driver\Cursor ` object.
 
 Examples
 --------
@@ -181,7 +181,7 @@ group, and sorts the results by name.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::aggregate()`
+- :phpmethod:`MongoDB\Database::aggregate()`
 - :manual:`aggregate ` command reference in the
   MongoDB manual
 - :manual:`Aggregation Pipeline ` documentation in
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index a86e9cc6..f76d6ca6 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::bulkWrite()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::bulkWrite()
+.. phpmethod:: MongoDB\Collection::bulkWrite()
 
    Executes multiple write operations.
 
@@ -29,13 +29,13 @@ Parameters
 
 ``$operations`` : array
   An array containing the write operations to perform.
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` supports
-  :phpmethod:`deleteMany() `,
-  :phpmethod:`deleteOne() `,
-  :phpmethod:`insertOne() `,
-  :phpmethod:`replaceOne() `,
-  :phpmethod:`updateMany() `, and
-  :phpmethod:`updateOne() ` operations in the
+  :phpmethod:`MongoDB\Collection::bulkWrite()` supports
+  :phpmethod:`deleteMany() `,
+  :phpmethod:`deleteOne() `,
+  :phpmethod:`insertOne() `,
+  :phpmethod:`replaceOne() `,
+  :phpmethod:`updateMany() `, and
+  :phpmethod:`updateOne() ` operations in the
   following array structure:
 
   .. code-block:: php
@@ -51,7 +51,7 @@ Parameters
 
   Arguments correspond to the respective operation methods. However, the
   ``writeConcern`` option is specified as a top-level option to
-  :phpmethod:`MongoDB\\Collection::bulkWrite()` instead of each individual
+  :phpmethod:`MongoDB\Collection::bulkWrite()` instead of each individual
   operation.
 
 ``$options`` : array
@@ -95,13 +95,13 @@ Parameters
          The default is ``true``.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -109,8 +109,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\BulkWriteResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\BulkWriteResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -131,11 +131,11 @@ Behavior
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::deleteMany()`
-- :phpmethod:`MongoDB\\Collection::deleteOne()`
-- :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::deleteMany()`
+- :phpmethod:`MongoDB\Collection::deleteOne()`
+- :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
 - :doc:`/tutorial/crud`
diff --git a/source/reference/method/MongoDBCollection-count.txt b/source/reference/method/MongoDBCollection-count.txt
index 0048703f..388f5bda 100644
--- a/source/reference/method/MongoDBCollection-count.txt
+++ b/source/reference/method/MongoDBCollection-count.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::count()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::count()
+.. phpmethod:: MongoDB\Collection::count()
 
    Count the number of documents that match the filter criteria.
 
@@ -74,17 +74,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -117,7 +117,7 @@ is provided, the ``count`` command provides an estimate using collection
 metadata. Even when provided with a query filter the ``count`` command can
 return inaccurate results with a sharded cluster if orphaned documents exist or
 if a chunk migration is in progress. The
-:phpmethod:`MongoDB\\Collection::countDocuments()` method avoids these sharded
+:phpmethod:`MongoDB\Collection::countDocuments()` method avoids these sharded
 cluster problems entirely.
 
 .. include:: /includes/extracts/note-bson-comparison.rst
@@ -127,5 +127,5 @@ See Also
 
 - :manual:`count ` command reference in the MongoDB
   manual
-- :phpmethod:`MongoDB\\Collection::countDocuments()`
-- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
+- :phpmethod:`MongoDB\Collection::countDocuments()`
+- :phpmethod:`MongoDB\Collection::estimatedDocumentCount()`
diff --git a/source/reference/method/MongoDBCollection-countDocuments.txt b/source/reference/method/MongoDBCollection-countDocuments.txt
index dc62b1d6..dc344f2d 100644
--- a/source/reference/method/MongoDBCollection-countDocuments.txt
+++ b/source/reference/method/MongoDBCollection-countDocuments.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::countDocuments()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::countDocuments()
+.. phpmethod:: MongoDB\Collection::countDocuments()
 
    Count the number of documents that match the filter criteria.
 
@@ -63,17 +63,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - skip
@@ -105,12 +105,12 @@ added between ``$match`` and ``group`` if present in the options.
 
    This method counts documents on the server side. To obtain an approximate
    total number of documents without filters, the
-   :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()` method can be
+   :phpmethod:`MongoDB\Collection::estimatedDocumentCount()` method can be
    used. This method estimates the number of documents based on collection
    metadata, thus sacrificing accuracy for performance.
 
 Since this method uses an aggregation pipeline, some query operators accepted
-within a :phpmethod:`MongoDB\\Collection::count()` ``filter`` cannot be used.
+within a :phpmethod:`MongoDB\Collection::count()` ``filter`` cannot be used.
 Consider the following alternatives to these restricted operators:
 
 .. list-table::
@@ -135,4 +135,4 @@ Consider the following alternatives to these restricted operators:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::estimatedDocumentCount()`
+- :phpmethod:`MongoDB\Collection::estimatedDocumentCount()`
diff --git a/source/reference/method/MongoDBCollection-createIndex.txt b/source/reference/method/MongoDBCollection-createIndex.txt
index 7f8aca41..6a74a5bd 100644
--- a/source/reference/method/MongoDBCollection-createIndex.txt
+++ b/source/reference/method/MongoDBCollection-createIndex.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::createIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::createIndex()
+.. phpmethod:: MongoDB\Collection::createIndex()
 
    Create an index for the collection.
 
@@ -117,13 +117,13 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -200,7 +200,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndexes()`
 - :doc:`/tutorial/indexes`
 - :manual:`createIndexes ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-createIndexes.txt b/source/reference/method/MongoDBCollection-createIndexes.txt
index efb740ea..85318b2d 100644
--- a/source/reference/method/MongoDBCollection-createIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createIndexes.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::createIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::createIndexes()
+.. phpmethod:: MongoDB\Collection::createIndexes()
 
    Create one or more indexes for the collection.
 
@@ -81,13 +81,13 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -113,9 +113,9 @@ Behavior
 The ``$indexes`` parameter is an array of index specification documents. Each
 element in ``$indexes`` must itself be an array or object with a ``key`` field,
 which corresponds to the ``$key`` parameter of :phpmethod:`createIndex()
-`. The array or object may include other
+`. The array or object may include other
 fields that correspond to index options accepted by :phpmethod:`createIndex()
-`. For a full list of the supported index
+`. For a full list of the supported index
 creation options, refer to the
 :manual:`createIndexes ` command reference
 in the MongoDB manual.
@@ -166,7 +166,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :doc:`/tutorial/indexes`
 - :manual:`createIndexes ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-createSearchIndex.txt b/source/reference/method/MongoDBCollection-createSearchIndex.txt
index df947463..ae85f97f 100644
--- a/source/reference/method/MongoDBCollection-createSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-createSearchIndex.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::createSearchIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::createSearchIndex()
+.. phpmethod:: MongoDB\Collection::createSearchIndex()
 
    Create an Atlas Search index for the collection.
 
@@ -107,10 +107,10 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::updateSearchIndex()`
 - :manual:`createSearchIndexes ` command
   reference in the MongoDB manual
 - `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-createSearchIndexes.txt b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
index a3081e60..85d27d84 100644
--- a/source/reference/method/MongoDBCollection-createSearchIndexes.txt
+++ b/source/reference/method/MongoDBCollection-createSearchIndexes.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::createSearchIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::createSearchIndexes()
+.. phpmethod:: MongoDB\Collection::createSearchIndexes()
 
    Create one or more Atlas Search indexes for the collection.
 
@@ -114,10 +114,10 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::updateSearchIndex()`
 - :manual:`createSearchIndexes ` command
   reference in the MongoDB manual
 - `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-deleteMany.txt b/source/reference/method/MongoDBCollection-deleteMany.txt
index ccb5e37d..b82b1c6b 100644
--- a/source/reference/method/MongoDBCollection-deleteMany.txt
+++ b/source/reference/method/MongoDBCollection-deleteMany.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::deleteMany()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::deleteMany()
+.. phpmethod:: MongoDB\Collection::deleteMany()
 
    Deletes all documents that match the filter criteria.
 
@@ -68,13 +68,13 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -82,8 +82,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\DeleteResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -127,8 +127,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::deleteOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::deleteOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`delete ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-deleteOne.txt b/source/reference/method/MongoDBCollection-deleteOne.txt
index 0c659891..43209ebd 100644
--- a/source/reference/method/MongoDBCollection-deleteOne.txt
+++ b/source/reference/method/MongoDBCollection-deleteOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::deleteOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::deleteOne()
+.. phpmethod:: MongoDB\Collection::deleteOne()
 
    Deletes at most one document that matches the filter criteria. If multiple
    documents match the filter criteria, only the :term:`first `
@@ -70,13 +70,13 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -84,8 +84,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\DeleteResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\DeleteResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -129,8 +129,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::deleteMany()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::deleteMany()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`delete ` command reference  in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-distinct.txt b/source/reference/method/MongoDBCollection-distinct.txt
index 42eae068..f8bcd4b0 100644
--- a/source/reference/method/MongoDBCollection-distinct.txt
+++ b/source/reference/method/MongoDBCollection-distinct.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::distinct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::distinct()
+.. phpmethod:: MongoDB\Collection::distinct()
 
    Finds the distinct values for a specified field across the collection.
 
@@ -63,17 +63,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
diff --git a/source/reference/method/MongoDBCollection-drop.txt b/source/reference/method/MongoDBCollection-drop.txt
index 0704ff6a..93b6a17c 100644
--- a/source/reference/method/MongoDBCollection-drop.txt
+++ b/source/reference/method/MongoDBCollection-drop.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::drop()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::drop()
+.. phpmethod:: MongoDB\Collection::drop()
 
    Drop the collection.
 
@@ -64,7 +64,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -76,7 +76,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -132,6 +132,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::dropCollection()`
+- :phpmethod:`MongoDB\Database::dropCollection()`
 - :manual:`drop ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt
index 07a18145..67ba427e 100644
--- a/source/reference/method/MongoDBCollection-dropIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropIndex.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::dropIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::dropIndex()
+.. phpmethod:: MongoDB\Collection::dropIndex()
 
    Drop an index from the collection.
 
@@ -27,10 +27,10 @@ Definition
 Parameters
 ----------
 
-``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+``$indexName`` : string| :phpclass:`MongoDB\Model\IndexInfo`
   The name or model object of the index to drop. View the existing indexes on
   the collection using the :phpmethod:`listIndexes()
-  ` method.
+  ` method.
 
 ``$options`` : array
   An array specifying the desired options.
@@ -58,7 +58,7 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -70,7 +70,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -122,7 +122,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::dropIndexes()`
+- :phpmethod:`MongoDB\Collection::dropIndexes()`
 - :doc:`/tutorial/indexes`
 - :manual:`dropIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt
index 41fda6e4..52595c71 100644
--- a/source/reference/method/MongoDBCollection-dropIndexes.txt
+++ b/source/reference/method/MongoDBCollection-dropIndexes.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::dropIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::dropIndexes()
+.. phpmethod:: MongoDB\Collection::dropIndexes()
 
    Drop all indexes in the collection, except for the required index on the
    ``_id`` field.
@@ -25,10 +25,10 @@ Definition
 Parameters
 ----------
 
-``$indexName`` : string| :phpclass:`MongoDB\\Model\\IndexInfo`
+``$indexName`` : string| :phpclass:`MongoDB\Model\IndexInfo`
   The name or model object of the index to drop. View the existing indexes on
   the collection using the :phpmethod:`listIndexes()
-  ` method.
+  ` method.
 
 ``$options`` : array
   An array specifying the desired options.
@@ -56,7 +56,7 @@ Parameters
          .. versionadded:: 1.3
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -68,7 +68,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -122,7 +122,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::dropIndex()`
+- :phpmethod:`MongoDB\Collection::dropIndex()`
 - :doc:`/tutorial/indexes`
 - :manual:`dropIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-dropSearchIndex.txt b/source/reference/method/MongoDBCollection-dropSearchIndex.txt
index f3499273..fb6be0e0 100644
--- a/source/reference/method/MongoDBCollection-dropSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-dropSearchIndex.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::dropSearchIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::dropSearchIndex()
+.. phpmethod:: MongoDB\Collection::dropSearchIndex()
 
    Drop an Atlas Search index for the collection.
 
@@ -56,10 +56,10 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::updateSearchIndex()`
 - :manual:`dropSearchIndex ` command
   reference in the MongoDB manual
 - `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
index 59a7b212..1dd1d2a6 100644
--- a/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
+++ b/source/reference/method/MongoDBCollection-estimatedDocumentCount.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::estimatedDocumentCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::estimatedDocumentCount()
+.. phpmethod:: MongoDB\Collection::estimatedDocumentCount()
 
    Gets an estimated number of documents in the collection using collection metadata.
 
@@ -50,17 +50,17 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
@@ -97,4 +97,4 @@ See Also
 
 - :manual:`count ` command reference in the MongoDB
   manual
-- :phpmethod:`MongoDB\\Collection::countDocuments()`
+- :phpmethod:`MongoDB\Collection::countDocuments()`
diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt
index ad63ec56..592f717e 100644
--- a/source/reference/method/MongoDBCollection-explain.txt
+++ b/source/reference/method/MongoDBCollection-explain.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::explain()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::explain()
+.. phpmethod:: MongoDB\Collection::explain()
 
    Explain the given command.
 
@@ -29,7 +29,7 @@ Definition
 Parameters
 ----------
 
-``$explainable`` : :phpclass:`MongoDB\\Operation\\Explainable`
+``$explainable`` : :phpclass:`MongoDB\Operation\Explainable`
   The command to explain.
 
 ``$options`` : array
@@ -54,7 +54,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - typeMap
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 8c0ce7c2..25cca009 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::find()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::find()
+.. phpmethod:: MongoDB\Collection::find()
 
    Finds documents matching the query.
 
@@ -156,7 +156,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -171,13 +171,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - returnKey
@@ -187,7 +187,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -222,7 +222,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\Driver\Cursor ` object.
 
 Errors/Exceptions
 -----------------
@@ -357,6 +357,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOne()`
+- :phpmethod:`MongoDB\Collection::findOne()`
 - :manual:`find ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index c5230c6c..d00c5866 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOne()
+.. phpmethod:: MongoDB\Collection::findOne()
 
    Finds a single document matching the query.
 
@@ -113,7 +113,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -128,13 +128,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - returnKey
@@ -144,7 +144,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -199,7 +199,7 @@ In the following example, documents in the ``restaurants`` collection use an
 :manual:`ObjectId ` for their identifier (the default)
 and documents in the ``zips`` collection use a string. Since ObjectId is a
 special BSON type, the query criteria for selecting a restaurant must use the
-:php:`MongoDB\\BSON\\ObjectId ` class.
+:php:`MongoDB\BSON\ObjectId ` class.
 
 .. code-block:: php
 
@@ -267,6 +267,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::find()`
+- :phpmethod:`MongoDB\Collection::find()`
 - :manual:`find ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndDelete.txt b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
index b34bd578..9a7066b7 100644
--- a/source/reference/method/MongoDBCollection-findOneAndDelete.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndDelete.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOneAndDelete()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndDelete()
+.. phpmethod:: MongoDB\Collection::findOneAndDelete()
 
    Finds a single document matching the query and deletes it.
 
@@ -80,7 +80,7 @@ Parameters
          the MongoDB manual.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -96,7 +96,7 @@ Parameters
          This will be used for the returned result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -169,7 +169,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
-- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+- :phpmethod:`MongoDB\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 - :manual:`findAndModify ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 697e7371..48f6df29 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOneAndReplace()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndReplace()
+.. phpmethod:: MongoDB\Collection::findOneAndReplace()
 
    Finds a single document matching the query and replaces it.
 
@@ -97,7 +97,7 @@ Parameters
          - ``MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER``
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -119,7 +119,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -242,7 +242,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
-- :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+- :phpmethod:`MongoDB\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 - :manual:`findAndModify ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
index cbfbad16..f4077b34 100644
--- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::findOneAndUpdate()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::findOneAndUpdate()
+.. phpmethod:: MongoDB\Collection::findOneAndUpdate()
 
    Finds a single document matching the query and updates it.
 
@@ -108,7 +108,7 @@ Parameters
          - ``MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER``
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -130,7 +130,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -220,7 +220,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOneAndDelete()`
-- :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+- :phpmethod:`MongoDB\Collection::findOneAndDelete()`
+- :phpmethod:`MongoDB\Collection::findOneAndReplace()`
 - :manual:`findAndModify ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-getCollectionName.txt b/source/reference/method/MongoDBCollection-getCollectionName.txt
index 70be8a8a..9b629232 100644
--- a/source/reference/method/MongoDBCollection-getCollectionName.txt
+++ b/source/reference/method/MongoDBCollection-getCollectionName.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::getCollectionName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getCollectionName()
+.. phpmethod:: MongoDB\Collection::getCollectionName()
 
    Returns the name of this collection.
 
@@ -49,5 +49,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
diff --git a/source/reference/method/MongoDBCollection-getDatabaseName.txt b/source/reference/method/MongoDBCollection-getDatabaseName.txt
index f83632ba..5cb4902c 100644
--- a/source/reference/method/MongoDBCollection-getDatabaseName.txt
+++ b/source/reference/method/MongoDBCollection-getDatabaseName.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::getDatabaseName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getDatabaseName()
+.. phpmethod:: MongoDB\Collection::getDatabaseName()
 
    Returns the name of the database containing this collection.
 
@@ -49,6 +49,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
 
diff --git a/source/reference/method/MongoDBCollection-getManager.txt b/source/reference/method/MongoDBCollection-getManager.txt
index e0bbea08..427ed29e 100644
--- a/source/reference/method/MongoDBCollection-getManager.txt
+++ b/source/reference/method/MongoDBCollection-getManager.txt
@@ -13,11 +13,11 @@ MongoDB\\Collection::getManager()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getManager()
+.. phpmethod:: MongoDB\Collection::getManager()
 
    Accessor for the
-   :php:`MongoDB\\Driver\\Manager ` used by this
-   :phpclass:`Collection `.
+   :php:`MongoDB\Driver\Manager ` used by this
+   :phpclass:`Collection `.
 
    .. code-block:: php
 
@@ -26,10 +26,10 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\Driver\Manager ` object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::getManager()`
-- :phpmethod:`MongoDB\\Database::getManager()`
+- :phpmethod:`MongoDB\Client::getManager()`
+- :phpmethod:`MongoDB\Database::getManager()`
diff --git a/source/reference/method/MongoDBCollection-getNamespace.txt b/source/reference/method/MongoDBCollection-getNamespace.txt
index 78e2484b..4003fbd8 100644
--- a/source/reference/method/MongoDBCollection-getNamespace.txt
+++ b/source/reference/method/MongoDBCollection-getNamespace.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::getNamespace()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getNamespace()
+.. phpmethod:: MongoDB\Collection::getNamespace()
 
    Returns the :term:`namespace` of the collection. A namespace is the canonical
    name of an index or collection in MongoDB.
@@ -50,5 +50,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
-- :phpmethod:`MongoDB\\Collection::getDatabaseName()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getDatabaseName()`
diff --git a/source/reference/method/MongoDBCollection-getReadConcern.txt b/source/reference/method/MongoDBCollection-getReadConcern.txt
index 37873d0f..0ce0b482 100644
--- a/source/reference/method/MongoDBCollection-getReadConcern.txt
+++ b/source/reference/method/MongoDBCollection-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getReadConcern()
+.. phpmethod:: MongoDB\Collection::getReadConcern()
 
    Returns the read concern for this collection.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -54,7 +54,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBCollection-getReadPreference.txt b/source/reference/method/MongoDBCollection-getReadPreference.txt
index 622701e5..b14980ae 100644
--- a/source/reference/method/MongoDBCollection-getReadPreference.txt
+++ b/source/reference/method/MongoDBCollection-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getReadPreference()
+.. phpmethod:: MongoDB\Collection::getReadPreference()
 
    Returns the read preference for this collection.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -55,6 +55,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBCollection-getTypeMap.txt b/source/reference/method/MongoDBCollection-getTypeMap.txt
index 50cd91da..8cd9240c 100644
--- a/source/reference/method/MongoDBCollection-getTypeMap.txt
+++ b/source/reference/method/MongoDBCollection-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getTypeMap()
+.. phpmethod:: MongoDB\Collection::getTypeMap()
 
    Returns the type map for this collection.
 
@@ -62,6 +62,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBCollection-getWriteConcern.txt b/source/reference/method/MongoDBCollection-getWriteConcern.txt
index a7ad354d..cc3e5d94 100644
--- a/source/reference/method/MongoDBCollection-getWriteConcern.txt
+++ b/source/reference/method/MongoDBCollection-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::getWriteConcern()
+.. phpmethod:: MongoDB\Collection::getWriteConcern()
 
    Returns the write concern for this collection.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -57,7 +57,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 6ff516e7..37f7d82f 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::insertMany()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::insertMany()
+.. phpmethod:: MongoDB\Collection::insertMany()
 
    Insert multiple documents.
 
@@ -65,13 +65,13 @@ Parameters
          The default is ``true``.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -79,8 +79,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\InsertManyResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\InsertManyResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -149,8 +149,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`insert ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index ce6f0484..7a638bdc 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::insertOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::insertOne()
+.. phpmethod:: MongoDB\Collection::insertOne()
 
    Insert one document.
 
@@ -55,13 +55,13 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -69,8 +69,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\InsertOneResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\InsertOneResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -123,8 +123,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`insert ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-listIndexes.txt b/source/reference/method/MongoDBCollection-listIndexes.txt
index 84ee74b3..b65b228b 100644
--- a/source/reference/method/MongoDBCollection-listIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listIndexes.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::listIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::listIndexes()
+.. phpmethod:: MongoDB\Collection::listIndexes()
 
    Returns information for all indexes for this collection.
 
@@ -48,7 +48,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -56,8 +56,8 @@ Parameters
 Return Values
 -------------
 
-A traversable :phpclass:`MongoDB\\Model\\IndexInfoIterator`, which contains a
-:phpclass:`MongoDB\\Model\\IndexInfo` object for each index for the collection.
+A traversable :phpclass:`MongoDB\Model\IndexInfoIterator`, which contains a
+:phpclass:`MongoDB\Model\IndexInfo` object for each index for the collection.
 
 Errors/Exceptions
 -----------------
diff --git a/source/reference/method/MongoDBCollection-listSearchIndexes.txt b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
index e8db9521..cc0f840a 100644
--- a/source/reference/method/MongoDBCollection-listSearchIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::listSearchIndexes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::listSearchIndexes()
+.. phpmethod:: MongoDB\Collection::listSearchIndexes()
 
    Gets index information for one or more search indexes in the collection.
 
@@ -72,17 +72,17 @@ Parameters
          will be returned.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -107,10 +107,10 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::updateSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\Collection::updateSearchIndex()`
 - :manual:`$listSearchIndexes `
   aggregation pipeline stage reference in the MongoDB manual
 - `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-mapReduce.txt b/source/reference/method/MongoDBCollection-mapReduce.txt
index 9081c36c..afb57373 100644
--- a/source/reference/method/MongoDBCollection-mapReduce.txt
+++ b/source/reference/method/MongoDBCollection-mapReduce.txt
@@ -17,7 +17,7 @@ MongoDB\\Collection::mapReduce()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::mapReduce()
+.. phpmethod:: MongoDB\Collection::mapReduce()
 
    The :manual:`mapReduce ` command allows you to
    run map-reduce aggregation operations over a collection.
@@ -34,7 +34,7 @@ Definition
 Parameters
 ----------
 
-``$map`` : :php:`MongoDB\\BSON\\Javascript `
+``$map`` : :php:`MongoDB\BSON\Javascript `
   A JavaScript function that associates or "maps" a value with a key and emits
   the key and value pair.
 
@@ -43,7 +43,7 @@ Parameters
      Passing a Javascript instance with a scope is deprecated. Put all scope
      variables in the ``scope`` option of the MapReduce operation.
 
-``$reduce`` : :php:`MongoDB\\BSON\\Javascript `
+``$reduce`` : :php:`MongoDB\BSON\Javascript `
   A JavaScript function that "reduces" to a single object all the values
   associated with a particular key.
 
@@ -89,7 +89,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - finalize
-       - :php:`MongoDB\\BSON\\Javascript `
+       - :php:`MongoDB\BSON\Javascript `
        - Follows the reduce method and modifies the output.
 
          .. note::
@@ -117,13 +117,13 @@ Parameters
          the documents input to the map function.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
          This option will be ignored when results are output to a collection.
@@ -134,7 +134,7 @@ Parameters
          finalize functions.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -153,7 +153,7 @@ Parameters
          information.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -161,7 +161,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\MapReduceResult` object, which allows for iteration of
+A :phpclass:`MongoDB\MapReduceResult` object, which allows for iteration of
 map-reduce results irrespective of the output method (e.g. inline, collection)
 via the :php:`IteratorAggregate ` interface. It also
 provides access to command statistics.
diff --git a/source/reference/method/MongoDBCollection-rename.txt b/source/reference/method/MongoDBCollection-rename.txt
index 2b617de9..347c205b 100644
--- a/source/reference/method/MongoDBCollection-rename.txt
+++ b/source/reference/method/MongoDBCollection-rename.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::rename()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::rename()
+.. phpmethod:: MongoDB\Collection::rename()
 
    Rename the collection.
 
@@ -64,7 +64,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -74,7 +74,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -124,6 +124,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::renameCollection()`
+- :phpmethod:`MongoDB\Database::renameCollection()`
 - :manual:`renameCollection ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index 94395eff..f9bfb1b8 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::replaceOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::replaceOne()
+.. phpmethod:: MongoDB\Collection::replaceOne()
 
    Replace at most one document that matches the filter criteria. If multiple
    documents match the filter criteria, only the :term:`first `
@@ -79,7 +79,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -91,7 +91,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -99,8 +99,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\UpdateResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -152,9 +152,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`update ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt
index 07f29211..2b077220 100644
--- a/source/reference/method/MongoDBCollection-updateMany.txt
+++ b/source/reference/method/MongoDBCollection-updateMany.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::updateMany()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::updateMany()
+.. phpmethod:: MongoDB\Collection::updateMany()
 
    Update all documents that match the filter criteria.
 
@@ -88,7 +88,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -100,7 +100,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -108,8 +108,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\UpdateResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -155,9 +155,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateOne()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateOne()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`update ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt
index 2a981cb2..321103c2 100644
--- a/source/reference/method/MongoDBCollection-updateOne.txt
+++ b/source/reference/method/MongoDBCollection-updateOne.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::updateOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::updateOne()
+.. phpmethod:: MongoDB\Collection::updateOne()
 
    Update at most one document that matches the filter criteria. If multiple
    documents match the filter criteria, only the :term:`first `
@@ -90,7 +90,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -102,7 +102,7 @@ Parameters
          new document when no match is found.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/collection-option-writeConcern.rst
 
          .. include:: /includes/extracts/common-option-writeConcern-transaction.rst
@@ -110,8 +110,8 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\UpdateResult` object, which encapsulates a
-:php:`MongoDB\\Driver\\WriteResult ` object.
+A :phpclass:`MongoDB\UpdateResult` object, which encapsulates a
+:php:`MongoDB\Driver\WriteResult ` object.
 
 Errors/Exceptions
 -----------------
@@ -157,9 +157,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::replaceOne()`
-- :phpmethod:`MongoDB\\Collection::updateMany()`
-- :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\Collection::replaceOne()`
+- :phpmethod:`MongoDB\Collection::updateMany()`
+- :phpmethod:`MongoDB\Collection::bulkWrite()`
 - :doc:`/tutorial/crud`
 - :manual:`update ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBCollection-updateSearchIndex.txt b/source/reference/method/MongoDBCollection-updateSearchIndex.txt
index bf165910..63b62167 100644
--- a/source/reference/method/MongoDBCollection-updateSearchIndex.txt
+++ b/source/reference/method/MongoDBCollection-updateSearchIndex.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::updateSearchIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::updateSearchIndex()
+.. phpmethod:: MongoDB\Collection::updateSearchIndex()
 
    Update an Atlas Search index for the collection.
 
@@ -71,10 +71,10 @@ Behavior
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::createSearchIndexes()`
-- :phpmethod:`MongoDB\\Collection::dropSearchIndex()`
-- :phpmethod:`MongoDB\\Collection::listSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::createSearchIndex()`
+- :phpmethod:`MongoDB\Collection::createSearchIndexes()`
+- :phpmethod:`MongoDB\Collection::dropSearchIndex()`
+- :phpmethod:`MongoDB\Collection::listSearchIndexes()`
 - :manual:`updateSearchIndex ` command
   reference in the MongoDB manual
 - `Atlas Search `__ documentation in the MongoDB Manual
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
index c54123bd..0722b6d7 100644
--- a/source/reference/method/MongoDBCollection-watch.txt
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -15,7 +15,7 @@ MongoDB\\Collection::watch()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::watch()
+.. phpmethod:: MongoDB\Collection::watch()
 
    Executes a :manual:`change stream ` operation on the
    collection. The change stream can be watched for collection-level changes.
@@ -77,11 +77,11 @@ Parameters
        - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/collection-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/collection-option-readPreference.rst
 
          This is used for both the initial change stream aggregation and for
@@ -92,7 +92,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-resumeAfter.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - showExpandedEvents
@@ -104,7 +104,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-startAfter.rst
 
      * - startAtOperationTime
-       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - :php:`MongoDB\BSON\TimestampInterface `
        - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
      * - typeMap
@@ -114,7 +114,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+A :phpclass:`MongoDB\ChangeStream` object, which allows for iteration of
 events in the change stream via the :php:`Iterator ` interface.
 
 Errors/Exceptions
@@ -193,8 +193,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::watch()`
-- :phpmethod:`MongoDB\\Database::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
+- :phpmethod:`MongoDB\Database::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index 293b093a..d942b8cc 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -13,7 +13,7 @@ MongoDB\\Collection::withOptions()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::withOptions()
+.. phpmethod:: MongoDB\Collection::withOptions()
 
    Returns a clone of the Collection object, but with different options.
 
@@ -36,12 +36,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the original collection's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the original collection's read preference.
 
@@ -53,14 +53,14 @@ Parameters
          to PHP values. Defaults to the original collection's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults to
          the original collection's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Errors/Exceptions
 -----------------
@@ -86,4 +86,4 @@ preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::__construct()`
+- :phpmethod:`MongoDB\Collection::__construct()`
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
index 09173500..c4d2524f 100644
--- a/source/reference/method/MongoDBCollection__construct.txt
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\Collection::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Collection::__construct()
+.. phpmethod:: MongoDB\Collection::__construct()
 
-   Constructs a new :phpclass:`Collection ` instance.
+   Constructs a new :phpclass:`Collection ` instance.
 
    .. code-block:: php
 
@@ -28,7 +28,7 @@ Definition
 
    This constructor has the following parameters:
 
-``$manager`` : :php:`MongoDB\\Driver\\Manager `
+``$manager`` : :php:`MongoDB\Driver\Manager `
   The :php:`Manager ` instance from the driver. The
   manager maintains connections between the driver and your MongoDB instances.
 
@@ -50,12 +50,12 @@ Definition
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the manager's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the manager's read preference.
 
@@ -75,7 +75,7 @@ Definition
             ]
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults
          to the manager's write concern.
 
@@ -88,9 +88,9 @@ Behavior
 --------
 
 If you construct a Collection explicitly, the Collection inherits any options
-from the :php:`MongoDB\\Driver\\Manager ` object.
-If you select the Collection from a :phpclass:`Client ` or
-:phpclass:`Database ` object, the Collection inherits its
+from the :php:`MongoDB\Driver\Manager ` object.
+If you select the Collection from a :phpclass:`Client ` or
+:phpclass:`Database ` object, the Collection inherits its
 options from that object.
 
 .. todo: add an example
@@ -98,7 +98,7 @@ options from that object.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::withOptions()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
-- :phpmethod:`MongoDB\\Database::selectCollection()`
-- :phpmethod:`MongoDB\\Database::__get()`
+- :phpmethod:`MongoDB\Collection::withOptions()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
+- :phpmethod:`MongoDB\Database::__get()`
diff --git a/source/reference/method/MongoDBDatabase-aggregate.txt b/source/reference/method/MongoDBDatabase-aggregate.txt
index 96d409ae..66546315 100644
--- a/source/reference/method/MongoDBDatabase-aggregate.txt
+++ b/source/reference/method/MongoDBDatabase-aggregate.txt
@@ -15,12 +15,12 @@ MongoDB\\Database::aggregate()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::aggregate()
+.. phpmethod:: MongoDB\Database::aggregate()
 
    Runs a specified :manual:`admin/diagnostic pipeline
    ` which does
    not require an underlying collection. For aggregations on collection data,
-   see :phpmethod:`MongoDB\\Collection::aggregate()`.
+   see :phpmethod:`MongoDB\Collection::aggregate()`.
 
    .. code-block:: php
 
@@ -105,15 +105,15 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/database-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/database-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -121,13 +121,13 @@ Parameters
        - .. include:: /includes/extracts/database-option-typeMap.rst
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` or
+A :php:`MongoDB\Driver\Cursor ` or
 :php:`ArrayIterator ` object. In both cases, the return value
 will be :php:`Traversable `.
 
@@ -164,7 +164,7 @@ running command operations.
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::aggregate()`
+- :phpmethod:`MongoDB\Collection::aggregate()`
 - :manual:`aggregate ` command reference in the
   MongoDB manual
 - :manual:`Aggregation Pipeline ` documentation in
diff --git a/source/reference/method/MongoDBDatabase-command.txt b/source/reference/method/MongoDBDatabase-command.txt
index 50ebfe79..86243d73 100644
--- a/source/reference/method/MongoDBDatabase-command.txt
+++ b/source/reference/method/MongoDBDatabase-command.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::command()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::command()
+.. phpmethod:: MongoDB\Database::command()
 
    Execute a :manual:`command ` on the database. This is
    generally used to execute commands that do not have a corresponding helper
@@ -44,11 +44,11 @@ Parameters
        - Description
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/database-option-readPreference.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -60,7 +60,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\Driver\Cursor ` object.
 
 Errors/Exceptions
 -----------------
@@ -102,7 +102,7 @@ Some database commands return a cursor with multiple results. The following
 example executes :manual:`listCollections `,
 which returns a cursor containing a result document for each collection in the
 ``test`` database. Note that this example is illustrative; applications would
-generally use :phpmethod:`MongoDB\\Database::listCollections()` in practice.
+generally use :phpmethod:`MongoDB\Database::listCollections()` in practice.
 
 .. code-block:: php
 
@@ -168,6 +168,6 @@ See Also
 
 - :doc:`/tutorial/commands`
 - :manual:`Database Commands ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\Cursor `
-- :php:`MongoDB\\Driver\\Manager::executeCommand()
+- :php:`MongoDB\Driver\Cursor `
+- :php:`MongoDB\Driver\Manager::executeCommand()
   `
diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt
index 2351f5d3..3c45debc 100644
--- a/source/reference/method/MongoDBDatabase-createCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::createCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::createCollection()
+.. phpmethod:: MongoDB\Database::createCollection()
 
    Explicitly creates a collection.
 
@@ -27,7 +27,7 @@ Definition
    MongoDB creates collections implicitly when you first reference the
    collection in a command, such as when inserting a document into a new
    collection. You may also explicitly create a collection with specific options
-   using the :phpmethod:`MongoDB\\Database::createCollection()` method, or using
+   using the :phpmethod:`MongoDB\Database::createCollection()` method, or using
    :manual:`db.createCollection() ` in
    the MongoDB shell.
 
@@ -195,7 +195,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -322,7 +322,7 @@ Parameters
             .. versionadded:: 1.13
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
diff --git a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
index 390f99c6..e6a266fb 100644
--- a/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
+++ b/source/reference/method/MongoDBDatabase-createEncryptedCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::createEncryptedCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::createEncryptedCollection()
+.. phpmethod:: MongoDB\Database::createEncryptedCollection()
 
    Explicitly creates an encrypted collection.
 
@@ -31,13 +31,13 @@ Definition
 
    This method will automatically create data keys for any encrypted fields
    where ``keyId`` is ``null``. Data keys will be created using
-   :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `
+   :php:`MongoDB\Driver\ClientEncryption::createDataKey() `
    and the provided ``$kmsProvider`` and ``$masterKey`` parameters. A copy of
    the modified ``encryptedFields`` option will be returned in addition to the
    result from creating the collection.
 
    This method does not affect any auto encryption settings on existing
-   :phpclass:`MongoDB\\Client` objects. Users must configure auto encryption
+   :phpclass:`MongoDB\Client` objects. Users must configure auto encryption
    after creating the encrypted collection with ``createEncryptedCollection()``.
 
 Parameters
@@ -46,18 +46,18 @@ Parameters
 ``$collectionName`` : string
   The name of the encrypted collection to create.
 
-``$clientEncryption`` : :php:`MongoDB\\Driver\\ClientEncryption `
+``$clientEncryption`` : :php:`MongoDB\Driver\ClientEncryption `
   The ClientEncryption object used to create data keys.
 
 ``$kmsProvider`` : string
   KMS provider (e.g. "local", "aws") that will be used to encrypt new data keys.
   This corresponds to the ``$kmsProvider`` parameter for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+  :php:`MongoDB\Driver\ClientEncryption::createDataKey() `.
 
 ``$masterKey`` : array|null
   KMS-specific key options that will be used to encrypt new data keys. This
   corresponds to the ``masterKey`` option for
-  :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `.
+  :php:`MongoDB\Driver\ClientEncryption::createDataKey() `.
 
   If ``$kmsProvider`` is "local", this should be ``null``.
 
@@ -65,7 +65,7 @@ Parameters
   An array specifying the desired options.
 
   The ``$options`` parameter supports the same options as
-  :phpmethod:`MongoDB\\Database::createCollection()`. The ``encryptedFields``
+  :phpmethod:`MongoDB\Database::createCollection()`. The ``encryptedFields``
   option is required.
 
 Return Values
@@ -79,7 +79,7 @@ option.
 Errors/Exceptions
 -----------------
 
-:phpclass:`MongoDB\\Exception\\CreateEncryptedCollectionException` if any error
+:phpclass:`MongoDB\Exception\CreateEncryptedCollectionException` if any error
 is encountered creating data keys or the collection. The original exception and
 modified ``encryptedFields`` option can be accessed via the ``getPrevious()``
 and ``getEncryptedFields()`` methods, respectively.
@@ -126,11 +126,11 @@ an encrypted string field.
 If the encrypted collection was successfully created, ``$result`` will contain
 the response document from the ``create`` command and
 ``$encryptedFields['fields'][0]['keyId']`` will contain a
-:php:`MongoDB\\BSON\\Binary ` object with subtype 4
+:php:`MongoDB\BSON\Binary ` object with subtype 4
 (i.e. UUID).
 
 The modified ``encryptedFields`` option can then be used to construct a new
-:phpclass:`MongoDB\\Client` with auto encryption enabled.
+:phpclass:`MongoDB\Client` with auto encryption enabled.
 
 .. code-block:: php
 
@@ -155,8 +155,8 @@ The modified ``encryptedFields`` option can then be used to construct a new
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
-- :phpmethod:`MongoDB\\Client::createClientEncryption()`
-- :php:`MongoDB\\Driver\\ClientEncryption::createDataKey() `
+- :phpmethod:`MongoDB\Database::createCollection()`
+- :phpmethod:`MongoDB\Client::createClientEncryption()`
+- :php:`MongoDB\Driver\ClientEncryption::createDataKey() `
 - :manual:`create ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBDatabase-drop.txt b/source/reference/method/MongoDBDatabase-drop.txt
index 457fad1a..da1c8ba0 100644
--- a/source/reference/method/MongoDBDatabase-drop.txt
+++ b/source/reference/method/MongoDBDatabase-drop.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::drop()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::drop()
+.. phpmethod:: MongoDB\Database::drop()
 
    Drop the database.
 
@@ -44,7 +44,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -56,7 +56,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
@@ -105,6 +105,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::dropDatabase()`
+- :phpmethod:`MongoDB\Client::dropDatabase()`
 - :manual:`dropDatabase ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-dropCollection.txt b/source/reference/method/MongoDBDatabase-dropCollection.txt
index 018f3cca..71beda83 100644
--- a/source/reference/method/MongoDBDatabase-dropCollection.txt
+++ b/source/reference/method/MongoDBDatabase-dropCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::dropCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::dropCollection()
+.. phpmethod:: MongoDB\Database::dropCollection()
 
    Drop a collection within the current database.
 
@@ -70,7 +70,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -82,7 +82,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
@@ -133,6 +133,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::drop()`
+- :phpmethod:`MongoDB\Collection::drop()`
 - :manual:`drop ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBDatabase-getDatabaseName.txt b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
index 6e3abd96..fcbd0ce8 100644
--- a/source/reference/method/MongoDBDatabase-getDatabaseName.txt
+++ b/source/reference/method/MongoDBDatabase-getDatabaseName.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::getDatabaseName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getDatabaseName()
+.. phpmethod:: MongoDB\Database::getDatabaseName()
 
    Returns the name of this database.
 
diff --git a/source/reference/method/MongoDBDatabase-getManager.txt b/source/reference/method/MongoDBDatabase-getManager.txt
index 72a2b057..91e013ae 100644
--- a/source/reference/method/MongoDBDatabase-getManager.txt
+++ b/source/reference/method/MongoDBDatabase-getManager.txt
@@ -13,11 +13,11 @@ MongoDB\\Database::getManager()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getManager()
+.. phpmethod:: MongoDB\Database::getManager()
 
    Accessor for the
-   :php:`MongoDB\\Driver\\Manager ` used by this
-   :phpclass:`Database `.
+   :php:`MongoDB\Driver\Manager ` used by this
+   :phpclass:`Database `.
 
    .. code-block:: php
 
@@ -26,10 +26,10 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Manager ` object.
+A :php:`MongoDB\Driver\Manager ` object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Client::getManager()`
-- :phpmethod:`MongoDB\\Collection::getManager()`
+- :phpmethod:`MongoDB\Client::getManager()`
+- :phpmethod:`MongoDB\Collection::getManager()`
diff --git a/source/reference/method/MongoDBDatabase-getReadConcern.txt b/source/reference/method/MongoDBDatabase-getReadConcern.txt
index 56568aa4..4915fcc4 100644
--- a/source/reference/method/MongoDBDatabase-getReadConcern.txt
+++ b/source/reference/method/MongoDBDatabase-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getReadConcern()
+.. phpmethod:: MongoDB\Database::getReadConcern()
 
    Returns the read concern for this database.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -54,7 +54,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadConcern()`
diff --git a/source/reference/method/MongoDBDatabase-getReadPreference.txt b/source/reference/method/MongoDBDatabase-getReadPreference.txt
index 5001455c..633633eb 100644
--- a/source/reference/method/MongoDBDatabase-getReadPreference.txt
+++ b/source/reference/method/MongoDBDatabase-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getReadPreference()
+.. phpmethod:: MongoDB\Database::getReadPreference()
 
    Returns the read preference for this database.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -55,6 +55,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getReadPreference()`
diff --git a/source/reference/method/MongoDBDatabase-getTypeMap.txt b/source/reference/method/MongoDBDatabase-getTypeMap.txt
index d06c6777..a30f4f0d 100644
--- a/source/reference/method/MongoDBDatabase-getTypeMap.txt
+++ b/source/reference/method/MongoDBDatabase-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getTypeMap()
+.. phpmethod:: MongoDB\Database::getTypeMap()
 
    Returns the type map for this database.
 
@@ -62,6 +62,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getTypeMap()`
diff --git a/source/reference/method/MongoDBDatabase-getWriteConcern.txt b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
index 55ea09f4..40419a4b 100644
--- a/source/reference/method/MongoDBDatabase-getWriteConcern.txt
+++ b/source/reference/method/MongoDBDatabase-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::getWriteConcern()
+.. phpmethod:: MongoDB\Database::getWriteConcern()
 
    Returns the write concern for this database.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -57,7 +57,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getWriteConcern()`
diff --git a/source/reference/method/MongoDBDatabase-listCollectionNames.txt b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
index 53814f72..d094028d 100644
--- a/source/reference/method/MongoDBDatabase-listCollectionNames.txt
+++ b/source/reference/method/MongoDBDatabase-listCollectionNames.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::listCollectionNames()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::listCollectionNames()
+.. phpmethod:: MongoDB\Database::listCollectionNames()
 
    Returns names for all collections in this database.
 
@@ -68,7 +68,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
 Return Values
@@ -134,7 +134,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::listCollections()`
+- :phpmethod:`MongoDB\Database::listCollections()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
 - `Enumerating Collections
diff --git a/source/reference/method/MongoDBDatabase-listCollections.txt b/source/reference/method/MongoDBDatabase-listCollections.txt
index d66b6a5f..511b8995 100644
--- a/source/reference/method/MongoDBDatabase-listCollections.txt
+++ b/source/reference/method/MongoDBDatabase-listCollections.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::listCollections()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::listCollections()
+.. phpmethod:: MongoDB\Database::listCollections()
 
    Returns information for all collections in this database.
 
@@ -66,7 +66,7 @@ Parameters
        - .. include:: /includes/extracts/common-option-maxTimeMS.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -74,8 +74,8 @@ Parameters
 Return Values
 -------------
 
-A traversable :phpclass:`MongoDB\\Model\\CollectionInfoIterator`, which contains
-a :phpclass:`MongoDB\\Model\\CollectionInfo` object for each collection in the
+A traversable :phpclass:`MongoDB\Model\CollectionInfoIterator`, which contains
+a :phpclass:`MongoDB\Model\CollectionInfo` object for each collection in the
 database.
 
 Example
@@ -160,7 +160,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::listCollectionNames()`
+- :phpmethod:`MongoDB\Database::listCollectionNames()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
 - `Enumerating Collections
diff --git a/source/reference/method/MongoDBDatabase-modifyCollection.txt b/source/reference/method/MongoDBDatabase-modifyCollection.txt
index 0a756b01..6aa036ff 100644
--- a/source/reference/method/MongoDBDatabase-modifyCollection.txt
+++ b/source/reference/method/MongoDBDatabase-modifyCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::modifyCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::modifyCollection()
+.. phpmethod:: MongoDB\Database::modifyCollection()
 
    Modifies a collection or view according to the specified
    ``$collectionOptions``.
@@ -57,7 +57,7 @@ Parameters
          .. versionadded:: 1.13
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -67,7 +67,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
diff --git a/source/reference/method/MongoDBDatabase-renameCollection.txt b/source/reference/method/MongoDBDatabase-renameCollection.txt
index 778dc10a..8c07952d 100644
--- a/source/reference/method/MongoDBDatabase-renameCollection.txt
+++ b/source/reference/method/MongoDBDatabase-renameCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::renameCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::renameCollection()
+.. phpmethod:: MongoDB\Database::renameCollection()
 
    Rename a collection within the current database.
 
@@ -68,7 +68,7 @@ Parameters
          collection. The default value is ``false``.
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - typeMap
@@ -78,7 +78,7 @@ Parameters
          This will be used for the returned command result document.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - .. include:: /includes/extracts/database-option-writeConcern.rst
 
 Return Values
@@ -126,6 +126,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::rename()`
+- :phpmethod:`MongoDB\Collection::rename()`
 - :manual:`renameCollection ` command reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 887d4a4d..854298e0 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::selectCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::selectCollection()
+.. phpmethod:: MongoDB\Database::selectCollection()
 
    Selects a collection within the database.
 
@@ -42,12 +42,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
          the database's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for collection operations. Defaults
          to the database's read preference.
 
@@ -57,14 +57,14 @@ Parameters
          database's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for collection operations. Defaults to
          the database's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Errors/Exceptions
 -----------------
@@ -75,7 +75,7 @@ Behavior
 --------
 
 The selected collection inherits options such as read preference and type
-mapping from the :phpclass:`Database ` object. Options may be
+mapping from the :phpclass:`Database ` object. Options may be
 overridden via the ``$options`` parameter.
 
 Example
@@ -110,6 +110,6 @@ database with a custom read preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::__get()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
-- :phpmethod:`MongoDB\\Collection::__construct()`
+- :phpmethod:`MongoDB\Database::__get()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
+- :phpmethod:`MongoDB\Collection::__construct()`
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index c2154a53..7128c8fc 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::selectGridFSBucket()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::selectGridFSBucket()
+.. phpmethod:: MongoDB\Database::selectGridFSBucket()
 
    Selects a GridFS bucket within the database.
 
@@ -53,12 +53,12 @@ Parameters
          .. versionadded: 1.4
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for bucket operations. Defaults to the
          database's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for bucket operations. Defaults to
          the database's read concern.
 
@@ -68,14 +68,14 @@ Parameters
          database's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for bucket operations. Defaults to the
          database's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\GridFS\\Bucket` object.
+A :phpclass:`MongoDB\GridFS\Bucket` object.
 
 Errors/Exceptions
 -----------------
@@ -86,7 +86,7 @@ Behavior
 --------
 
 The selected bucket inherits options such as read preference and type
-mapping from the :phpclass:`Database ` object. Options may be
+mapping from the :phpclass:`Database ` object. Options may be
 overridden via the ``$options`` parameter.
 
 Example
@@ -120,4 +120,4 @@ database with a custom read preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::__construct()`
+- :phpmethod:`MongoDB\GridFS\Bucket::__construct()`
diff --git a/source/reference/method/MongoDBDatabase-watch.txt b/source/reference/method/MongoDBDatabase-watch.txt
index c79656ec..396e5cfd 100644
--- a/source/reference/method/MongoDBDatabase-watch.txt
+++ b/source/reference/method/MongoDBDatabase-watch.txt
@@ -15,7 +15,7 @@ MongoDB\\Database::watch()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::watch()
+.. phpmethod:: MongoDB\Database::watch()
 
    Executes a :manual:`change stream ` operation on the
    database. The change stream can be watched for database-level changes.
@@ -73,11 +73,11 @@ Parameters
        - .. include:: /includes/extracts/watch-option-maxAwaitTimeMS.rst
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/database-option-readConcern.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/database-option-readPreference.rst
 
          This is used for both the initial change stream aggregation and for
@@ -88,7 +88,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-resumeAfter.rst
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
      * - showExpandedEvents
@@ -100,7 +100,7 @@ Parameters
        - .. include:: /includes/extracts/watch-option-startAfter.rst
 
      * - startAtOperationTime
-       - :php:`MongoDB\\BSON\\TimestampInterface `
+       - :php:`MongoDB\BSON\TimestampInterface `
        - .. include:: /includes/extracts/watch-option-startAtOperationTime.rst
 
      * - typeMap
@@ -110,7 +110,7 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\ChangeStream` object, which allows for iteration of
+A :phpclass:`MongoDB\ChangeStream` object, which allows for iteration of
 events in the change stream via the :php:`Iterator ` interface.
 
 Errors/Exceptions
@@ -188,8 +188,8 @@ script was iterating the change stream, the output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::watch()`
-- :phpmethod:`MongoDB\\Client::watch()`
+- :phpmethod:`MongoDB\Collection::watch()`
+- :phpmethod:`MongoDB\Client::watch()`
 - :manual:`Aggregation Pipeline ` documentation in
   the MongoDB Manual
 - :manual:`Change Streams ` documentation in the MongoDB manual
diff --git a/source/reference/method/MongoDBDatabase-withOptions.txt b/source/reference/method/MongoDBDatabase-withOptions.txt
index fc5d88ec..f601a977 100644
--- a/source/reference/method/MongoDBDatabase-withOptions.txt
+++ b/source/reference/method/MongoDBDatabase-withOptions.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::withOptions()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::withOptions()
+.. phpmethod:: MongoDB\Database::withOptions()
 
    Returns a clone of the Database object, but with different options.
 
@@ -36,12 +36,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for database operations. Defaults to
          the original database's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for database operations. Defaults to
          the original database's read preference.
 
@@ -53,14 +53,14 @@ Parameters
          to PHP values. Defaults to the original database's type map.
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for database operations. Defaults to
          the original database's write concern.
 
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Database` object.
+A :phpclass:`MongoDB\Database` object.
 
 Errors/Exceptions
 -----------------
@@ -86,4 +86,4 @@ preference:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::__construct()`
+- :phpmethod:`MongoDB\Database::__construct()`
diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt
index 0a715e99..cf52a134 100644
--- a/source/reference/method/MongoDBDatabase__construct.txt
+++ b/source/reference/method/MongoDBDatabase__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\Database::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::__construct()
+.. phpmethod:: MongoDB\Database::__construct()
 
-   Constructs a new :phpclass:`Database ` instance.
+   Constructs a new :phpclass:`Database ` instance.
 
    .. code-block:: php
 
@@ -28,7 +28,7 @@ Definition
 Parameters
 ----------
 
-``$manager`` : :php:`MongoDB\\Driver\\Manager `
+``$manager`` : :php:`MongoDB\Driver\Manager `
   The :php:`Manager ` instance from the driver. The
   manager maintains connections between the driver and your MongoDB instances.
 
@@ -47,12 +47,12 @@ Parameters
        - Description
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for database operations. Defaults to
          the manager's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for database operations. Defaults to
          the manager's read preference.
 
@@ -72,7 +72,7 @@ Parameters
             ]
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for database operations. Defaults to
          the manager's write concern.
 
@@ -85,13 +85,13 @@ Behavior
 --------
 
 If you construct a Database explicitly, the Database inherits any options from
-the :php:`MongoDB\\Driver\\Manager ` object. If
-you select the Database from a :phpclass:`Client ` object, the
+the :php:`MongoDB\Driver\Manager ` object. If
+you select the Database from a :phpclass:`Client ` object, the
 Database inherits its options from that object.
 
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::withOptions()`
-- :phpmethod:`MongoDB\\Client::selectDatabase()`
-- :phpmethod:`MongoDB\\Client::__get()`
+- :phpmethod:`MongoDB\Database::withOptions()`
+- :phpmethod:`MongoDB\Client::selectDatabase()`
+- :phpmethod:`MongoDB\Client::__get()`
diff --git a/source/reference/method/MongoDBDatabase__get.txt b/source/reference/method/MongoDBDatabase__get.txt
index c888a716..e71c42d4 100644
--- a/source/reference/method/MongoDBDatabase__get.txt
+++ b/source/reference/method/MongoDBDatabase__get.txt
@@ -13,7 +13,7 @@ MongoDB\\Database::__get()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Database::__get()
+.. phpmethod:: MongoDB\Database::__get()
 
    Select a collection within the database.
 
@@ -30,14 +30,14 @@ Parameters
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object.
+A :phpclass:`MongoDB\Collection` object.
 
 Behavior
 --------
 
 The selected collection inherits options such as read preference and type
-mapping from the :phpclass:`Database ` object. If you wish to
-override any options, use the :phpmethod:`MongoDB\\Database::selectCollection()`
+mapping from the :phpclass:`Database ` object. If you wish to
+override any options, use the :phpmethod:`MongoDB\Database::selectCollection()`
 method.
 
 .. note::
@@ -45,7 +45,7 @@ method.
    To select collections whose names contain special characters, such as
    ``.``, use complex syntax, as in ``$database->{'that.database'}``.
 
-   Alternatively, :phpmethod:`MongoDB\\Database::selectCollection()` supports
+   Alternatively, :phpmethod:`MongoDB\Database::selectCollection()` supports
    selecting collections whose names contain special characters.
 
 Examples
@@ -66,6 +66,6 @@ collections from the ``test`` database:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::selectCollection()`
-- :phpmethod:`MongoDB\\Client::selectCollection()`
+- :phpmethod:`MongoDB\Database::selectCollection()`
+- :phpmethod:`MongoDB\Client::selectCollection()`
 - :php:`Property Overloading ` in the PHP Manual
diff --git a/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt b/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
index dcda2574..02810569 100644
--- a/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
+++ b/source/reference/method/MongoDBDeleteResult-getDeletedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\DeleteResult::getDeletedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\DeleteResult::getDeletedCount()
+.. phpmethod:: MongoDB\DeleteResult::getDeletedCount()
 
    Return the number of documents that were deleted.
 
@@ -36,5 +36,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getDeletedCount()
+- :php:`MongoDB\Driver\WriteResult::getDeletedCount()
   `
diff --git a/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt b/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
index a82fa523..5e3cbb4e 100644
--- a/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBDeleteResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\DeleteResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\DeleteResult::isAcknowledged()
+.. phpmethod:: MongoDB\DeleteResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBGridFSBucket-delete.txt b/source/reference/method/MongoDBGridFSBucket-delete.txt
index 731fb4e4..9c876c60 100644
--- a/source/reference/method/MongoDBGridFSBucket-delete.txt
+++ b/source/reference/method/MongoDBGridFSBucket-delete.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::delete()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::delete()
+.. phpmethod:: MongoDB\GridFS\Bucket::delete()
 
    Delete a file and its chunks from the GridFS bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
index 917f03b5..217fc262 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::downloadToStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::downloadToStream()
 
    Selects a GridFS file by its ``_id`` and copies its contents to a writable
    stream.
@@ -68,6 +68,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
index 8bd4a1d6..d520793a 100644
--- a/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-downloadToStreamByName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::downloadToStreamByName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::downloadToStreamByName()
+.. phpmethod:: MongoDB\GridFS\Bucket::downloadToStreamByName()
 
    Selects a GridFS file by its ``filename`` and copies its contents to a
    writable stream.
@@ -99,6 +99,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-drop.txt b/source/reference/method/MongoDBGridFSBucket-drop.txt
index 53a10091..324db854 100644
--- a/source/reference/method/MongoDBGridFSBucket-drop.txt
+++ b/source/reference/method/MongoDBGridFSBucket-drop.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::drop()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::drop()
+.. phpmethod:: MongoDB\GridFS\Bucket::drop()
 
    Drops the files and chunks collections associated with this GridFS bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index d112dd66..bfd57089 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::find()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::find()
+.. phpmethod:: MongoDB\GridFS\Bucket::find()
 
    Finds documents from the GridFS bucket's files collection matching the query.
 
@@ -156,7 +156,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -171,13 +171,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/bucket-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/bucket-option-readPreference.rst
 
      * - returnKey
@@ -187,7 +187,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -222,7 +222,7 @@ Parameters
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\Cursor ` object.
+A :php:`MongoDB\Driver\Cursor ` object.
 
 Errors/Exceptions
 -----------------
@@ -285,5 +285,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::find()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::findOne()`
+- :phpmethod:`MongoDB\Collection::find()`
+- :phpmethod:`MongoDB\GridFS\Bucket::findOne()`
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
index 1ff9f258..89877e3a 100644
--- a/source/reference/method/MongoDBGridFSBucket-findOne.txt
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::findOne()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::findOne()
+.. phpmethod:: MongoDB\GridFS\Bucket::findOne()
 
    Finds a single document from the GridFS bucket's files collection matching
    the query.
@@ -114,7 +114,7 @@ Parameters
 
             { ts: { $gte:  } }
 
-         The :php:`MongoDB\\BSON\\Timestamp `
+         The :php:`MongoDB\BSON\Timestamp `
          class reference describes how to represent MongoDB's BSON timestamp
          type with PHP.
 
@@ -129,13 +129,13 @@ Parameters
          the MongoDB manual.
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - .. include:: /includes/extracts/bucket-option-readConcern.rst
 
          .. include:: /includes/extracts/common-option-readConcern-transaction.rst
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - .. include:: /includes/extracts/bucket-option-readPreference.rst
 
      * - returnKey
@@ -145,7 +145,7 @@ Parameters
          .. versionadded:: 1.2
 
      * - session
-       - :php:`MongoDB\\Driver\\Session `
+       - :php:`MongoDB\Driver\Session `
        - .. include:: /includes/extracts/common-option-session.rst
 
          .. versionadded:: 1.3
@@ -236,5 +236,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::findOne()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::find()`
+- :phpmethod:`MongoDB\Collection::findOne()`
+- :phpmethod:`MongoDB\GridFS\Bucket::find()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
index 52ea9249..96a61c4d 100644
--- a/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getBucketName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getBucketName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getBucketName()
+.. phpmethod:: MongoDB\GridFS\Bucket::getBucketName()
 
    Returns the name of this bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
index 16116e56..2a9ff6da 100644
--- a/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getChunkSizeBytes.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getChunkSizeBytes()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getChunkSizeBytes()
+.. phpmethod:: MongoDB\GridFS\Bucket::getChunkSizeBytes()
 
    Returns the chunk size of this bucket in bytes.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
index 36dbd8a5..ce1c97b9 100644
--- a/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getChunksCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getChunksCollection()
+.. phpmethod:: MongoDB\GridFS\Bucket::getChunksCollection()
 
    Returns the chunks collection used by the bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object for the chunks collection.
+A :phpclass:`MongoDB\Collection` object for the chunks collection.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
index 0b6dd8e0..22703fdd 100644
--- a/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getDatabaseName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getDatabaseName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getDatabaseName()
+.. phpmethod:: MongoDB\GridFS\Bucket::getDatabaseName()
 
    Returns the name of the database containing this bucket.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
index fa8625f9..9dc275ca 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileDocumentForStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getFileDocumentForStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileDocumentForStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::getFileDocumentForStream()
 
    Gets the file document of the GridFS file associated with a stream.
 
@@ -78,4 +78,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileIdForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileIdForStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
index b42ab19b..0107b3d8 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFileIdForStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::getFileIdForStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getFileIdForStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::getFileIdForStream()
 
    Gets the file document's ID of the GridFS file associated with a stream.
 
@@ -69,4 +69,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::getFileDocumentForStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::getFileDocumentForStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
index 57813ad6..510cfad1 100644
--- a/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getFilesCollection()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getFilesCollection()
+.. phpmethod:: MongoDB\GridFS\Bucket::getFilesCollection()
 
    Returns the files collection used by the bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :phpclass:`MongoDB\\Collection` object for the files collection.
+A :phpclass:`MongoDB\Collection` object for the files collection.
 
 Examples
 --------
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
index 7b12c051..d1d4c610 100644
--- a/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getReadConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getReadConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getReadConcern()
+.. phpmethod:: MongoDB\GridFS\Bucket::getReadConcern()
 
    Returns the read concern for this GridFS bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadConcern ` object.
+A :php:`MongoDB\Driver\ReadConcern ` object.
 
 Example
 -------
@@ -55,7 +55,7 @@ See Also
 --------
 
 - :manual:`Read Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\ReadConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getReadConcern()`
-- :phpmethod:`MongoDB\\Collection::getReadConcern()`
-- :phpmethod:`MongoDB\\Database::getReadConcern()`
+- :php:`MongoDB\Driver\ReadConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getReadConcern()`
+- :phpmethod:`MongoDB\Collection::getReadConcern()`
+- :phpmethod:`MongoDB\Database::getReadConcern()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
index 532a6e23..6843cc93 100644
--- a/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getReadPreference.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getReadPreference()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getReadPreference()
+.. phpmethod:: MongoDB\GridFS\Bucket::getReadPreference()
 
    Returns the read preference for this GridFS bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\ReadPreference `
+A :php:`MongoDB\Driver\ReadPreference `
 object.
 
 Example
@@ -56,6 +56,6 @@ See Also
 --------
 
 - :manual:`Read Preference ` in the MongoDB manual
-- :phpmethod:`MongoDB\\Client::getReadPreference()`
-- :phpmethod:`MongoDB\\Collection::getReadPreference()`
-- :phpmethod:`MongoDB\\Database::getReadPreference()`
+- :phpmethod:`MongoDB\Client::getReadPreference()`
+- :phpmethod:`MongoDB\Collection::getReadPreference()`
+- :phpmethod:`MongoDB\Database::getReadPreference()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
index 7d9a309a..1005f2a2 100644
--- a/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getTypeMap.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getTypeMap()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getTypeMap()
+.. phpmethod:: MongoDB\GridFS\Bucket::getTypeMap()
 
    Returns the type map for this GridFS bucket.
 
@@ -63,6 +63,6 @@ See Also
 --------
 
 - :doc:`/reference/bson`
-- :phpmethod:`MongoDB\\Client::getTypeMap()`
-- :phpmethod:`MongoDB\\Collection::getTypeMap()`
-- :phpmethod:`MongoDB\\Database::getTypeMap()`
+- :phpmethod:`MongoDB\Client::getTypeMap()`
+- :phpmethod:`MongoDB\Collection::getTypeMap()`
+- :phpmethod:`MongoDB\Database::getTypeMap()`
diff --git a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
index 77303b92..21e535af 100644
--- a/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
+++ b/source/reference/method/MongoDBGridFSBucket-getWriteConcern.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::getWriteConcern()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::getWriteConcern()
+.. phpmethod:: MongoDB\GridFS\Bucket::getWriteConcern()
 
    Returns the write concern for this GridFS bucket.
 
@@ -26,7 +26,7 @@ Definition
 Return Values
 -------------
 
-A :php:`MongoDB\\Driver\\WriteConcern `
+A :php:`MongoDB\Driver\WriteConcern `
 object.
 
 Example
@@ -58,7 +58,7 @@ See Also
 --------
 
 - :manual:`Write Concern ` in the MongoDB manual
-- :php:`MongoDB\\Driver\\WriteConcern::isDefault() `
-- :phpmethod:`MongoDB\\Client::getWriteConcern()`
-- :phpmethod:`MongoDB\\Collection::getWriteConcern()`
-- :phpmethod:`MongoDB\\Database::getWriteConcern()`
+- :php:`MongoDB\Driver\WriteConcern::isDefault() `
+- :phpmethod:`MongoDB\Client::getWriteConcern()`
+- :phpmethod:`MongoDB\Collection::getWriteConcern()`
+- :phpmethod:`MongoDB\Database::getWriteConcern()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
index 9118cecc..bfabc282 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::openDownloadStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::openDownloadStream()
 
    Selects a GridFS file by its ``_id`` and opens it as a readable stream.
 
@@ -66,6 +66,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStreamByName()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
index 4c0b525d..287cf4b5 100644
--- a/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openDownloadStreamByName.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::openDownloadStreamByName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::openDownloadStreamByName()
+.. phpmethod:: MongoDB\GridFS\Bucket::openDownloadStreamByName()
 
    Selects a GridFS file by its ``filename`` and opens it as a readable stream.
 
@@ -94,6 +94,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStream()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::downloadToStreamByName()`
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openDownloadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::downloadToStreamByName()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openDownloadStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 18fb3361..2d9d35e1 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::openUploadStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::openUploadStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::openUploadStream()
 
    Opens a writable stream for a new GridFS file.
 
@@ -44,7 +44,7 @@ Parameters
      * - _id
        - mixed
        - Value to use as the file document identifier. Defaults to a new
-         :php:`MongoDB\\BSON\\ObjectId ` object.
+         :php:`MongoDB\BSON\ObjectId ` object.
 
      * - chunkSizeBytes
        - integer
@@ -100,4 +100,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::uploadFromStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::uploadFromStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt b/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt
index 59991e61..2d8fe60d 100644
--- a/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt
+++ b/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt
@@ -15,7 +15,7 @@ MongoDB\\GridFS\\Bucket::registerGlobalStreamWrapperAlias()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::registerGlobalStreamWrapperAlias()
+.. phpmethod:: MongoDB\GridFS\Bucket::registerGlobalStreamWrapperAlias()
 
    Registers an alias for the bucket, which enables files within the bucket to
    be accessed using a basic filename string (e.g.
diff --git a/source/reference/method/MongoDBGridFSBucket-rename.txt b/source/reference/method/MongoDBGridFSBucket-rename.txt
index 20d9c1d7..75545a8a 100644
--- a/source/reference/method/MongoDBGridFSBucket-rename.txt
+++ b/source/reference/method/MongoDBGridFSBucket-rename.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::rename()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::rename()
+.. phpmethod:: MongoDB\GridFS\Bucket::rename()
 
    Selects a GridFS file by its ``_id`` and alters its ``filename``.
 
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index adcadaef..163c8788 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -13,7 +13,7 @@ MongoDB\\GridFS\\Bucket::uploadFromStream()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::uploadFromStream()
+.. phpmethod:: MongoDB\GridFS\Bucket::uploadFromStream()
 
    Creates a new GridFS file and copies the contents of a readable stream to it.
 
@@ -48,7 +48,7 @@ Parameters
      * - _id
        - mixed
        - Value to use as the file document identifier. Defaults to a new
-         :php:`MongoDB\\BSON\\ObjectId ` object.
+         :php:`MongoDB\BSON\ObjectId ` object.
 
      * - chunkSizeBytes
        - integer
@@ -73,7 +73,7 @@ Return Values
 
 The ``_id`` field of the metadata document associated with the newly created
 GridFS file. If the ``_id`` option is not specified, a new
-:php:`MongoDB\\BSON\\ObjectId ` object will be used
+:php:`MongoDB\BSON\ObjectId ` object will be used
 by default.
 
 Errors/Exceptions
@@ -111,4 +111,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\GridFS\\Bucket::openUploadStream()`
+- :phpmethod:`MongoDB\GridFS\Bucket::openUploadStream()`
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index 40472f0c..014369a9 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -13,9 +13,9 @@ MongoDB\\GridFS\\Bucket::__construct()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\GridFS\\Bucket::__construct()
+.. phpmethod:: MongoDB\GridFS\Bucket::__construct()
 
-   Constructs a new :phpclass:`Bucket ` instance.
+   Constructs a new :phpclass:`Bucket ` instance.
 
    .. code-block:: php
 
@@ -28,7 +28,7 @@ Definition
 Parameters
 ----------
 
-``$manager`` : :php:`MongoDB\\Driver\\Manager `
+``$manager`` : :php:`MongoDB\Driver\Manager `
   The :php:`Manager ` instance from the driver. The
   manager maintains connections between the driver and your MongoDB instances.
 
@@ -64,12 +64,12 @@ Parameters
          .. versionadded: 1.4
 
      * - readConcern
-       - :php:`MongoDB\\Driver\\ReadConcern `
+       - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for bucket operations. Defaults to the
          manager's read concern.
 
      * - readPreference
-       - :php:`MongoDB\\Driver\\ReadPreference `
+       - :php:`MongoDB\Driver\ReadPreference `
        - The default read preference to use for bucket operations. Defaults to
          the manager's read preference.
 
@@ -89,7 +89,7 @@ Parameters
             ]
 
      * - writeConcern
-       - :php:`MongoDB\\Driver\\WriteConcern `
+       - :php:`MongoDB\Driver\WriteConcern `
        - The default write concern to use for bucket operations. Defaults to the
          manager's write concern.
 
@@ -102,8 +102,8 @@ Behavior
 --------
 
 If you construct a Bucket explicitly, the Bucket inherits any options
-from the :php:`MongoDB\\Driver\\Manager ` object.
-If you select the Bucket from a :phpclass:`Database ` object,
+from the :php:`MongoDB\Driver\Manager ` object.
+If you select the Bucket from a :phpclass:`Database ` object,
 the Bucket inherits its options from that object.
 
 Examples
@@ -131,4 +131,4 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::selectGridFSBucket()`
+- :phpmethod:`MongoDB\Database::selectGridFSBucket()`
diff --git a/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt b/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
index 9297008b..f114b456 100644
--- a/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
+++ b/source/reference/method/MongoDBInsertManyResult-getInsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertManyResult::getInsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertManyResult::getInsertedCount()
+.. phpmethod:: MongoDB\InsertManyResult::getInsertedCount()
 
    Return the number of documents that were inserted.
 
@@ -36,5 +36,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getInsertedCount()
   `
diff --git a/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt b/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
index 75c63870..bf30e28b 100644
--- a/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
+++ b/source/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertManyResult::getInsertedIds()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertManyResult::getInsertedIds()
+.. phpmethod:: MongoDB\InsertManyResult::getInsertedIds()
 
    Return a map of IDs (i.e. ``_id`` field values) for the inserted documents.
 
@@ -32,5 +32,5 @@ A map of IDs (i.e. ``_id`` field values) for the inserted documents.
 The index of each ID in the map corresponds to each document's position in the
 bulk operation. If a document had an ID prior to inserting (i.e. the driver did
 not generate an ID), the index will contain its ``_id`` field value. Any
-driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectId
+driver-generated ID will be a :php:`MongoDB\BSON\ObjectId
 ` instance.
diff --git a/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt b/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
index db376e5f..2589edb4 100644
--- a/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBInsertManyResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertManyResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertManyResult::isAcknowledged()
+.. phpmethod:: MongoDB\InsertManyResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt b/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
index 35508015..d6ba1279 100644
--- a/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
+++ b/source/reference/method/MongoDBInsertOneResult-getInsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertOneResult::getInsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertOneResult::getInsertedCount()
+.. phpmethod:: MongoDB\InsertOneResult::getInsertedCount()
 
    Return the number of documents that were inserted.
 
@@ -37,5 +37,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getInsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getInsertedCount()
   `
diff --git a/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt b/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
index 8d4a01dd..e3cef55d 100644
--- a/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
+++ b/source/reference/method/MongoDBInsertOneResult-getInsertedId.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertOneResult::getInsertedId()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertOneResult::getInsertedId()
+.. phpmethod:: MongoDB\InsertOneResult::getInsertedId()
 
    Return the ID (i.e. ``_id`` field value) for the inserted document.
 
@@ -31,5 +31,5 @@ The ID (i.e. ``_id`` field value) of the inserted document.
 
 If the document had an ID prior to inserting (i.e. the driver did not need to
 generate an ID), this will contain its ``_id`` field value. Any driver-generated
-ID will be a :php:`MongoDB\\BSON\\ObjectId `
+ID will be a :php:`MongoDB\BSON\ObjectId `
 instance.
diff --git a/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt b/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
index 921e3a61..3e4505cd 100644
--- a/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBInsertOneResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\InsertOneResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\InsertOneResult::isAcknowledged()
+.. phpmethod:: MongoDB\InsertOneResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBMapReduceResult-getCounts.txt b/source/reference/method/MongoDBMapReduceResult-getCounts.txt
index 35c738dd..50cae3ef 100644
--- a/source/reference/method/MongoDBMapReduceResult-getCounts.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getCounts.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getCounts()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getCounts()
+.. phpmethod:: MongoDB\MapReduceResult::getCounts()
 
    Returns count statistics for the map-reduce operation.
 
@@ -63,6 +63,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :manual:`mapReduce ` command reference in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt b/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
index 05b6bbc1..fd094fed 100644
--- a/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getExecutionTimeMS.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getExecutionTimeMS()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getExecutionTimeMS()
+.. phpmethod:: MongoDB\MapReduceResult::getExecutionTimeMS()
 
    Returns the execution time in milliseconds of the map-reduce operation.
 
@@ -55,6 +55,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :manual:`mapReduce ` command reference in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBMapReduceResult-getIterator.txt b/source/reference/method/MongoDBMapReduceResult-getIterator.txt
index cb459cde..9de94895 100644
--- a/source/reference/method/MongoDBMapReduceResult-getIterator.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getIterator.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getIterator()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getIterator()
+.. phpmethod:: MongoDB\MapReduceResult::getIterator()
 
    Returns a :php:`Traversable `, which may be used to iterate
    through the results of the map-reduce operation.
@@ -81,5 +81,5 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :php:`IteratorAggregate::getIterator() `
diff --git a/source/reference/method/MongoDBMapReduceResult-getTiming.txt b/source/reference/method/MongoDBMapReduceResult-getTiming.txt
index 0492b3be..98268285 100644
--- a/source/reference/method/MongoDBMapReduceResult-getTiming.txt
+++ b/source/reference/method/MongoDBMapReduceResult-getTiming.txt
@@ -13,7 +13,7 @@ MongoDB\\MapReduceResult::getTiming()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\MapReduceResult::getTiming()
+.. phpmethod:: MongoDB\MapReduceResult::getTiming()
 
    Returns timing statistics for the map-reduce operation.
 
@@ -22,7 +22,7 @@ Definition
       function getTiming(): array
 
    Timing statistics will only be available if the ``verbose`` option was
-   specified for :phpmethod:`MongoDB\\Collection::mapReduce()`.
+   specified for :phpmethod:`MongoDB\Collection::mapReduce()`.
 
 Return Values
 -------------
@@ -34,7 +34,7 @@ Examples
 --------
 
 This example specifies the ``verbose`` option for
-:phpmethod:`MongoDB\\Collection::mapReduce()` and reports the timing statistics
+:phpmethod:`MongoDB\Collection::mapReduce()` and reports the timing statistics
 for a map-reduce operation.
 
 .. code-block:: php
@@ -71,6 +71,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::mapReduce()`
+- :phpmethod:`MongoDB\Collection::mapReduce()`
 - :manual:`mapReduce ` command reference in the
   MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
index dcd8e703..0b86f350 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedMax.txt
@@ -15,10 +15,10 @@ MongoDB\\Model\\CollectionInfo::getCappedMax()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedMax()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getCappedMax()
 
    Return the document limit for the capped collection. This correlates with the
-   ``max`` option for :phpmethod:`MongoDB\\Database::createCollection()`.
+   ``max`` option for :phpmethod:`MongoDB\Database::createCollection()`.
 
    .. code-block:: php
 
@@ -31,7 +31,7 @@ The document limit for the capped collection. If the collection is not capped,
 ``null`` will be returned.
 
 This method is deprecated in favor of using
-:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the
+:phpmethod:`MongoDB\Model\CollectionInfo::getOptions()` and accessing the
 ``max`` key.
 
 Examples
@@ -61,9 +61,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::isCapped()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`Capped Collections ` in the MongoDB manual
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
index 62732aa4..9b0101aa 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getCappedSize.txt
@@ -15,11 +15,11 @@ MongoDB\\Model\\CollectionInfo::getCappedSize()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedSize()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getCappedSize()
 
    Return the size limit for the capped collection in bytes. This correlates
    with the ``size`` option for
-   :phpmethod:`MongoDB\\Database::createCollection()`.
+   :phpmethod:`MongoDB\Database::createCollection()`.
 
    .. code-block:: php
 
@@ -32,7 +32,7 @@ The size limit for the capped collection in bytes. If the collection is not
 capped, ``null`` will be returned.
 
 This method is deprecated in favor of using
-:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the
+:phpmethod:`MongoDB\Model\CollectionInfo::getOptions()` and accessing the
 ``size`` key.
 
 Examples
@@ -61,9 +61,9 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::isCapped()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`Capped Collections ` in the MongoDB manual
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt b/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt
index 4fa22dc0..73f47668 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getIdIndex.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::getIdIndex()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getIdIndex()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getIdIndex()
 
    Returns information about the ``_id`` field index.
 
@@ -70,6 +70,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt b/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt
index 4d4f19ff..efdc1182 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getInfo.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::getInfo()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getInfo()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getInfo()
 
    Returns additional information about the collection.
 
@@ -56,6 +56,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getName.txt b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
index d3104af8..83a74b2b 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getName.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getName.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\CollectionInfo::getName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getName()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getName()
 
    Return the collection name.
 
@@ -47,6 +47,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::getCollectionName()`
+- :phpmethod:`MongoDB\Collection::getCollectionName()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
index 3ffac1db..d438b44b 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getOptions.txt
@@ -13,10 +13,10 @@ MongoDB\\Model\\CollectionInfo::getOptions()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getOptions()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getOptions()
 
    Return the collection options. This correlates with the options for
-   :phpmethod:`MongoDB\\Database::createCollection()`, but may include
+   :phpmethod:`MongoDB\Database::createCollection()`, but may include
    additional fields set by the server.
 
    .. code-block:: php
@@ -60,6 +60,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-getType.txt b/source/reference/method/MongoDBModelCollectionInfo-getType.txt
index 9fdf5c99..39a6c442 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-getType.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-getType.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::getType()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::getType()
+.. phpmethod:: MongoDB\Model\CollectionInfo::getType()
 
    Return the collection type.
 
@@ -49,6 +49,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::createCollection()`
+- :phpmethod:`MongoDB\Database::createCollection()`
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
index a6067e0a..aa70df80 100644
--- a/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
+++ b/source/reference/method/MongoDBModelCollectionInfo-isCapped.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\CollectionInfo::isCapped()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\CollectionInfo::isCapped()
+.. phpmethod:: MongoDB\Model\CollectionInfo::isCapped()
 
    Return whether the collection is a :manual:`capped collection
    `.
@@ -30,7 +30,7 @@ Return Values
 A boolean indicating whether the collection is a capped collection.
 
 This method is deprecated in favor of using
-:phpmethod:`MongoDB\\Model\\CollectionInfo::getOptions()` and accessing the
+:phpmethod:`MongoDB\Model\CollectionInfo::getOptions()` and accessing the
 ``capped`` key.
 
 Examples
@@ -59,8 +59,8 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
-- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedMax()`
+- :phpmethod:`MongoDB\Model\CollectionInfo::getCappedSize()`
 - :manual:`Capped Collections ` in the MongoDB manual
 - :manual:`listCollections ` command
   reference in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
index 6f82a77a..4ef37321 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getName.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\DatabaseInfo::getName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getName()
+.. phpmethod:: MongoDB\Model\DatabaseInfo::getName()
 
    Return the database name.
 
@@ -46,6 +46,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Database::getDatabaseName()`
+- :phpmethod:`MongoDB\Database::getDatabaseName()`
 - :manual:`listDatabases ` command reference
   in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
index 8c3a0b0b..3af6ef48 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()
+.. phpmethod:: MongoDB\Model\DatabaseInfo::getSizeOnDisk()
 
    Return the total size of the database file on disk in bytes.
 
diff --git a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
index 1c68299e..72849b8e 100644
--- a/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
+++ b/source/reference/method/MongoDBModelDatabaseInfo-isEmpty.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\DatabaseInfo::isEmpty()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\DatabaseInfo::isEmpty()
+.. phpmethod:: MongoDB\Model\DatabaseInfo::isEmpty()
 
    Return whether the database has any data.
 
diff --git a/source/reference/method/MongoDBModelIndexInfo-getKey.txt b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
index ff416f91..0925428f 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getKey.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getKey.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::getKey()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getKey()
+.. phpmethod:: MongoDB\Model\IndexInfo::getKey()
 
    Return the index specification (i.e. indexed field(s) and order). This
    correlates with the ``$key`` parameter for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -53,6 +53,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getName.txt b/source/reference/method/MongoDBModelIndexInfo-getName.txt
index b37c6621..4404964d 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getName.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getName.txt
@@ -13,10 +13,10 @@ MongoDB\\Model\\IndexInfo::getName()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getName()
+.. phpmethod:: MongoDB\Model\IndexInfo::getName()
 
    Return the index name. This correlates with the return value of
-   :phpmethod:`MongoDB\\Collection::createIndex()`. An index name may be derived
+   :phpmethod:`MongoDB\Collection::createIndex()`. An index name may be derived
    from the ``$key`` parameter or explicitly specified via the ``name`` option.
 
    .. code-block:: php
@@ -50,6 +50,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
index f4bb7a59..099a1830 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getNamespace.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\IndexInfo::getNamespace()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getNamespace()
+.. phpmethod:: MongoDB\Model\IndexInfo::getNamespace()
 
    Return the index namespace, which is the namespace of the collection
    containing the index.
@@ -49,7 +49,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::getNamespace()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::getNamespace()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
index 96a22770..cd0d1bb4 100644
--- a/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-getVersion.txt
@@ -13,7 +13,7 @@ MongoDB\\Model\\IndexInfo::getVersion()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::getVersion()
+.. phpmethod:: MongoDB\Model\IndexInfo::getVersion()
 
    Return the index version.
 
@@ -48,6 +48,6 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt b/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
index 017e6e7b..27fd3f9a 100644
--- a/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-is2dSphere.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\IndexInfo::is2dSphere()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::is2dSphere()
+.. phpmethod:: MongoDB\Model\IndexInfo::is2dSphere()
 
    Return whether the index is a :manual:`2dsphere `
    index.
@@ -55,7 +55,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
 - :manual:`2dsphere Indexes ` reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
index f6c2007d..87b7a53d 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isGeoHaystack.txt
@@ -18,7 +18,7 @@ MongoDB\\Model\\IndexInfo::isGeoHaystack()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isGeoHaystack()
+.. phpmethod:: MongoDB\Model\IndexInfo::isGeoHaystack()
 
    Return whether the index is a :manual:`geoHaystack `
    index.
@@ -58,7 +58,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
 - :manual:`geoHaystack Indexes ` reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
index 533793c9..22c307ab 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isSparse.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::isSparse()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isSparse()
+.. phpmethod:: MongoDB\Model\IndexInfo::isSparse()
 
    Return whether the index is a :manual:`sparse index `.
    This correlates with the ``sparse`` option for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -50,7 +50,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
 - :manual:`Sparse Indexes ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isText.txt b/source/reference/method/MongoDBModelIndexInfo-isText.txt
index 7e0488f5..b600ebdd 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isText.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isText.txt
@@ -15,7 +15,7 @@ MongoDB\\Model\\IndexInfo::isText()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isText()
+.. phpmethod:: MongoDB\Model\IndexInfo::isText()
 
    Return whether the index is a :manual:`text ` index.
 
@@ -54,7 +54,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
-- :phpmethod:`MongoDB\\Collection::listIndexes()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::listIndexes()`
 - :manual:`Text Indexes ` reference in the MongoDB
   manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
index a33a22b9..ef417942 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isTtl.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::isTtl()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isTtl()
+.. phpmethod:: MongoDB\Model\IndexInfo::isTtl()
 
    Return whether the index is a :manual:`TTL index `. This
    correlates with the ``expireAfterSeconds`` option for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -50,7 +50,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
 - :manual:`TTL Indexes ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
index ef61e7c3..12d8b45c 100644
--- a/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
+++ b/source/reference/method/MongoDBModelIndexInfo-isUnique.txt
@@ -13,11 +13,11 @@ MongoDB\\Model\\IndexInfo::isUnique()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\Model\\IndexInfo::isUnique()
+.. phpmethod:: MongoDB\Model\IndexInfo::isUnique()
 
    Return whether the index is a :manual:`unique index `.
    This correlates with the ``unique`` option for
-   :phpmethod:`MongoDB\\Collection::createIndex()`.
+   :phpmethod:`MongoDB\Collection::createIndex()`.
 
    .. code-block:: php
 
@@ -50,7 +50,7 @@ The output would then resemble:
 See Also
 --------
 
-- :phpmethod:`MongoDB\\Collection::createIndex()`
+- :phpmethod:`MongoDB\Collection::createIndex()`
 - :manual:`listIndexes ` command reference in
   the MongoDB manual
 - :manual:`Unique Indexes ` in the MongoDB manual
diff --git a/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt b/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
index f347a8cf..f668fe12 100644
--- a/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
+++ b/source/reference/method/MongoDBUpdateResult-getMatchedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getMatchedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getMatchedCount()
+.. phpmethod:: MongoDB\UpdateResult::getMatchedCount()
 
    Return the number of documents that were matched.
 
@@ -29,7 +29,7 @@ Definition
       (e.g. setting the value of a field to its current value), the matched
       count may be greater than the value returned by
       :phpmethod:`getModifiedCount()
-      `.
+      `.
 
 Return Values
 -------------
@@ -44,6 +44,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\UpdateResult::getModifiedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getMatchedCount()
+- :phpmethod:`MongoDB\UpdateResult::getModifiedCount()`
+- :php:`MongoDB\Driver\WriteResult::getMatchedCount()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt b/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
index 3e2a7a6e..5c8bfe73 100644
--- a/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
+++ b/source/reference/method/MongoDBUpdateResult-getModifiedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getModifiedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getModifiedCount()
+.. phpmethod:: MongoDB\UpdateResult::getModifiedCount()
 
    Return the number of documents that were modified.
 
@@ -28,7 +28,7 @@ Definition
       If an update/replace operation results in no change to the document
       (e.g. setting the value of a field to its current value), the modified
       count may be less than the value returned by :phpmethod:`getMatchedCount()
-      `.
+      `.
 
 Return Values
 -------------
@@ -43,6 +43,6 @@ Errors/Exceptions
 See Also
 --------
 
-- :phpmethod:`MongoDB\\UpdateResult::getMatchedCount()`
-- :php:`MongoDB\\Driver\\WriteResult::getModifiedCount()
+- :phpmethod:`MongoDB\UpdateResult::getMatchedCount()`
+- :php:`MongoDB\Driver\WriteResult::getModifiedCount()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt b/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
index 0bbb39fb..7074696e 100644
--- a/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
+++ b/source/reference/method/MongoDBUpdateResult-getUpsertedCount.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getUpsertedCount()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getUpsertedCount()
+.. phpmethod:: MongoDB\UpdateResult::getUpsertedCount()
 
    Return the number of documents that were upserted.
 
@@ -38,5 +38,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedCount()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedCount()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt b/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
index 52498708..d9200778 100644
--- a/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
+++ b/source/reference/method/MongoDBUpdateResult-getUpsertedId.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::getUpsertedId()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::getUpsertedId()
+.. phpmethod:: MongoDB\UpdateResult::getUpsertedId()
 
    Return the ID (i.e. ``_id`` field value) of the upserted document.
 
@@ -29,7 +29,7 @@ upserted, ``null`` will be returned.
 
 If the document had an ID prior to upserting (i.e. the server did not need to
 generate an ID), this will contain its ``_id`` field value. Any server-generated
-ID will be a :php:`MongoDB\\BSON\\ObjectId `
+ID will be a :php:`MongoDB\BSON\ObjectId `
 instance.
 
 Errors/Exceptions
@@ -40,5 +40,5 @@ Errors/Exceptions
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::getUpsertedIds()
+- :php:`MongoDB\Driver\WriteResult::getUpsertedIds()
   `
diff --git a/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt b/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
index af15d1f1..2e7c7b05 100644
--- a/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
+++ b/source/reference/method/MongoDBUpdateResult-isAcknowledged.txt
@@ -13,7 +13,7 @@ MongoDB\\UpdateResult::isAcknowledged()
 Definition
 ----------
 
-.. phpmethod:: MongoDB\\UpdateResult::isAcknowledged()
+.. phpmethod:: MongoDB\UpdateResult::isAcknowledged()
 
    Return whether the write was acknowledged.
 
@@ -29,6 +29,6 @@ A boolean indicating whether the write was acknowledged.
 See Also
 --------
 
-- :php:`MongoDB\\Driver\\WriteResult::isAcknowledged()
+- :php:`MongoDB\Driver\WriteResult::isAcknowledged()
   `
 - :manual:`Write Concern ` in the MongoDB manual
diff --git a/source/tutorial/codecs.txt b/source/tutorial/codecs.txt
index 32669cbf..a4bb5dd6 100644
--- a/source/tutorial/codecs.txt
+++ b/source/tutorial/codecs.txt
@@ -42,7 +42,7 @@ The example above selects a collection and instructs it to use the ``PersonCodec
 When inserting data, the ``PersonCodec`` is used to encode the document. When retrieving data, the same ``PersonCodec``
 is used to decode BSON data into a ``Person`` instance. Note that while the ``PersonCodec`` could technically decode any
 BSON document that contains a name field, we wouldn't want to use it for any other documents. Document codecs are meant
-to be used with a :phpclass:`MongoDB\\Collection`, or when decoding embedded documents.
+to be used with a :phpclass:`MongoDB\Collection`, or when decoding embedded documents.
 
 When using a collection with a codec, the codec will only accept and return data of that type for certain operations.
 Insert and replace operations (e.g. ``insertOne``, ```findOneAndReplace``, and some ``bulkWrite`` operations) will
diff --git a/source/tutorial/collation.txt b/source/tutorial/collation.txt
index a867ae25..6ba335e7 100644
--- a/source/tutorial/collation.txt
+++ b/source/tutorial/collation.txt
@@ -196,7 +196,7 @@ A collection called ``names`` contains the following documents:
    { "_id" : 4, "first_name" : "Jürgen" }
 
 The following :phpmethod:`findOneAndUpdate()
-` operation on the collection does not
+` operation on the collection does not
 specify a collation.
 
 .. code-block:: php
@@ -214,7 +214,7 @@ Because ``Gunter`` is lexically first in the collection, the above operation
 returns no results and updates no documents.
 
 Consider the same :phpmethod:`findOneAndUpdate()
-` operation but with a collation
+` operation but with a collation
 specified, which uses the locale ``de@collation=phonebook``.
 
 .. note::
@@ -349,7 +349,7 @@ Aggregation
 ~~~~~~~~~~~
 
 To use collation with an :phpmethod:`aggregate()
-` operation, specify a collation in the
+` operation, specify a collation in the
 aggregation options.
 
 The following aggregation example uses a collection called ``names`` and groups
diff --git a/source/tutorial/commands.txt b/source/tutorial/commands.txt
index bccf7462..3efa999e 100644
--- a/source/tutorial/commands.txt
+++ b/source/tutorial/commands.txt
@@ -14,14 +14,14 @@ Overview
 --------
 
 The |php-library| provides helper methods across the :phpclass:`Client
-`, :phpclass:`Database `, and
-:phpclass:`Collection ` classes for common
+`, :phpclass:`Database `, and
+:phpclass:`Collection ` classes for common
 :manual:`database commands `. In addition, the
-:phpmethod:`MongoDB\\Database::command()` method may be used to run database
+:phpmethod:`MongoDB\Database::command()` method may be used to run database
 commands that do not have a helper method.
 
-The :phpmethod:`MongoDB\\Database::command()` method always returns a
-:php:`MongoDB\\Driver\\Cursor ` object, since it must
+The :phpmethod:`MongoDB\Database::command()` method always returns a
+:php:`MongoDB\Driver\Cursor ` object, since it must
 support execution of commands that return single result documents *and* multiple
 results via a command cursor.
 
@@ -63,7 +63,7 @@ example executes :manual:`listCollections `,
 which returns a cursor containing a result document for each collection in the
 ``test`` database, and iterates through the results using a ``foreach`` loop.
 Note that this example is illustrative; applications would generally use
-:phpmethod:`MongoDB\\Database::listCollections()` in practice.
+:phpmethod:`MongoDB\Database::listCollections()` in practice.
 
 .. code-block:: php
 
@@ -103,8 +103,8 @@ Specifying a Custom Read Preference
 Write commands, such as :manual:`createUser `,
 can only be executed on a writable server (e.g. :term:`primary` replica set
 member). Command helper methods in the |php-library|, such as
-:phpmethod:`MongoDB\\Database::drop()`, know to apply their own :term:`read
-preference` if necessary. However, the :phpmethod:`MongoDB\\Database::command()`
+:phpmethod:`MongoDB\Database::drop()`, know to apply their own :term:`read
+preference` if necessary. However, the :phpmethod:`MongoDB\Database::command()`
 method is a generic method and defaults to the read preference of the Database
 object on which it is invoked. When necessary, the ``readPreference`` option may
 be used to override the default read preference.
diff --git a/source/tutorial/connecting.txt b/source/tutorial/connecting.txt
index c964362a..cffd19ef 100644
--- a/source/tutorial/connecting.txt
+++ b/source/tutorial/connecting.txt
@@ -22,4 +22,4 @@ Specifying connection options
 
 Connection options can be passed via the ``$uri`` parameter, or through the
 ``$options`` and ``$driverOptions`` parameters. The available options are
-documented in the :phpmethod:`MongoDB\\Client::__construct()` reference.
+documented in the :phpmethod:`MongoDB\Client::__construct()` reference.
diff --git a/source/tutorial/crud.txt b/source/tutorial/crud.txt
index 3abbf579..a69ec662 100644
--- a/source/tutorial/crud.txt
+++ b/source/tutorial/crud.txt
@@ -12,7 +12,7 @@ CRUD Operations
 
 
 CRUD operations *create*, *read*, *update*, and *delete* documents. The
-|php-library|'s :phpclass:`MongoDB\\Collection` class implements MongoDB's
+|php-library|'s :phpclass:`MongoDB\Collection` class implements MongoDB's
 cross-driver `CRUD specification
 `_,
 providing access to methods for inserting, finding, updating, and deleting
@@ -29,9 +29,9 @@ Insert Documents
 Insert One Document
 ~~~~~~~~~~~~~~~~~~~
 
-The :phpmethod:`MongoDB\\Collection::insertOne()` method inserts a single
+The :phpmethod:`MongoDB\Collection::insertOne()` method inserts a single
 document into MongoDB and returns an instance of
-:phpclass:`MongoDB\\InsertOneResult`, which you can use to access the ID of the
+:phpclass:`MongoDB\InsertOneResult`, which you can use to access the ID of the
 inserted document.
 
 .. this uses the insertOne example from the method reference:
@@ -70,14 +70,14 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::insertOne()`
+   :phpmethod:`MongoDB\Collection::insertOne()`
 
 Insert Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-The :phpmethod:`MongoDB\\Collection::insertMany()` method allows you to insert
+The :phpmethod:`MongoDB\Collection::insertMany()` method allows you to insert
 multiple documents in one write operation and returns an instance of
-:phpclass:`MongoDB\\InsertManyResult`, which you can use to access the IDs of
+:phpclass:`MongoDB\InsertManyResult`, which you can use to access the IDs of
 the inserted documents.
 
 .. this uses the insertMany example from the method reference:
@@ -88,14 +88,14 @@ the inserted documents.
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::insertMany()`
+   :phpmethod:`MongoDB\Collection::insertMany()`
 
 Query Documents
 ---------------
 
-The |php-library| provides the :phpmethod:`MongoDB\\Collection::findOne()` and
-:phpmethod:`MongoDB\\Collection::find()` methods for querying documents and the
-:phpmethod:`MongoDB\\Collection::aggregate()` method for performing
+The |php-library| provides the :phpmethod:`MongoDB\Collection::findOne()` and
+:phpmethod:`MongoDB\Collection::find()` methods for querying documents and the
+:phpmethod:`MongoDB\Collection::aggregate()` method for performing
 :manual:`aggregation operations `.
 
 .. include:: /includes/extracts/note-bson-comparison.rst
@@ -103,7 +103,7 @@ The |php-library| provides the :phpmethod:`MongoDB\\Collection::findOne()` and
 Find One Document
 ~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::findOne()` returns the :term:`first document
+:phpmethod:`MongoDB\Collection::findOne()` returns the :term:`first document
 ` that matches the query or ``null`` if no document matches the
 query.
 
@@ -153,21 +153,21 @@ The output would then resemble:
    ``"94301"``. The same criteria would not have matched a document with an
    integer value of ``94301`` due to MongoDB's :manual:`comparison rules for
    BSON types `. Similarly, users should
-   use a :php:`MongoDB\\BSON\\ObjectId ` object
+   use a :php:`MongoDB\BSON\ObjectId ` object
    when matching an ``_id`` with an :manual:`ObjectId `
    value, as strings and ObjectIds are not directly comparable.
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::findOne()`
+   :phpmethod:`MongoDB\Collection::findOne()`
 
 .. _php-find-many-documents:
 
 Find Many Documents
 ~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::find()` returns a
-:php:`MongoDB\\Driver\\Cursor ` object, which you can
+:phpmethod:`MongoDB\Collection::find()` returns a
+:php:`MongoDB\Driver\Cursor ` object, which you can
 iterate upon to access all matched documents.
 
 The following example lists the documents in the ``zips`` collection with the
@@ -198,7 +198,7 @@ The output would resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::find()`
+   :phpmethod:`MongoDB\Collection::find()`
 
 .. _php-query-projection:
 
@@ -355,7 +355,7 @@ Regular Expressions
 ~~~~~~~~~~~~~~~~~~~
 
 Filter criteria may include regular expressions, either by using the
-:php:`MongoDB\\BSON\\Regex ` class directory or the
+:php:`MongoDB\BSON\Regex ` class directory or the
 :query:`$regex` operator.
 
 The following example lists documents in the ``zips`` collection where the city
@@ -421,10 +421,10 @@ Complex Queries with Aggregation
 
 MongoDB's :manual:`Aggregation Framework ` allows
 you to issue complex queries that filter, transform, and group collection data.
-The |php-library|\'s :phpmethod:`MongoDB\\Collection::aggregate()` method
+The |php-library|\'s :phpmethod:`MongoDB\Collection::aggregate()` method
 returns a :php:`Traversable ` object, which you can iterate upon to
 access the results of the aggregation operation. Refer to the
-:phpmethod:`MongoDB\\Collection::aggregate()` method's :ref:`behavior
+:phpmethod:`MongoDB\Collection::aggregate()` method's :ref:`behavior
 reference ` for more about the method's output.
 
 The following example lists the 5 US states with the most zip codes associated
@@ -458,7 +458,7 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::aggregate()`
+   :phpmethod:`MongoDB\Collection::aggregate()`
 
 Update Documents
 ----------------
@@ -466,18 +466,18 @@ Update Documents
 Update One Document
 ~~~~~~~~~~~~~~~~~~~
 
-Use the :phpmethod:`MongoDB\\Collection::updateOne()` method to update a single
-document matching a filter. :phpmethod:`MongoDB\\Collection::updateOne()`
-returns a :phpclass:`MongoDB\\UpdateResult` object, which you can use to access
+Use the :phpmethod:`MongoDB\Collection::updateOne()` method to update a single
+document matching a filter. :phpmethod:`MongoDB\Collection::updateOne()`
+returns a :phpclass:`MongoDB\UpdateResult` object, which you can use to access
 statistics about the update operation.
 
 Update methods have two required parameters: the query filter that identifies
 the document or documents to update, and an update document that specifies what
-updates to perform. The :phpmethod:`MongoDB\\Collection::updateOne()` reference
+updates to perform. The :phpmethod:`MongoDB\Collection::updateOne()` reference
 describes each parameter in detail.
 
 The following example inserts two documents into an empty ``users`` collection
-in the ``test`` database using the :phpmethod:`MongoDB\\Collection::insertOne()`
+in the ``test`` database using the :phpmethod:`MongoDB\Collection::insertOne()`
 method, and then updates the documents where the value for the ``state`` field
 is ``"ny"`` to include a ``country`` field set to ``"us"``:
 
@@ -499,7 +499,7 @@ is ``"ny"`` to include a ``country`` field set to ``"us"``:
    printf("Modified %d document(s)\n", $updateResult->getModifiedCount());
 
 Since the update operation uses the
-:phpmethod:`MongoDB\\Collection::updateOne()` method, which updates the first
+:phpmethod:`MongoDB\Collection::updateOne()` method, which updates the first
 document to match the filter criteria, the results would then resemble:
 
 .. code-block:: none
@@ -537,19 +537,19 @@ therefore not be equal, and the output from the operation would resemble:
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::updateOne()`
-   - :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+   - :phpmethod:`MongoDB\Collection::updateOne()`
+   - :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 
 Update Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::updateMany()` updates one or more documents
-matching the filter criteria and returns a :phpclass:`MongoDB\\UpdateResult`
+:phpmethod:`MongoDB\Collection::updateMany()` updates one or more documents
+matching the filter criteria and returns a :phpclass:`MongoDB\UpdateResult`
 object, which you can use to access statistics about the update operation.
 
 Update methods have two required parameters: the query filter that identifies
 the document or documents to update, and an update document that specifies what
-updates to perform. The :phpmethod:`MongoDB\\Collection::updateMany()` reference
+updates to perform. The :phpmethod:`MongoDB\Collection::updateMany()` reference
 describes each parameter in detail.
 
 The following example inserts three documents into an empty ``users`` collection
@@ -588,7 +588,7 @@ operation therefore resembles:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::updateMany()`
+   :phpmethod:`MongoDB\Collection::updateMany()`
 
 Replace Documents
 ~~~~~~~~~~~~~~~~~
@@ -598,23 +598,23 @@ a document to include new fields or new field values, a replacement operation
 replaces the entire document with a new document, but retains the original
 document's ``_id`` value.
 
-The :phpmethod:`MongoDB\\Collection::replaceOne()` method replaces a single
+The :phpmethod:`MongoDB\Collection::replaceOne()` method replaces a single
 document that matches the filter criteria and returns an instance of
-:phpclass:`MongoDB\\UpdateResult`, which you can use to access statistics about
+:phpclass:`MongoDB\UpdateResult`, which you can use to access statistics about
 the replacement operation.
 
-:phpmethod:`MongoDB\\Collection::replaceOne()` has two required parameters: the
+:phpmethod:`MongoDB\Collection::replaceOne()` has two required parameters: the
 query filter that identifies the document or documents to replace, and a
 replacement document that will replace the original document in MongoDB. The
-:phpmethod:`MongoDB\\Collection::replaceOne()` reference describes each
+:phpmethod:`MongoDB\Collection::replaceOne()` reference describes each
 parameter in detail.
 
 .. important::
 
    Replacement operations replace all of the fields in a document except the
    ``_id`` value. To avoid accidentally overwriting or deleting desired fields,
-   use the :phpmethod:`MongoDB\\Collection::updateOne()` or
-   :phpmethod:`MongoDB\\Collection::updateMany()` methods to update individual
+   use the :phpmethod:`MongoDB\Collection::updateOne()` or
+   :phpmethod:`MongoDB\Collection::updateMany()` methods to update individual
    fields in a document rather than replacing the entire document.
 
 The following example inserts one document into an empty ``users`` collection in
@@ -645,8 +645,8 @@ The output would then resemble:
 
 .. seealso::
 
-   - :phpmethod:`MongoDB\\Collection::replaceOne()`
-   - :phpmethod:`MongoDB\\Collection::findOneAndReplace()`
+   - :phpmethod:`MongoDB\Collection::replaceOne()`
+   - :phpmethod:`MongoDB\Collection::findOneAndReplace()`
 
 Upsert
 ~~~~~~
@@ -658,9 +658,9 @@ document and inserts it. If there *are* matching documents, then the operation
 modifies or replaces the matching document or documents.
 
 When a document is upserted, the ID is accessible via
-:phpmethod:`MongoDB\\UpdateResult::getUpsertedId()`.
+:phpmethod:`MongoDB\UpdateResult::getUpsertedId()`.
 
-The following example uses :phpmethod:`MongoDB\\Collection::updateOne()` with
+The following example uses :phpmethod:`MongoDB\Collection::updateOne()` with
 the ``upsert`` option set to ``true`` and an empty ``users`` collection in the
 ``test`` database, therefore inserting the document into the database:
 
@@ -715,18 +715,18 @@ Delete Documents
 Delete One Document
 ~~~~~~~~~~~~~~~~~~~
 
-The :phpmethod:`MongoDB\\Collection::deleteOne()` method deletes a single
+The :phpmethod:`MongoDB\Collection::deleteOne()` method deletes a single
 document that matches the filter criteria and returns a
-:phpclass:`MongoDB\\DeleteResult`, which you can use to access statistics about
+:phpclass:`MongoDB\DeleteResult`, which you can use to access statistics about
 the delete operation.
 
 If multiple documents match the filter criteria,
-:phpmethod:`MongoDB\\Collection::deleteOne()` deletes the :term:`first
+:phpmethod:`MongoDB\Collection::deleteOne()` deletes the :term:`first
 ` matching document.
 
-:phpmethod:`MongoDB\\Collection::deleteOne()` has one required parameter: a
+:phpmethod:`MongoDB\Collection::deleteOne()` has one required parameter: a
 query filter that specifies the document to delete. Refer to the
-:phpmethod:`MongoDB\\Collection::deleteOne()` reference for full method
+:phpmethod:`MongoDB\Collection::deleteOne()` reference for full method
 documentation.
 
 The following operation deletes the first document where the ``state`` field's
@@ -753,18 +753,18 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::deleteOne()`
+   :phpmethod:`MongoDB\Collection::deleteOne()`
 
 Delete Many Documents
 ~~~~~~~~~~~~~~~~~~~~~
 
-:phpmethod:`MongoDB\\Collection::deleteMany()` deletes all of the documents that
-match the filter criteria and returns a :phpclass:`MongoDB\\DeleteResult`, which
+:phpmethod:`MongoDB\Collection::deleteMany()` deletes all of the documents that
+match the filter criteria and returns a :phpclass:`MongoDB\DeleteResult`, which
 you can use to access statistics about the delete operation.
 
-:phpmethod:`MongoDB\\Collection::deleteMany()` has one required parameter: a
+:phpmethod:`MongoDB\Collection::deleteMany()` has one required parameter: a
 query filter that specifies the document to delete. Refer to the
-:phpmethod:`MongoDB\\Collection::deleteMany()` reference for full method
+:phpmethod:`MongoDB\Collection::deleteMany()` reference for full method
 documentation.
 
 The following operation deletes all of the documents where the ``state`` field's
@@ -791,4 +791,4 @@ The output would then resemble:
 
 .. seealso::
 
-   :phpmethod:`MongoDB\\Collection::deleteMany()`
+   :phpmethod:`MongoDB\Collection::deleteMany()`
diff --git a/source/tutorial/custom-types.txt b/source/tutorial/custom-types.txt
index 0b08172a..b96a0421 100644
--- a/source/tutorial/custom-types.txt
+++ b/source/tutorial/custom-types.txt
@@ -6,7 +6,7 @@ Custom Data-Types
 
 .. note::
 
-   This tutorial explains implementing custom data types using the :php:`MongoDB\\BSON\\Persistable `
+   This tutorial explains implementing custom data types using the :php:`MongoDB\BSON\Persistable `
    interface found in the MongoDB extension. Consider using a codec instead to decouple the MongoDB persistence logic
    from your business logic. See the :ref:`codec tutorial ` for an example.
 
@@ -21,7 +21,7 @@ communicates to the server, and deserializes BSON back into PHP variables when
 it receives data from the server.
 
 It is possible to influence the behavior by implementing the
-:php:`MongoDB\\BSON\\Persistable ` interface.
+:php:`MongoDB\BSON\Persistable ` interface.
 If a class implements this interface, then upon serialization the
 :php:`bsonSerialize ` method is
 called. This method is responsible for returning an array or stdClass object
@@ -29,7 +29,7 @@ to convert to BSON and store in the database. That data will later be used to
 reconstruct the object upon reading from the database.
 
 As an example we present the ``LocalDateTime`` class. This class wraps around
-the :php:`MongoDB\\BSON\\UTCDateTime ` data
+the :php:`MongoDB\BSON\UTCDateTime ` data
 type and a time zone.
 
 .. code-block:: php
@@ -51,7 +51,7 @@ type and a time zone.
         }
     ?>
 
-As it implements the :php:`MongoDB\\BSON\\Persistable
+As it implements the :php:`MongoDB\BSON\Persistable
 ` interface, the
 class is required to implement the :php:`bsonSerialize
 ` and :php:`bsonUnserialize
@@ -59,7 +59,7 @@ class is required to implement the :php:`bsonSerialize
 :php:`bsonSerialize ` method, we
 return an array with the two values that we need to persist: the point in time
 in milliseconds since the Epoch, represented by a
-:php:`MongoDB\\BSON\\UTCDateTime ` object, and
+:php:`MongoDB\BSON\UTCDateTime ` object, and
 a string containing the Olson time zone identifier:
 
 .. code-block:: php
@@ -81,7 +81,7 @@ stored object.
 
 When the document is read from the database, the driver detects whether a
 ``__pclass`` field is present and then executes
-:php:`MongoDB\\BSON\\Persistable::bsonUnserialize
+:php:`MongoDB\BSON\Persistable::bsonUnserialize
 ` method which is
 responsible for restoring the object's original state.
 
@@ -108,25 +108,25 @@ properties.
     ?>
 
 You may have noticed that the class also implements the
-:php:`MongoDB\\BSON\\UTCDateTimeInterface
+:php:`MongoDB\BSON\UTCDateTimeInterface
 ` interface. This interface defines
-the two non-constructor methods of the :php:`MongoDB\\BSON\\UTCDateTime
+the two non-constructor methods of the :php:`MongoDB\BSON\UTCDateTime
 ` class.
 
 It is recommended that wrappers around existing BSON classes implement their
-respective interface (i.e. :php:`MongoDB\\BSON\\UTCDateTimeInterface
+respective interface (i.e. :php:`MongoDB\BSON\UTCDateTimeInterface
 `) so that the wrapper objects can be
 used in the same context as their original unwrapped version. It is also
 recommended that you always type-hint against the interface (i.e.
-:php:`MongoDB\\BSON\\UTCDateTimeInterface
+:php:`MongoDB\BSON\UTCDateTimeInterface
 `) and never against the concrete
-class (i.e. :php:`MongoDB\\BSON\\UTCDateTime
+class (i.e. :php:`MongoDB\BSON\UTCDateTime
 `), as this would prevent wrapped objects from
 being accepted into methods.
 
 In our new ``toDateTime`` method we return a :php:`DateTime `
 object with the local time zone set, instead of the UTC time zone that
-:php:`MongoDB\\BSON\\UTCDateTime ` normally uses
+:php:`MongoDB\BSON\UTCDateTime ` normally uses
 in its return value.
 
 .. code-block:: php
diff --git a/source/tutorial/encryption.txt b/source/tutorial/encryption.txt
index 393fe820..3a912165 100644
--- a/source/tutorial/encryption.txt
+++ b/source/tutorial/encryption.txt
@@ -91,7 +91,7 @@ Creating an Encryption Key
    and thus it is very important that you keep this key secure.
 
 To create an encryption key, create a
-:php:`MongoDB\\Driver\\ClientEncryption `
+:php:`MongoDB\Driver\ClientEncryption `
 instance with encryption options and use the
 :php:`createDataKey() `
 method. The method will return the key ID which can be used to reference the key
@@ -157,7 +157,7 @@ specifying the ``autoEncryption``
 :php:`driver option `.
 The following examples demonstrate how to setup automatic client-side field
 level encryption and use a
-:php:`MongoDB\\Driver\\ClientEncryption `
+:php:`MongoDB\Driver\ClientEncryption `
 object to create a new encryption key.
 
 
@@ -209,7 +209,7 @@ Explicit Encryption
 
 Explicit encryption is a MongoDB community feature and does not use
 crypt_shared_ or mongocryptd_. Explicit encryption is provided by the
-:php:`MongoDB\\Driver\\ClientEncryption ` class.
+:php:`MongoDB\Driver\ClientEncryption ` class.
 
 .. literalinclude:: /examples/encryption/csfle-explicit_encryption.php
    :language: php
diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt
index 4eb7e156..4688aefb 100644
--- a/source/tutorial/gridfs.txt
+++ b/source/tutorial/gridfs.txt
@@ -13,7 +13,7 @@ GridFS
 :manual:`GridFS ` is a specification for storing and retrieving
 files in MongoDB. GridFS uses two collections to store files. One collection
 stores the file chunks (e.g. ``fs.chunks``), and the other stores file metadata
-(e.g. ``fs.files``). The :phpclass:`MongoDB\\GridFS\\Bucket` class provides an
+(e.g. ``fs.files``). The :phpclass:`MongoDB\GridFS\Bucket` class provides an
 interface around these collections for working with the files as PHP
 :php:`Streams `.
 
@@ -21,9 +21,9 @@ Creating a GridFS Bucket
 ------------------------
 
 You can construct a GridFS bucket using the PHP extension's
-:php:`MongoDB\\Driver\\Manager ` class, or select
-a bucket from the |php-library|'s :phpclass:`MongoDB\\Database` class via the
-:phpmethod:`selectGridFSBucket() `
+:php:`MongoDB\Driver\Manager ` class, or select
+a bucket from the |php-library|'s :phpclass:`MongoDB\Database` class via the
+:phpmethod:`selectGridFSBucket() `
 method.
 
 The bucket can be constructed with various options:
@@ -35,7 +35,7 @@ The bucket can be constructed with various options:
   needed. The default size is ``261120`` (i.e. 255 KiB).
 - ``readConcern``, ``readPreference`` and ``writeConcern`` options can be used
   to specify defaults for read and write operations, much like the
-  :phpclass:`MongoDB\\GridFS\\Collection` options.
+  :phpclass:`MongoDB\GridFS\Collection` options.
 
 Uploading Files with Writable Streams
 -------------------------------------
@@ -112,9 +112,9 @@ number. Revision numbers are used to distinguish between files sharing the same
 ``filename`` metadata field, ordered by date of upload (i.e. the ``uploadDate``
 metadata field). The ``revision`` option accepted by
 :phpmethod:`openDownloadStreamByName()
-` and
+` and
 :phpmethod:`downloadToStreamByName()
-` can be positive or negative.
+` can be positive or negative.
 
 A positive ``revision`` number may be used to select files in order of the
 oldest upload date. A revision of ``0`` would denote the file with the oldest
@@ -157,7 +157,7 @@ You can delete a GridFS file by its ``_id``.
 Finding File Metadata
 ---------------------
 
-The :phpmethod:`find() ` method allows you to
+The :phpmethod:`find() ` method allows you to
 retrieve documents from the GridFS files collection, which contain metadata
 about the GridFS files.
 
@@ -173,7 +173,7 @@ Accessing File Metadata for an Existing Stream
 ----------------------------------------------
 
 The :phpmethod:`getFileDocumentForStream()
-` method may be used to get
+` method may be used to get
 the file document for an existing readable or writable GridFS stream.
 
 .. code-block:: php
@@ -193,16 +193,16 @@ the file document for an existing readable or writable GridFS stream.
    Since the file document for a writable stream is not committed to MongoDB
    until the stream is closed,
    :phpmethod:`getFileDocumentForStream()
-   ` can only return an
+   ` can only return an
    in-memory document, which will be missing some fields (e.g. ``length``,
    ``md5``).
 
 The :phpmethod:`getFileIdForStream()
-` method may be used to get the
+` method may be used to get the
 ``_id`` for an existing readable or writable GridFS stream. This is a
 convenience for accessing the ``_id`` property of the object returned by
 :phpmethod:`getFileDocumentForStream()
-`.
+`.
 
 .. code-block:: php
 
diff --git a/source/tutorial/indexes.txt b/source/tutorial/indexes.txt
index e04d4365..51d2d3f7 100644
--- a/source/tutorial/indexes.txt
+++ b/source/tutorial/indexes.txt
@@ -11,7 +11,7 @@ appropriate index exists for a query, MongoDB can use the index to limit the
 number of documents it must inspect.
 
 The PHP driver supports managing indexes through the
-:phpclass:`MongoDB\\Collection` class, which implements MongoDB's
+:phpclass:`MongoDB\Collection` class, which implements MongoDB's
 cross-driver `Index Management
 `_
 and `Enumerating Indexes
@@ -26,12 +26,12 @@ MongoDB.
 Create Indexes
 --------------
 
-Create indexes with the :phpmethod:`MongoDB\\Collection::createIndex()` or
-:phpmethod:`MongoDB\\Collection::createIndexes()` methods. Refer to the method
+Create indexes with the :phpmethod:`MongoDB\Collection::createIndex()` or
+:phpmethod:`MongoDB\Collection::createIndexes()` methods. Refer to the method
 reference for more details about each method.
 
 The following example creates an ascending index on the ``state`` field using
-the :phpmethod:`createIndex() ` method:
+the :phpmethod:`createIndex() ` method:
 
 .. code-block:: php
 
@@ -54,10 +54,10 @@ similar to:
 List Indexes
 ------------
 
-The :phpmethod:`MongoDB\\Collection::listIndexes()` method provides information
+The :phpmethod:`MongoDB\Collection::listIndexes()` method provides information
 about the indexes in a collection. The
-:phpmethod:`MongoDB\\Collection::listIndexes()` method returns an iterator of
-:phpclass:`MongoDB\\Model\\IndexInfo` objects, which you can use to view
+:phpmethod:`MongoDB\Collection::listIndexes()` method returns an iterator of
+:phpclass:`MongoDB\Model\IndexInfo` objects, which you can use to view
 information about each index. Refer to the method reference for more details.
 
 The following example lists all indexes in the ``zips`` collection in the
@@ -107,8 +107,8 @@ The output would resemble:
 Drop Indexes
 ------------
 
-The :phpmethod:`MongoDB\\Collection::dropIndex()` method lets you drop a single
-index while :phpmethod:`MongoDB\\Collection::dropIndexes()` drops all of the
+The :phpmethod:`MongoDB\Collection::dropIndex()` method lets you drop a single
+index while :phpmethod:`MongoDB\Collection::dropIndexes()` drops all of the
 indexes on a collection. Refer to the method reference for more details about
 each method.
 
diff --git a/source/tutorial/modeling-bson-data.txt b/source/tutorial/modeling-bson-data.txt
index 46ab3cf9..56f0217a 100644
--- a/source/tutorial/modeling-bson-data.txt
+++ b/source/tutorial/modeling-bson-data.txt
@@ -17,13 +17,13 @@ Type Maps
 
 Most methods that read data from MongoDB support a ``typeMap`` option, which
 allows control over how BSON is converted to PHP. Additionally,
-the :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
-:phpclass:`MongoDB\\Collection` classes accept a ``typeMap`` option, which can
+the :phpclass:`MongoDB\Client`, :phpclass:`MongoDB\Database`, and
+:phpclass:`MongoDB\Collection` classes accept a ``typeMap`` option, which can
 be used to specify a default type map to apply to any supporting methods and
-selected classes (e.g. :phpmethod:`MongoDB\\Client::selectDatabase()`).
+selected classes (e.g. :phpmethod:`MongoDB\Client::selectDatabase()`).
 
-The :phpclass:`MongoDB\\Client`, :phpclass:`MongoDB\\Database`, and
-:phpclass:`MongoDB\\Collection` classes use the following type map by
+The :phpclass:`MongoDB\Client`, :phpclass:`MongoDB\Database`, and
+:phpclass:`MongoDB\Collection` classes use the following type map by
 default:
 
 .. code-block:: php
@@ -35,13 +35,13 @@ default:
    ]
 
 The type map above will convert BSON documents and arrays to
-:phpclass:`MongoDB\\Model\\BSONDocument` and
-:phpclass:`MongoDB\\Model\\BSONArray` objects, respectively. The ``root`` and
+:phpclass:`MongoDB\Model\BSONDocument` and
+:phpclass:`MongoDB\Model\BSONArray` objects, respectively. The ``root`` and
 ``document`` keys are used to distinguish the top-level BSON document from
 embedded documents, respectively.
 
 A type map may specify any class that implements
-:php:`MongoDB\\BSON\\Unserializable ` as well as
+:php:`MongoDB\BSON\Unserializable ` as well as
 ``"array"``, ``"stdClass``", and ``"object"`` (``"stdClass``" and ``"object"``
 are aliases of one another).
 
@@ -54,7 +54,7 @@ Persistable Classes
 -------------------
 
 The driver's :php:`persistence specification ` outlines how
-classes implementing its :php:`MongoDB\\BSON\\Persistable
+classes implementing its :php:`MongoDB\BSON\Persistable
 ` interface are serialized to and deserialized from
 BSON. The :php:`Persistable ` interface is analogous
 to PHP's :php:`Serializable interface `.
@@ -156,7 +156,7 @@ The same document in the MongoDB shell might display as:
 
 .. note::
 
-   :php:`MongoDB\\BSON\\Persistable ` may only be used
+   :php:`MongoDB\BSON\Persistable ` may only be used
    for root and embedded BSON documents. It may not be used for BSON arrays.
 
 Working with Enums
@@ -208,10 +208,10 @@ enum is responsible for converting the value back to an enum case:
    }
 
 Enums are prohibited from implementing
-:php:`MongoDB\\BSON\\Unserializable ` and
-:php:`MongoDB\\BSON\\Persistable `, since enum cases
+:php:`MongoDB\BSON\Unserializable ` and
+:php:`MongoDB\BSON\Persistable `, since enum cases
 have no state and cannot be instantiated like ordinary objects. Pure and backed
 enums can, however, implement
-:php:`MongoDB\\BSON\\Serializable `, which can be
+:php:`MongoDB\BSON\Serializable `, which can be
 used to overcome the default behavior whereby backed enums are serialized as
 their case value and pure enums cannot be serialized.
diff --git a/source/tutorial/stable-api.txt b/source/tutorial/stable-api.txt
index 1220f032..d018162a 100644
--- a/source/tutorial/stable-api.txt
+++ b/source/tutorial/stable-api.txt
@@ -15,7 +15,7 @@ Declaring an API Version
 
 To declare an API version, pass a ``serverApi`` driver option when creating your
 client. The value is a
-:php:`MongoDB\\Driver\\ServerApi ` instance that
+:php:`MongoDB\Driver\ServerApi ` instance that
 contains API version information. This feature is introduced in MongoDB 5.0,
 which will initially support only API version "1". Additional versions may be
 introduced in future versions of the server.
@@ -46,7 +46,7 @@ By default, declaring an API version guarantees behavior for commands that are
 part of the stable API, but does not forbid using commands that are not part
 of the API version. To only allow commands and options that are part of the
 stable API, specify the ``strict`` option when creating the
-:php:`MongoDB\\Driver\\ServerApi ` instance:
+:php:`MongoDB\Driver\ServerApi ` instance:
 
 .. code-block:: php
 
@@ -85,9 +85,9 @@ testing to ensure a smooth transition to a future API version.
 Usage with the Command Helper
 -----------------------------
 
-When using the :phpmethod:`MongoDB\\Database::command()` method to run arbitrary
+When using the :phpmethod:`MongoDB\Database::command()` method to run arbitrary
 commands, the API version declared to the client is automatically appended to
 the command document. Setting any of the ``apiVersion``, ``apiStrict``, or
 ``apiDeprecationErrors`` command options in the command document and calling
-:phpmethod:`MongoDB\\Database::command()` from a client with a declared API
+:phpmethod:`MongoDB\Database::command()` from a client with a declared API
 version is not supported and will lead to undefined behavior.
diff --git a/source/tutorial/tailable-cursor.txt b/source/tutorial/tailable-cursor.txt
index 370a642a..6285676e 100644
--- a/source/tutorial/tailable-cursor.txt
+++ b/source/tutorial/tailable-cursor.txt
@@ -17,7 +17,7 @@ Overview
 
 When the driver executes a query or command (e.g.
 :manual:`aggregate `), results from the operation
-are returned via a :php:`MongoDB\\Driver\\Cursor `
+are returned via a :php:`MongoDB\Driver\Cursor `
 object. The Cursor class implements PHP's :php:`Iterator `
 interface, which allows it to be iterated with ``foreach`` and interface with
 any PHP functions that work with :php:`iterables `. Similar to
@@ -99,7 +99,7 @@ preceding example to use the Iterator methods directly:
    throw an exception, since all results on the cursor have been exhausted.
 
 The purpose of this example is to demonstrate the functional equivalence between
-``foreach`` and manual iteration with PHP's :php:`Iterator `API.
+``foreach`` and manual iteration with PHP's :php:`Iterator ` API.
 For normal cursors, there is little reason to manually iterate results instead
 of a concise ``foreach`` loop.
 
@@ -108,7 +108,7 @@ Iterating a Tailable Cursor
 
 In order to demonstrate a tailable cursor in action, we'll need two scripts: a
 "producer" and a "consumer". The producer script will create a new capped
-collection using :phpmethod:`MongoDB\\Database::createCollection()` and proceed
+collection using :phpmethod:`MongoDB\Database::createCollection()` and proceed
 to insert a new document into that collection each second.
 
 .. code-block:: php
@@ -131,7 +131,7 @@ to insert a new document into that collection each second.
 
 With the producer script still running, we will now execute a consumer script to
 read the inserted documents using a tailable cursor, indicated by the
-``cursorType`` option to :phpmethod:`MongoDB\\Collection::find()`. We'll start
+``cursorType`` option to :phpmethod:`MongoDB\Collection::find()`. We'll start
 by using ``foreach`` to illustrate its shortcomings:
 
 .. code-block:: php
@@ -187,4 +187,4 @@ to check if there is actually data available to read at each step.
 Since we've elected to use a ``TAILABLE_AWAIT`` cursor, the server will delay
 its response to the driver for a set amount of time. In this example, we've
 requested that the server block for approximately 100 milliseconds by specifying
-the ``maxAwaitTimeMS`` option to :phpmethod:`MongoDB\\Collection::find()`.
+the ``maxAwaitTimeMS`` option to :phpmethod:`MongoDB\Collection::find()`.
diff --git a/source/upgrade.txt b/source/upgrade.txt
index 50da6f2f..58d34eb1 100644
--- a/source/upgrade.txt
+++ b/source/upgrade.txt
@@ -46,31 +46,31 @@ the new driver.
      - BSON type interface
 
    * - MongoId
-     - :php:`MongoDB\\BSON\\ObjectId `
-     - :php:`MongoDB\\BSON\\ObjectIdInterface `
+     - :php:`MongoDB\BSON\ObjectId `
+     - :php:`MongoDB\BSON\ObjectIdInterface `
 
    * - MongoCode
-     - :php:`MongoDB\\BSON\\Javascript `
-     - :php:`MongoDB\\BSON\\JavascriptInterface `
+     - :php:`MongoDB\BSON\Javascript `
+     - :php:`MongoDB\BSON\JavascriptInterface `
 
    * - MongoDate
-     - :php:`MongoDB\\BSON\\UTCDateTime `
-     - :php:`MongoDB\\BSON\\UTCDateTimeInterface `
+     - :php:`MongoDB\BSON\UTCDateTime `
+     - :php:`MongoDB\BSON\UTCDateTimeInterface `
 
    * - MongoRegex
-     - :php:`MongoDB\\BSON\\Regex `
-     - :php:`MongoDB\\BSON\\RegexInterface `
+     - :php:`MongoDB\BSON\Regex `
+     - :php:`MongoDB\BSON\RegexInterface `
 
    * - MongoBinData
-     - :php:`MongoDB\\BSON\\Binary `
-     - :php:`MongoDB\\BSON\\BinaryInterface `
+     - :php:`MongoDB\BSON\Binary `
+     - :php:`MongoDB\BSON\BinaryInterface `
 
    * - MongoInt32
      - Not implemented. [1]_
      -
 
    * - MongoInt64
-     - :php:`MongoDB\\BSON\\Int64 `
+     - :php:`MongoDB\BSON\Int64 `
      - Not implemented. [2]_
 
    * - MongoDBRef
@@ -78,23 +78,23 @@ the new driver.
      -
 
    * - MongoMinKey
-     - :php:`MongoDB\\BSON\\MinKey `
-     - :php:`MongoDB\\BSON\\MinKeyInterface `
+     - :php:`MongoDB\BSON\MinKey `
+     - :php:`MongoDB\BSON\MinKeyInterface `
 
    * - MongoMaxKey
-     - :php:`MongoDB\\BSON\\MaxKey `
-     - :php:`MongoDB\\BSON\\MaxKeyInterface `
+     - :php:`MongoDB\BSON\MaxKey `
+     - :php:`MongoDB\BSON\MaxKeyInterface `
 
    * - MongoTimestamp
-     - :php:`MongoDB\\BSON\\Timestamp `
-     - :php:`MongoDB\\BSON\\TimestampInterface `
+     - :php:`MongoDB\BSON\Timestamp `
+     - :php:`MongoDB\BSON\TimestampInterface `
 
 .. [1] The new driver does not implement an equivalent class for MongoInt32.
    When decoding BSON, 32-bit integers will always be represented as a PHP
    integer. When encoding BSON, PHP integers will encode as either a 32-bit or
    64-bit integer depending on their value.
 
-.. [2] :php:`MongoDB\\BSON\\Int64 ` does not have an
+.. [2] :php:`MongoDB\BSON\Int64 ` does not have an
    interface defined. The new driver does not allow applications to instantiate
    this type (i.e. its constructor is private) and it is only created during
    BSON decoding when a 64-bit integer cannot be represented as a PHP integer on
@@ -121,8 +121,8 @@ problematic:
   was a gap in their key sequence. Such gaps were caused by unsetting a key to
   remove an element and forgetting to numerically reindex the array.
 
-The |php-library|'s :phpclass:`BSONDocument ` and
-:phpclass:`BSONArray ` classes address these concerns
+The |php-library|'s :phpclass:`BSONDocument ` and
+:phpclass:`BSONArray ` classes address these concerns
 by preserving the BSON type information during serialization and
 deserialization; however, some users may still prefer the legacy behavior. If
 desired, you can use the ``typeMap`` option to have the library return
@@ -173,7 +173,7 @@ The above example would output something similar to:
 Collection API
 --------------
 
-This library's :phpclass:`MongoDB\\Collection` class implements MongoDB's
+This library's :phpclass:`MongoDB\Collection` class implements MongoDB's
 cross-driver `CRUD
 `_
 and `Index Management
@@ -197,102 +197,102 @@ equivalent method(s) in the new driver.
    :header-rows: 1
 
    * - MongoCollection method
-     - :phpclass:`MongoDB\\Collection` method(s)
+     - :phpclass:`MongoDB\Collection` method(s)
 
    * - ``MongoCollection::aggregate()``
-     - :phpmethod:`MongoDB\\Collection::aggregate()`
+     - :phpmethod:`MongoDB\Collection::aggregate()`
 
    * - ``MongoCollection::aggregateCursor()``
-     - :phpmethod:`MongoDB\\Collection::aggregate()`
+     - :phpmethod:`MongoDB\Collection::aggregate()`
 
    * - ``MongoCollection::batchInsert()``
-     - :phpmethod:`MongoDB\\Collection::insertMany()`
+     - :phpmethod:`MongoDB\Collection::insertMany()`
 
    * - ``MongoCollection::count()``
-     - :phpmethod:`MongoDB\\Collection::count()`
+     - :phpmethod:`MongoDB\Collection::count()`
 
    * - ``MongoCollection::createDBRef()``
      - Not yet implemented. [3]_
 
    * - ``MongoCollection::createIndex()``
-     - :phpmethod:`MongoDB\\Collection::createIndex()`
+     - :phpmethod:`MongoDB\Collection::createIndex()`
 
    * - ``MongoCollection::deleteIndex()``
-     - :phpmethod:`MongoDB\\Collection::dropIndex()`
+     - :phpmethod:`MongoDB\Collection::dropIndex()`
 
    * - ``MongoCollection::deleteIndexes()``
-     - :phpmethod:`MongoDB\\Collection::dropIndexes()`
+     - :phpmethod:`MongoDB\Collection::dropIndexes()`
 
    * - ``MongoCollection::drop()``
-     - :phpmethod:`MongoDB\\Collection::drop()`
+     - :phpmethod:`MongoDB\Collection::drop()`
 
    * - ``MongoCollection::distinct()``
-     - :phpmethod:`MongoDB\\Collection::distinct()`
+     - :phpmethod:`MongoDB\Collection::distinct()`
 
    * - ``MongoCollection::ensureIndex()``
-     - :phpmethod:`MongoDB\\Collection::createIndex()`
+     - :phpmethod:`MongoDB\Collection::createIndex()`
 
    * - ``MongoCollection::find()``
-     - :phpmethod:`MongoDB\\Collection::find()`
+     - :phpmethod:`MongoDB\Collection::find()`
 
    * - ``MongoCollection::findAndModify()``
-     - :phpmethod:`MongoDB\\Collection::findOneAndDelete()`,
-       :phpmethod:`MongoDB\\Collection::findOneAndReplace()`, and
-       :phpmethod:`MongoDB\\Collection::findOneAndUpdate()`
+     - :phpmethod:`MongoDB\Collection::findOneAndDelete()`,
+       :phpmethod:`MongoDB\Collection::findOneAndReplace()`, and
+       :phpmethod:`MongoDB\Collection::findOneAndUpdate()`
 
    * - ``MongoCollection::findOne()``
-     - :phpmethod:`MongoDB\\Collection::findOne()`
+     - :phpmethod:`MongoDB\Collection::findOne()`
 
    * - ``MongoCollection::getDBRef()``
      - Not implemented. [3]_
 
    * - ``MongoCollection::getIndexInfo()``
-     - :phpmethod:`MongoDB\\Collection::listIndexes()`
+     - :phpmethod:`MongoDB\Collection::listIndexes()`
 
    * - ``MongoCollection::getName()``
-     - :phpmethod:`MongoDB\\Collection::getCollectionName()`
+     - :phpmethod:`MongoDB\Collection::getCollectionName()`
 
    * - ``MongoCollection::getReadPreference()``
-     - :phpmethod:`MongoDB\\Collection::getReadPreference()`
+     - :phpmethod:`MongoDB\Collection::getReadPreference()`
 
    * - ``MongoCollection::getSlaveOkay()``
      - Not implemented.
 
    * - ``MongoCollection::getWriteConcern()``
-     - :phpmethod:`MongoDB\\Collection::getWriteConcern()`
+     - :phpmethod:`MongoDB\Collection::getWriteConcern()`
 
    * - ``MongoCollection::group()``
-     - Not implemented. Use :phpmethod:`MongoDB\\Database::command()`. See
+     - Not implemented. Use :phpmethod:`MongoDB\Database::command()`. See
        :ref:`Group Command Helper ` for an example.
 
    * - ``MongoCollection::insert()``
-     - :phpmethod:`MongoDB\\Collection::insertOne()`
+     - :phpmethod:`MongoDB\Collection::insertOne()`
 
    * - ``MongoCollection::parallelCollectionScan()``
      - Not implemented.
 
    * - ``MongoCollection::remove()``
-     - :phpmethod:`MongoDB\\Collection::deleteMany()` and
-       :phpmethod:`MongoDB\\Collection::deleteOne()`
+     - :phpmethod:`MongoDB\Collection::deleteMany()` and
+       :phpmethod:`MongoDB\Collection::deleteOne()`
 
    * - ``MongoCollection::save()``
-     - :phpmethod:`MongoDB\\Collection::insertOne()` or
-       :phpmethod:`MongoDB\\Collection::replaceOne()` with the ``upsert``
+     - :phpmethod:`MongoDB\Collection::insertOne()` or
+       :phpmethod:`MongoDB\Collection::replaceOne()` with the ``upsert``
        option.
 
    * - ``MongoCollection::setReadPreference()``
-     - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`.
+     - Not implemented. Use :phpmethod:`MongoDB\Collection::withOptions()`.
 
    * - ``MongoCollection::setSlaveOkay()``
      - Not implemented.
 
    * - ``MongoCollection::setWriteConcern()``
-     - Not implemented. Use :phpmethod:`MongoDB\\Collection::withOptions()`.
+     - Not implemented. Use :phpmethod:`MongoDB\Collection::withOptions()`.
 
    * - ``MongoCollection::update()``
-     - :phpmethod:`MongoDB\\Collection::replaceOne()`,
-       :phpmethod:`MongoDB\\Collection::updateMany()`, and
-       :phpmethod:`MongoDB\\Collection::updateOne()`.
+     - :phpmethod:`MongoDB\Collection::replaceOne()`,
+       :phpmethod:`MongoDB\Collection::updateMany()`, and
+       :phpmethod:`MongoDB\Collection::updateOne()`.
 
    * - ``MongoCollection::validate()``
      - Not implemented.
@@ -312,18 +312,18 @@ longer done in the new driver and library.
 IDs of inserted documents (whether generated or not) may be accessed through the
 following methods on the write result objects:
 
-- :phpmethod:`MongoDB\\InsertOneResult::getInsertedId()` for
-  :phpmethod:`MongoDB\\Collection::insertOne()`
-- :phpmethod:`MongoDB\\InsertManyResult::getInsertedIds()` for
-  :phpmethod:`MongoDB\\Collection::insertMany()`
-- :phpmethod:`MongoDB\\BulkWriteResult::getInsertedIds()` for
-  :phpmethod:`MongoDB\\Collection::bulkWrite()`
+- :phpmethod:`MongoDB\InsertOneResult::getInsertedId()` for
+  :phpmethod:`MongoDB\Collection::insertOne()`
+- :phpmethod:`MongoDB\InsertManyResult::getInsertedIds()` for
+  :phpmethod:`MongoDB\Collection::insertMany()`
+- :phpmethod:`MongoDB\BulkWriteResult::getInsertedIds()` for
+  :phpmethod:`MongoDB\Collection::bulkWrite()`
 
 Bulk Write Operations
 ~~~~~~~~~~~~~~~~~~~~~
 
 The legacy driver's MongoWriteBatch classes have been replaced with a
-general-purpose :phpmethod:`MongoDB\\Collection::bulkWrite()` method. Whereas
+general-purpose :phpmethod:`MongoDB\Collection::bulkWrite()` method. Whereas
 the legacy driver only allowed bulk operations of the same type, the new method
 allows operations to be mixed (e.g. inserts, updates, and deletes).
 
@@ -332,16 +332,16 @@ MongoCollection::save() Removed
 
 ``MongoCollection::save()``, which was syntactic sugar for an insert or upsert
 operation, has been removed in favor of explicitly using
-:phpmethod:`MongoDB\\Collection::insertOne()` or
-:phpmethod:`MongoDB\\Collection::replaceOne()` (with the ``upsert`` option).
+:phpmethod:`MongoDB\Collection::insertOne()` or
+:phpmethod:`MongoDB\Collection::replaceOne()` (with the ``upsert`` option).
 
 While the ``save`` method does have its uses for interactive environments, such
 as the MongoDB shell, it was intentionally excluded from the
 `CRUD specification `_
 for language drivers. Generally, application code should know if the document
 has an identifier and be able to explicitly insert or replace the document and
-handle the returned :phpclass:`MongoDB\\InsertOneResult` or
-:phpclass:`MongoDB\\UpdateResult`, respectively. This also helps avoid
+handle the returned :phpclass:`MongoDB\InsertOneResult` or
+:phpclass:`MongoDB\UpdateResult`, respectively. This also helps avoid
 inadvertent and potentially dangerous :manual:`full-document replacements
 `.
 
@@ -350,10 +350,10 @@ inadvertent and potentially dangerous :manual:`full-document replacements
 Group Command Helper
 ~~~~~~~~~~~~~~~~~~~~
 
-:phpclass:`MongoDB\\Collection` does not have a helper method for the
+:phpclass:`MongoDB\Collection` does not have a helper method for the
 :manual:`group ` command. The following example
 demonstrates how to execute a group command using the
-:phpmethod:`MongoDB\\Database::command()` method:
+:phpmethod:`MongoDB\Database::command()` method:
 
 .. code-block:: php
 

From 32c16b7134e7097a1a19221cd2608f046c4c5ab6 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Fri, 22 Mar 2024 09:24:54 -0400
Subject: [PATCH 308/321] DOCSP-36898: Fix seealso syntax in CSFLE tutorial
 (#1265)

Co-authored-by: Chris Cho 
---
 source/tutorial/client-side-encryption.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/source/tutorial/client-side-encryption.txt b/source/tutorial/client-side-encryption.txt
index 2b5aca6c..3d5bae1b 100644
--- a/source/tutorial/client-side-encryption.txt
+++ b/source/tutorial/client-side-encryption.txt
@@ -55,7 +55,9 @@ more than one encryption key or create them dynamically.
    // To store the key ID for later use, you can use serialize or var_export
    $keyId = $clientEncryption->createDataKey('local', ['keyAltNames' => ['my-encryption-key']]);
 
-.. seealso:: :manual:`Encryption Key Management ` in the MongoDB manual
+.. seealso::
+
+   :manual:`Encryption Key Management ` in the MongoDB manual
 
 
 Automatic Encryption and Decryption

From 63ab20b5a9e2d66e0c094efdcfca10c8feba7ad3 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 25 Mar 2024 09:45:09 -0400
Subject: [PATCH 309/321] DOCSP-37027: Remove use of post in
 collection-option-collation (#1266)

Snooty does not yet support this.
---
 source/includes/extracts-collection-option.yaml | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/source/includes/extracts-collection-option.yaml b/source/includes/extracts-collection-option.yaml
index 94d9b9b0..3d3a71d3 100644
--- a/source/includes/extracts-collection-option.yaml
+++ b/source/includes/extracts-collection-option.yaml
@@ -1,8 +1,11 @@
 ref: collection-option-collation
-source: 
-  ref: common-option-collation
-  file: extracts-common-option.yaml
-post: |
+content: |
+  :manual:`Collation ` allows users to specify
+  language-specific rules for string comparison, such as rules for lettercase
+  and accent marks. When specifying collation, the ``locale`` field is
+  mandatory; all other collation fields are optional. For descriptions of the
+  fields, see :manual:`Collation Document `.
+
   If the collation is unspecified but the collection has a default collation,
   the operation uses the collation specified for the collection. If no
   collation is specified for the collection or for the operation, MongoDB uses

From d64897fa9537d1701458e921791419f67e4267ae Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 25 Mar 2024 11:37:23 -0400
Subject: [PATCH 310/321] Fix versionadded syntax (#1269)

---
 source/includes/extracts-watch-option.yaml                    | 4 ++--
 .../reference/method/MongoDBDatabase-selectGridFSBucket.txt   | 2 +-
 .../reference/method/MongoDBGridFSBucket-openUploadStream.txt | 2 +-
 .../reference/method/MongoDBGridFSBucket-uploadFromStream.txt | 2 +-
 source/reference/method/MongoDBGridFSBucket__construct.txt    | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/source/includes/extracts-watch-option.yaml b/source/includes/extracts-watch-option.yaml
index 533e76ac..648989c7 100644
--- a/source/includes/extracts-watch-option.yaml
+++ b/source/includes/extracts-watch-option.yaml
@@ -61,7 +61,7 @@ content: |
 
      This is an option of the ``$changeStream`` pipeline stage.
 
-  .. versionadded: 1.13
+  .. versionadded:: 1.13
 ---
 ref: watch-option-maxAwaitTimeMS
 content: |
@@ -121,7 +121,7 @@ content: |
 
      This is an option of the ``$changeStream`` pipeline stage.
 
-  .. versionadded: 1.5
+  .. versionadded:: 1.5
 ---
 ref: watch-option-startAtOperationTime
 content: |
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index 9cebd3fc..ef772595 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -50,7 +50,7 @@ Parameters
 
          Defaults to ``false``.
 
-         .. versionadded: 1.4
+         .. versionadded:: 1.4
 
      * - readConcern
        - :php:`MongoDB\Driver\ReadConcern `
diff --git a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
index 24baebde..3a0ea02e 100644
--- a/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-openUploadStream.txt
@@ -57,7 +57,7 @@ Parameters
 
          Defaults to ``false``.
 
-         .. versionadded: 1.4
+         .. versionadded:: 1.4
 
      * - metadata
        - array|object
diff --git a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
index 0ba54e9f..eabfc2e9 100644
--- a/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+++ b/source/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
@@ -61,7 +61,7 @@ Parameters
 
          Defaults to ``false``.
 
-         .. versionadded: 1.4
+         .. versionadded:: 1.4
 
      * - metadata
        - array|object
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index 766e8650..ac26ecae 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -61,7 +61,7 @@ Parameters
 
          Defaults to ``false``.
 
-         .. versionadded: 1.4
+         .. versionadded:: 1.4
 
      * - readConcern
        - :php:`MongoDB\Driver\ReadConcern `

From 2e2ddaf093eb472e64748785e51f613f9f804af0 Mon Sep 17 00:00:00 2001
From: Jeremy Mikola 
Date: Mon, 25 Mar 2024 12:19:48 -0400
Subject: [PATCH 311/321] PHPLIB-1322: Document codec option for classes and
 operations (#1264)

The bucket-option-codec and collection-option-codec do not inherit common-option-codec since Snooty does not yet support "post" for appending to inherited content.

* Note why Bucket's codec option is not passed to CollectionWrapper
---
 source/includes/extracts-bucket-option.yaml              | 8 ++++++++
 source/includes/extracts-collection-option.yaml          | 8 ++++++++
 source/includes/extracts-common-option.yaml              | 5 +++++
 .../reference/method/MongoDBClient-selectCollection.txt  | 7 +++++++
 source/reference/method/MongoDBClient-watch.txt          | 6 ++++++
 source/reference/method/MongoDBCollection-aggregate.txt  | 6 ++++++
 source/reference/method/MongoDBCollection-bulkWrite.txt  | 9 +++++++++
 source/reference/method/MongoDBCollection-find.txt       | 6 ++++++
 source/reference/method/MongoDBCollection-findOne.txt    | 6 ++++++
 .../method/MongoDBCollection-findOneAndReplace.txt       | 6 ++++++
 source/reference/method/MongoDBCollection-insertMany.txt | 6 ++++++
 source/reference/method/MongoDBCollection-insertOne.txt  | 6 ++++++
 .../method/MongoDBCollection-listSearchIndexes.txt       | 6 ++++++
 source/reference/method/MongoDBCollection-replaceOne.txt | 6 ++++++
 source/reference/method/MongoDBCollection-watch.txt      | 6 ++++++
 .../reference/method/MongoDBCollection-withOptions.txt   | 7 +++++++
 source/reference/method/MongoDBCollection__construct.txt | 7 +++++++
 source/reference/method/MongoDBDatabase-aggregate.txt    | 6 ++++++
 .../method/MongoDBDatabase-selectCollection.txt          | 7 +++++++
 .../method/MongoDBDatabase-selectGridFSBucket.txt        | 7 +++++++
 source/reference/method/MongoDBDatabase-watch.txt        | 6 ++++++
 source/reference/method/MongoDBGridFSBucket-find.txt     | 6 ++++++
 source/reference/method/MongoDBGridFSBucket-findOne.txt  | 6 ++++++
 .../reference/method/MongoDBGridFSBucket__construct.txt  | 7 +++++++
 24 files changed, 156 insertions(+)

diff --git a/source/includes/extracts-bucket-option.yaml b/source/includes/extracts-bucket-option.yaml
index 0492ae9f..a3eb915f 100644
--- a/source/includes/extracts-bucket-option.yaml
+++ b/source/includes/extracts-bucket-option.yaml
@@ -1,3 +1,11 @@
+ref: bucket-option-codec
+content: |
+  The :doc:`codec ` to use for encoding or decoding documents.
+  This option is mutually exclusive with the ``typeMap`` option.
+
+  Defaults to the bucket's codec. Inheritance for a default ``codec`` option
+  takes precedence over that of the ``typeMap`` option.
+---
 ref: bucket-option-readConcern
 source:
   ref: common-option-readConcern
diff --git a/source/includes/extracts-collection-option.yaml b/source/includes/extracts-collection-option.yaml
index 94d9b9b0..838a009f 100644
--- a/source/includes/extracts-collection-option.yaml
+++ b/source/includes/extracts-collection-option.yaml
@@ -1,3 +1,11 @@
+ref: collection-option-codec
+content: |
+  The :doc:`codec ` to use for encoding or decoding documents.
+  This option is mutually exclusive with the ``typeMap`` option.
+
+  Defaults to the collection's codec. Inheritance for a default ``codec`` option
+  takes precedence over that of the ``typeMap`` option.
+---
 ref: collection-option-collation
 source: 
   ref: common-option-collation
diff --git a/source/includes/extracts-common-option.yaml b/source/includes/extracts-common-option.yaml
index 65940b1c..39cab355 100644
--- a/source/includes/extracts-common-option.yaml
+++ b/source/includes/extracts-common-option.yaml
@@ -1,3 +1,8 @@
+ref: common-option-codec
+content: |
+  The :doc:`codec ` to use for encoding or decoding documents.
+  This option is mutually exclusive with the ``typeMap`` option.
+---
 ref: common-option-collation
 content: |
   :manual:`Collation ` allows users to specify
diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt
index e7e58e86..c1984500 100644
--- a/source/reference/method/MongoDBClient-selectCollection.txt
+++ b/source/reference/method/MongoDBClient-selectCollection.txt
@@ -45,6 +45,13 @@ Parameters
        - Type
        - Description
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - The default :doc:`codec ` to use for collection
+         operations.
+
+         .. versionadded:: 1.17
+
      * - readConcern
        - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
diff --git a/source/reference/method/MongoDBClient-watch.txt b/source/reference/method/MongoDBClient-watch.txt
index 1cee5f01..336f38cc 100644
--- a/source/reference/method/MongoDBClient-watch.txt
+++ b/source/reference/method/MongoDBClient-watch.txt
@@ -48,6 +48,12 @@ Parameters
        - integer
        - .. include:: /includes/extracts/watch-option-batchSize.rst
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/common-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/common-option-collation.rst
diff --git a/source/reference/method/MongoDBCollection-aggregate.txt b/source/reference/method/MongoDBCollection-aggregate.txt
index 4566b92b..acbbee08 100644
--- a/source/reference/method/MongoDBCollection-aggregate.txt
+++ b/source/reference/method/MongoDBCollection-aggregate.txt
@@ -70,6 +70,12 @@ Parameters
          This only applies when using the :ref:`$out ` and
          :ref:`$out ` stages.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/collection-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/collection-option-collation.rst
diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt
index f76d6ca6..db4bfb8f 100644
--- a/source/reference/method/MongoDBCollection-bulkWrite.txt
+++ b/source/reference/method/MongoDBCollection-bulkWrite.txt
@@ -70,6 +70,15 @@ Parameters
        - If ``true``, allows the write operation to circumvent document level
          validation. Defaults to ``false``.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/collection-option-codec.rst
+
+         Bulk writes use the codec for ``insertOne`` and ``replaceOne``
+         operations.
+
+         .. versionadded:: 1.17
+
      * - comment
        - mixed
        - .. include:: /includes/extracts/common-option-comment.rst
diff --git a/source/reference/method/MongoDBCollection-find.txt b/source/reference/method/MongoDBCollection-find.txt
index 25cca009..d6e5a74d 100644
--- a/source/reference/method/MongoDBCollection-find.txt
+++ b/source/reference/method/MongoDBCollection-find.txt
@@ -61,6 +61,12 @@ Parameters
          Unlike the previous wire protocol version, a batchSize of ``1`` for the
          :dbcommand:`find` command does not close the cursor.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/collection-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/collection-option-collation.rst
diff --git a/source/reference/method/MongoDBCollection-findOne.txt b/source/reference/method/MongoDBCollection-findOne.txt
index d00c5866..269d81eb 100644
--- a/source/reference/method/MongoDBCollection-findOne.txt
+++ b/source/reference/method/MongoDBCollection-findOne.txt
@@ -52,6 +52,12 @@ Parameters
          the :program:`mongos` if some shards are unavailable instead of
          throwing an error.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/collection-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/collection-option-collation.rst
diff --git a/source/reference/method/MongoDBCollection-findOneAndReplace.txt b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
index 48f6df29..c0a4cef1 100644
--- a/source/reference/method/MongoDBCollection-findOneAndReplace.txt
+++ b/source/reference/method/MongoDBCollection-findOneAndReplace.txt
@@ -50,6 +50,12 @@ Parameters
        - If ``true``, allows the write operation to circumvent document level
          validation. Defaults to ``false``.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/collection-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/collection-option-collation.rst
diff --git a/source/reference/method/MongoDBCollection-insertMany.txt b/source/reference/method/MongoDBCollection-insertMany.txt
index 37f7d82f..bcaec509 100644
--- a/source/reference/method/MongoDBCollection-insertMany.txt
+++ b/source/reference/method/MongoDBCollection-insertMany.txt
@@ -46,6 +46,12 @@ Parameters
        - If ``true``, allows the write operation to circumvent document level
          validation. Defaults to ``false``.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/collection-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - comment
        - mixed
        - .. include:: /includes/extracts/common-option-comment.rst
diff --git a/source/reference/method/MongoDBCollection-insertOne.txt b/source/reference/method/MongoDBCollection-insertOne.txt
index 7a638bdc..d4b0d0de 100644
--- a/source/reference/method/MongoDBCollection-insertOne.txt
+++ b/source/reference/method/MongoDBCollection-insertOne.txt
@@ -46,6 +46,12 @@ Parameters
        - If ``true``, allows the write operation to circumvent document level
          validation. Defaults to ``false``.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/collection-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - comment
        - mixed
        - .. include:: /includes/extracts/common-option-comment.rst
diff --git a/source/reference/method/MongoDBCollection-listSearchIndexes.txt b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
index cc0f840a..73b58653 100644
--- a/source/reference/method/MongoDBCollection-listSearchIndexes.txt
+++ b/source/reference/method/MongoDBCollection-listSearchIndexes.txt
@@ -52,6 +52,12 @@ Parameters
          returning a cursor or failure from ``aggregate`` without doing
          significant server-side work.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/collection-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/common-option-collation.rst
diff --git a/source/reference/method/MongoDBCollection-replaceOne.txt b/source/reference/method/MongoDBCollection-replaceOne.txt
index f9bfb1b8..7a5444a1 100644
--- a/source/reference/method/MongoDBCollection-replaceOne.txt
+++ b/source/reference/method/MongoDBCollection-replaceOne.txt
@@ -52,6 +52,12 @@ Parameters
        - If ``true``, allows the write operation to circumvent document level
          validation. Defaults to ``false``.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/collection-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/collection-option-collation.rst
diff --git a/source/reference/method/MongoDBCollection-watch.txt b/source/reference/method/MongoDBCollection-watch.txt
index 0722b6d7..083e129b 100644
--- a/source/reference/method/MongoDBCollection-watch.txt
+++ b/source/reference/method/MongoDBCollection-watch.txt
@@ -48,6 +48,12 @@ Parameters
        - integer
        - .. include:: /includes/extracts/watch-option-batchSize.rst
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/collection-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/common-option-collation.rst
diff --git a/source/reference/method/MongoDBCollection-withOptions.txt b/source/reference/method/MongoDBCollection-withOptions.txt
index d942b8cc..8123904b 100644
--- a/source/reference/method/MongoDBCollection-withOptions.txt
+++ b/source/reference/method/MongoDBCollection-withOptions.txt
@@ -35,6 +35,13 @@ Parameters
        - Type
        - Description
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - The default :doc:`codec ` to use for collection
+         operations. Defaults to the original collection's codec.
+
+         .. versionadded:: 1.17
+
      * - readConcern
        - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt
index c4d2524f..a7480447 100644
--- a/source/reference/method/MongoDBCollection__construct.txt
+++ b/source/reference/method/MongoDBCollection__construct.txt
@@ -49,6 +49,13 @@ Definition
        - Type
        - Description
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - The default :doc:`codec ` to use for collection
+         operations.
+
+         .. versionadded:: 1.17
+
      * - readConcern
        - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
diff --git a/source/reference/method/MongoDBDatabase-aggregate.txt b/source/reference/method/MongoDBDatabase-aggregate.txt
index 66546315..8c022586 100644
--- a/source/reference/method/MongoDBDatabase-aggregate.txt
+++ b/source/reference/method/MongoDBDatabase-aggregate.txt
@@ -74,6 +74,12 @@ Parameters
          This only applies when using the :ref:`$out ` and
          :ref:`$out ` stages.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/common-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/common-option-collation.rst
diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt
index 854298e0..b88179cd 100644
--- a/source/reference/method/MongoDBDatabase-selectCollection.txt
+++ b/source/reference/method/MongoDBDatabase-selectCollection.txt
@@ -41,6 +41,13 @@ Parameters
        - Type
        - Description
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - The default :doc:`codec ` to use for collection
+         operations.
+
+         .. versionadded:: 1.17
+
      * - readConcern
        - :php:`MongoDB\Driver\ReadConcern `
        - The default read concern to use for collection operations. Defaults to
diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
index 9cebd3fc..a931ba4c 100644
--- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
+++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt
@@ -44,6 +44,13 @@ Parameters
        - integer
        - The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - The default :doc:`codec ` to use for bucket methods
+         that return a file document (e.g. :phpmethod:`MongoDB\GridFS\Bucket::find()`).
+
+         .. versionadded:: 1.17
+
      * - disableMD5
        - boolean
        - Whether to disable automatic MD5 generation when storing files.
diff --git a/source/reference/method/MongoDBDatabase-watch.txt b/source/reference/method/MongoDBDatabase-watch.txt
index 396e5cfd..d8c53763 100644
--- a/source/reference/method/MongoDBDatabase-watch.txt
+++ b/source/reference/method/MongoDBDatabase-watch.txt
@@ -48,6 +48,12 @@ Parameters
        - integer
        - .. include:: /includes/extracts/watch-option-batchSize.rst
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/common-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/common-option-collation.rst
diff --git a/source/reference/method/MongoDBGridFSBucket-find.txt b/source/reference/method/MongoDBGridFSBucket-find.txt
index bfd57089..85344f7a 100644
--- a/source/reference/method/MongoDBGridFSBucket-find.txt
+++ b/source/reference/method/MongoDBGridFSBucket-find.txt
@@ -61,6 +61,12 @@ Parameters
          Unlike the previous wire protocol version, a batchSize of ``1`` for the
          :dbcommand:`find` command does not close the cursor.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/bucket-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/common-option-collation.rst
diff --git a/source/reference/method/MongoDBGridFSBucket-findOne.txt b/source/reference/method/MongoDBGridFSBucket-findOne.txt
index 89877e3a..7bcc6860 100644
--- a/source/reference/method/MongoDBGridFSBucket-findOne.txt
+++ b/source/reference/method/MongoDBGridFSBucket-findOne.txt
@@ -53,6 +53,12 @@ Parameters
          the :program:`mongos` if some shards are unavailable instead of
          throwing an error.
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - .. include:: /includes/extracts/bucket-option-codec.rst
+
+         .. versionadded:: 1.17
+
      * - collation
        - array|object
        - .. include:: /includes/extracts/common-option-collation.rst
diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt
index 766e8650..b051361f 100644
--- a/source/reference/method/MongoDBGridFSBucket__construct.txt
+++ b/source/reference/method/MongoDBGridFSBucket__construct.txt
@@ -55,6 +55,13 @@ Parameters
        - integer
        - The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
 
+     * - codec
+       - MongoDB\\Codec\\DocumentCodec
+       - The default :doc:`codec ` to use for bucket methods
+         that return a file document (e.g. :phpmethod:`MongoDB\GridFS\Bucket::find()`).
+
+         .. versionadded:: 1.17
+
      * - disableMD5
        - boolean
        - Whether to disable automatic MD5 generation when storing files.

From bb8bbdc533a24c095b024ee27ec450512d564052 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?=
 
Date: Fri, 19 Apr 2024 15:04:07 +0200
Subject: [PATCH 312/321] PHPLIB-1163 Create tutorial for using MongoDB with
 Bref (#1273) (#1282)

---
 source/examples/aws-lambda/composer.json  |  19 +++
 source/examples/aws-lambda/index.php      |  31 +++++
 source/examples/aws-lambda/serverless.yml |  22 ++++
 source/tutorial.txt                       |   1 +
 source/tutorial/aws-lambda.txt            | 151 ++++++++++++++++++++++
 5 files changed, 224 insertions(+)
 create mode 100644 source/examples/aws-lambda/composer.json
 create mode 100644 source/examples/aws-lambda/index.php
 create mode 100644 source/examples/aws-lambda/serverless.yml
 create mode 100644 source/tutorial/aws-lambda.txt

diff --git a/source/examples/aws-lambda/composer.json b/source/examples/aws-lambda/composer.json
new file mode 100644
index 00000000..5d1c6071
--- /dev/null
+++ b/source/examples/aws-lambda/composer.json
@@ -0,0 +1,19 @@
+{
+    "name": "mongodb/bref-tutorial",
+    "type": "project",
+    "license": "MIT",
+    "repositories": [
+        {
+            "type": "path",
+            "url": "../../..",
+            "options": {
+                "symlink": false
+            }
+        }
+    ],
+    "require": {
+        "bref/bref": "^2.1",
+        "bref/extra-php-extensions": "^1.4",
+        "mongodb/mongodb": "@dev"
+    }
+}
diff --git a/source/examples/aws-lambda/index.php b/source/examples/aws-lambda/index.php
new file mode 100644
index 00000000..caad319b
--- /dev/null
+++ b/source/examples/aws-lambda/index.php
@@ -0,0 +1,31 @@
+selectCollection('sample_guides', 'planets')
+        ->find([], ['sort' => ['orderFromSun' => 1]]);
+} catch (Throwable $exception) {
+    exit($exception->getMessage());
+}
+
+?>
+
+
+
+    MongoDB Planets
+
+
+    
    + +
  • name ?>
  • + +
+ + diff --git a/source/examples/aws-lambda/serverless.yml b/source/examples/aws-lambda/serverless.yml new file mode 100644 index 00000000..7773d1dd --- /dev/null +++ b/source/examples/aws-lambda/serverless.yml @@ -0,0 +1,22 @@ +service: app + +provider: + name: aws + region: us-east-1 + environment: + MONGODB_URI: ${env:MONGODB_URI} + +plugins: + - ./vendor/bref/bref + - ./vendor/bref/extra-php-extensions + +functions: + api: + handler: index.php + description: '' + runtime: php-83-fpm + timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds) + events: + - httpApi: '*' + layers: + - ${bref-extra:mongodb-php-83} diff --git a/source/tutorial.txt b/source/tutorial.txt index 31595bdc..f50c19c8 100644 --- a/source/tutorial.txt +++ b/source/tutorial.txt @@ -18,5 +18,6 @@ Tutorials /tutorial/indexes /tutorial/tailable-cursor /tutorial/example-data + /tutorial/aws-lambda /tutorial/modeling-bson-data /tutorial/stable-api diff --git a/source/tutorial/aws-lambda.txt b/source/tutorial/aws-lambda.txt new file mode 100644 index 00000000..efce81fc --- /dev/null +++ b/source/tutorial/aws-lambda.txt @@ -0,0 +1,151 @@ +============================== +Deploy to AWS Lambda with Bref +============================== + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +Overview +-------- + +`Bref `__ lets you deploy serverless PHP applications on AWS Lambda. +In this tutorial, you will deploy a simple PHP application with the MongoDB PHP extension, +and connect to an Atlas cluster using AWS IAM authentication. + +Prerequisites +-------------- + +To deploy to AWS Lambda by using Bref, you must have the following components set up: + +- AWS account with access keys +- Serverless Framework + +To learn how to set these up, follow the `Setup tutorial `__ +in the Bref official documentation. + +Install the MongoDB extension +----------------------------- + +Bref uses Lambda layers to provide the PHP runtime. The ``bref`` layer is compiled +with PHP and a few extensions. Other extensions, like ``mongodb``, are available +in additional layers. + +Start by creating a new directory for your project and install the required MongoDB +and Bref dependencies. + +.. code-block:: none + + $ mkdir bref-mongodb-app && cd bref-mongodb-app + $ composer init + $ composer require bref/bref bref/extra-php-extensions mongodb/mongodb + +Then initialize the serverless configuration using the ``bref`` command. + +.. code-block:: none + + $ vendor/bin/bref init + + +After this series of commands, you should have this files: + +- ``composer.json`` for PHP dependencies installed in the ``vendor`` directory +- ``index.php`` a sample webpage +- ``serverless.yml`` for the configuration of the deployment + +To validate your setup, try deploying this default application. This outputs +a URL that renders a webpage with the Bref logo: + +.. code-block:: none + + $ serverless deploy + + +Now that you have initialized the project, you will add the ``mongodb`` extension. +Locate the "Serverless config" name in the list of extensions provided by +`bref/extra-php-extension `__. +Add it to the ``layers`` of the function in ``serverless.yaml``, this file +will look like this: + +.. code-block:: yaml + + plugins: + - ./vendor/bref/bref + - ./vendor/bref/extra-php-extensions + + functions: + api: + handler: index.php + runtime: php-83-fpm + layers: + - ${bref-extra:mongodb-php-83} + + + +Let's use the MongoDB driver with a web page that list planets from the Atlas +`sample dataset `__. +Replace the contents of ``index.php`` with the following: + +.. literalinclude:: /examples/aws-lambda/index.php + :language: php + + +Redeploy the application with the new ``index.php``: + +.. code-block:: none + + $ serverless deploy + + +The application will display an error message because the ``MONGODB_URI`` +environment variable has not yet been set. We'll look at how to set this +variable in the next section. + +AWS Credentials +--------------- + +Atlas supports passwordless authentication with AWS credentials. In any Lambda function, +AWS sets environment variables that contains the access token and secret token with +the role assigned to deployed function. + +1. Open the Lambda function in the AWS console +2. In :guilabel:`Configuration > Permission`, copy the :guilabel:`Role name` +3. Add this role to your Atlas cluster with the built-in Role: "Read and write any database" + +To learn how to set up unified AWS access, see `Set Up Unified AWS Access +`__ +in the MongoDB Atlas documentation. + +Now that the permissions have been configured, the Lambda function is allowed to access +your Atlas cluster. You can configure your application with the Atlas endpoint. + +Access to Atlas clusters is also restricted by IP address. Since the range of IP that comes +from AWS is very wide, you can `allow access from everywhere +`__. + +.. note:: + + Using VPC Peering is recommended in order to isolate your Atlas cluster from Internet. + This requires the Lambda function to be deployed in this AWS VPC. + +Find the connection URI in the Atlas UI :guilabel:`Atlas > Deployment > Database > Connect`. +Select :guilabel:`3. AWS IAM`. +Remove the ``:`` part from the URI, the credentials +will be read from environment variables. + +Update the ``serverless.yml`` file to pass the environment variable ``MONGODB_URI``. + +.. code-block:: yaml + + provider: + environment: + MONGODB_URI: "mongodb+srv://cluster0.example.mongodb.net/?authSource=%24external&authMechanism=MONGODB-AWS&retryWrites=true&w=majority" + +Finally, deploy with the new configuration. After deployment completes, you can +access the function URL and see the list of planets from your Atlas cluster. + +.. code-block:: none + + $ serverless deploy From 720bc05bc28a2ac122e34cc0c008a64aa5903c40 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 23 Apr 2024 21:01:55 +0200 Subject: [PATCH 313/321] Fix syntax error in docs (#1285) --- source/reference/method/MongoDBDatabase-aggregate.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/reference/method/MongoDBDatabase-aggregate.txt b/source/reference/method/MongoDBDatabase-aggregate.txt index 8c022586..6be8d104 100644 --- a/source/reference/method/MongoDBDatabase-aggregate.txt +++ b/source/reference/method/MongoDBDatabase-aggregate.txt @@ -163,7 +163,7 @@ running command operations. $cursor = $database->aggregate( [ ['$currentOp' => []], - ['$match' => ['op' => 'command'], + ['$match' => ['op' => 'command']], ] ); From afa36ddf7e85d08f0372cfb81e1dd1973a426d4e Mon Sep 17 00:00:00 2001 From: Nora Reidy Date: Thu, 9 May 2024 13:27:57 -0400 Subject: [PATCH 314/321] DOCSP-37027: Fix 1.16 build errors (#1290) --- source/includes/extracts-option-requires.yaml | 21 +++++++++---------- source/reference.txt | 2 -- .../method/MongoDBCollection-bulkWrite.txt | 12 +++++------ .../method/MongoDBCollection-dropIndex.txt | 3 +-- .../method/MongoDBCollection-dropIndexes.txt | 2 +- .../method/MongoDBCollection-explain.txt | 2 +- .../MongoDBCollection-findOneAndUpdate.txt | 2 +- .../method/MongoDBCollection-updateMany.txt | 2 +- .../method/MongoDBCollection-updateOne.txt | 2 +- .../MongoDBDatabase-createCollection.txt | 2 +- source/reference/result-classes.txt | 2 +- source/tutorial/gridfs.txt | 2 +- 12 files changed, 25 insertions(+), 29 deletions(-) diff --git a/source/includes/extracts-option-requires.yaml b/source/includes/extracts-option-requires.yaml index 3b65fbba..edc1c0d3 100644 --- a/source/includes/extracts-option-requires.yaml +++ b/source/includes/extracts-option-requires.yaml @@ -1,48 +1,47 @@ +ref: _option-requires-version +content: | + This option is available since MongoDB {{version}} and will result in an + exception at execution time if specified for an older server version. --- ref: option-requires-4.2 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "4.2" --- ref: option-requires-4.4 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "4.4" --- ref: option-requires-5.0 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "5.0" --- ref: option-requires-5.3 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "5.3" --- ref: option-requires-6.0 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "6.0" --- ref: option-requires-7.0 source: - ref: option-requires-version file: extracts-option-requires.yaml + ref: _option-requires-version replacement: version: "7.0" ---- -ref: option-requires-version -content: | - This option is available since MongoDB {{version}} and will result in an - exception at execution time if specified for an older server version. ... diff --git a/source/reference.txt b/source/reference.txt index 1d2c76db..48ec340b 100644 --- a/source/reference.txt +++ b/source/reference.txt @@ -12,8 +12,6 @@ Reference /reference/class/MongoDBDatabase /reference/class/MongoDBCollection /reference/class/MongoDBGridFSBucket - /reference/write-result-classes /reference/result-classes - /reference/enumeration-classes /reference/functions /reference/exception-classes diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt index f76d6ca6..f7defc12 100644 --- a/source/reference/method/MongoDBCollection-bulkWrite.txt +++ b/source/reference/method/MongoDBCollection-bulkWrite.txt @@ -30,12 +30,12 @@ Parameters ``$operations`` : array An array containing the write operations to perform. :phpmethod:`MongoDB\Collection::bulkWrite()` supports - :phpmethod:`deleteMany() `, - :phpmethod:`deleteOne() `, - :phpmethod:`insertOne() `, - :phpmethod:`replaceOne() `, - :phpmethod:`updateMany() `, and - :phpmethod:`updateOne() ` operations in the + :phpmethod:`MongoDB\Collection::deleteMany()`, + :phpmethod:`MongoDB\Collection::deleteOne()`, + :phpmethod:`MongoDB\Collection::insertOne()`, + :phpmethod:`MongoDB\Collection::replaceOne()`, + :phpmethod:`MongoDB\Collection::updateMany()`, and + :phpmethod:`MongoDB\Collection::updateOne()` operations in the following array structure: .. code-block:: php diff --git a/source/reference/method/MongoDBCollection-dropIndex.txt b/source/reference/method/MongoDBCollection-dropIndex.txt index 67ba427e..d1aa937c 100644 --- a/source/reference/method/MongoDBCollection-dropIndex.txt +++ b/source/reference/method/MongoDBCollection-dropIndex.txt @@ -29,8 +29,7 @@ Parameters ``$indexName`` : string| :phpclass:`MongoDB\Model\IndexInfo` The name or model object of the index to drop. View the existing indexes on - the collection using the :phpmethod:`listIndexes() - ` method. + the collection by using the :phpmethod:`MongoDB\Collection::listIndexes()` method. ``$options`` : array An array specifying the desired options. diff --git a/source/reference/method/MongoDBCollection-dropIndexes.txt b/source/reference/method/MongoDBCollection-dropIndexes.txt index 52595c71..6e052cb2 100644 --- a/source/reference/method/MongoDBCollection-dropIndexes.txt +++ b/source/reference/method/MongoDBCollection-dropIndexes.txt @@ -28,7 +28,7 @@ Parameters ``$indexName`` : string| :phpclass:`MongoDB\Model\IndexInfo` The name or model object of the index to drop. View the existing indexes on the collection using the :phpmethod:`listIndexes() - ` method. + ` method. ``$options`` : array An array specifying the desired options. diff --git a/source/reference/method/MongoDBCollection-explain.txt b/source/reference/method/MongoDBCollection-explain.txt index 592f717e..03619755 100644 --- a/source/reference/method/MongoDBCollection-explain.txt +++ b/source/reference/method/MongoDBCollection-explain.txt @@ -29,7 +29,7 @@ Definition Parameters ---------- -``$explainable`` : :phpclass:`MongoDB\Operation\Explainable` +``$explainable`` : ``MongoDB\Operation\Explainable`` The command to explain. ``$options`` : array diff --git a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt index f4077b34..19849ad3 100644 --- a/source/reference/method/MongoDBCollection-findOneAndUpdate.txt +++ b/source/reference/method/MongoDBCollection-findOneAndUpdate.txt @@ -33,7 +33,7 @@ Parameters ``$update`` : array|object Specifies the field and value combinations to update and any relevant update - operators. ``$update`` uses MongoDB's :method:`update operators + operators. ``$update`` uses MongoDB's :manual:`update operators `. Starting with MongoDB 4.2, an `aggregation pipeline `_ can be passed as this parameter. diff --git a/source/reference/method/MongoDBCollection-updateMany.txt b/source/reference/method/MongoDBCollection-updateMany.txt index 2b077220..9d567ec3 100644 --- a/source/reference/method/MongoDBCollection-updateMany.txt +++ b/source/reference/method/MongoDBCollection-updateMany.txt @@ -33,7 +33,7 @@ Parameters ``$update`` : array|object Specifies the field and value combinations to update and any relevant update - operators. ``$update`` uses MongoDB's :method:`update operators + operators. ``$update`` uses MongoDB's :manual:`update operators `. Starting with MongoDB 4.2, an `aggregation pipeline `_ can be passed as this parameter. diff --git a/source/reference/method/MongoDBCollection-updateOne.txt b/source/reference/method/MongoDBCollection-updateOne.txt index 321103c2..42877e73 100644 --- a/source/reference/method/MongoDBCollection-updateOne.txt +++ b/source/reference/method/MongoDBCollection-updateOne.txt @@ -35,7 +35,7 @@ Parameters ``$update`` : array|object Specifies the field and value combinations to update and any relevant update - operators. ``$update`` uses MongoDB's :method:`update operators + operators. ``$update`` uses MongoDB's :manual:`update operators `. Starting with MongoDB 4.2, an `aggregation pipeline `_ can be passed as this parameter. diff --git a/source/reference/method/MongoDBDatabase-createCollection.txt b/source/reference/method/MongoDBDatabase-createCollection.txt index 3c45debc..8b49e901 100644 --- a/source/reference/method/MongoDBDatabase-createCollection.txt +++ b/source/reference/method/MongoDBDatabase-createCollection.txt @@ -296,7 +296,7 @@ Parameters rules or expressions. You can specify the expressions using the same operators as MongoDB's :manual:`query operators ` with the - exception of :query:`$geoNear`, :query:`$near`, :query:`$nearSphere`, + exception of :query:`$near`, :query:`$nearSphere`, :query:`$text`, and :query:`$where`. .. note:: diff --git a/source/reference/result-classes.txt b/source/reference/result-classes.txt index db5ff759..b59f480c 100644 --- a/source/reference/result-classes.txt +++ b/source/reference/result-classes.txt @@ -10,7 +10,7 @@ Result Classes BulkWriteResult Class DeleteResult Class InsertManyResult Class - InsertOneResult Class + InsertOneResult Class UpdateResult Class ChangeStream Class MapReduceResult Class diff --git a/source/tutorial/gridfs.txt b/source/tutorial/gridfs.txt index 4688aefb..dc6afa15 100644 --- a/source/tutorial/gridfs.txt +++ b/source/tutorial/gridfs.txt @@ -35,7 +35,7 @@ The bucket can be constructed with various options: needed. The default size is ``261120`` (i.e. 255 KiB). - ``readConcern``, ``readPreference`` and ``writeConcern`` options can be used to specify defaults for read and write operations, much like the - :phpclass:`MongoDB\GridFS\Collection` options. + :phpclass:`MongoDB\Collection` options. Uploading Files with Writable Streams ------------------------------------- From a89988327ea63210acbc5933819792690ac5c2e5 Mon Sep 17 00:00:00 2001 From: Nora Reidy Date: Fri, 10 May 2024 13:10:18 -0400 Subject: [PATCH 315/321] DOCSP-37027: Additional 1.17 build fixes (#1301) --- source/tutorial/encryption.txt | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/source/tutorial/encryption.txt b/source/tutorial/encryption.txt index 3a912165..c16845f9 100644 --- a/source/tutorial/encryption.txt +++ b/source/tutorial/encryption.txt @@ -19,45 +19,45 @@ To get started using in-use encryption in your project, the to be compiled with `libmongocrypt `_ (enabled by default). -Additionally, either `crypt_shared`_ or `mongocryptd`_ are required in order to +Additionally, either ``crypt_shared`` or ``mongocryptd`` are required in order to use *automatic* client-side encryption. Neither is required for *explicit* encryption. -crypt_shared -~~~~~~~~~~~~ +``crypt_shared`` +~~~~~~~~~~~~~~~~ The :manual:`Automatic Encryption Shared Library ` -(crypt_shared) provides the same functionality as mongocryptd_, but does not +(``crypt_shared``) provides the same functionality as ``mongocryptd``, but does not require you to spawn another process to perform automatic encryption. -By default, the PHP driver attempts to load crypt_shared from the system path(s) -and uses it automatically if found. To load crypt_shared from another location, +By default, the PHP driver attempts to load ``crypt_shared`` from the system path(s) +and uses it automatically if found. To load ``crypt_shared`` from another location, use the ``cryptSharedLibPath`` auto encryption :php:`driver option ` -when constructing a client. If the driver cannot load crypt_shared it will -attempt to fallback to using mongocryptd by default. The -``cryptSharedLibRequired`` option may be used to always require crypt_shared and +when constructing a client. If the driver cannot load ``crypt_shared`` it will +attempt to fallback to using ``mongocryptd`` by default. The +``cryptSharedLibRequired`` option may be used to always require ``crypt_shared`` and fail if it cannot be loaded. For detailed installation instructions see the MongoDB documentation for the :manual:`Automatic Encryption Shared Library `. -mongocryptd -~~~~~~~~~~~ +``mongocryptd`` +~~~~~~~~~~~~~~~ -The mongocryptd binary is an alternative requirement for automatic client-side +The ``mongocryptd`` binary is an alternative requirement for automatic client-side encryption and is included as a component in the :manual:`MongoDB Enterprise Server package `. For detailed installation instructions see the :manual:`MongoDB documentation on mongocryptd `. -mongocryptd performs the following: +``mongocryptd`` performs the following: - Parses the automatic encryption rules specified in the client configuration. If the ``schemaMap`` auto encryption driver option contains invalid syntax, - mongocryptd returns an error. + ``mongocryptd`` returns an error. - Uses the specified automatic encryption rules to mark fields in read and write operations for encryption. @@ -67,11 +67,11 @@ mongocryptd performs the following: see :manual:`Supported Operations for Automatic Encryption `. A client configured with auto encryption will automatically spawn the -mongocryptd process from the application's ``PATH``. Applications can control +``mongocryptd`` process from the application's ``PATH``. Applications can control the spawning behavior via various auto encryption :php:`driver options `. -mongocryptd is only responsible for supporting automatic client-side encryption +``mongocryptd`` is only responsible for supporting automatic client-side encryption and does not itself perform any encryption or decryption. @@ -208,7 +208,7 @@ Explicit Encryption ~~~~~~~~~~~~~~~~~~~ Explicit encryption is a MongoDB community feature and does not use -crypt_shared_ or mongocryptd_. Explicit encryption is provided by the +``crypt_shared`` or ``mongocryptd``. Explicit encryption is provided by the :php:`MongoDB\Driver\ClientEncryption ` class. .. literalinclude:: /examples/encryption/csfle-explicit_encryption.php From 157909bb400dbe504b53f21ebb6b70a8d71bcdc3 Mon Sep 17 00:00:00 2001 From: Nora Reidy Date: Fri, 10 May 2024 13:10:45 -0400 Subject: [PATCH 316/321] DOCSP-37027: Additional build fixes 1.18 (#1302) --- source/reference/method/MongoDBClient-addSubscriber.txt | 6 +++--- source/reference/method/MongoDBClient-removeSubscriber.txt | 2 +- ...MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/reference/method/MongoDBClient-addSubscriber.txt b/source/reference/method/MongoDBClient-addSubscriber.txt index b85d8d99..f5be110c 100644 --- a/source/reference/method/MongoDBClient-addSubscriber.txt +++ b/source/reference/method/MongoDBClient-addSubscriber.txt @@ -17,8 +17,8 @@ Definition .. phpmethod:: MongoDB\Client::addSubscriber() - Registers a monitoring event subscriber with this Client. The subscriber - will be notified of all events for this Client. + Registers a monitoring event subscriber with this Client. The subscriber + will be notified of all events for this Client. .. code-block:: php @@ -50,7 +50,7 @@ notified once of each event for this Client. Example ------- -Create a :phpclass:`MongoDB\Driver\Monitoring\CommandSubscriber` that +Create a :php:`MongoDB\Driver\Monitoring\CommandSubscriber` that logs all events: .. code-block:: php diff --git a/source/reference/method/MongoDBClient-removeSubscriber.txt b/source/reference/method/MongoDBClient-removeSubscriber.txt index 9270689d..e95f74e7 100644 --- a/source/reference/method/MongoDBClient-removeSubscriber.txt +++ b/source/reference/method/MongoDBClient-removeSubscriber.txt @@ -17,7 +17,7 @@ Definition .. phpmethod:: MongoDB\Client::removeSubscriber() - Unregisters a monitoring event subscriber with this Client. + Unregisters a monitoring event subscriber with this Client. .. code-block:: php diff --git a/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt b/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt index 2d8fe60d..405b0d3e 100644 --- a/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt +++ b/source/reference/method/MongoDBGridFSBucket-registerGlobalStreamWrapperAlias.txt @@ -19,7 +19,7 @@ Definition Registers an alias for the bucket, which enables files within the bucket to be accessed using a basic filename string (e.g. - `gridfs:///`). + ``gridfs:///``). .. code-block:: php @@ -58,7 +58,7 @@ revision is read (revision ``-1``). In write mode, the stream context can contain the option ``gridfs['chunkSizeBytes']``. If omitted, the defaults are inherited from the ``Bucket`` instance option. -The functions `rename` and `unlink` will rename or remove all revisions of a +The functions ``rename`` and ``unlink`` will rename or remove all revisions of a filename. If the filename does not exist, these functions throw a ``FileNotFoundException``. Example From 10e02edcfecb9fdabaa03ed4332fb8ba39e59842 Mon Sep 17 00:00:00 2001 From: MongoDB PHP Bot <162451593+mongodb-php-bot@users.noreply.github.com> Date: Fri, 10 May 2024 19:11:45 +0200 Subject: [PATCH 317/321] DOCSP-37027: Additional 1.17 build fixes (#1301) (#1303) Co-authored-by: Nora Reidy --- source/tutorial/encryption.txt | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/source/tutorial/encryption.txt b/source/tutorial/encryption.txt index 3a912165..c16845f9 100644 --- a/source/tutorial/encryption.txt +++ b/source/tutorial/encryption.txt @@ -19,45 +19,45 @@ To get started using in-use encryption in your project, the to be compiled with `libmongocrypt `_ (enabled by default). -Additionally, either `crypt_shared`_ or `mongocryptd`_ are required in order to +Additionally, either ``crypt_shared`` or ``mongocryptd`` are required in order to use *automatic* client-side encryption. Neither is required for *explicit* encryption. -crypt_shared -~~~~~~~~~~~~ +``crypt_shared`` +~~~~~~~~~~~~~~~~ The :manual:`Automatic Encryption Shared Library ` -(crypt_shared) provides the same functionality as mongocryptd_, but does not +(``crypt_shared``) provides the same functionality as ``mongocryptd``, but does not require you to spawn another process to perform automatic encryption. -By default, the PHP driver attempts to load crypt_shared from the system path(s) -and uses it automatically if found. To load crypt_shared from another location, +By default, the PHP driver attempts to load ``crypt_shared`` from the system path(s) +and uses it automatically if found. To load ``crypt_shared`` from another location, use the ``cryptSharedLibPath`` auto encryption :php:`driver option ` -when constructing a client. If the driver cannot load crypt_shared it will -attempt to fallback to using mongocryptd by default. The -``cryptSharedLibRequired`` option may be used to always require crypt_shared and +when constructing a client. If the driver cannot load ``crypt_shared`` it will +attempt to fallback to using ``mongocryptd`` by default. The +``cryptSharedLibRequired`` option may be used to always require ``crypt_shared`` and fail if it cannot be loaded. For detailed installation instructions see the MongoDB documentation for the :manual:`Automatic Encryption Shared Library `. -mongocryptd -~~~~~~~~~~~ +``mongocryptd`` +~~~~~~~~~~~~~~~ -The mongocryptd binary is an alternative requirement for automatic client-side +The ``mongocryptd`` binary is an alternative requirement for automatic client-side encryption and is included as a component in the :manual:`MongoDB Enterprise Server package `. For detailed installation instructions see the :manual:`MongoDB documentation on mongocryptd `. -mongocryptd performs the following: +``mongocryptd`` performs the following: - Parses the automatic encryption rules specified in the client configuration. If the ``schemaMap`` auto encryption driver option contains invalid syntax, - mongocryptd returns an error. + ``mongocryptd`` returns an error. - Uses the specified automatic encryption rules to mark fields in read and write operations for encryption. @@ -67,11 +67,11 @@ mongocryptd performs the following: see :manual:`Supported Operations for Automatic Encryption `. A client configured with auto encryption will automatically spawn the -mongocryptd process from the application's ``PATH``. Applications can control +``mongocryptd`` process from the application's ``PATH``. Applications can control the spawning behavior via various auto encryption :php:`driver options `. -mongocryptd is only responsible for supporting automatic client-side encryption +``mongocryptd`` is only responsible for supporting automatic client-side encryption and does not itself perform any encryption or decryption. @@ -208,7 +208,7 @@ Explicit Encryption ~~~~~~~~~~~~~~~~~~~ Explicit encryption is a MongoDB community feature and does not use -crypt_shared_ or mongocryptd_. Explicit encryption is provided by the +``crypt_shared`` or ``mongocryptd``. Explicit encryption is provided by the :php:`MongoDB\Driver\ClientEncryption ` class. .. literalinclude:: /examples/encryption/csfle-explicit_encryption.php From 97d8252bbb5eaccd64688085a7473517c1c10976 Mon Sep 17 00:00:00 2001 From: Nora Reidy Date: Fri, 10 May 2024 15:24:51 -0400 Subject: [PATCH 318/321] DOCSP-3702: 1.18 build error (#1306) --- source/reference/method/MongoDBClient-addSubscriber.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/reference/method/MongoDBClient-addSubscriber.txt b/source/reference/method/MongoDBClient-addSubscriber.txt index f5be110c..0410ebaa 100644 --- a/source/reference/method/MongoDBClient-addSubscriber.txt +++ b/source/reference/method/MongoDBClient-addSubscriber.txt @@ -50,7 +50,8 @@ notified once of each event for this Client. Example ------- -Create a :php:`MongoDB\Driver\Monitoring\CommandSubscriber` that +Create a :php:`MongoDB\Driver\Monitoring\CommandSubscriber +` that logs all events: .. code-block:: php From 252b7534b0190536bc231360407f23072de72922 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 21 May 2024 16:45:54 -0400 Subject: [PATCH 319/321] DOCSP-38371: Remove broken link (#1312) (#1314) Co-authored-by: Mike Woofter <108414937+mongoKart@users.noreply.github.com> --- source/tutorial/decimal128.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/tutorial/decimal128.txt b/source/tutorial/decimal128.txt index f73074f3..eced91cf 100644 --- a/source/tutorial/decimal128.txt +++ b/source/tutorial/decimal128.txt @@ -13,8 +13,8 @@ Decimal128 Overview -------- -MongoDB 3.4 introduced support for a :manual:`Decimal128 BSON type -`, which is a 128-bit decimal-based +MongoDB 3.4 introduced support for a Decimal128 BSON type, +which is a 128-bit decimal-based floating-point value capable of emulating decimal rounding with exact precision. This functionality is intended for applications that handle :manual:`monetary data `, such as financial and tax computations. From 51c9e4bb24632d9fa210cd8e8f06ddc6f8f6e78e Mon Sep 17 00:00:00 2001 From: MongoDB PHP Bot <162451593+mongodb-php-bot@users.noreply.github.com> Date: Thu, 6 Jun 2024 19:27:56 +0200 Subject: [PATCH 320/321] Merge v1.17 into v1.18 (#1339) * Merge v1.16 into v1.17 (#1327) * PHPLIB-1279: Revise driver/extension terminology (#1335) Prefer "extension" over "driver" when referring to ext-mongodb specifically. Also removes mention of Int64 having a private constructor. * PHPLIB-1466: Remove obsolete "Type Map Limitations" --------- Co-authored-by: Jeremy Mikola --- source/faq.txt | 12 +++++------ source/includes/extracts-error.yaml | 4 ++-- source/includes/extracts-note.yaml | 2 +- source/index.txt | 3 +-- source/reference/bson.txt | 4 ++-- source/reference/class/MongoDBClient.txt | 2 +- source/reference/class/MongoDBCollection.txt | 16 +-------------- source/reference/class/MongoDBDatabase.txt | 2 +- .../reference/class/MongoDBGridFSBucket.txt | 2 +- source/reference/exception-classes.txt | 11 +++++----- source/reference/function/add_logger.txt | 6 +++--- source/reference/function/remove_logger.txt | 3 ++- .../method/MongoDBDatabase__construct.txt | 4 ++-- .../method/MongoDBGridFSBucket__construct.txt | 4 ++-- source/tutorial/commands.txt | 2 +- source/tutorial/custom-types.txt | 8 ++++---- source/tutorial/decimal128.txt | 7 +++---- source/tutorial/encryption.txt | 20 +++++++++---------- source/tutorial/example-data.txt | 4 ++-- source/tutorial/install-php-library.txt | 5 ++--- source/tutorial/modeling-bson-data.txt | 12 +++++------ source/tutorial/server-selection.txt | 10 +++++----- source/upgrade.txt | 19 ++++++++---------- 23 files changed, 71 insertions(+), 91 deletions(-) diff --git a/source/faq.txt b/source/faq.txt index fef32264..101f757f 100644 --- a/source/faq.txt +++ b/source/faq.txt @@ -125,15 +125,15 @@ The following are all examples of These errors typically manifest as a :php:`MongoDB\Driver\Exception\ConnectionTimeoutException ` -exception from the driver. The actual exception messages originate from -libmongoc, which is the underlying library used by the PHP driver. Since these -messages can take many forms, it's helpful to break down the structure of the -message so you can better diagnose errors in your application. +exception from the extension. The actual exception messages originate from +libmongoc, which is the underlying system library used by the extension. Since +these messages can take many forms, it's helpful to break down the structure of +the message so you can better diagnose errors in your application. Messages will typically start with "No suitable servers found". The next part of -the message indicates *how* server selection failed. By default, the PHP driver +the message indicates *how* server selection failed. By default, the extension avoids a server selection loop and instead makes a single attempt (according to -the ``serverSelectionTryOnce`` connection string option). If the driver is +the ``serverSelectionTryOnce`` connection string option). If the extension is configured to utilize a loop, a message like "serverSelectionTimeoutMS expired" will tell us that we exhausted its time limit. diff --git a/source/includes/extracts-error.yaml b/source/includes/extracts-error.yaml index 1a41843a..c4d8afa5 100644 --- a/source/includes/extracts-error.yaml +++ b/source/includes/extracts-error.yaml @@ -10,12 +10,12 @@ ref: error-driver-invalidargumentexception content: | :php:`MongoDB\Driver\Exception\InvalidArgumentException ` for errors related to the - parsing of parameters or options at the driver level. + parsing of parameters or options at the extension level. --- ref: error-driver-runtimeexception content: | :php:`MongoDB\Driver\Exception\RuntimeException - ` for other errors at the driver + ` for other errors at the extension level (e.g. connection errors). --- ref: error-badmethodcallexception-write-result diff --git a/source/includes/extracts-note.yaml b/source/includes/extracts-note.yaml index 620a7ac3..6225fafb 100644 --- a/source/includes/extracts-note.yaml +++ b/source/includes/extracts-note.yaml @@ -6,7 +6,7 @@ content: | :php:`comparison ` and :php:`type juggling ` rules. When matching a special BSON type the query criteria should use the respective :php:`BSON class - ` in the driver (e.g. use + ` in the extension (e.g. use :php:`MongoDB\BSON\ObjectId ` to match an :manual:`ObjectId `). --- diff --git a/source/index.txt b/source/index.txt index 7e76323f..01158168 100644 --- a/source/index.txt +++ b/source/index.txt @@ -5,8 +5,7 @@ MongoDB PHP Library .. default-domain:: mongodb The |php-library| provides a high-level abstraction around the lower-level -`PHP driver `_, also known as the ``mongodb`` -extension. +:php:`mongodb extension `. The ``mongodb`` extension provides a limited API to connect to the database and execute generic commands, queries, and write operations. In contrast, the diff --git a/source/reference/bson.txt b/source/reference/bson.txt index 30753247..315b87a5 100644 --- a/source/reference/bson.txt +++ b/source/reference/bson.txt @@ -28,7 +28,7 @@ Classes This class extends PHP's :php:`ArrayObject ` class. It also implements PHP's :php:`JsonSerializable ` interface and the - driver's :php:`MongoDB\BSON\Serializable ` and + extension's :php:`MongoDB\BSON\Serializable ` and :php:`MongoDB\BSON\Unserializable ` interfaces. @@ -41,7 +41,7 @@ Classes This class extends PHP's :php:`ArrayObject ` class. It also implements PHP's :php:`JsonSerializable ` interface and the - driver's :php:`MongoDB\BSON\Serializable ` and + extension's :php:`MongoDB\BSON\Serializable ` and :php:`MongoDB\BSON\Unserializable ` interfaces. diff --git a/source/reference/class/MongoDBClient.txt b/source/reference/class/MongoDBClient.txt index 4dc6cdbe..d5145c65 100644 --- a/source/reference/class/MongoDBClient.txt +++ b/source/reference/class/MongoDBClient.txt @@ -18,7 +18,7 @@ Definition This class serves as an entry point for the |php-library|. It is the preferred class for connecting to a MongoDB server or cluster of servers and acts as a gateway for accessing individual databases and collections. - :phpclass:`MongoDB\Client` is analogous to the driver's + :phpclass:`MongoDB\Client` is analogous to the extension's :php:`MongoDB\Driver\Manager ` class, which it `composes `_. diff --git a/source/reference/class/MongoDBCollection.txt b/source/reference/class/MongoDBCollection.txt index 956b0129..462ac4d9 100644 --- a/source/reference/class/MongoDBCollection.txt +++ b/source/reference/class/MongoDBCollection.txt @@ -18,7 +18,7 @@ Definition Provides methods for common operations on collections and documents, including CRUD operations and index management. - You can construct collections directly using the driver's + You can construct collections directly using the extension's :php:`MongoDB\Driver\Manager ` class or select a collection from the library's :phpclass:`MongoDB\Client` or :phpclass:`MongoDB\Database` classes. A collection may also be cloned from @@ -37,20 +37,6 @@ Definition Operations within the :phpclass:`MongoDB\Collection` class inherit the collection's options. -Type Map Limitations --------------------- - -The :manual:`aggregate ` (when not using a -cursor), :manual:`distinct `, and -:manual:`findAndModify ` helpers do not -support a ``typeMap`` option due to a driver limitation. The -:phpmethod:`aggregate() `, -:phpmethod:`distinct() `, -:phpmethod:`findOneAndReplace() `, -:phpmethod:`findOneAndUpdate() `, and -:phpmethod:`findOneAndDelete() ` -methods return BSON documents as ``stdClass`` objects and BSON arrays as arrays. - Methods ------- diff --git a/source/reference/class/MongoDBDatabase.txt b/source/reference/class/MongoDBDatabase.txt index c5a5b3a5..d733616f 100644 --- a/source/reference/class/MongoDBDatabase.txt +++ b/source/reference/class/MongoDBDatabase.txt @@ -18,7 +18,7 @@ Definition Provides methods for common operations on a database, such as executing database commands and managing collections. - You can construct a database directly using the driver's + You can construct a database directly using the extension's :php:`MongoDB\Driver\Manager ` class or select a database from the library's :phpclass:`MongoDB\Client` class. A database may also be cloned from an existing :phpclass:`MongoDB\Database` diff --git a/source/reference/class/MongoDBGridFSBucket.txt b/source/reference/class/MongoDBGridFSBucket.txt index 51d61fce..c3e3e6e6 100644 --- a/source/reference/class/MongoDBGridFSBucket.txt +++ b/source/reference/class/MongoDBGridFSBucket.txt @@ -22,7 +22,7 @@ Definition provides an interface around these collections for working with the files as PHP :php:`Streams `. - You can construct a GridFS bucket using the driver's + You can construct a GridFS bucket using the extension's :php:`Manager ` class, or select a bucket from the library's :phpclass:`MongoDB\Database` class via the :phpmethod:`selectGridFSBucket() ` diff --git a/source/reference/exception-classes.txt b/source/reference/exception-classes.txt index 584c55d5..b21801a3 100644 --- a/source/reference/exception-classes.txt +++ b/source/reference/exception-classes.txt @@ -53,7 +53,7 @@ MongoDB\\Exception\\InvalidArgumentException Thrown for errors related to the parsing of parameters or options within the library. - This class extends the driver's :php:`InvalidArgumentException + This class extends the extension's :php:`InvalidArgumentException ` class and implements the library's :phpclass:`Exception ` interface. @@ -67,10 +67,9 @@ MongoDB\\Exception\\UnexpectedValueException This exception is thrown when a command response from the server is malformed or not what the library expected. This exception means that an assertion in some operation, which abstracts a database command, has failed. - It may indicate a corrupted BSON response or bug in the server, driver, or - library. + It may indicate a corrupted BSON response or bug in the server or driver. - This class extends the driver's :php:`UnexpectedValueException + This class extends the extension's :php:`UnexpectedValueException ` class and implements the library's :phpclass:`Exception ` interface. @@ -133,7 +132,7 @@ MongoDB\\Exception\\Exception .. phpclass:: MongoDB\Exception\Exception - This interface extends the driver's :php:`Exception + This interface extends the extension's :php:`Exception ` interface and is implemented by all exception classes within the library. @@ -144,6 +143,6 @@ MongoDB\\Exception\\RuntimeException .. phpclass:: MongoDB\Exception\RuntimeException - This class extends the driver's :php:`RuntimeException + This class extends the extension's :php:`RuntimeException ` class, which in turn extends PHP's :php:`RuntimeException ` class. diff --git a/source/reference/function/add_logger.txt b/source/reference/function/add_logger.txt index ea105a9f..69076915 100644 --- a/source/reference/function/add_logger.txt +++ b/source/reference/function/add_logger.txt @@ -17,7 +17,7 @@ Definition .. phpmethod:: MongoDB\add_logger() - Registers a PSR logger to receive log messages from the driver. + Registers a PSR logger to receive log messages from the extension. .. code-block:: php @@ -36,8 +36,8 @@ Behavior This function allows the application to register one or more `Psr\\Log\\LoggerInterface `__ -objects to receive log messages from libmongoc and the driver. Each registered -logger will receive messages for *all* clients. +objects to receive log messages from libmongoc and the extension. Each +registered logger will receive messages for *all* clients. Messages originating from the extension will have their log level translated to an equivalent `PSR log level `__. diff --git a/source/reference/function/remove_logger.txt b/source/reference/function/remove_logger.txt index 099b1c02..369c5c13 100644 --- a/source/reference/function/remove_logger.txt +++ b/source/reference/function/remove_logger.txt @@ -17,7 +17,8 @@ Definition .. phpmethod:: MongoDB\remove_logger() - Unregisters a PSR logger to no longer receive log messages from the driver. + Unregisters a PSR logger to no longer receive log messages from the + extension. .. code-block:: php diff --git a/source/reference/method/MongoDBDatabase__construct.txt b/source/reference/method/MongoDBDatabase__construct.txt index cf52a134..f25e6c4b 100644 --- a/source/reference/method/MongoDBDatabase__construct.txt +++ b/source/reference/method/MongoDBDatabase__construct.txt @@ -29,8 +29,8 @@ Parameters ---------- ``$manager`` : :php:`MongoDB\Driver\Manager ` - The :php:`Manager ` instance from the driver. The - manager maintains connections between the driver and your MongoDB instances. + The :php:`Manager ` instance from the extension. The + manager maintains connections between the driver and MongoDB. ``$databaseName`` : string The name of the database. diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt index 58f4e3db..1349e5f4 100644 --- a/source/reference/method/MongoDBGridFSBucket__construct.txt +++ b/source/reference/method/MongoDBGridFSBucket__construct.txt @@ -29,8 +29,8 @@ Parameters ---------- ``$manager`` : :php:`MongoDB\Driver\Manager ` - The :php:`Manager ` instance from the driver. The - manager maintains connections between the driver and your MongoDB instances. + The :php:`Manager ` instance from the extension. The + manager maintains connections between the driver and MongoDB. ``$databaseName`` : string The name of the database. diff --git a/source/tutorial/commands.txt b/source/tutorial/commands.txt index 3efa999e..1debe37b 100644 --- a/source/tutorial/commands.txt +++ b/source/tutorial/commands.txt @@ -91,7 +91,7 @@ The output might resemble the following: will return a single result document with the essential ingredients for constructing the cursor (i.e. the cursor's ID, namespace, and an optional first batch of results). If the :php:`MongoDB\Driver\Manager::executeCommand() - ` method in the PHP driver detects + ` method in the extension detects such a response, it will construct an iterable command cursor and return it instead of the raw result document. If necessary, raw result documents can still be observed using `command monitoring diff --git a/source/tutorial/custom-types.txt b/source/tutorial/custom-types.txt index b96a0421..f3736675 100644 --- a/source/tutorial/custom-types.txt +++ b/source/tutorial/custom-types.txt @@ -16,7 +16,7 @@ if you want to store date/time information retaining the time zone information that PHP's :php:`DateTimeImmutable ` class stores with a point in time. -The driver serializes PHP variables, including objects, into BSON when it +The extension serializes PHP variables, including objects, into BSON when it communicates to the server, and deserializes BSON back into PHP variables when it receives data from the server. @@ -74,12 +74,12 @@ a string containing the Olson time zone identifier: } ?> -The driver will additionally add a ``__pclass`` field to the document, and +The extension will additionally add a ``__pclass`` field to the document, and store that in the database, too. This field contains the PHP class name so that -upon deserialization the driver knows which class to use for recreating the +upon deserialization the extension knows which class to use for recreating the stored object. -When the document is read from the database, the driver detects whether a +When the document is read from the database, the extension detects whether a ``__pclass`` field is present and then executes :php:`MongoDB\BSON\Persistable::bsonUnserialize ` method which is diff --git a/source/tutorial/decimal128.txt b/source/tutorial/decimal128.txt index eced91cf..2397ccd8 100644 --- a/source/tutorial/decimal128.txt +++ b/source/tutorial/decimal128.txt @@ -19,9 +19,8 @@ floating-point value capable of emulating decimal rounding with exact precision. This functionality is intended for applications that handle :manual:`monetary data `, such as financial and tax computations. -The :php:`MongoDB\BSON\Decimal128 ` class, which was -introduced in :php:`PHP driver ` 1.2.0, may be used to work with this -type in PHP. +The :php:`MongoDB\BSON\Decimal128 ` class may be used +to work with this type in PHP. Working with Decimal128 Values ------------------------------ @@ -70,7 +69,7 @@ The output would then resemble: Mathematical Operations with BCMath ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The :php:`PHP driver ` does not provide any functionality for working +The :php:`extension ` does not provide any functionality for working with ``Decimal128`` values; however, the string representation of a :php:`MongoDB\BSON\Decimal128 ` object may be used with PHP's :php:`BCMath ` extension. diff --git a/source/tutorial/encryption.txt b/source/tutorial/encryption.txt index c16845f9..adf4cc41 100644 --- a/source/tutorial/encryption.txt +++ b/source/tutorial/encryption.txt @@ -15,9 +15,9 @@ Dependencies ------------ To get started using in-use encryption in your project, the -`PHP driver `_ (i.e. ``mongodb`` extension) will need -to be compiled with `libmongocrypt `_ -(enabled by default). +:php:`extension ` will need to be compiled with +`libmongocrypt `_ (enabled by +default). Additionally, either ``crypt_shared`` or ``mongocryptd`` are required in order to use *automatic* client-side encryption. Neither is required for *explicit* @@ -31,14 +31,14 @@ The :manual:`Automatic Encryption Shared Library ` -when constructing a client. If the driver cannot load ``crypt_shared`` it will -attempt to fallback to using ``mongocryptd`` by default. The -``cryptSharedLibRequired`` option may be used to always require ``crypt_shared`` and -fail if it cannot be loaded. +when constructing a client. If the extension cannot load ``crypt_shared`` it +will attempt to fallback to using ``mongocryptd`` by default. The +``cryptSharedLibRequired`` option may be used to always require ``crypt_shared`` +and fail if it cannot be loaded. For detailed installation instructions see the MongoDB documentation for the :manual:`Automatic Encryption Shared Library `. diff --git a/source/tutorial/example-data.txt b/source/tutorial/example-data.txt index 920de587..d0b748cc 100644 --- a/source/tutorial/example-data.txt +++ b/source/tutorial/example-data.txt @@ -9,8 +9,8 @@ Some examples in this documentation use example data fixtures from `primer-dataset.json `_. Importing the dataset into MongoDB can be done in several ways. The following -example imports the ``zips.json`` file into a ``test.zips`` collection: -:php:`driver ` directly: +example imports the ``zips.json`` file into a ``test.zips`` collection using the +:php:`extension ` directly: .. code-block:: php diff --git a/source/tutorial/install-php-library.txt b/source/tutorial/install-php-library.txt index af409c36..913a945e 100644 --- a/source/tutorial/install-php-library.txt +++ b/source/tutorial/install-php-library.txt @@ -11,9 +11,8 @@ Install the |php-library| :class: singlecol The |php-library| is a high-level abstraction for the -`PHP driver `_ (i.e. ``mongodb`` extension). This page -will briefly explain how to install both the ``mongodb`` extension and the -|php-library|. +:php:`mongodb extension `. This page will briefly explain how to +install both the ``mongodb`` extension and the |php-library|. Installing the Extension ------------------------ diff --git a/source/tutorial/modeling-bson-data.txt b/source/tutorial/modeling-bson-data.txt index 56f0217a..5429b031 100644 --- a/source/tutorial/modeling-bson-data.txt +++ b/source/tutorial/modeling-bson-data.txt @@ -53,16 +53,16 @@ are aliases of one another). Persistable Classes ------------------- -The driver's :php:`persistence specification ` outlines how -classes implementing its :php:`MongoDB\BSON\Persistable +The extension's :php:`persistence specification ` outlines +how classes implementing its :php:`MongoDB\BSON\Persistable ` interface are serialized to and deserialized from BSON. The :php:`Persistable ` interface is analogous to PHP's :php:`Serializable interface `. -The driver automatically handles serialization and deserialization for classes -implementing the :php:`Persistable ` interface without -requiring the use of the ``typeMap`` option. This is done by encoding the name -of the PHP class in a special property within the BSON document. +The extension automatically handles serialization and deserialization for +classes implementing the :php:`Persistable ` interface +without requiring the use of the ``typeMap`` option. This is done by encoding +the name of the PHP class in a special property within the BSON document. .. note:: diff --git a/source/tutorial/server-selection.txt b/source/tutorial/server-selection.txt index 31047d93..c63ca5c9 100644 --- a/source/tutorial/server-selection.txt +++ b/source/tutorial/server-selection.txt @@ -15,8 +15,8 @@ Server Selection and Monitoring Before any operation can be executed, the |php-library| must first select a server from the topology (e.g. replica set, sharded cluster). Selecting a server -requires an accurate view of the topology, so the driver (i.e. ``mongodb`` -extension) regularly monitors the servers to which it is connected. +requires an accurate view of the topology, so the extension regularly monitors +the servers to which it is connected. In most other drivers, server discovery and monitoring is handled by a background thread; however, the PHP driver is single-threaded and must therefore @@ -30,9 +30,9 @@ Consider the following example application: /** * When constructing a Client, the library creates a MongoDB\Driver\Manager - * object from the driver. In turn, the driver will either create a libmongoc - * client object (and persist it according to the constructor parameters) or - * re-use a previously persisted client. + * object from the extension. In turn, the extension will either create a + * libmongoc client object (and persist it according to the constructor + * parameters) or re-use a previously persisted client. * * Assuming a new libmongoc client was created, the host name(s) in the * connection string must be resolved via DNS. Likewise, if the connection diff --git a/source/upgrade.txt b/source/upgrade.txt index 58d34eb1..18e92e52 100644 --- a/source/upgrade.txt +++ b/source/upgrade.txt @@ -19,9 +19,9 @@ those differences for the benefit of those upgrading from the legacy driver. Additionally, a community-developed `mongo-php-adapter `_ library exists, which -implements the ``mongo`` extension API using this library and the new driver. -While this adapter library is not officially supported by MongoDB, it does bear -mentioning. +implements the ``mongo`` extension API using this library and the ``mongodb`` +extension. While this adapter library is not officially supported by MongoDB, it +does bear mentioning. BSON ---- @@ -31,9 +31,9 @@ Type Classes When upgrading from the legacy driver, type classes such as MongoId must be replaced with classes in the -`MongoDB\\BSON namespace `_. The -new driver also introduces interfaces for its BSON types, which should be -preferred if applications need to type hint against BSON values. +`MongoDB\\BSON namespace `_. The new +driver also introduces interfaces for its BSON types, which should be preferred +if applications need to type hint against BSON values. The following table lists all legacy classes alongside the equivalent class in the new driver. @@ -95,10 +95,7 @@ the new driver. 64-bit integer depending on their value. .. [2] :php:`MongoDB\BSON\Int64 ` does not have an - interface defined. The new driver does not allow applications to instantiate - this type (i.e. its constructor is private) and it is only created during - BSON decoding when a 64-bit integer cannot be represented as a PHP integer on - a 32-bit platform. + interface defined. .. [3] The new driver does not implement an equivalent class for MongoDBRef since :manual:`DBRefs ` are merely a BSON @@ -307,7 +304,7 @@ generated ObjectId (i.e. MongoId object). This behavior was a bit of a hack, as it did not rely on the argument being :php:`passed by reference `; instead, it directly modified memory through the extension API and could not be implemented in PHP userland. As such, it is no -longer done in the new driver and library. +longer done in the new driver. IDs of inserted documents (whether generated or not) may be accessed through the following methods on the write result objects: From 1dd68a81151470d5b4ed674589de11e51acd1d1b Mon Sep 17 00:00:00 2001 From: Heli Aldridge Date: Tue, 6 Aug 2024 16:23:19 -0400 Subject: [PATCH 321/321] DOP-4904: Remove git submodule --- .gitmodules | 4 ---- mongo-php-library | 1 - 2 files changed, 5 deletions(-) delete mode 100644 .gitmodules delete mode 160000 mongo-php-library diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index fc42715e..00000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "mongo-php-library"] - path = mongo-php-library - url = https://github.com/mongodb/mongo-php-library.git - branch = v1.18 diff --git a/mongo-php-library b/mongo-php-library deleted file mode 160000 index fe91f962..00000000 --- a/mongo-php-library +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fe91f962fd5b5ddf8165edb09b04262cda677f6e