JavaScript: Update data

Perform an UPDATE on the table or view.

Parameters

Examples

Updating your data

const \{ error \} = await supabase
  .from('countries')
  .update(\{ name: 'Australia' \})
  .eq('id', 1)

Update a record and return it

const \{ data, error \} = await supabase
  .from('countries')
  .update(\{ name: 'Australia' \})
  .eq('id', 1)
  .select()

Updating JSON data

const \{ data, error \} = await supabase
  .from('users')
  .update(\{
    address: \{
      street: 'Melrose Place',
      postcode: 90210
    \}
  \})
  .eq('address->postcode', 90210)
  .select()