[英]Is it more efficient to move documents between collections or change a field value in Firestore?
[英]Move Documents between collections in ArangoDB
有没有一种简单的方法可以在 ArangoDB 的 collections 之间移动文档? 我尝试了简单的方法来更改_id
,但担心这不应该或不可能:
FOR i IN collection_A
UPDATE { _key: i._key, _id: CONCAT('collection_B/',i._key) } IN collection_A
有没有有用的方法可以使用 AQL 将我的文档从collection_A
移动到collection_B
?
你可以尝试类似的东西
FOR i IN collection_A
LET i_b = UNSET(i, "_id") // Remove the id that is not valid before insert
INSERT i_b INTO collection_B
REMOVE i IN collection_A
只需在 collection_A 中插入而不是更新 For I 插入到 collection_B
FOR u IN collection_A
INSERT u IN collection_B
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.