Skip to content

The delete builder is used to remove items from your DynamoDB tables.

import { db } from "./db";
import { users } from "./schema";
await db.delete(users).where(eq(users.id, "123")).execute();

Initializes the delete builder for a specific entity.

  • Arguments:
    • entity: A Mizzle entity definition.
  • Returns: DeleteBuilder

Specifies the item to delete. Like update, this must resolve to the full primary key of the item.

  • Arguments:
    • expression: A Mizzle expression that resolves to the entity’s keys.
  • Returns: this

Instructs DynamoDB to return the content of the item that was deleted.

  • Returns: this

Executes the DeleteItem operation.

  • Returns: Promise<T | undefined>