0

I just started learning mongo and having trouble with its configiration, it all seems a bit confusing.

Since started learning Node I am running WSL with Ubuntu 18.04 Bionic through Hyper with ZSH. I have tried to install mongodb thorugh NPM with no luck. As mongo is not supported in WSL I followed instalation steps from this tread and it worked.

However I am not sure if its working correctly as I can access mongod service from any directory without need to install any dependency with NPM, is it correct behaviour? Shouldn't this be a separate instance of the database?

I tried in the my prod directory:

sudo mongod --dbpath=/data

and..

sudo mongod --dbpath ~/mnt/c/rob/dev/code/mongodb-data

.. but its failing and aborting whole process with code:100.

I apologise if that is a silly question, but I am just getting more and more confused.

Robert Jamborski
  • 183
  • 2
  • 13
  • Does this answer your question? [MongoDb shuts down with Code 100](https://stackoverflow.com/questions/41420466/mongodb-shuts-down-with-code-100) – Joe May 04 '20 at 23:09

1 Answers1

0

mongod is the server process. It basically implements the actual database.

If you want to run a local database server, you'd run mongod.

mongo is a client process. It connects to the database and allows you to issue queries, etc.

If you want to connect to a server using the MongoDB shell, you'd use mongo. The server could be on your computer or elsewhere (e.g. Atlas). It is possible to use mongo without mongod.

mongo has nothing to do with npm. It is a standalone program.

D. SM
  • 13,584
  • 3
  • 12
  • 21