MongoDB is NoSQL database
MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License.
An official documentation is attached.
- Install MongoDB Community Edition on Mac
1. Install MongoDB Community Edition on Mac with Home brew
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Tap the MongoDB Homebrew Tap
$ brew tap mongodb/brew
$ brew install email@example.com
$ brew services start firstname.lastname@example.org
$ brew services stop email@example.com
manually as a background process
$ mongod --config /usr/local/etc/mongod.conf --fork
- To stop a
mongodrunning as a background process, connect to the
mongodfrom the mongo shell, and issue the
shutdowncommand as needed.
To verify that MongoDB is running, search for
mongod in your running processes
$ ps aux | grep -v grep | grep mongod
Connect and Use MongoDB
To begin using MongoDB, connect a mongo shell to the running instance. From a new terminal, issue the following.