beanie
beanie copied to clipboard
Asynchronous Python ODM for MongoDB
MongoDB and motor offer field encryption trough the `motor_asyncio.AsyncIOMotorClientEncryption` which offer a `.encrypt` and `.decrypt` function. A possible implementation would be similar to Indexes. Eg. typehinting the field as `Encrpted(str)`....
i try to chained call with method find, sort, limit, skip and finally use aggregate, but got unexpected result. a. insert 100 records into db b. try to find data...
Currently the cache just saves query results. Lets check some example. We got an Document which got caching enabled. ```py doc = await ExampleDoc.get(...) print(doc.example) # prints "example" doc.example =...
In version `1.11.6`, the collection is only created if the `indexes` attribute of the Settings class is set to a list containing at least one index.
`Document.get`'s `document_id` parameter is currently type hinted as `PydanticObjectId` which suggests that the document id always will be a MongoDB ObjectID. But this library allows re-assigning the document id type,...
I thought it would be a good idea to have several caching strategies, so I modified a bit the cache API to give ideas of how it could be, for...
The cache is currently limited on single process applications. Example: You fetch and cache document x on process 1 and fetch it also on process 2. If you modify the...
QUESTION: Is events + method an atomic action, or do we need to do verbose transaction management?
Hi, We are trying to implement an "accession number" field called ```acc``` in our Beanie Documents. Since ```acc``` is a counter that follows a specific format, we decided to make...
When used with FastAPI, all parent required fields become child required fields when creating a new document. For example: **Models** ```python from beanie import Document, Indexed, Link class Organization(Document): slug:...
Hi. I needed to check the duplicate fields(unique fields) in the database. I added unique_fields to ItemSettings to solve this. Sample: ``` class User(Document): first_name: str | None = None...