MCPcopy Create free account
hub / github.com/NanmiCoder/MediaCrawler / get_collection

Method get_collection

database/mongodb_store_base.py:99–103  ·  view source on GitHub ↗

Get collection: {prefix}_{suffix}

(self, collection_suffix: str)

Source from the content-addressed store, hash-verified

97 self._connection = MongoDBConnection()
98
99 async def get_collection(self, collection_suffix: str) -> AsyncIOMotorCollection:
100 """Get collection: {prefix}_{suffix}"""
101 db = await self._connection.get_db()
102 collection_name = f"{self.collection_prefix}_{collection_suffix}"
103 return db[collection_name]
104
105 async def save_or_update(self, collection_suffix: str, query: Dict, data: Dict) -> bool:
106 """Save or update data (upsert)"""

Callers 5

save_or_updateMethod · 0.95
find_oneMethod · 0.95
find_manyMethod · 0.95
create_indexMethod · 0.95
testMethod · 0.95

Calls 1

get_dbMethod · 0.80

Tested by 1

testMethod · 0.76