Skip to main content

Delete

Deletes a key-value pair from the database.

  • Parameters:
    • key: The key to delete.
  • Returns:
    • The result of the operation, includes a number indicating the number of rows affected by the operation or an error if the operation failed.
const result = db.delete("user:1234");
if (result.success) {
console.log(`Deleted ${result.data} rows`);
} else {
console.log(result.error.message);
}