Sunday, July 30, 2017

The NoSQL database movement came about to address the shortcomings of
relational databases and the demands of modern software development. new data is unstructured and semi-structured, so
developers also need a database that is capable of efficiently storing
it. Unfortunately, the rigidly defined, schema-based approach used by
relational databases makes it impossible to quickly incorporate new
types of data, and is a poor fit for unstructured and semi-structured
data. NoSQL provides a data model that maps better to these needs.

MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling across a configurable set of systems that function as storage nodes.

MongoDB stores all data in documents, which are JSON-style data
structures composed of field-and-value pairs. MongoDB stores documents
on disk in the BSON serialization format. BSON
is a binary representation of JSON documents, though it contains more
data types than JSON. These documents can be simple documents as above
and can also be complex documents such as below:

{

id: x,

name: y,

other: z,

multipleArray: [

{lab1: "A", lab2: "B", lab3:"C"},

{lab1: "AB", lab2: "BB", lab3:"CB"},

{lab1: "AC", lab2: "BC", lab3:"CC"}

]

}

Document Database

A record in MongoDB is a document, which is a data structure composed
of field and value pairs. MongoDB documents are similar to JSON
objects. The values of fields may include other documents, arrays,
and arrays of documents.

Most user-accessible data structures in MongoDB are documents, including:
-> All database records.
-> Query selectors, which define what records to select for read, update, and delete operations.
-> Update definitions, which define what fields to modify during an update.
-> Index specifications, which define what fields to index.
-> Data output by MongoDB for reporting and configuration, such as
the output of the server-status and the replica set configuration
document.

MongoDB didn’t provide any command to create “database“.
Actually, you don’t need to create it manually, because, MangoDB will
create it on the fly, during the first time you save the value into the
defined collection (or table in SQL), and database.

> show dbsfinance 0.000GBhospital 0.000GBlocal 0.000GBmydb 0.000GB----------------------------------------------------------------------To query the document on the basis of some condition, you can use following operations.