Start MongoDB from within a Grunt task

automation, gruntjs, mongodb, shell

Solution

You can use grunt-shell to run the command:

grunt.initConfig({
    shell: {
        mongo: {
            command: 'mongod'
        }
    }
});

Problem

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`.

Original source