Skip to content

Commit

Permalink
Version/1.25.0 (#844)
Browse files Browse the repository at this point in the history
* version: 1.25.0

* fix doc
  • Loading branch information
roman-right authored Jan 25, 2024
1 parent 3258326 commit 72b35f9
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
2 changes: 1 addition & 1 deletion beanie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
31 changes: 31 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

Beanie project

## [1.25.0] - 2024-01-24
### Encode Date Objects
- Author - [George Sakkis](https://github.com/gsakkis)
- PR <https://github.com/roman-right/beanie/pull/816>

### Fix: Findinterface Type-Hints Break On View Models
- Author - [Guy Tsitsiashvili](https://github.com/GuyGooL5)
- PR <https://github.com/roman-right/beanie/pull/819>

### Fix: Count With Text Queries And Links
- Author - [Benjamin Earle](https://github.com/MrEarle)
- PR <https://github.com/roman-right/beanie/pull/826>

### Update Migration Command To Enable/Disable Transactions
- Author - [Mahmoud Mabrouk](https://github.com/mmabrouk)
- PR <https://github.com/roman-right/beanie/pull/828>

### Sync Method
- Author - [Roman Right](https://github.com/roman-right)
- PR <https://github.com/roman-right/beanie/pull/831>

### 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 <https://github.com/roman-right/beanie/pull/834>

[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
Expand Down
7 changes: 5 additions & 2 deletions docs/tutorial/defining-a-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand All @@ -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).
Also, you can limit the nesting depth during find operations. You can read more about this [here](/tutorial/relations/#nested-links).
4 changes: 3 additions & 1 deletion docs/tutorial/relations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_beanie.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == "1.24.0"
assert __version__ == "1.25.0"

0 comments on commit 72b35f9

Please sign in to comment.