How to install and run MongoDB

In our Vapor application, we will use MongoDB to store our Shopping List and items data. To get started with MongoDB, we first need to install it on our system, which is easy to do by taking the following steps:

  1. Install mongodb using the homebrew package installed on macOS, or, if you are on Debian based Linux, install it using the apt-get package:
$ brew install mongodbUpdating Homebrew...==> Downloading https://homebrew.bintray.com/bottles/mongodb-3.4.10.sierra.bottl######################################################################## 100.0%==> Pouring mongodb-3.4.10.sierra.bottle.tar.gz==> CaveatsTo have launchd start mongodb now and restart at login:  brew services start mongodbOr, if you don't want/need ...

Get Hands-On Full-Stack Development with Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.