$softDelete

Mark a record as deleted without permanently removing it from the table. The $softDelete method updates the record’s deletion status, typically by setting a deletedAt timestamp or a deleted flag. This allows the record to remain in the database and be restored later if needed, while excluding it from active queries by default.

Query
Parameter's

$where

<StaticProps>

$options

<FindOptions>

await Member.$softDelete({
    $where: {
        userId: {
            $startsWith: '123'
        }
    },
    $options: {
        $limit: 1
    }
});

Last updated