You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/LokiJS-Forge/LokiDB/blob/master/CONTRIBUTING.md#question
Current behavior
update a record
delete that record
save database
values left in database
Expected behavior
no values left in database
Minimal reproduction of the problem with instructions
save after (update record and delete record) leaves behind values in DB
save after update, save after delete record does not leave behind values
What is the motivation / use case for changing the behavior?
Explicitly saving database after an update and delete would leave behind records
Sorry for the really late reply. I tried to reproduce the bug, but it didn't work:
constdb=newLoki("myTestApp3");db.initializePersistence().then(()=>{constcoll=db.addCollection<Name>("myColl");// Insert documents.coll.insert({name: "Hello"});coll.insert({name: "World"});returndb.saveDatabase();// save or not save, doesn't changes anything}).then(()=>{// Update and remove one record.constcoll=db.getCollection<Name>("myColl");constdoc=coll.find()[0];expect(doc.name=="Hello")doc.name="Good by";coll.update(doc);coll.remove(doc);returndb.saveDatabase();}).then(()=>{constall=db.getCollection<Name>("myColl").find();expect(all.length).toEqual(1);expect(all[0].name).toEqual("World");}).then(()=>{// Load database.constdb2=newLoki("myTestApp2");returndb2.initializePersistence({autoload: true}).then(()=>{// Only one record present.constall=db.getCollection<Name>("myColl").find();expect(all.length).toEqual(1);expect(all[0].name).toEqual("World");});}).catch(e=>{fail(e);}).then(()=>{done();});
I'm submitting a...
Current behavior
update a record
delete that record
save database
values left in database
Expected behavior
no values left in database
Minimal reproduction of the problem with instructions
save after (update record and delete record) leaves behind values in DB
save after update, save after delete record does not leave behind values
What is the motivation / use case for changing the behavior?
Explicitly saving database after an update and delete would leave behind records
Environment
The text was updated successfully, but these errors were encountered: