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
I found this strange sort of behavior/bug in my Electron + ReactJS app.
When I delete an item from the database using db.update(..., {$unset: ...}), everything works fine during that same session.
But when I close the app and open it up again, the object I deleted is replaced by 'null' and causes crashes in my app
Yes, I could null-check and if so skip that null entry, but in a big database with lots of null entries that would introduce inefficiencies and I really shouldn't have to null-check where I know I deleted an entry.
I suspect this problem arises from the database compaction during the startup of the second session.
I found this strange sort of behavior/bug in my Electron + ReactJS app.
When I delete an item from the database using
db.update(..., {$unset: ...})
, everything works fine during that same session.But when I close the app and open it up again, the object I deleted is replaced by 'null' and causes crashes in my app
Yes, I could null-check and if so skip that null entry, but in a big database with lots of null entries that would introduce inefficiencies and I really shouldn't have to null-check where I know I deleted an entry.
I suspect this problem arises from the database compaction during the startup of the second session.
My
$unset
code looks like this.Is this intentional? Is there a way to prevent this? When I unset an object I expect it to be removed from the array, not be replaced by null.
The text was updated successfully, but these errors were encountered: