JavaScript: Delete data

Perform a DELETE on the table or view.

By default, deleted rows are not returned. To return it, chain the call with .select() after filters.

Parameters

Examples

Delete a single record

const response = await supabase .from('countries') .delete() .eq('id', 1) 

Delete a record and return it

const { data, error } = await supabase .from('countries') .delete() .eq('id', 1) .select() 

Delete multiple records

const response = await supabase .from('countries') .delete() .in('id', [1, 2, 3])