[英]Arangodb update query failing with error 1213
var docs = ///aql
for(var i = 0; i< docs.length;i++) {
db._collection(edgeCol).update(docs[i]._id, {"a": 10});
}
I get following error: 我收到以下错误:
[ArangoError 1213: cross collection request not allowed] Error: cross collection request not allowed
[ArangoError 1213:不允许交叉收集请求]错误:不允许交叉收集请求
1213 (cross-collection request) means that you are calling update
on a collection but specify the id of a document from another collection for update. 1213(跨集合请求)表示您正在调用一个集合上的
update
,但指定另一个集合中的文档ID进行更新。 This is unsupported. 不支持此功能。
What you could do instead is either update by _key
, ie 相反,您可以执行
_key
更新,即
for(var i = 0; i< docs.length;i++) {
db._collection(edgeCol).update(docs[i]._id, {"a": 10});
}
or update using the db
object and its _update
method (and omitting the collection object): 或使用
db
对象及其_update
方法进行更新(并省略收集对象):
for(var i = 0; i< docs.length;i++) {
db._update(docs[i]._id, {"a": 10});
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.