MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / _get_documents_by_db

Function _get_documents_by_db

mongoengine/base/common.py:52–62  ·  view source on GitHub ↗

Get all registered Documents class attached to a given database

(connection_alias, default_connection_alias)

Source from the content-addressed store, hash-verified

50
51
52def _get_documents_by_db(connection_alias, default_connection_alias):
53 """Get all registered Documents class attached to a given database"""
54
55 def get_doc_alias(doc_cls):
56 return doc_cls._meta.get("db_alias", default_connection_alias)
57
58 return [
59 doc_cls
60 for doc_cls in _document_registry.values()
61 if get_doc_alias(doc_cls) == connection_alias
62 ]

Callers 1

disconnectFunction · 0.90

Calls 1

get_doc_aliasFunction · 0.85

Tested by

no test coverage detected