velocity / components /updatedynamicendpoint.py
Junaidb's picture
Create updatedynamicendpoint.py
b7f11de verified
raw
history blame contribute delete
480 Bytes
from components.mongodbconnection import provideClient
mc=provideClient()
db=mc["x402ify_db"]
coll=db["x402ify_col"]
def UpdateDynamicEndpoint(owner,tag,newendpoint):
try:
coll.find_one_and_update(
{"owner": owner},
{ "$set": {"dynamicendpoints.$[elem].endpoint": newendpoint}
},
array_filters=[{"elem.endpoint_linker": tag}],
)
return {"status":True}
except Exception as e:
return {"status":False}