I'm receiving Data each second from a Database and with the help of the Write and read node and I store my data each minutes. I can delete the stored Data by configuiring another write note as delete instead of overwrite or append but that delete the complete file.
My question is that: is there a way to delete only data older than 24 hours rather than the complete file?
Thanks in advance for your help.
Depends on the database you are using.
With a influx database you can make a continues query that will do the job for you. Other databases you can make your own query do delete data older then 24H.
You don't mention how you store your data to file, i.e. what format. If there is a timestamp you could load the file, delete lines with timestamp older than 24 hr attach new lines and save. Or if no timestamp you could load file, delete all line except last 1440(1 day in mins), attach new line and save.
I expressed myself wrongly. I mean storing it in node red(file).
I store it in a .txt file. and I have and yes I have added an inject node with timestamps.
If you want to be able to do things like delete data before a certain time then you would be better to use a database. Then it is trivial.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.