Web Developer
Appwrite 1.5.5
Goal of function: See if computer_id and action_id exist in completed collection.
Issue: If computer_id or action_id is anywhere in any of the docs, it will return all docs.
I was using relationships before for the action and device but had the same issue. Changed to string to see if issue continued and it did.
Computer1: aaa
Computer2: bbb
Action1: 111
Action2: 222
Completed Docs:
Doc1: deviceAction: aaa_111
Doc2: deviceAction: bbb_222
Function runs with aaa_111, returns Doc1
Function runs with aaa_222, returns Doc1 and Doc2
let device_action_value = format!("{}_{}", computer_id, action_id);
let query = json!({
"values": [
{
"method": "equal",
"attribute": "deviceAction",
"values": device_action_value
}
]
});