jeudi 24 novembre 2016

How to start mongod server from node js?

I have tests that need mongod server running first, but how can I achieve that?

I tried the following code:

describe('database related', function () {
    beforeEach(function () {
        childProcess.execSync('sh mongod', function (err, stdout, stderr) {
            if (err) {
                console.log(err);
                throw err;
            }
        });
    });

But it fails that claims: cannot execute binary file.

Aucun commentaire:

Enregistrer un commentaire