Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如
if(table1.customer1 != null) then insert into table2 'customer1'
这可以在 MongoDB 中完成吗?
唯一的方法是两阶段提交:http ://docs.mongodb.org/manual/tutorial/perform-two-phase-commits/
没有办法(在单个操作中)根据另一个文档的值(在相同或不同的集合中)更新一个集合中的文档。
您可以在应用程序代码中执行此操作,但不能保证是原子的。