Delete Documents

Open inAnthropic

Prerequisites

  • TerminusDB running locally (install guide)
  • A connected client instance with documents to delete

What you'll achieve By the end of this guide, you will have deleted documents from your TerminusDB database using the JavaScript client, the Python client, or the HTTP API.

To delete a document you need its document ID (e.g. Player/George).

Delete a document

Example: TypeScript
const deleteDoc = async () => {
  const docId = "Player/George"
  await client.deleteDocument({ id: docId })
  console.log(`Deleted ${docId}`)
}

Deleting a document is permanent within the current branch. If you need to recover a deleted document, use time travel to access a previous commit.

Next steps

You've learnt the full CRUD lifecycle. To go further:

Was this helpful?