diff --git a/beanie/__init__.py b/beanie/__init__.py index 971bd90f..91f233de 100644 --- a/beanie/__init__.py +++ b/beanie/__init__.py @@ -33,7 +33,7 @@ from beanie.odm.utils.init import init_beanie from beanie.odm.views import View -__version__ = "1.24.0" +__version__ = "1.25.0" __all__ = [ # ODM "Document", diff --git a/docs/changelog.md b/docs/changelog.md index 2eaf6410..4ebef45c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,37 @@ Beanie project +## [1.25.0] - 2024-01-24 + +### Encode Date Objects +- Author - [George Sakkis](https://github.com/gsakkis) +- PR + +### Fix: Findinterface Type-Hints Break On View Models +- Author - [Guy Tsitsiashvili](https://github.com/GuyGooL5) +- PR + +### Fix: Count With Text Queries And Links +- Author - [Benjamin Earle](https://github.com/MrEarle) +- PR + +### Update Migration Command To Enable/Disable Transactions +- Author - [Mahmoud Mabrouk](https://github.com/mmabrouk) +- PR + +### Sync Method +- Author - [Roman Right](https://github.com/roman-right) +- PR + +### Limit Nesting Level Of Linked Documents + +*WARNING: This is a breaking change. Please, read [the docs](https://beanie-odm.dev/tutorial/defining-a-document/#nested-documents-depth) before updating.* + +- Author - [Roman Right](https://github.com/roman-right) +- PR + +[1.25.0]: https://pypi.org/project/beanie/1.25.0 + ## [1.24.0] - 2023-12-24 ### Exclude revision_id From The get_changes Method diff --git a/docs/tutorial/defining-a-document.md b/docs/tutorial/defining-a-document.md index f3cdb1f0..96f11204 100644 --- a/docs/tutorial/defining-a-document.md +++ b/docs/tutorial/defining-a-document.md @@ -230,7 +230,9 @@ class Sample(Document): ### Nested Documents Depth It is possible to define nested linked documents with Beanie. Sometimes this can lead to infinite recursion. To prevent this, or to decrease the database load, you can limit the maximum nesting depth. By default, it is set to 3, which means it will fetch up to 3 levels of nested documents. + You can configure: + - maximum depth for all linked documents - depth for a specific linked document @@ -241,7 +243,8 @@ class Sample(Document): category: Link[Category] class Settings: - max_nesting_depth = 2 # Maximum nesting depth for all linked documents of this model + max_nesting_depth = 2 + # Maximum nesting depth for all linked documents of this model ``` Specific: @@ -256,4 +259,4 @@ class Sample(Document): } ``` -Also, you can limit the nesting depth during find operations. You can read more about this [here](tutorial/relations.md#nested-links). \ No newline at end of file +Also, you can limit the nesting depth during find operations. You can read more about this [here](/tutorial/relations/#nested-links). \ No newline at end of file diff --git a/docs/tutorial/relations.md b/docs/tutorial/relations.md index b5b16373..999eb5cd 100644 --- a/docs/tutorial/relations.md +++ b/docs/tutorial/relations.md @@ -223,12 +223,14 @@ await SelfLinkedSample.find( ).to_list() ``` -Also, you can set up the maximum nesting depth on the document definition level. You can read more about this [here](tutorial/defining-a-document.md#nested-documents-depth). +Also, you can set up the maximum nesting depth on the document definition level. You can read more about this [here](/tutorial/defining-a-document/#nested-documents-depth). ### On-demand fetch If you don't use prefetching, linked documents will be presented as objects of the `Link` class. + You can fetch them manually afterwards. + To fetch all the linked documents, you can use the `fetch_all_links` method ```python diff --git a/pyproject.toml b/pyproject.toml index 8c8655e4..6cae02dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "beanie" -version = "1.24.0" +version = "1.25.0" description = "Asynchronous Python ODM for MongoDB" readme = "README.md" requires-python = ">=3.7,<4.0" diff --git a/tests/test_beanie.py b/tests/test_beanie.py index 84b4605a..1551d70f 100644 --- a/tests/test_beanie.py +++ b/tests/test_beanie.py @@ -2,4 +2,4 @@ def test_version(): - assert __version__ == "1.24.0" + assert __version__ == "1.25.0"