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

Permanently deleting an entry from persistant storage #665

Open
soubhikchatterjee opened this issue Jan 7, 2021 · 2 comments
Open

Permanently deleting an entry from persistant storage #665

soubhikchatterjee opened this issue Jan 7, 2021 · 2 comments

Comments

@soubhikchatterjee
Copy link

I am using nedb in one of my projects. It seems to be matching my needs so far. I see one issue though, when trying to delete a record, instead of deleting the entire record, it does a partial deletion. i.e. it deletes the record and adds $$deleted: true.

{"$$deleted":true,"_id":"5ff56dece70e4d331ca9d724"}

Can the record be deleted permanently?

This is my code:

  db.remove({ name: doc.name }, {}, function (err, numRemoved) {
        // numRemoved = 1
      });
@jampy
Copy link

jampy commented Jan 11, 2021

you can manually call compactDatafile(), read https://github.com/louischatriot/nedb#persistence

@RickyKongCoder
Copy link

actually I have tried run
compactDatafile() in callback of db.remove but still not works.
the function has no effect

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

3 participants