Is it possible to start MongoDB from within a Grunt task? Basically when I'm running my development environment with grunt server
I want it to start up the MongoDB server as well possibly by running mongod
.
相关问题
- MongoDB can not create unique sparse index (duplic
- How to get the return code of a shell script in lu
- Spring Data MongoDB - lazy access to some fields
- Golang mongodb aggregation
- Invoking Mirth Connect CLI with Powershell script
相关文章
- 使用2台跳板机的情况下如何使用scp传文件
- mongodb有没有什么办法禁止读取数据的时候进行缓存
- mongodb-aggregate聚合查询分组后如何获得多字段
- In IntelliJ IDEA, how can I create a key binding t
- mongodb error: how do I make sure that your journa
- shell中反引号 `` 赋值变量问题
- How get the time in milliseconds in FreeBSD?
- How to track MongoDB requests from a console appli
You can use grunt-shell to run the command:
To add to JJJ's answer, using grunt-shell-spawn if you want to make sure each project has it's own mongodb instance with it's own data you would do this:
The example also prints out only errors.
You would then just add
shell:mongodb
to yourgrunt server
task list (preferably the first task), adddata
to your.gitignore
(assuming you're using git) and you're good to go.You can use grunt-shell-spawn to do this. The previous answer recommends grunt-shell, which runs synchronously on the main process - blocking execution of other tasks.