Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database updates require server restart #659

Open
ScriptedAlchemy opened this issue Nov 14, 2020 · 4 comments
Open

Database updates require server restart #659

ScriptedAlchemy opened this issue Nov 14, 2020 · 4 comments

Comments

@ScriptedAlchemy
Copy link

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?

@hernancorigliano
Copy link

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.

@fl3xice
Copy link

fl3xice commented Jun 1, 2021

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

@bogere
Copy link

bogere commented Jun 8, 2021

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

@fl3xice
Copy link

fl3xice commented Jun 13, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants