javascript - Nodejs exec mongodb command in Bluebird Promise -


i want run mongod command in node.js using promises, database operations can run after mongodb process started. tried hands following, failed:

var promise = require("bluebird");  var execasync = promise.promisify(require('child_process').exec);  execasync("~/mongodb/bin/mongod").then(function(result){     console.log("started mongodb..."); }).catch(function(error){     console.log("error in starting mongodb..."+json.stringify(error)); }); 

any suggestions?

you shouldn't start mongod process in node, should doing other way. can check whether it's running, not whether has started properly.


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

python - How to read gradle build progress from it's output? -

c# - How do I debug "System.DllNotFoundException: The specified procedure could not be found"? -