nedb icon indicating copy to clipboard operation
nedb copied to clipboard

Database updates require server restart

Open ScriptedAlchemy opened this issue 3 years ago • 4 comments

Hey. Im having issues where i need to restart the server to see database updates Is there anything you're aware of that could've caused this?

ScriptedAlchemy avatar Nov 14 '20 21:11 ScriptedAlchemy

If you are modifying the db file manually, you need to restart the server. But otherwise, seems to be working fine. I insert new records and see them in a query instantly.

hernancorigliano avatar May 10 '21 03:05 hernancorigliano

The same thing, everything works fine with insertion, but when update(), fields with the same id appear in the database, and after updating the server or loading the database, they are combined into one and displayed normally

fl3xice avatar Jun 01 '21 17:06 fl3xice

Please enable autoCompaction for the nedb database like this. `const { salesDB } = require('./db')

//The database is automatically compacted (i.e. put back in the one-line-per-document format) every time //you load each database within your application. avoid the duplicate _ids during update or delete. `salesDB.persistence.setAutocompactionInterval(5000) //5-10 seconds`` Read more here. https://github.com/louischatriot/nedb#persistence

bogere avatar Jun 08 '21 15:06 bogere

Everything okay! it's my bad, @ScriptedAlchemy maybe close issue?

fl3xice avatar Jun 13 '21 04:06 fl3xice