收藏
回答

救救孩子!云数据库删除问题

框架类型 问题类型 终端类型 AppID 基础库版本
小程序 需求 工具 wxfe34012447b2e35d 2.2.5

删除失败 Error: errCode: -1  | errMsg: document.remove:fail Error: cannot remove document with _id 99de0bd7-960f-4358-a098-23afcd3630a6, please make sure that the document exists and you have the corresponding Write permission; at document.remove api;

db.collection('Reserve').doc(that.data.id).remove({

          success: function (res) {

            console.log('删除成功',res.data)

            that.setData({

              myclass: str,

              myseat: str,

              mystart: str,

              myend: str,

              id: null,

            });

            app.globalData.is_ordering= false;

          },

          fail: function(err){

            console.log('删除失败',err)

          }

        });

_id是我从数据库中获取的,为什么再次查找时就说没有呢? 在云平台数据库中的右上角也能查找到啊。。


回答关注问题邀请回答
收藏

1 个回答

  • V.O.N
    V.O.N
    2019-07-03

    数据库的权限选的第一个 所有用户可读、仅创建者可读写。这应该是最高权限了吧,是说只能相同的openid才可以修改吗?

    2019-07-03
    有用
    回复 2
    • V.O.N
      V.O.N
      2019-07-03

      行吧,小白刚刚测试了一下 现在回来自答吧 数据库删除是需要相同openid的,就是同一个创建者。之前测试的时候直接在数据库让同学手动添加的记录,所以我删不掉,只能他来删除

      2019-07-03
      1
      回复
    • Gary
      Gary
      2022-09-05回复V.O.N
      非常感谢,我也遇到这个问题了,删除不掉别人的数据
      2022-09-05
      回复
登录 后发表内容