Deleting Records

To delete a record you can execute, for example:

const user = await xata.db.Users.delete('rec_cd8s3r8avc42pi67m13g')

// or, using the delete method on the record object:

In case the record with the given ID doesn't exist, the REST API returns a 404 and the TypeScript SDK throws an exception.

Next Steps

Now that you have seen how to do the basic create, remove, update, and delete operations, you can check out the docs on using the free text search API, which is a new super power that Xata gives you.

You can also review the pages on getting data, updating data, inserting data. We've got guides for each of these operations.