nedb default stores data in RAM, thus for each operation on the data appending in the end of the file, the line describing this operation.
If you erase the contents of the data file during running of your script attached to this file, then when the process exits, the script overwrites the file nedb latest actual data from the RAM.
To remove data from a file, perform the following steps:
- complete Your script;
- remove data from a file;
- start Your script.