I've been working with lokijs on node and use it with express and socket and typescript.
Now i've got two instances of loki database and when I use db.saveDatabase()
it is not set in the file although I did initialize with new Loki(
. The collection itself seems to be well updated but somehow this can't be set to persistence after the db has been updated with an entry earlier by reloading the webpage. Even the callback which I added in saveDatabase is running ${DB_PATH}/${DB_NAME}
, { persistenceMethod: 'fs'});db.saveDatabase((error) => { console.log(
Do we have an error: ${error}
) });
I run it local on a windows 10 machine. Rights to the folder seems to be ok.