事务可以与mongodb聚合$ merge一起使用吗? [英] Will transactions work with mongodb aggregation $merge?
本文介绍了事务可以与mongodb聚合$ merge一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我使用mongodb事务同时更新两个文档.其中一个文档我想同时更新多个文档.我想使用mongodb聚合以某种方式构造文档. $ merge
是否会成为交易的一部分并更新所有文档,还是有可能失败?
If I am using a mongodb transaction to update two documents at the same time.One of the documents I would like to update numerous documents at the same time. And I want to use mongodb aggregation to structure the documents in a certain way. Will $merge
be part of the transaction and update all docs or is there a posibility of failure?
推荐答案
没有交易将无法进行.根据mongodb docs db.collection.交易中允许使用aggregate()
,但不包括 $ merge
阶段.在此处.
No the transaction will not work. According to mongodb docs db.collection.aggregate()
is allowed in transaction but the $merge
stage is excluded. See more here.
这篇关于事务可以与mongodb聚合$ merge一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文