Skip to content

Commit

Permalink
version update 0.4.1 - projections
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-right committed Apr 19, 2021
1 parent 9962ed8 commit 437b9a6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 16 deletions.
2 changes: 1 addition & 1 deletion beanie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from beanie.odm.documents import Document
from beanie.odm.cursor import Cursor

__version__ = "0.4.0"
__version__ = "0.4.1"
__all__ = [
# ODM
"Document",
Expand Down
7 changes: 6 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
Beanie project changes

## [0.4.1] - 2021-04-19
### Added
- Projections support to reduce database load. [Issue](https://github.com/roman-right/beanie/issues/16). **Thanks [Nicholas Smith](https://github.com/nzsmith1)**

## [0.4.0] - 2021-04-18
### Added
- [ODM Documentation](https://roman-right.github.io/beanie/documentation/odm/)
Expand Down Expand Up @@ -53,4 +57,5 @@ Beanie project changes
[0.3.3]: https://pypi.org/project/beanie/0.3.3
[0.3.4]: https://pypi.org/project/beanie/0.3.4
[0.4.0b1]: https://pypi.org/project/beanie/0.4.0b1
[0.4.0]: https://pypi.org/project/beanie/0.4.0
[0.4.0]: https://pypi.org/project/beanie/0.4.0
[0.4.1]: https://pypi.org/project/beanie/0.4.1
32 changes: 20 additions & 12 deletions docs/documentation/odm.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ Creates internal CollectionMeta class for the Document on the init step,
- `database`: AsyncIOMotorDatabase - Motor database instance
- `document_class`: Type - a class, inherited from Document class
- `allow_index_dropping`: bool - if index dropping is allowed
- `collection_class`: Optional[Type] - Collection, which was set up by user
- `collection_class`: Optional[Type] - Collection, which was set up
by user

**Returns**:

Expand Down Expand Up @@ -101,9 +102,10 @@ Beanie initialization
**Arguments**:

- `database`: AsyncIOMotorDatabase - motor database instance
- `document_models`: List[Union[Type[Document], str]] - model
classes or strings with dot separated paths
- `allow_index_dropping`: bool - if index dropping is allowed. Default True
- `document_models`: List[Union[Type[Document], str]] - model classes
or strings with dot separated paths
- `allow_index_dropping`: bool - if index dropping is allowed.
Default True

**Returns**:

Expand Down Expand Up @@ -170,7 +172,8 @@ Insert many documents to the collection
**Arguments**:

- `documents`: List["Document"] - documents to insert
- `keep_ids`: bool - should it insert documents with ids or ignore it? Default False - ignore
- `keep_ids`: bool - should it insert documents with ids
or ignore it? Default False - ignore
- `session`: ClientSession - pymongo session

**Returns**:
Expand Down Expand Up @@ -223,8 +226,9 @@ Find many documents by criteria
- `filter_query`: dict - The selection criteria.
- `skip`: Optional[int] - The number of documents to omit.
- `limit`: Optional[int] - The maximum number of results to return.
- `sort`: Union[None, str, List[Tuple[str, SortDirection]]] - A key or a list of (key, direction) pairs
specifying the sort order for this query.
- `sort`: Union[None, str, List[Tuple[str, SortDirection]]] - A key
or a list of (key, direction) pairs specifying the sort order
for this query.
- `session`: ClientSession - pymongo session

**Returns**:
Expand All @@ -245,8 +249,9 @@ Get all the documents

- `skip`: Optional[int] - The number of documents to omit.
- `limit`: Optional[int] - The maximum number of results to return.
- `sort`: Union[None, str, List[Tuple[str, SortDirection]]] - A key or a list of (key, direction) pairs
specifying the sort order for this query.
- `sort`: Union[None, str, List[Tuple[str, SortDirection]]] - A key
or a list of (key, direction) pairs specifying the sort order
for this query.
- `session`: ClientSession - pymongo session

**Returns**:
Expand Down Expand Up @@ -280,7 +285,8 @@ Fully update one document in the database
**Arguments**:

- `filter_query`: dict - the selection criteria.
- `document`: Document - the document which will replace the found one.
- `document`: Document - the document which will replace the found
one.
- `session`: ClientSession - pymongo session.

**Returns**:
Expand Down Expand Up @@ -484,7 +490,8 @@ Aggregate
**Arguments**:

- `aggregation_query`: List[dict] - query with aggregation commands
- `item_model`: Type[BaseModel] - model of item to return in the list of aggregations
- `item_model`: Type[BaseModel] - model of item to return in the
list of aggregations
- `session`: ClientSession - pymongo session.

**Returns**:
Expand Down Expand Up @@ -570,7 +577,8 @@ InspectionResult
class Cursor()
```

Cursor class. Wrapper over AsyncIOMotorCursor, which parse result with model
Cursor class. Wrapper over AsyncIOMotorCursor,
which parse result with model

<a name="cursor.Cursor.to_list"></a>
#### to\_list
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "beanie"
version = "0.4.0"
version = "0.4.1"
description = "Asynchronous Python ODM for MongoDB"
authors = ["Roman <[email protected]>"]
license = "Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions scripts/build_odm_doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pydoc-markdown -I beanie/odm --render-toc > docs/documentation/odm.md
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__ == "0.4.0"
assert __version__ == "0.4.1"

0 comments on commit 437b9a6

Please sign in to comment.