문제

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
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top