JavaScript Nodejs exec mongodb command in Bluebird Promise node.js mongodb exec

I want to run mongod command in node.js using Promises, so that database operations can run only after mongodb process is started. I tried my hands with following, but 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?

Answer:1

Problem: I'm trying to validate when the user only inputted special characters without typing any number with it. I'm using this expression /^\+?[0-9 \.-]+$/ to accept only '+' sign, numbers, dots, ...

Problem: I'm trying to validate when the user only inputted special characters without typing any number with it. I'm using this expression /^\+?[0-9 \.-]+$/ to accept only '+' sign, numbers, dots, ...

This is what I thought should work but it doesn't. I'm am using unicode 112 for the "p" key and 115 for "s". var audio = document.getElementById("lessonTrack"); window.addEventListener("...

This is what I thought should work but it doesn't. I'm am using unicode 112 for the "p" key and 115 for "s". var audio = document.getElementById("lessonTrack"); window.addEventListener("...

  1. bind keyboard shortcut javascript
  2. bind keyboard shortcut
  3. bind keyboard shortcut to function
  4. bind keyboard command
  5. ubuntu bind keyboard shortcut
  6. windows bind keyboard shortcut
  7. wpf bind keyboard shortcut
  8. jquery bind keyboard shortcuts
  9. wxpython bind keyboard shortcuts
  10. key bind keyboard shortcuts
  11. bind applescript to keyboard shortcut
  12. windows 7 bind keyboard shortcut
  13. c# bind keyboard shortcuts

Im getting error on using Google API. having right to connect with Google Drive and add new sheet and insert data into it. It was working till yesterday but when i run the application today. Im ...

Im getting error on using Google API. having right to connect with Google Drive and add new sheet and insert data into it. It was working till yesterday but when i run the application today. Im ...

  1. google drive error creating copy
  2. google drive error accessing folder contents
  3. google drive error 404
  4. google drive error 403
  5. google drive error 401
  6. google drive error 1603
  7. google drive error making copy
  8. google drive error 500
  9. google drive error 400
  10. google drive error rendering shape
  11. google drive error message
  12. google drive error playing video
  13. google drive error unusual traffic
  14. google drive error uploading
  15. google drive error d41d
  16. google drive error a synced folder is missing
  17. google drive error unable to load file
  18. google drive error reload
  19. google drive error can't open file
  20. google drive error 503

I have an ExtJS application and some different environments (local machine, development, production-like test environment, and production). The ExtJS application is backed by a Java backend which is ...

I have an ExtJS application and some different environments (local machine, development, production-like test environment, and production). The ExtJS application is backed by a Java backend which is ...