Skip to content

DOCSP-48606: builderEncoder Database #232

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions source/reference/method/MongoDBCollection-withOptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,17 @@ Parameters
- Type
- Description

* - builderEncoder
- ``MongoDB\Codec\Encoder``
- The encoder used to serialize native PHP types to BSON data in
query and aggregation options. If omitted, the ``Collection``
instance uses the default encoder.

.. versionadded:: 1.21

* - codec
- MongoDB\\Codec\\DocumentCodec
- The default :doc:`codec </data-formats/codecs>` to use for collection
- ``MongoDB\Codec\DocumentCodec``
- The default :ref:`codec <php-codecs>` to use for collection
operations. Defaults to the original collection's codec.

.. versionadded:: 1.17
Expand Down
8 changes: 8 additions & 0 deletions source/reference/method/MongoDBDatabase-withOptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ Parameters
- Type
- Description

* - builderEncoder
- ``MongoDB\Codec\Encoder``
- The encoder used to serialize native PHP types to BSON data in
query and aggregation options. If omitted, the ``Database``
instance uses the default encoder.

.. versionadded:: 1.21.1
Copy link
Member

Choose a reason for hiding this comment

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

This can be 1.21.

PHPLIB-1646 only fixed a bug with this method not inheriting the existing Database's option.

If builderEncoder is explicitly provided in the $options array (which is what this is documenting), it was always passed along to construct the new Database instance.


* - readConcern
- :php:`MongoDB\Driver\ReadConcern <class.mongodb-driver-readconcern>`
- The default read concern to use for database operations. Defaults to
Expand Down
7 changes: 7 additions & 0 deletions source/whats-new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ improvements, and fixes:
change also allows you to set a sort order as an option when performing
update and replace operations in a bulk operation.

- Adds the ``builderEncoder`` option to the following methods:

- :phpmethod:`Database constructor <MongoDB\Database::__construct()>`
- :phpmethod:`MongoDB\Database::withOptions()`
- :phpmethod:`Collection constructor <MongoDB\Collection::__construct()>`
- :phpmethod:`MongoDB\Collection::withOptions()`

For more information about the changes in this version, see the
:github:`v1.21 release notes
</mongodb/mongo-php-library/releases/tag/1.21.0>` on GitHub.
Expand Down
Loading