Skip to main content

MongoDB Overview



         MongoDB is an open-source document database, and leading NoSQL database. MongoDB is written in c++.


               MongoDB is a cross-platform, document oriented database that provides, high performance, high availability,   and easy scalability.

                MongoDB works on concept of collection and document.

Database

Database is a physical container for collections. Each database gets its own set of files on the file system. A single
MongoDB server typically has multiple databases.

Collection

Collection is a group of MongoDB documents. It is the equivalent of an RDBMS table. A collection exists within a
single database. Collections do not enforce a schema. Documents within a collection can have different fields.
Typically, all documents in a collection are of similar or related purpose.

Document

A document is a set of key-value pairs. Documents have dynamic schema. Dynamic schema means that documents
in the same collection do not need to have the same set of fields or structure, and common fields in a collection's
documents may hold different types of data.

 Relationship of RDBMS terminology with MongoDB

RDBMS    MongoDB
Database        Database
Table              Collection
Tuple/Row     Document
column           Field
Table Join       Embedded Documents
Primary Key   Primary Key (Default key _id provided by mongodb   itself)
Database Server and Client
Mysqld/Oracle       mongod
mysql/sqlplus          mongo

Comments

Popular posts from this blog

Java OOP Concepts

Java OOP Concepts Java OOP Concepts:       Java is not fully Object Oriented Programing Languages Because java Provide Primitive Data types Like int,string etc.             Java Provide Following OOPS: Object Class  Inheritance  Polymorphism Abstraction  Encapsulation 1.Object    -Object is nothing but just Blueprint Of Class Means it contain Properties And Behaviour Of Class.     example: real time Example is People, pen. 2.Class   -Class Contain Methods and Properties. so we can say that Collection of Object is nothing But Class. 3.Inheritance   -Inheritance is Process  or Scenario  for accessing Parent class Properties .Means access Properties and Method of Parent class into Sub Class. 4.Polymorphism    -In simple Word Polymorphism is way to Perform one Task in Multiple Dif...

Factory Pattern

Factory Pattern        Factory Pattern is way to create object in such Way using Common Interface  without exposing the creation logic Simple Example       Example: step  1.  creation of interface.     public interface BANK {        double getIntrest();   } step  2.  implementation of interface for BOB. public class BOB implements BANK {     @Override     public double getIntrest() {         return 8.7;     } } step 3.  implementation of interface for SBI . public class SBI implements BANK{     @Override     public double getIntrest() {         return 5.7;     }      } step 4.  implementation of interface for UNION  . public class UNION  implements BANK{     ...

HashMap in Java

    -What is HashMap:       A HashMap has value and  key. store value based on Key. HasMap implements the Map interface and extends AbstractMap class.       Allow only one null as key and can contain   multiple null value.       Also Conatin Order of element.         HasMap----extend---->AbstractMap----implement---->Map                 Now we see how to Put and Retrive value from HashMap.                Example.             import java.util.*;               class MapTest{                        public static void main(String args[]){     HashMap<Integer,String> map=new HashMap<Integer,String>();     map.put(1,"vjp");   map.put(...