techfort / LokiJS

javascript embeddable / in-memory database
http:/techfort.github.io/LokiJS
MIT License
6.74k stars 482 forks source link

[Question] Reload database / cancel changes #929

Open HanimHank opened 1 year ago

HanimHank commented 1 year ago

I'm using lokijs with auto save off, and saving the database using db.saveDatabase() after certain actions.

Suppose I make a few changes and want to discard them. I don't call saveDatabase(), but the data stays in-memory, for the duration of the work session, I believe.

Instead of manually undoing the changes, is there a way to revert the database to the previously saved state? Or clear the in-memory changes?

Thank you so much!

deepam-kapur commented 1 year ago

Can I work on this?

jowmahin commented 1 year ago

Can I work on this?

What's your idea for how this could work?