My First Step Into MongoDB – Installing MongoDB on Ubuntu

 

MongoDB

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)

  1. Download MongoDB, I downloaded the latest production version which is 1.4.3
  2. Extract the file.
    $ tar -xvf mongodb-linux-i686-1.4.3.tgz
  3. 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
  4. Run the MongoDB service.
    $ cd mongodb-linux-i686-1.4.3/bin
    $ ./mongod
  5. 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:

  1. Beginner Step Into MongoDB
  2. CakePHP Tutorial:Installing CakePHP on Ubuntu

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值