beanie
beanie copied to clipboard
Asynchronous Python ODM for MongoDB
This is a great project, I'm migrating from mongoengine, but I don't know how to deal with situations like this. ```python import mongoengine as me from mongoengine import Document class...
Creating a document without defining an `id` field, appears to generate the following error during save (of a new document) when `validate_on_save` is true in the settings. ``` E pydantic.error_wrappers.ValidationError:...
I'm interested in using beanie for a project with API that is backed by Atlas. One of the constraints I have is the use of rotating credentials that get updated...
https://www.mongodb.com/docs/manual/reference/method/db.collection.findOneAndUpdate/ https://www.mongodb.com/docs/manual/reference/method/db.collection.findOneAndReplace/ Any chance to add it soon? Along with bulk support.
Currently, there is no syntactic sugar for deleting a document and retrieving the deletion result, to know whether the doc existed or not. ```python result = MyDocument.find_one({...}).delete() ``` This does...
In some contexts, synchronous operations are required but in others, asynchronous operations are possible and more efficient. For example a CLI with [Typer](https://github.com/tiangolo/typer) and a RestAPI with [FastAPI](https://github.com/tiangolo/fastapi). It would...
I have a Photo document: ``` class Photo(Document): query: str description: str thumb_url: str small_url: str user_id: PydanticObjectId likes: Optional[int] ``` and in Gallery document I reference photos as a...
## production version number I don't see any specific documentation in your repo related to version numbers, version management or version number conventions - so I'm not sure if my...
``` class UserView(BaseModel): id: str username: str class UserModel(Document): username: str email: str u = await UserModel.find_one(UserModel.id == "xxx").project(UserView) print(u.id) ``` got the error: ``` pydantic.error_wrappers.ValidationError: 1 validation error for...
I'm using the `Link` type to model a relation to another collection, but when I try to serialize it, it fails with a strange error: ````py ValueError: [TypeError("'_thread.lock' object is...