开发者

How to concurrently run mongo scripts

开发者 https://www.devze.com 2023-03-22 12:24 出处:网络
How can I run mongo myDbName script1.js mongo myDbName script2.js concurrently? Is there a way to fork the execution? (I am searching for something like a --fork option

How can I run

mongo myDbName script1.js

mongo myDbName script2.js

concurrently?

Is there a way to fork the execution? (I am searching for something like a --fork option like in mongod --fork)

Tha开发者_开发百科nks folks! Olmo


Running those two scripts is like running two commands on the shell.

Simplest thing would be to run them in two different shells. Or you can run them in background if you are not writing something important to stdout in those scripts.

In a more complex way, you can write a program which will fork and exec these two commands, but it's really an overkill.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号