From 8ea021f128e94e60b01173e011ca7ea10b1ef230 Mon Sep 17 00:00:00 2001 From: norareidy Date: Fri, 11 Oct 2024 10:45:07 -0400 Subject: [PATCH 1/3] DOCSP-43615: raw() ID conversion --- docs/upgrade.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/upgrade.txt b/docs/upgrade.txt index 3032b8e1e..b2ace1c3e 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -120,6 +120,10 @@ This library version introduces the following breaking changes: Because of this behavior, you cannot have two separate ``id`` and ``_id`` fields in your documents. + In v5.1, {+odm-short+} also performs this conversion if you use the ``Model::raw()`` + method to hydrate a Model instance. When passing a complex query filter, use the + ``DB::where()`` method instead of ``Model::raw()``. + - Removes support for the ``$collection`` property. The following code shows how to assign a MongoDB collection to a variable in your ``User`` class in older versions compared to v5.0: From 83e652549bd3a41c3d837453bc3a04670eaca671 Mon Sep 17 00:00:00 2001 From: norareidy Date: Fri, 11 Oct 2024 10:48:57 -0400 Subject: [PATCH 2/3] utcdatetime --- docs/upgrade.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/upgrade.txt b/docs/upgrade.txt index b2ace1c3e..39b21a006 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -114,15 +114,18 @@ This library version introduces the following breaking changes: - In query results, the library converts BSON ``UTCDateTime`` objects to ``Carbon`` date classes, applying the default timezone. + In v5.1, {+odm-short+} also performs this conversion to the ``Model::raw()`` + method results before hydrating a Model instance. + - ``id`` is an alias for the ``_id`` field in MongoDB documents, and the library 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. - In v5.1, {+odm-short+} also performs this conversion if you use the ``Model::raw()`` - method to hydrate a Model instance. When passing a complex query filter, use the - ``DB::where()`` method instead of ``Model::raw()``. + In v5.1, {+odm-short+} also performs this conversion to the ``Model::raw()`` + method results before hydrating a Model instance. When passing a complex query + filter, use the ``DB::where()`` method instead of ``Model::raw()``. - 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 efcc779693ba46facc6da3233526bd71a5eb6436 Mon Sep 17 00:00:00 2001 From: norareidy Date: Fri, 11 Oct 2024 10:56:07 -0400 Subject: [PATCH 3/3] wording --- docs/upgrade.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/upgrade.txt b/docs/upgrade.txt index 39b21a006..d730435fa 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -114,7 +114,7 @@ This library version introduces the following breaking changes: - In query results, the library converts BSON ``UTCDateTime`` objects to ``Carbon`` date classes, applying the default timezone. - In v5.1, {+odm-short+} also performs this conversion to the ``Model::raw()`` + In v5.1, the library also performs this conversion to the ``Model::raw()`` method results before hydrating a Model instance. - ``id`` is an alias for the ``_id`` field in MongoDB documents, and the library @@ -123,7 +123,7 @@ This library version introduces the following breaking changes: Because of this behavior, you cannot have two separate ``id`` and ``_id`` fields in your documents. - In v5.1, {+odm-short+} also performs this conversion to the ``Model::raw()`` + In v5.1, the library also performs this conversion to the ``Model::raw()`` method results before hydrating a Model instance. When passing a complex query filter, use the ``DB::where()`` method instead of ``Model::raw()``.