document – The ORM core

class monguo.document.BaseDocument

The document base, not support query operations.

classmethod fields_dict()

Get all the Field instance attributes.

classmethod validate_document(document)

Validate the given document.

  • document: The document to be validated.
class monguo.document.EmbeddedDocument

The embedded document, not support query operations.

class monguo.document.Document

The ORM core, supports all the query operations of motor.

classmethod get_collection(pymongo=False)

Get the collection related to cls, it’s an instance of MotorCollection.

  • pymongo: Return pymongo.collection if True.
classmethod get_collection_name()

Get the collection name related to cls.

classmethod get_database(pymongo=False)

Get the database related to cls, it’s an instance of MotorDatabase.

  • pymongo: Return pymongo.database if True.
classmethod get_database_name()

Get the database name related to cls.

classmethod to_list(*args, **kwargs)

Warp cursor.to_list() since length is required in cursor.to_list

classmethod translate_dbref(*args, **kwargs)

Get the document related with dbref.

  • dbref: The dbref to be translated.
classmethod translate_dbref_in_document(*args, **kwargs)

Translate dbrefs in the specified document.

  • document: The specified document.
  • depth: The translate depth.
classmethod translate_dbref_in_document_list(*args, **kwargs)

Translate dbrefs in the document list.

  • document_list: The specified document list.
  • depth: The translate depth.
Fork me on GitHub