0% found this document useful (0 votes)
12 views21 pages

NoSQL

The document provides an overview of NoSQL databases, highlighting their ability to handle unstructured data and their increasing popularity due to the evolving data landscape. It introduces MongoDB as a document database that uses BSON format and outlines its CRUD operations, including methods for creating, reading, updating, and deleting documents. Additionally, it discusses various MongoDB features such as aggregation, indexing, and bulk write operations.

Uploaded by

imsubash2707
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views21 pages

NoSQL

The document provides an overview of NoSQL databases, highlighting their ability to handle unstructured data and their increasing popularity due to the evolving data landscape. It introduces MongoDB as a document database that uses BSON format and outlines its CRUD operations, including methods for creating, reading, updating, and deleting documents. Additionally, it discusses various MongoDB features such as aggregation, indexing, and bulk write operations.

Uploaded by

imsubash2707
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

NoSQL

© 2025 NTT DATA, Inc.


Agenda

1.Introduction to NoSQL
2.Types of NoSQL Databases
3.Introduction to MongoDB
4.MongoDB Create ,Read, Query operators, Update, Delete, Aggregate and Indexes

© 2025 NTT DATA, Inc. 2


What are NoSQL databases?

• NoSQL databases are interchangeably referred to as “nonrelational,” “NoSQL DBs,” or “non-SQL”


to highlight the fact that they can handle huge volumes of rapidly changing, unstructured data in
different ways than a relational (SQL) database with rows and tables.

• NoSQL technologies have been around since the 1960s, under various names, but are enjoying a
surge in popularity as the data landscape shifts and developers need to adapt to handle the sheer
volume and vast array of data generated from the cloud, mobile, social media, and big data.

• From viral celebrity tweets to life-saving information in electronic medical records, new data and
data types are being generated at a dizzying pace. NoSQL databases have evolved to help
developers quickly create database systems to store the new information and make it readily
available for search, consolidation, and analysis.

© 2025 NTT DATA, Inc. 3


Types of data models with NoSQL databases

• Most nonrelational, high-performance databases, sometimes called “not only SQL,” can also
handle highly structured data—they just aren’t limited to fixed data models like relational (SQL)
databases.
• The four most common types of NoSQL databases are:

© 2025 NTT DATA, Inc. 4


© 2025 NTT DATA, Inc. 5
MongoDB

• MongoDB is a document database. It stores data in a type of JSON format called BSON.
• A record in MongoDB is a document, which is a data structure composed of key value pairs like the
structure of JSON objects.

© 2025 NTT DATA, Inc. 6


Introduction to MongoDB

• MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
• MongoDB Enterprise: The subscription-based, self-managed version of MongoDB
• MongoDB Community: The source-available, free-to-use, and self-managed version of
MongoDB

© 2025 NTT DATA, Inc. 7


Document Database

• A record in MongoDB is a document, which is a data structure composed of field and


value pairs. MongoDB documents are like JSON objects. The values of fields may
include other documents, arrays, and arrays of documents.

© 2025 NTT DATA, Inc. 8


SQL Terms and MongoDB Terms

SQL Terms/Concepts MongoDB Terms/Concepts


database database
table collection
row document or BSON document
column field
index index
table joins $lookup, embedded documents
primary key primary key

Specify any unique column or column In MongoDB, the primary key is automatically
combination as primary key. set to the _id field.
aggregation (e.g. group by) aggregation pipeline

See the SQL to Aggregation Mapping Chart.


SELECT INTO NEW_TABLE $out

MERGE INTO TABLE $merge

UNION ALL $unionWith


transactions transactions

© 2025 NTT DATA, Inc. 9


MongoDB CRUD Operations
CRUD operations create, read, update, and delete documents.
Create Operations
Create or insert operations add new documents to a collection. If the collection does not currently
exist, insert operations will create the collection.

MongoDB provides the following methods to insert documents into a collection:

db.collection.insertOne()

db.collection.insertMany()

In MongoDB, insert operations target a single collection. All write operations in MongoDB are atomic
on the level of a single document.

© 2025 NTT DATA, Inc. 10


Create

db.collection.insertMany()

Inserts multiple documents into a collection.

© 2025 NTT DATA, Inc. 11


Read Operations
Read operations retrieve documents from a collection; i.e. query a collection for documents.
MongoDB provides the following methods to read documents from a collection:

db.collection.find()

db.collection.findOne(query, projection, options)


Returns one document that satisfies the specified query criteria on the collection or view.

The returned document may vary depending on the number of documents that match the query criteria, and
the query plan used:

© 2025 NTT DATA, Inc. 12


Query operators

$or
$and
$in
$eq
$ne
$nin
$It
$gt
$regex

© 2025 NTT DATA, Inc. 13


Query operators

• Sort
A document that defines the sort order of the result set.

The sort parameter contains field and value pairs, in the following form:

{ field: value }

• Limit
• Skip

© 2025 NTT DATA, Inc. 14


Update Operations
• Update operations modify existing documents in a
collection. MongoDB provides the following methods to
update documents of a collection:
Update Operators
• (<query>,<update>,<options>)
$set
• db.collection.updateOne() $unset
$inc
• db.collection.updateMany() $rename
• db.collection.replaceOne() $currentDate
$addToSet

© 2025 NTT DATA, Inc. 15


Update

© 2025 NTT DATA, Inc. 16


Delete Operations

• Delete operations remove documents from a collection. MongoDB provides the following methods
to delete documents of a collection:

• db.collection.deleteOne()

• db.collection.deleteMany()

© 2025 NTT DATA, Inc. 17


Bulk Write Operations

• Overview
• MongoDB provides clients the ability to perform write operations in bulk. Bulk write operations affect
a single collection. MongoDB allows applications to determine the acceptable level of
acknowledgment required for bulk write operations.

• The db.collection.bulkWrite() method provides the ability to perform bulk insert, update, and delete
operations.

• MongoDB also supports bulk insert through the db.collection.insertMany() method.

© 2025 NTT DATA, Inc. 18


Aggregate

• Parameter
• db.collection.aggregate(pipeline, options)
• Calculates aggregate values for the data in a collection or a view.

© 2025 NTT DATA, Inc. 19


Indexes

• Returns an array that holds a list of documents that identify and describe the existing indexes on
the collection, including hidden indexes and indexes that are currently being built.

• You must call db.collection.getIndexes() on a collection. For example:

• db.collection.getIndexes()

© 2025 NTT DATA, Inc. 20

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy