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