
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
|pipeline status| |coverage report| |pypi link|
.. |pipeline status| image:: https://git.yurzs.dev/yurzs/mdocument/badges/master/pipeline.svg :target: https://git.yurzs.dev/yurzs/mdocument/-/commits/master
.. |coverage report| image:: https://git.yurzs.dev/yurzs/mdocument/badges/master/coverage.svg :target: https://git.yurzs.dev/yurzs/mdocument/-/commits/master
.. |pypi link| image:: https://badge.fury.io/py/mdocument.svg :target: https://pypi.org/project/mdocument
.. |code style| image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black
.. |imports: isort| image:: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336 :target: https://pycqa.github.io/isort
.. role:: strike :class: strike
MDocument is a simple ORM for MongoDB with addition of relations.
There are two ways of using mdocument:
.. code-block:: python
import asyncio
import motor.motor_asyncio
from mdocument import MDocument, relations, model
client = motor.motor_asyncio.AsyncIOMotorClient()
class Video(MDocument):
__collection__ = "videos"
__database__ = "mdocument"
__client__ = client
class Model(MDocument.Model):
title = model.Field(str)
views_count = model.Field(int)
public_id = model.Field(str, unique=True)
class Comment(MDocument):
__collection__ = "comments"
__database__ = "mdocument"
__client__ = client
class Model(MDocument.Model):
text = model.Field(str)
video = model.FieldSync(Video, relation=relations.RelationOneToMany, synced_fields=["_id", "title"])
async def main():
video = await Video.create({"title": "Test"})
comment1 = await Comment.create(
video=video._id,
message="First!",
)
comment2 = await Comment.create(
video=video._id,
message="Second!"
)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Now we can easily access our comments using our related documents
TODO: REWRITE DOCUMENTATION!
FAQs
Simple DRM for motor client
We found that mdocument 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.