Documentsubclasses utilizing the
Queryableinherits) gain class-level active record behaviours. Additionally,
Identifiedas well, providing an automatically generated ObjectId field named
idwhich maps to the stored
_idkey. There is a fairly substantial number of collection metadata and calculated properties available.
Accountclass to a database will look up the collection name to use from the
__collection__attribute. Alternatively you could bind directly to a specific collection. Either way, binding will automatically apply the metadata options for data access and validation and enable the
get_collectionmethod to provide you the correct, configured object.
create_indexes. Creating the collection will create any declared indexes automatically by default. For other collection-level management operations it is recommended to utilize
get_collectionand issue calls to the PyMongo API directly.