Try MongoDB with your projects

What is MongoDB?
                                MongoDB is an open source database that uses a document-oriented data model. MongoDB is one of several database types to arise in the mid-2000s under the NoSQL banner. Instead of using tables and rows as in relational databases,MongoDB is built on an architecture of collections and documents.

NoSQL is not a relational database. The reality is that a relational database model may not be the best solution for all situations. The NoSQL taxonomy supports key-value stores, document store, BigTable, and graph databases. MongoDB, for example, uses a document model, which can be thought of as a row in a RDBMS.


First get MongoDB from below link

Double click on the set up you downloaded and install into you PC.

Start MongoDB instance locally by issuing the following command inside the bin folder inside MongoDB installation directory.
cd C:\Program Files\MongoDB\Server\3.4\bin
mongod 

Set the path - mongod --dbpath [PATH_TO_DATA_DIRECTORY]
      *you have to create a directory in C: drive and give the to the above command

Check MongoDB is working by connecting to the local instance using an IDE. Default port for MongoDB is 27017.


MongoDB Operations. 

Insert a Value
   db.students.insert({ "name": "John Smith", "
                                  dateOfBirth": ISODate("1990-01-01T00:00:00Z"),          
                                 "subjects": ["Application frameworks", "Computer architecture"] });

Find value
  db.students.find({"name":"John"})

Update value
  db.students.update({"name":"John"}, {$push:{"subjects":"Distributed computing"}})

Remove document
  db.students.remove({"name":"John"})





Comments

Popular Posts