收藏
回答

云开发使用update中删除数据库中子元素的某一条数据,显示null?

数据库中text数据 text:

  • "_id": "XXXXXX"
  • "_openid": "XXXXX"
  • "children": [
  • {"desc":"qwr","originPrice":"req","price":"wer","tag":"w...}
  • {"desc":"wq","originPrice":"wqr","price":"ewqr","tag":"e...}
  • {"desc":"wq","originPrice":"wqr","price":"ewqr","tag":"e...}
  • {"desc":"wq","originPrice":"wqr","price":"ewqr","tag":"e...}
  • ]
  • "shopName":"ssd"

使用 update删除children中的一条数据,显示null

const db= wx.cloud.database()

db.collection("text").doc(_id).update({

data:{

[ 'children.' + index_item] : db.command.remove()

}

})

怎么把null去掉呢

最后一次编辑于  2019-12-31
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签