fix
This commit is contained in:
@@ -21,13 +21,13 @@ async def create(config: Config) -> str:
|
||||
return result.inserted_id
|
||||
|
||||
|
||||
async def update_data(project: str, stage: str, name: str, value: dict) -> bool:
|
||||
result = await collection.update_one({'project': project, 'stage': stage, 'name': name}, {'$set': {'value': value}})
|
||||
async def update_data(id: bson.ObjectId, value: dict) -> bool:
|
||||
result = await collection.update_one({'_id': id}, {'$set': {'value': value}})
|
||||
return result.modified_count != 0
|
||||
|
||||
|
||||
async def delete(project: str, stage: str, name: str) -> bool:
|
||||
result = await collection.delete_one({'project': project, 'stage': stage, 'name': name})
|
||||
async def delete(id: bson.ObjectId) -> bool:
|
||||
result = await collection.delete_one({'_id': id})
|
||||
return result.deleted_count != 0
|
||||
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@ async def create(experiment: Experiment) -> str:
|
||||
return result.inserted_id
|
||||
|
||||
|
||||
async def update(project: str, stage: str, name: str, enabled: bool, condition: str) -> bool:
|
||||
result = await collection.update_one({'project': project, 'stage': stage, 'name': name}, {'$set': {'enabled': enabled, 'condition': condition}})
|
||||
async def update(id: bson.ObjectId, enabled: bool, condition: str) -> bool:
|
||||
result = await collection.update_one({'_id': id}, {'$set': {'enabled': enabled, 'condition': condition}})
|
||||
return result.modified_count != 0
|
||||
|
||||
|
||||
async def delete(project: str, stage: str, name: str) -> bool:
|
||||
result = await collection.delete_one({'project': project, 'stage': stage, 'name': name})
|
||||
async def delete(id: bson.ObjectId) -> bool:
|
||||
result = await collection.delete_one({'_id': id})
|
||||
return result.deleted_count != 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user