Hi,
I’m trying to find out how to query all devices from an application by its tags.
I did not find anything in the API.
As an example I want to create 2 queries to the API: #1: give me all devices having tag: “XYZ” with value “true” #2: give me all devices NOT having tag “XYZ”
Hi,
at least for #1 I found the solution:
result = await resin.models.device.getAll({
$filter: {
device_tag: {
$any: {
$alias: ‘unmanaged’,
$expr: {
unmanaged: {
tag_key: “XYZ”,
value: “true”
}
}
}
}
}
});
But for #2 I’m not able to find a solution…
Help appreciated.
For the benefit of any future audience I’ve had the pinejs-client tests recommended to me as a good resource for finding out the capabilities of our API query language.