Blogroll

Showing posts with label mongodb. Show all posts
Showing posts with label mongodb. Show all posts
Wednesday, September 12, 2012

Simple blog using mongoDb

This is simple blog allow display post , add new post and add comment for post using MongoDb for storage.
Note: Download mongDb for php at this link http://www.mongodb.org/display/DOCS/PHP+Language+Center

And install mongDb before demotrastion.

I pushed source to gitHub att this link https://github.com/bvtuan/blog_mongodb
Hope it useful for who learning mongoDb.

Thursday, August 9, 2012

Install mongodb for windows

Follow some below step:
1. Download lasted version at http://www.mongodb.org/downloads and choose right version for your computer.
2. Extract zip file to somewhere, For me is c:\bin\mongodb.
3.Create folder that save mongodb data, For me is c:\data 
4.Open cmd and type cd c:\bin\mongodb\bin
5.Continue and cmd and type mongod --dbpath c:\data to run mongodb as services (c:\data is folder that created before).
In this step, mongdb is running, Remember don't close cmd because it's running.
To do testing with mongDb, do below step:
6. If have no error appear, It mean you installed mongodb  as services successful. Next test it working.
7.Open cmd and type  cd c:\bin\mongodb\bin and type another text is mongo and enter. Mongo shell will be apper.
8. Type code to insert to db db.test.save({a:'abc'}) , It mean add a with value is 'abc' to test collection
9.To show record in test collection , type code db.test.find()

Nodejs with mongodb

Today, I excited to research nodeJs and i find way  how to access db to Mongodb from nodeJS.
At first, install module mongodb for node in this link