I am facing some difficulty in finding the perfect solution of autosaving data while using LokiJS in NodeJS...
I tried something from the official doc, but all it says is that saveDB is not a function.
Pls help.
I am facing some difficulty in finding the perfect solution of autosaving data while using LokiJS in NodeJS...
I tried something from the official doc, but all it says is that saveDB is not a function.
Pls help.
When you initialize a new database you can specify the autosave
and autoload
parameters:
let db = new loki('db.json', {autosave: true, autoload: true});
You can also manually save after you make any changes with:
db.saveDatabase();