Skip to content

Commit

Permalink
Added support for more bson types and some general fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gurcuff91 committed Apr 17, 2024
1 parent 6625a51 commit 4fe5d7b
Show file tree
Hide file tree
Showing 4 changed files with 350 additions and 214 deletions.
4 changes: 4 additions & 0 deletions docs/docs/data_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ tailored to specific use cases.
#### Supported bson types

- `bson.ObjectId`
- `bson.Int64`
- `bson.Decimal128`
- `bson.Regex`
- `bson.Code`

#### Custom types

Expand Down
6 changes: 3 additions & 3 deletions mongotoy/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def connect(
return self._connect(*conn, ping)

@sync.proxy
async def migrate(
def migrate(
self,
document_cls: typing.Type[T],
session: 'Session' = None
Expand Down Expand Up @@ -1340,15 +1340,15 @@ def download_to(
self,
fs: FsBucket,
dest: typing.IO,
revision: int = None
revision: int = 0
) -> typing.Coroutine[typing.Any, typing.Any, None] | None:
return self._download_to(fs, dest, revision)

@sync.proxy
def stream(
self,
fs: FsBucket,
revision: int = None
revision: int = 0
) -> typing.Union[typing.Coroutine[typing.Any, typing.Any, 'FsObjectStream'], 'FsObjectStream']:
return self._stream(fs, revision)

Expand Down
Loading

0 comments on commit 4fe5d7b

Please sign in to comment.