云函数 http api 更新记录 出错问题?
发布于 6 年前 作者 longli 3364 次浏览 来自 问答

调用的这个接口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:{question:_.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:{question:_.pull({sort:\“2\”})}})\n    |                                                                        ^^^^ hint: [QFNCOPI2e-EZ.J_a]”}

请问是什么问题 不能使用_,pull 吗?

1 回复

可以将 _ 替换为 db.command 试试看

回到顶部