
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
A MongoDB ODM based on Motor and Pydantic.
The project code is hosted on GitHub, documentation on ReadTheDocs.
pip install Motor-ODM
from motor.motor_asyncio import AsyncIOMotorClient
from motor_odm import Document
# Create a custom model by subclassing Document
class User(Document):
class Mongo:
# Set the collection name
collection = "users"
# Add attributes to your model
username: str
age: int
# Connect your model to a database
client = AsyncIOMotorClient(...)
Document.use(client.get_default_database())
# Create documents and save them to the database
u = User(username="John", age=20)
await u.insert()
# Query the database
async for user in User.all():
print(user.username)
For a more complete overview have a look at the docs.
FAQs
A MongoDB ODM based on Motor and Pydantic.
We found that Motor-ODM demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.