云函数 httpapi databaseUpdate出错
发布于 6 年前 作者 yangliu 8268 次浏览 来自 问答

接口地址 https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseUpdate.html

代码 {

  “env”:“chunlin-5d5ie”,

  “query”: “db.collection(\“Question\”).where({nameid:\“8\”}).update({data:{qusetion:_.pull({sort:2})}})”

}

报错 {“errcode”:-605101,“errmsg”:“RuntimeError: cannot read property ‘pull’ (from line 1, col 72 to line 1, col 76)\n\n> 1 | db.collection(\“Question\”).where({nameid:\“8\”}).update({data:{qusetion:_.pull({sort:2})}})\n    |                                                                        ^^^^ hint: [ZFNCjOLoRa-joBtBa]”}

不支持_.pull 希望尽快修复

1 回复

可以将 _ 换为 db.command.pull 试试?HTTP API 环境可能没有 _ 的 alias

回到顶部