Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
7 changes: 4 additions & 3 deletions docs/query-builder.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +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, {+odm-short+}
automatically converts between ``id`` and ``_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``
Expand Down
7 changes: 4 additions & 3 deletions docs/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading