Search
ctrl/
Ask AI
Light
Dark
System

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, offset, and 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',
}}