从NEDB数据库文件删除对象不起作用

时间:2019-12-05 07:43:43

标签: node.js database nedb

const database = new datastore({ filename: './database.db', autoload: true });



app.delete('/delete/:key',(request,response)=>{
     const param = request.params.key
     console.log(param)
    database.remove({key:param},{})
 })

我从前端获得了正确的参数值。但是database.db文件中没有任何变化

database.db文件


 {"task":"travel","checked":false,"key":1575483080551,"_id":"DyPPtRccllHb3xt2"}
{"task":"laksh","checked":false,"key":1575483067807,"_id":"wCudlggNZJk4o00W"}
{"task":"hello world","checked":false,"key":1575528880099,"_id":"wtOcryJKAV0uqhXh"}

0 个答案:

没有答案