def get_collection(collection_name, custom_mongo_client=None):
"""
Return the collection
:type collection_name: str
:param collection_name:
:type custom_mongo_client: MongoClient
:param custom_mongo_client:
:rtype: Collection
:return:
"""
if custom_mongo_client is None:
custom_mongo_client = get_mongo_client()
db = custom_mongo_client[config.db_name]
return db[collection_name]
评论列表
文章目录