'Return a PyMongo collection for the document.'

@classmethod
def _get_collection(cls):

    if ((not hasattr(cls, '_collection')) or (cls._collection is None)):
        if (cls._meta.get('max_size') or cls._meta.get('max_documents')):
            cls._collection = cls._get_capped_collection()
        else:
            db = cls._get_db()
            collection_name = cls._get_collection_name()
            cls._collection = db[collection_name]
        if cls._meta.get('auto_create_index', True):
            cls.ensure_indexes()
    return cls._collection
