http://komunitasweb.com/2010/06/my-first-step-into-mongodb-installing-mongodb-on-ubuntu/
Lately MongoDB become more and more popular in NoSQL movement. For you who haven’t heard about it, MongoDB is a scalable, high-performance, open source, document-oriented database. I always keep my eyes on MongoDB, but never have a chance to really taste the goods. So, right now I want to jump and tame the beast.
First thing first, installing MongoDB on my machine (Ubuntu)
- Download MongoDB, I downloaded the latest production version which is 1.4.3
- Extract the file.
$ tar -xvf mongodb-linux-i686-1.4.3.tgz
- Create data directory for MongoDB, by default it will store data in /data/db
$ sudo mkdir -p /data/db/ $ sudo chown `id -u` /data/db
- Run the MongoDB service.
$ cd mongodb-linux-i686-1.4.3/bin $ ./mongod
- Open another terminal and make sure you are in MongoDB bin directory and start the shell.
$ ./mongo
That’s it. Now I can play around with MongoDB.
> db.komunitasweb.save({greeting:'hello world'}) > db.komunitasweb.save({greeting:'good morning'}) > db.komunitasweb.find() { "_id" : ObjectId("4c1fd172101b5f3e6fa79d63"), "greeting" : "hello world" } { "_id" : ObjectId("4c1fd1c9101b5f3e6fa79d64"), "greeting" : "good morning" } > db.komunitasweb.find({greeting:"good morning"}) { "_id" : ObjectId("4c1fd1c9101b5f3e6fa79d64"), "greeting" : "good morning" }
Next time, I’ll show you more about MongoDB as I learn to tame this beast. See you.
Related posts: