Mac command line installation mongodb

  mongodb, question

clipboard.png

  1. Which version is better to download?
  2. I want to install on the command line.
  3. Look at the Internet is said to install /usr/local/ directory
  4. Is it possible to install it in a common directory like /home/user/ etc?
  5. Look at the online saying, why do you have to create the root directory to create the data/db directory?
  6. How to configure the database and start the database

We might as well brew install mongodb, simple and convenient, ha, ha, ha.

Or install a docker, docker pull mongodb, delete and change a mirror image if you are not happy, and it is easy to worry about.

Then expose the corresponding port (default 27017 bar) and use the driver of the corresponding language.

If you use it directly, you can use the command line mongod, run mongo on another interface, and use db. getcollection (‘XXX’). find ({}) and so on. you can find it on the internet yourself.