1. download the mongodb-linux-i686-1.8.2.tgz in the/home/nh/Downloads/directory and unzip it to get the mongodb-linux-i686-1.8.22. create a directory named data1 under/home/nh/Downloads/mongodb-linux-i686-1.8.2 and under/home/nh/Downloads/mongodb-linux-i686-1.8.2/log1
1. Download The mongodb-linux-i686-1.8.2.tgz in the directory/home/nh/Downloads/and unzip it to get the mongodb-linux-i686-1.8.2
2. Create the directory data1 under/home/nh/Downloads/mongodb-linux-i686-1.8.2 and create the file log1.log under the/home/nh/Downloads/mongodb-linux-i686-1.8.2/log1 directory
3.www.linuxidc.com @ linuxidc :~ /Downloads/mongodb-linux-i686-1.8.2/bin $./mongod-dbpath/home/nh/Downloads/mongodb-linux-i686-1.8.2/data1-logpath/home/nh/Downloads/mongodb-linux-i686-1.8.2/log1/log1.log
4.www.linuxidc.com @ linuxidc :~ /Downloads/mongodb-linux-i686-1.8.2/bin $./mongo 55 Ubuntu: 27017 (execute this command in another command line window, 55ubuntu is your host name)
5.> db. test. save ({a: 1}) (executed in shell)
6.> db. test. findOne () (view the saved document {a: 1}. The result is displayed, indicating that it is available)
{"_ Id": ObjectId ("4e8ff5cd7a348a89a3b2dc3f"), "a": 1}