云开发数据库删除数据问题
发布于 4 年前 作者 xgong 488 次浏览 来自 官方Issues

我想公用数据库,每个用户都可以往同一个表里输入数据,也可以删除,我遇到的问题是甲录的信息乙无法删除,反之乙录的信息甲也删不了,报以下错误,什么意思了Error: errCode: -1  | errMsg: document.remove:fail Error: cannot remove document with _id 890198e15d485b2d0ca3092027cd35a4, please make sure that the document exists and you have the corresponding Write permission; at document.remove api;

2 回复

大概是权限问题,云开发数据库默认情况只有数据的创建者可以读写数据,用户之间不能互相操作

是使用的云函数操作数据库还是小程序客户端操作的数据库?

若是小程序端直接操作数据库的情况,是因为权限问题,且这个问题无法修复,只能建议你使用云函数操作数据库,可以做到多人操作同一数据库的需求。

回到顶部