单个 MongoDB 查询中的多个操作
是否可以使用 MongoDB 在单个查询中更改多个集合?
一个 SQL 示例:
begin
update table_1 set some_field=1;
update table_2 set a_different_field=2;
commit
Is it possible to alter more than one collection in a single query with MongoDB?
A SQL example:
begin
update table_1 set some_field=1;
update table_2 set a_different_field=2;
commit
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你需要使用 db.eval 来做类似的事情。使用 db.eval 你可以在服务器上执行 javascript。
您可以在 mongoDB 网站。
I think you need to use db.eval for something like that. With db.eval you can execute javascript on the server.
You can find more info about it at the mongoDB website.