deleteById()

You can delete a data on Schema from database

Syntax

User.deleteById(id,callback?)
  • Id; ID is a string and required.

  • Callback; Callback is a function and not required.

Example

const id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

User.deleteById(id,(callback) => {
console.log(callback)
/*
true
*/
})

Last updated