当前位置: 首页 > 后端技术 > Python

如何通过python的sdkpymilvus判断一个集合是否存在?

时间:2023-03-26 01:24:48 Python

删除集合方案一:defdelete_collection():frompymilvusimportutilityutility.drop_collection(settings.MILVUS_CONFIG.collection.name)方案二:fromcore.milvus.modelsimportcollectionconn=connections._fetch_handler('default')ifconn.has_collection(settings.MILVUS_CONFIG.collection.name):logger.debug('集合已经存在')collection.drop()