JavaScript: 更新数据

对表或视图执行UPDATE操作。

Parameters

Examples

更新您的数据

const { error } = await supabase
  .from('instruments')
  .update({ name: '钢琴' })
  .eq('id', 1)

更新记录并返回它

const { data, error } = await supabase
  .from('instruments')
  .update({ name: '钢琴' })
  .eq('id', 1)
  .select()

更新JSON数据

const { data, error } = await supabase
  .from('users')
  .update({
    address: {
      street: '梅尔罗斯广场',
      postcode: 90210
    }
  })
  .eq('address->postcode', 90210)
  .select()