Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Learn MongoDB in 24 Hours
Learn MongoDB in 24 Hours
Learn MongoDB in 24 Hours
Ebook124 pages1 hour

Learn MongoDB in 24 Hours

Rating: 5 out of 5 stars

5/5

()

Read preview

About this ebook

MongoDB gives flexibility in compare to RDBMS. It has features like dynamic schemas, storage for large volume data, scaling database architecture, real-time data reporting, data sharding, and so on. It enables to develop application faster. To address all these features in a concise manner, this e-book is created.


This e-book has explained features of MongoDB, that is important from the point of Big data analytics. It makes clear the confusion over MySQL and NoSQL working pattern. It has accommodated all the topics on MongoDB with examples. It guides you right through setting up MongoDB environment to security requirements. The book is too small, but all important aspect of MongoDB is covered. The examples and code are explained in a manner that beginners can easily absorb the content. The book has also illustrated various shell commands to access MongoDB. Not only that, but the user will also explore about JSON document and creating queries in MongoDB.


The book can be used for further reference for application build on MongoDB Java or MongoDB Python. Minimum price range and maximum deliverable is the main plus point of this e-book.


Table content


Chapter 1: Introduction


Chapter 2: Download and Install MongoDB on Windows


Download & Install MongoDB on Windows


Install Driver- Javascript, Python and Ruby


Install Robomongo- MongoDB Management Tool


MongoDB Configuration, Import and Export


Configuring MongoDB server with configuration file


Chapter 3: Create Database & Insert Data


Creating a database


Creating a collection


Chapter 4: Add MongoDB Array using insert()


Chapter 5: ObjectId()


Chapter 6: Query Document using find()


Chapter 7: Cursor


Chapter 8: Query Modifications using limit(), sort()


Chapter 9: Count() & remove() function


Chapter 10: Update() Document


Chapter 11: Indexing, Monitoring & Backup


Chapter 12: How to Create User in Mongodb & assign Roles


Chapter 13: Authentication with Kerberos


Chapter 14: Replica Set


Replica Set: Adding the First Member using rs.initiate()


Replica Set: Adding a Secondary using rs.add()


Replica Set: Reconfiguring or Removing using rs.remove()


Troubleshooting Replica Sets


Chapter 15: Sharded Cluster


Chapter 16: Indexing - createIndex()


Understanding Impact of Indexes


Create Indexes


Finding Indexes


Dropping Indexes


Chapter 17: Regular Expression (Regex)


Using $regex operator for Pattern matching


Pattern Matching with $options


Pattern matching without the regex operator


Fetching last 'n' documents from a collection

LanguageEnglish
PublisherPublishdrive
Release dateOct 31, 2021
Learn MongoDB in 24 Hours

Read more from Alex Nordeen

Related to Learn MongoDB in 24 Hours

Related ebooks

Enterprise Applications For You

View More

Related articles

Reviews for Learn MongoDB in 24 Hours

Rating: 5 out of 5 stars
5/5

2 ratings1 review

What did you think?

Tap to rate

Review must be at least 10 words

  • Rating: 5 out of 5 stars
    5/5
    Un excelente resumen de las funciones más utilizadas en MongoDB

Book preview

Learn MongoDB in 24 Hours - Alex Nordeen

Chapter 1: Introduction

Mongodb is a document-oriented NoSQL database used for high volume data storage. In this tutorial you will learn how Mongodb can be accessed and some of its important features like indexing, regular expression, sharding data, etc.

MongoDB is a database which came into light around the mid-2000s. It falls under the category of a NoSQL database.

What is MongoDB

MongoDB is a document database. Each database contains collections which in turn contains documents. Each document can be different with varying number of fields. The size and content of each document can be different from each other.

The document structure is more in line with how developers construct their classes and objects in their respective programming languages. Developers will often say that their classes are not rows and columns but have a clear structure with key-value pairs.

As seen in the introduction with NoSQL databases, the rows (or documents as called in MongoDB) doesn't need to have a schema defined beforehand. Instead, the fields can be created on the fly.

The data model available within MongoDB allows you to represent hierarchical relationships, to store arrays, and other more complex structures more easily.

Scalability – The MongoDB environments are very scalable. Companies across the world have defined clusters with some of them running 100+ nodes with around millions of documents within the database

The below example shows how a document can be modeled in MongoDB.

The _id field is added by MongoDB to uniquely identify the document in the collection.

What you can note is that the Order Data ( OrderID , Product and Quantity ) which in RDBMS will normally be stored in a separate table, while in MongoDB it is actually stored as an embedded document in the collection itself. This is one of the key differences of how data is modelled in MongoDB.

{

        _id : <0bjectld>

 

        CustomerName : Guru99 ,

        Order:

        {

                OrderlD: 111

                Product: ProductA

                Quantity: 5

        }

 

What Is Meant By NoSQL

NoSQL is not a relational database. It provides more flexibility since all records are not restricted by the same column names and types defined across the entire table. The below example will give a better idea of what is NoSQL.

Following 2 tables are simple example of a Customer table and an Order table wherein the Customer's table is linked to the Order's table via a relationship.

Customer Table

Order Table

In NoSQL, the tables can probably look like the ones as shown below

Customer Table

Order Table

The first thing you will notice straightaway is that you don't have columns with special column names defined, but instead each field has a key-value pair.

You will notice that in the customer's table that the first 3 keys are the same for all 3 rows, but the fourth key (City and Status) is different for the first 2 rows and not applicable for the third row.

Likewise, in the Orders tables,

Enjoying the preview?
Page 1 of 1