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.
是否可以在使用 MongoDB 的单个查询中更改多个集合?
一个 SQL 示例:
begin update table_1 set some_field=1; update table_2 set a_different_field=2; commit
我认为你需要使用 db.eval 来做类似的事情。使用 db.eval,您可以在服务器上执行 javascript。
您可以在mongoDB 网站上找到有关它的更多信息。