From 11fe1ef26e0a41889fc10b215e38694bbaa084b5 Mon Sep 17 00:00:00 2001 From: MongoDB PHP Bot <162451593+mongodb-php-bot@users.noreply.github.com> Date: Thu, 12 Sep 2024 12:50:20 +0200 Subject: [PATCH 1/5] Update changelog (#3144) (#3147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jérôme Tamarelle --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d813edb5a..90c22dfd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog All notable changes to this project will be documented in this file. -## [5.0.0] - next +## [5.0.0] - 2024-09-12 * Remove support for Laravel 10 by @GromNaN in [#3123](https://github.com/mongodb/laravel-mongodb/pull/3123) * **BREAKING CHANGE** Use `id` as an alias for `_id` in commands and queries for compatibility with Eloquent packages by @GromNaN in [#3040](https://github.com/mongodb/laravel-mongodb/pull/3040) and [#3136](https://github.com/mongodb/laravel-mongodb/pull/3136) From 3430333ff10c6abf8138308c24027745db5c9082 Mon Sep 17 00:00:00 2001 From: norareidy Date: Thu, 12 Sep 2024 16:38:25 -0400 Subject: [PATCH 2/5] DOCSP-43530: Id field in query results --- docs/query-builder.txt | 3 ++- docs/upgrade.txt | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/query-builder.txt b/docs/query-builder.txt index 0a4c878df..4af267844 100644 --- a/docs/query-builder.txt +++ b/docs/query-builder.txt @@ -196,7 +196,8 @@ the value of the ``title`` field is ``"Back to the Future"``: You can use the ``id`` alias in your queries to represent the ``_id`` field in MongoDB documents, as shown in the preceding code. When you run a find operation using the query builder, {+odm-short+} - automatically converts between ``id`` and ``_id``. This provides better + automatically converts between ``id`` and ``_id``. In query results + the ``_id`` field is renamed to ``id``. This provides better compatibility with Laravel, as the framework assumes that each record has a primary key named ``id`` by default. diff --git a/docs/upgrade.txt b/docs/upgrade.txt index a992197f3..8cc9b5250 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -115,9 +115,10 @@ This library version introduces the following breaking changes: date classes, applying the default timezone. - ``id`` is an alias for the ``_id`` field in MongoDB documents, and the library - automatically converts between ``id`` and ``_id`` when querying data. Because - of this behavior, you cannot have two separate ``id`` and ``_id`` fields in your - documents. + automatically converts between ``id`` and ``_id`` when querying data. The query + result object includes an ``id`` field to represent the document's ``_id`` field. + Because of this behavior, you cannot have two separate ``id`` and ``_id`` fields + in your documents. - Removes support for the ``$collection`` property. The following code shows how to assign a MongoDB collection to a variable in your ``User`` class in From 2ebff0c714ea7395a99014758e1286d841974946 Mon Sep 17 00:00:00 2001 From: norareidy Date: Thu, 12 Sep 2024 16:45:30 -0400 Subject: [PATCH 3/5] edits --- docs/query-builder.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/query-builder.txt b/docs/query-builder.txt index 4af267844..4aa31fadc 100644 --- a/docs/query-builder.txt +++ b/docs/query-builder.txt @@ -195,8 +195,8 @@ the value of the ``title`` field is ``"Back to the Future"``: You can use the ``id`` alias in your queries to represent the ``_id`` field in MongoDB documents, as shown in the preceding - code. When you run a find operation using the query builder, {+odm-short+} - automatically converts between ``id`` and ``_id``. In query results + code. When you run a find operation using the query builder, the {+odm-short+} + automatically converts between ``id`` and ``_id``. In query results, the ``_id`` field is renamed to ``id``. This provides better compatibility with Laravel, as the framework assumes that each record has a primary key named ``id`` by default. From 8d3b4cd0a61eeb8c15ad8f32fa24cb8f673e7e85 Mon Sep 17 00:00:00 2001 From: norareidy Date: Fri, 13 Sep 2024 11:14:00 -0400 Subject: [PATCH 4/5] RR feedback --- docs/query-builder.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/query-builder.txt b/docs/query-builder.txt index 4aa31fadc..2bb6f75f2 100644 --- a/docs/query-builder.txt +++ b/docs/query-builder.txt @@ -195,10 +195,10 @@ the value of the ``title`` field is ``"Back to the Future"``: You can use the ``id`` alias in your queries to represent the ``_id`` field in MongoDB documents, as shown in the preceding - code. When you run a find operation using the query builder, the {+odm-short+} - automatically converts between ``id`` and ``_id``. In query results, - the ``_id`` field is renamed to ``id``. This provides better - compatibility with Laravel, as the framework assumes that each record has a + code. When you use the query builder to run a find operation, the {+odm-short+} + automatically converts between ``_id`` and ``id`` field names. In query results, + the ``_id`` field is presented as ``id``. This provides better + consistency with Laravel, as the framework assumes that each record has a primary key named ``id`` by default. Because of this behavior, you cannot have two separate ``id`` and ``_id`` From d0178782cb319e6560c7c1cf76078438fd4b9b6f Mon Sep 17 00:00:00 2001 From: norareidy Date: Fri, 13 Sep 2024 11:30:41 -0400 Subject: [PATCH 5/5] fix --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1e6213ba..32f7b856b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All notable changes to this project will be documented in this file. +## [5.0.1] - 2024-09-13 + +* Restore support for Laravel 10 by @GromNaN in [#3148](https://github.com/mongodb/laravel-mongodb/pull/3148) + ## [5.0.0] - 2024-09-12 * **BREAKING CHANGE** Use `id` as an alias for `_id` in commands and queries for compatibility with Eloquent packages by @GromNaN in [#3040](https://github.com/mongodb/laravel-mongodb/pull/3040) and [#3136](https://github.com/mongodb/laravel-mongodb/pull/3136)