api-typings icon indicating copy to clipboard operation
api-typings copied to clipboard

云数据库报错“Property 'update' does not exist on type 'Query'.”

Open coordinate opened this issue 3 years ago • 3 comments

拷贝的官方文档 await db.collection('todos').where({ done: false }).update({ data: { progress: 1 }})

coordinate avatar Apr 22 '21 06:04 coordinate

我这边也是 "miniprogram-api-typings":"^3.5.0" ,这样可以解决:

// tsconfig.json
{
  "compilerOptions": {
    "typeRoots": ["typings"]
    // ...
// typings/index.d.ts
// ...
declare namespace DB {
  interface Query {
    update(options?: RQ<IUpdateDocumentOptions>): Promise<IUpdateResult>
  }
}

fritx avatar Aug 31 '22 11:08 fritx

一年了,3.6.0问题依旧

GiantappMan avatar Nov 15 '22 15:11 GiantappMan

两年了,原文:在开放安全规则后,where.update 和 where.remove 也在小程序端开放了,可以进行符合安全规则的批量更新. 希望可以加上。

aolsx avatar May 24 '23 05:05 aolsx