api-typings
api-typings copied to clipboard
云数据库报错“Property 'update' does not exist on type 'Query'.”
拷贝的官方文档
await db.collection('todos').where({ done: false }).update({ data: { progress: 1 }})
我这边也是 "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>
}
}
一年了,3.6.0问题依旧
两年了,原文:在开放安全规则后,where.update 和 where.remove 也在小程序端开放了,可以进行符合安全规则的批量更新. 希望可以加上。