delete()
You can delete a data from database using with delete()
Syntax
db.delete(path,listener?)
Path; Path is a string, split with dot and required.
Callback; Callback is a function and not required.
Example
db.delete("user.john.bag",(err,data) => {
if(err) return console.log(err.message)
console.log("Bag removed from john")
console.log(data)
})
/*
{
name:"John",
surname:"Doe",
age:18
}
*/
Last updated
Was this helpful?