I have an ESP32 that scans Bluetooth devices, and upload it to Firebase Realtime Database. Because it constantly uploads the information, I need to keep deleting old scanned devices. Tried to set the Rules on Firebase to delete devices older than 1 minute, but it didn't work.
The data upload in the following format:
`{
"beacons": {
"00:22:8c:f3:26:a2": {
"3C:61:05:64:4F:14": {
"rssi": -95,
"time": 1682528088
}
}
}
}`
I am trying to set the rules to delete the objects after 1 minute they were uploaded. Using the following rules, but it don't delete automatically:
`{
"rules": {
"beacons": {
"$beaconId": {
".read": true,
".write": true,
".validate": true,
"$deviceId": {
".validate": true,
".write": "data.child('time').val() > (now - 60000)",
".read": true
}
}
}
}
}`
Tried setting the time to my timezone (-3), and also timezone 0, but it didn't work either.