MCPcopy
hub / github.com/hsliuping/TradingAgents-CN / get_mongo_db

Function get_mongo_db

app/core/database.py:391–395  ·  view source on GitHub ↗

获取MongoDB数据库实例

()

Source from the content-addressed store, hash-verified

389
390
391def get_mongo_db() -> AsyncIOMotorDatabase:
392 """获取MongoDB数据库实例"""
393 if mongo_db is None:
394 raise RuntimeError("MongoDB数据库未初始化")
395 return mongo_db
396
397
398def get_mongo_db_sync() -> Database:

Callers 15

check_database_statusFunction · 0.90
check_database_statusFunction · 0.90
__init__Method · 0.90
__init__Method · 0.90
initializeMethod · 0.90
initializeMethod · 0.90
__init__Method · 0.90
initializeMethod · 0.90
initializeMethod · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by 15

test_mongodb_connectionFunction · 0.72
mainFunction · 0.72
test_priorityFunction · 0.72
test_stock_fundamentalsFunction · 0.72
mainFunction · 0.72
test_kline_realtimeFunction · 0.72
test_usage_recordingFunction · 0.72
test_akshare_news_syncFunction · 0.72
test_pct_chg_filterFunction · 0.72
test_config_bridgeFunction · 0.72
test_news_syncFunction · 0.72