> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/database/collections/delete-record.md).

# Delete a record

Delete one record of a collection.

**Where:** Database → Collections → *collection* → **Delete...** on a row (or **Delete** in the record form) · `/projects/<project>/db/collections/<collection>/records`

## Before you start

* You need `database:delete` on the collection (`database:collection:<name>`).
* A delete cannot be undone, unless the collection has **Soft delete** on (schema **Settings** tab, see [Edit a schema](/codemash/cloud/database/collections/edit-schema.md#change-or-remove-it-later)): then the record is only marked as deleted and hidden.

## Steps

1. Open **Database → Collections** and click the collection. Find the record (sort a column, or move with **Next**).
2. Press **Delete...** on its row. The dialog **Delete Confirmation** asks *Are you sure you want to delete?*

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-4770a89d8b5a7a0e3879ca6b3af9f66b1bc214af%2Fdelete-record-1.png?alt=media" alt="Records list of books behind the dialog Delete Confirmation: Are you sure you want to delete? with Cancel and Delete"><figcaption><p>The confirmation dialog.</p></figcaption></figure>
3. Press **Delete**. **Cancel** keeps the record.

## Result

The dialog closes and the row is gone from the list. Every [schema trigger](/codemash/cloud/database/collections/schema-triggers.md) **When deleted** runs with the deleted record's data.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-a6ed112cf877ed026da1b86e01514ae70d47f2b7%2Fdelete-record-2.png?alt=media" alt="Records list of books without The Dispossessed"><figcaption><p>The list after the delete.</p></figcaption></figure>

## Change or remove it later

* A deleted record cannot be restored from Cloud. Add it again with [Add or edit a record](/codemash/cloud/database/collections/add-records.md).
* To delete every record of a collection, delete the schema — see [Edit a schema](/codemash/cloud/database/collections/edit-schema.md#change-or-remove-it-later) — or use `deleteMany` from code; it refuses an empty filter unless you send `allRecords: true` (`CM-ERRORS-DATABASE-037`).

## Do it from code

```ts
await norbix.api.database.deleteOne({ collectionName: 'books', id });
const { count } = await norbix.api.database.count({ collectionName: 'books' });
console.log(count); // 12
```

```sh
norbix api database one delete --collectionName books --id 6ac4f6ebf002ebc3670fbf09 --yes
```

The client setup is on the [Database page](/codemash/cloud/database.md#use-it-from-code). API: [Delete One](/codemash/api-reference/database/collections/delete-one.md) · [Delete Many](/codemash/api-reference/database/collections/delete-many.md)
