How to change a boolean value in FARM

I am having an issue creating a router that updates a boolean false value to true in my mongodb. All of this is activated by a button on my front end.

    @router.post("/started", response_description="start fight")
    async def update_started(request: Request, started: bool):
        start = await request.app.mongodb["matches"].update_one({"$set": {"started": True}})
        return start

    
    #@router.put("/update", response_description="start fight")
    #async def update_started(started: bool, request: Request):
     #   if started == False:
       #     started = request.app.database["matches"].update_one(
         #       {"started": False}, {"$set": True}
        #    )

I've tried many variations of this and am getting a 500 http error



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation