【问题标题】:Several operations inside of a single MongoDB query单个 MongoDB 查询中的多个操作
【发布时间】:2011-01-22 12:40:30
【问题描述】:

是否可以使用 MongoDB 在单个查询中更改多个集合?

一个 SQL 示例:

begin
update table_1 set some_field=1;
update table_2 set a_different_field=2;
commit

【问题讨论】:

    标签: database pymongo


    【解决方案1】:

    我认为你需要使用 db.eval 来做类似的事情。使用 db.eval,您可以在服务器上执行 javascript。

    您可以在mongoDB website找到更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-01
      • 1970-01-01
      • 2019-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-06
      相关资源
      最近更新 更多