Light
Dark
System
v3latest
v3latest
v2
v1

Delete

The delete command is used to delete objects from the database.

Copy
delete Hero
filter .name = 'Iron Man';

Deletion statements support filter, order by, and offset/limit clauses. See EdgeQL > Select for full documentation on these clauses.

Copy
delete Hero
filter .name ilike 'the %'
order by .name
offset 10
limit 5;

A delete statement returns the set of deleted objects. You can pass this set into select to fetch properties and links of the (now-deleted) objects. This is the last moment this data will be available before being permanently deleted.

Copy
db> 
... 
with movie := (delete Movie filter .title = "Untitled")
select movie {id, title};
{default::Movie {
  id: b11303c6-40ac-11ec-a77d-d393cdedde83,
  title: 'Untitled',
}}
Light
Dark
System

We use ChatGPT with additional context from our documentation to answer your questions. Not all answers will be accurate. Please join our Discord if you need more help.