MongoDB
The MongoDB NoSQL database system is described in Chapter 10, NoSQL Databases.
Download the MongoDB installation file from https://www.mongodb.com/download-center#community (or just search MongoDB download
to find that web page). Then, follow these steps (for macOS X):
- Open a Terminal window.
- Execute these shell commands (the
$
indicates the prompt):$ cd ~/Downloads $ ls mongo* $ tar xzf mongodb-osx-ssl-x86_64-3.4.7.tar $ sudo mkdir –p /usr/local/mongodb $ sudo mv mongodb-osx-x86_64-3.4.7 /usr/local/mongodb
These will decompress the file that you downloaded, create the folder
/usr/local/mongodb
, and then move the specified decompressed file to that folder. You may be asked for your computer password. Thels
command will list the files that match the patternmongo*.tar
. Use that to get the right filename. (The one shown here was correct in August, 2017.) - Execute these commands next:
$ sudo mkdir -p /data/db $ sudo chown johnrhubbard /data/db
Use your own username with the
chown...