Get collection: {prefix}_{suffix}
(self, collection_suffix: str)
| 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)""" |