NoSQL is designed for distributed data stores where very large scale of data storing is needed. It is different from traditional
relational database management systems and are developed to manage data
that do not necessarily follow a fixed schema.
This avoids joins and are easy to scale.
Categories of NoSQL database
Setup MongoDB
Let's see how to get started with MongoDB. Get the installation instructions from here.
To get MongoDB in Python we need install module PyMongo by typing
This avoids joins and are easy to scale.
Categories of NoSQL database
- Key-value store (eg. Voldermort, Tokyo Cabinet, Riak)
- Graph (eg. FlockDB, AllegroGraph)
- Big tables/column families (eg. Cassandra, Hypertable )
- Document store (eg. CouchDB, MongoDB)
Setup MongoDB
Let's see how to get started with MongoDB. Get the installation instructions from here.
After the MongoDB installation, your database ready and starts
running on your system. You can check if your system is running MongoDB,
by typing
mongo
in the Terminal. If it is, there will be shell version number and some other details of MongoDB, printed on the terminal.
Let's make Mongo as back-end in our project. Here i created a paint-application using flask and
MongoDB .The same application in Django link.
To get MongoDB in Python we need install module PyMongo by typing
$ pip install pymongo
To connect to the database, we create a database instance- a connection object by including the following in our python logic.
from pymongo import Connection
conn_obj = Connection()
db = conn_obj.our_db_name
Now we are ready to use our MongoDB database through the python code.
db.collection_name.find()
It's also possible to get the specific item in the collection.
db.collection_name.find_one({"color": "Orange", })
Reading all the documents of the specified kind, is by,
db.collection_name.find({"color": "Orange", })
More option can be found here.
No comments:
Post a Comment