Where to store data in nedb?

Decided to use for a small project nedb. Checked, added a lot of test data. And decided to clean. Cleared the file .db where are stored all the data, but after looking that the data is still loaded, I do not know. Apparently the data is preserved in RAM. But why the data is saved there, if I connected the file? How to clean DB?
June 8th 19 at 16:57
1 answer
June 8th 19 at 16:59
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:
  1. complete Your script;
  2. remove data from a file;
  3. start Your script.

Find more questions by tags Databases