title: How to run mongodump command in spawn/exec child process with arguments
body: <p>I need to run mongodump command with below arguments</p>
  
  <pre><code>    var dbhost = mongoose.connection.host || "127.0.0.1",
                      dbport = mongoose.connection.port,
                      dbname = mongoose.connection.name,
                      dbuser = mongoose.connection.options.user,
                      dbpass = mongoose.connection.options.pass,
                      backupPath = path,
                      date = new Date(),
                      currentDate =  date.toLocaleString(),
                      backupFileName ='DBBACKUP-'+currentDate;
  </code></pre>
  
  <p>how to pass above variables to child process</p>
  
  <p>I've tried with below code </p>
  
  <pre><code>var backupDB = spawn('mongodump --host '+dbhost+' --port '+dbport+' --username '+dbuser+' --password '+dbpass+' --db '+dbname+' --archive=backupFileName.gz --gzip');
  backupDB.stdout.on('data',function(data){ console.log('stdout: ' + data);
  </code></pre>
  
  <p>it throwed this error </p>
  
  <pre><code>error: uncaughtException: spawn mongodump --host 127.0.0.1 --port 27017 --username --password --db mydb --archive=backupFileName.gz --gzip ENOENT 
  </code></pre>