Brief About The Mongo DB Database

Posted By : Palak Sharma | 28-Jun-2018

The database is a collection of information which can be updated, managed and accessible. Data is organized into rows, columns, and tables. Mongo Database is also an open source document that provides the optimal performance and scaling. A record in MongoDB is a document, which consists of values and pairs. The values of fields may include other documents, arrays, and arrays of arrays.

 

The features of MongoDB are:- 

1) Mongo DB is a document database in which collections of documents can be held.

2) Mongo DB is easy to scale.

3) Mongo DB uses internal memory to store the data, thus results in faster accessibility.

Mongo DB is a NoSQL Database. What is NoSQL Database? NoSQL Databases are not dependent on schema, row, tables to represent data. Monog DB uses the document to represent data in a formatted manner.

 

MongoDB Curd Operations:- 

1) Create Operation:- Create or insert operation adds a new document to the collection. In DB document can be added in two ways:-

a) db.collection.insertOne()

b) db.collection.insertMany()

db.inventory.insertOne(
   { item: "canvas", qty: 100, tags: ["cotton"], size: { h: 28, w: 35.5, uom: "cm" } }
)

2) Read Operation:- Read operation used to retrieve the document from a collection. 

3) Update Operation :- Update operation updates the existing document in a collection. Following methods are there to update the document:-

a) db.collection.updateOne()

b) db.collection.updateMany()

c) db.collection.replaceOne()

{
  <update operator>: { <field1>: <value1>, ... },
  <update operator>: { <field2>: <value2>, ... },
  ...
}

4) Delete Operation :- Delete operation is used to delete the document from a collection.

Mongo DB provides the option of BULK WRITE, "db.collection.bulkWrite()" method provides the ability to bulk insert, update.

 

Sharding and Aggregation:-  Sharding is the method for distributing data across multiple machines. The database in which a lot of data is present and it can challenge the server capacity, sharding is used. For example, high query rates can exhaust the CPU's capacity. Aggregation perform operation son grouped data from the documents and gives us the computed result

 

 

 

So to conclude , above are the highlights on what is mongoDB and what features it consists of .

About Author

Author Image
Palak Sharma

Palak is enthusiastic and passionate about coding , Her areas of expertise in coding languages are JavaScript and angular , html and css .

Request for Proposal

Name is required

Comment is required

Sending message..