# ilorm-plugin-softdelete

> Plugin to handle soft delete with ilorm

Latest version **0.1.2** (published 2018-02-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install ilorm-plugin-softdelete
pnpm add ilorm-plugin-softdelete
yarn add ilorm-plugin-softdelete
bun add ilorm-plugin-softdelete
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-02-05 |
| First published | 2018-02-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | guillaume DAIX |
| Maintainers | stombre |
| Keywords | plugin, delete, mongodb, orm, ilorm |

## Links

- npm: https://www.npmjs.com/package/ilorm-plugin-softdelete
- npm.io page: https://npm.io/package/ilorm-plugin-softdelete

## Dependencies (1)

- [ilorm-constants](https://npm.io/package/ilorm-constants.md) ^0.1.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2018-02-05
- 0.1.1 — 2018-02-05

## README

# ilorm-plugin-softDelete
## Soft delete
When soft delete is enable. All remove / removeOne order are converted in update a flag "isDeleted" to true.
After, all the query targeting the database have a default query ; isDeleted = false.

## Use the plugin
The plugin add `forceRemove` and `forceRemoveOne` to handle the hard delete.

```javascript
const ilorm = require('ilorm');
const ilormSoftDelete = require('ilorm-soft-delete');

ilorm.use(ilormSoftDelete());

// Now model have ;
User.query()
    .removeOne(); // Soft delete (update the flag)

User.query()
    .forceRemoveOne(); // Hard delete (real delete).
```

---
_Source: https://npm.io/package/ilorm-plugin-softdelete · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
