Getting Started
What is MongoDB?
Install / Config
C.R.U.D. Ops
Data Modeling
Database Mgmt
Installation and Configuration
Installing MongoDB on a Mac
Download from
mongodb.org/downloads
.
Extract to a folder
.
Open the terminal app
tar xvfz Downloads/mongodb-osx-x86_62-nn-nn-nn.nn.nn.tgz
Rename the folder
mv
.
mv mongodb-osx-x86_62-nn-nn-nn.nn.nn mongodb
Create a data folder
.
mkdir data
mkdir data/db
Put the binaries in the path
.
echo "export PATH=$PATH:/path/to/mongodb">.bash_profile
Exit the terminal app
Reopen the terminal app
Create a /path/to/mongodb/mongod.conf file
.
Copy the sample from github.com/mongodb/mongo/blob/master/rpm/mongod.conf
Open TextEdit
Format - Make Plain Text
Change "logpath=" and "dbpath="
Save to /path/to/mongodb/mongod.conf
Start mongod
.
mongod -f /path/to/mongodb/mongod.conf
Test
.
mongo
use mydb
db.test.save({a:1})
db.test.find()
+
o
-