Skip to main content

Soft delete

Set options.softDelete to true to mark records as deleted rather than permanently removing them from the database. This process allows for data recovery and maintains audit trails.

Behavior

When softDelete is enabled, the Manta SDK performs the following actions:

  • Sets a deletedAt timestamp on the targeted records.
  • If a deletedAt field does not exist, it may create a new boolean field called deleteByManta and set it to true.

Usage

TypeScript
// Soft delete inactive users in Manta Tables
await manta.deleteRecords({
table: "user",
where: { status: "inactive" },
options: {
softDelete: true
},
});