- 1. Provision and installation of resources (Ayjs.net)
- Learning instructions: Nodejs is still operating in a non-Windows environment, so everything is
- Current time: December 06, 2014 Aaronyang
- Website address: www.mongodb.org
- Document reference Address: http://docs.mongodb.org/manual
- Current mongodb-osx-x86_64-2.6.5.gz: Baidu Cloud Download extract password: Azoa
- Code installation: (seemingly more than 100 trillion, and the official website is relatively slow)
- Mode 1:
- Open the terminal, we first install homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Then press any key, enter the administrator password, and then enter to start downloading and installing the
- Update Homebrew:brew Update
- Brew mode installation Mongo:brew Install MongoDB
- or the latest version (including tested) brew install Mongodb-devel
- or compile the brew install MongoDB--with-openssl through the source code
- Mode 2:
Curl-o http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.4.tgz
- Decompression extraction
TAR-ZXVF mongodb-osx-x86_64-2.6.5.tgz
- 2. Install (I am using the download from the official website)
- I created a new soft folder on the desktop, put the extracted files into the soft folder, into the soft inside.
- 2.1 Copy the extracted files to the directory you want to run
- reference:
mkdir-p mongodbcp-r-n mongodb-osx-x86_64-2.6.5/mongodb
my: /p>
-
mkdir-p mongodbcp-r-n/users/aaronyang/desktop/soft/mongodb-osx-x86_64-2.6.5/mongodb
Tip: Novice Mac users, may not know how to get the file path in the terminal, you just put the folder into the terminal inside a drag and drop to get the path.
- 2.2 Ensure that the PATH variable has a location for the binaries
-
export path=mongodb/bin: $PATH;
- 3. Running MongoDB
- 3.1 Specify the data directory
- by default, the directory where the Mongod process runs is/data/db
- Create directory: Mkdir-p/data/db
- If you specify a different directory, for example, I create a new data in the MongoDB folder
- then open terminal Mongod-dbpath/users/aaronyang/mongodb/data
- file directory, I directly drag the data folder to the terminal interface automatically generated
- 3.2 To ensure that the current user, the Mongod process can read and write to the Data folder
- 3.3 Run Mongod with no path parameter, default data read and write in/data/db
- 3.4 Stop Mongod, terminal class Press CTRL + C key
- 4. Start your journey
- official documentation, start learning, or use other techniques, such as Java,.net,nodejs, to perform operations equivalent to MONGO terminal
5. This article right only left www.ayjs.net, not allowed reprint!!!!
[Aaronyang] Nodejs learning-mongodb[1]