微信小程序开发 | 云数据库更新异常

使用update的时候,出现了错误:stats:
也即是数据根本没有更新。寻寻觅觅……(参考地址:参考解决地址)
然后,用add方法来测试一下添加的数据是什么样的:
参考官网地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-client-api/database/collection.add.html

db.collection('weightdata').add({
      // data 字段表示需新增的 JSON 数据
      data: {
        // _id: 'todo-identifiant-aleatoire', // 可选自定义 _id,在此处场景下用数据库自动分配的就可以了
        description: "learn cloud database",
        due: new Date("2018-09-01"),
        tags: [
          "cloud",
          "database"
        ],
        // 为待办事项添加一个地理位置(113°E,23°N)
        location: new db.Geo.Point(113, 23),
        done: false
      },
      success: function (res) {
        // res 是一个对象,其中有 _id 字段标记刚创建的记录的 id
        console.log(res)
      },
      fail: console.error
    })

添加完成后,我们打开云开发控制台,然后,截图如下:
e

而我自己添加的数据记录如下图:
e


   Reprint policy


《微信小程序开发 | 云数据库更新异常》 by 梦否 is licensed under a Creative Commons Attribution 4.0 International License
 Previous
Hexo主题推荐 Hexo主题推荐
前段时间电脑键盘用着莫名的无效了,加上自己的C盘已经快满了,就想着重装一个系统,瘦瘦身。由于昨天重新安装了系统,hexo博客感觉next的主题也不是那么好看了。于是想着重找一个。下面推荐几款自己感觉比较好看的主题。 主题:Melody参考
2019-07-22
Next 
微信小程序开发 | 绘制折线图【一】【转】 微信小程序开发 | 绘制折线图【一】【转】
简单了解一下绘制折线图 官网地址:https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html 在学习之前,不妨来使用一些别人封装好的图表组件,看看效果。使用
  TOC