修改数据: update()

对表执行 UPDATE .

final res = await supabase
  .from('cities')
  .update({ 'name': 'Middle Earth' })
  .match({ 'name': 'Auckland' })
  .execute();

Notes

TODO 更新 dart 的链接

  • update() 应该和 Filters 搭配使用来定位您想更新的选项.

Examples

更新您的数据

final res = await supabase
  .from('cities')
  .update({ 'name': 'Middle Earth' })
  .match({ 'name': 'Auckland' })
  .execute();

更新JSON数据

Postgres 提供了 许多 用于处理 JSON 数据的运算符. 目前只能更新整个 JSON 文档,但我们正在研究如何更新单个关键字。

final res = await supabase
  .from('users')
  .update({
    'address': {
      'street': 'Melrose Place',
      'postcode': 90210
    }
  })
  .eq('address->postcode', 90210)
  .execute();

results matching ""

    No results matching ""