when we click on a row in said table, display a radio-button switch. The switch should change a specific value in the selected row.
When I click a row, and then the switch, the query associated with the switch runs fine. It does not show any errors; no error about not being able to connect to the database, no error that it does not have write permissions. It says the query is successful. But, in the query output, it says "modifiedCount: 0", whereas I'd expect it to have a value of 1.
Anyone got a clue what I should look at next to get this resolved?
It might help to include some screenshots of the build at play here, but I'm initially wondering if the query is getting the appropriate value from the table row and then if the database is actually getting updated. Let us know and our team will get back to you here!
Okay. The issue is that ReTool doesn't support Mongo's classic syntax (where we could do a lookup on _id = "hjfkdashf" and just expect it to understand that it should convert that string to an ObjectId). Instead ReTool uses MongoDB's Extended JSON syntax. This means we have to be explicit about the "_id" string being of type ObjectId, like so...
{ _id: { "$oid" : <your-object-id> } }
when interacting with ObjectId().
That gets me a matchedCount: 1 in the query output.
Now I'm just stuck with figuring out how to get the boolean-opposite of a value, ie, if I just want to flip the existing boolean, how do I achieve that?
e.g. in my Update field, what I want is something like...