Skip to main content

Access embedded documents with CRUD by id.

Project description

PyPI versionBuild Status


This package provides basic CRUD methods on EmbeddedDocumentListField through _id.


import mongoengine
from mongoengine_embedded import EmbeddedResource, ResourceContainer

# embedded resource
class Masterpiece(mongoengine.EmbeddedDocument, EmbeddedResource):
    title = mongoengine.StringField()

# document contains embedded resource
class Monkey(mongoengine.Document):
    masterpieces = mongoengine.EmbeddedDocumentListField(
        Masterpiece, element_name='masterpiece')

the_monkey = Monkey()

# Create
one_masterpiece = the_monkey.create_masterpiece(title='Complete Works of William Shakespeare')
another_masterpiece = the_monkey.create_masterpiece(title='Siku Quanshu')

another_id =
# Read
another = the_monkey.get_masterpiece_by_id(another_id)

# Update
the_monkey.modify_masterpiece_by_id(another_id, set__name='Jing Shi Zi Ji')

# Destroy


This Package can be installed through pip:

pip install mongoengine-embedded



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mongoengine-embedded, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size mongoengine-embedded-1.0.1.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page