3

this is my order to delete a data from my db

chats.remove({ _id: chatId }, {}, function (err, numRemoved) // chatId = 1001131507377

the database before running the remove order

{"_id":1001131507377,"chatTitle":"test group","AddedBy":"159263523 - @rrbot - Abd"}

the data base after running the remove order

{"_id":1001131507377,"chatTitle":"test group","AddedBy":"159263523 - @rrbot - Abd"} {"$$deleted":true,"_id":1001131507377}

it passes and doesn't show any error

Engineer Passion
  • 1,051
  • 1
  • 8
  • 14

1 Answers1

4

NeDB is working correctly. Updates to data are appended at the end of the file until NeDB "compacts" the data.

You can manually compact the data with the command: chats.persistence.compactDatafile()

For more information see: https://github.com/louischatriot/nedb#persistence

zekim
  • 82
  • 4