mongodb-js / mongodb-prebuilt

Install MongoDB prebuilt package using npm https://npmjs.org/package/mongodb-prebuilt
ISC License
56 stars 50 forks source link

how to shutdown server #38

Closed seriousManual closed 5 years ago

seriousManual commented 7 years ago

In the documentation you mention that via the mongodb helper the server can be started. Is there any way to shutdown that server instance programatically?

smelted-code commented 7 years ago

Ideally we'd have a function we could invoke that would terminate the spawned process. But in the meantime, I hope this unblocks folks:

new MongoBins("mongo", ["--eval", "db.getSiblingDB('admin').shutdownServer()"]).run();

Don't forget to pass in your port if it's not the default.

There's probably some slicker mongo-fu out there. Answer provided without warranty, etc. etc.

References:

winfinit commented 7 years ago

this is great, thank you, I will add a helper function.

StarpTech commented 7 years ago

Any updates? @winfinit should be easy to provide a function to exit the child process. Do you accept PR?

winfinit commented 7 years ago

Hello Dusting,

PRs are always welcome! I’ve meant to fix this one for a while now, but just didn’t get around it yet.

On Aug 10, 2017, at 9:58 AM, Dustin Deus notifications@github.com wrote:

Any updates? @winfinit https://github.com/winfinit should be easy to provide a function to exit the child process. Do you accept PR?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/winfinit/mongodb-prebuilt/issues/38#issuecomment-321558862, or mute the thread https://github.com/notifications/unsubscribe-auth/ABIeWZnYu5LPCB5KuEpRqkd6ZG9TwFIeks5sWwxwgaJpZM4NMP9Z.