typicode / lowdb

Simple and fast JSON database
MIT License
21.49k stars 923 forks source link

Remove Method #538

Closed gabrielsdiogo closed 2 years ago

gabrielsdiogo commented 2 years ago

I can't find the remove method, for remove object of json database file, can someone help me ?

UlisesGascon commented 2 years ago

Hi @gabrielsdiogo!

You can use remove method from lodash:

db.get(collection).remove(/*criteria works like in filter()*/)
typicode commented 2 years ago

You can search also "how to remove item from array". There's different way so I won't list them but something like that db.data = db.data.filter(/*...*/) can work.