MCPcopy Create free account
hub / github.com/Boris-code/feapder / delete

Method delete

feapder/db/mongodb.py:401–424  ·  view source on GitHub ↗

删除 Args: coll_name: 集合名 condition: 查找条件 Returns: True / False

(self, coll_name, condition: Dict)

Source from the content-addressed store, hash-verified

399 return 0
400
401 def delete(self, coll_name, condition: Dict) -> bool:
402 """
403 删除
404 Args:
405 coll_name: 集合名
406 condition: 查找条件
407 Returns: True / False
408
409 """
410 try:
411 collection = self.get_collection(coll_name)
412 collection.delete_one(condition)
413 except Exception as e:
414 log.error(
415 """
416 error:{}
417 condition: {}
418 """.format(
419 e, condition
420 )
421 )
422 return False
423 else:
424 return True
425
426 def run_command(self, command: Dict):
427 """

Callers

nothing calls this directly

Calls 2

get_collectionMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected