收藏
回答

云开发 comment.set() 报错?

 console.log("dealNetworkWhenSetTuid upData==", upData)
  await db.collection("user").where(
    {
      _openid: userMsg.data[0]._openid
    }
  ).update(
    {
      data: upData
    }
  )


打印信息如下:

dealNetworkWhenSetTuid upData== {
  "node_position": 3,
  "t_uid": "optGL0uXwly3i4x3WVOHB-HmI6ms",
  "first_t_user": {
    "operator": "set",
    "operands": [
      {}
    ],
    "fieldName": {}
  },
  "second_t_user": {
    "node_position": 1,
    "open_id": "oq6Pm5DIMXX2iKHCpQ5E_ObOlzZ4",
    "unionid": "optGL0v6N_8RwDyyacdabbGEz6KI",
    "money": 1
  },
  "second_t_openid": "oq6Pm5DIMXX2iKHCpQ5E_ObOlzZ4"
}



错误信息:

ERROR RequestId:cd1368e1-4aaa-11ec-956a-525400a835cb Result:{"errCode":1,"errMsg":"user code exception caught","stackTrace":"Error: errCode: -502001 database request fail | errMsg: [FailedOperation] multiple write errors: [{write errors: [{'$set' is empty. You must specify a field like so: {$set: {\u003cfield\u003e: ...}}}]}, {\u003cnil\u003e}]; \n at Object.returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6032:16)\n at Object.checkError (/var/user/node_modules/wx-server-sdk/index.js:1364:23)\n at Promise (/var/user/node_modules/wx-server-sdk/index.js:1459:33)\n at process._tickCallback (internal/process/next_tick.js:68:7)"}

其中使用了:upData.first_t_user = command.set({})


请问大佬,comment.set 不可以设置值为 空对象吗?


回答关注问题邀请回答
收藏
登录 后发表内容