【发布时间】:2019-04-23 07:36:01
【问题描述】:
我有一个 Stitch 函数可以做几件事,但在这一行出现错误:
try {
// voteAsObjectId is the Id of the photo to vote converted to BSON.ObjectId.
await db
.collection('photos')
.updateOne({ "_id": voteAsObjectId }, { "$inc": { votes: 1 }});
} catch (err) {
throw new Error("An error occurred while updating photo's votes:" + err);
}
错误如下:
StitchError: update not permitted
这似乎是与权限相关的错误,但我的应用程序中有一些其他功能,它们成功运行了对该集合的每个 .find .insert 和 .aggregate 查询,只有 .updateOne 和 .updateMany 操作给我带来了麻烦。
我的收藏权限如下所示:
这是我的架构:
这是一个示例文档:
【问题讨论】:
-
您的规则的 Apply When 表达式是什么? (即当你点击铅笔时)
-
@ChrisBush 这是{}
-
转到“用户”和“查看活动”以获取有关错误的更多信息