MongoDB

MongoDb Aggregate Count Example

Today we will learn about MongoDb’s aggregate function ‘Count,’ but first let’s look at a brief overview of aggregate functions. In SQL or other relational databases, aggregation in the process that records and returns computed results like SUM MIN, MAX, AVG, and COUNT. MongoDb uses a similar concept but in a different fashion – it uses the concept of data ...

Read More »

MongoDB Node.js Tutorial

In the past examples we studied the basics of MongoDb and how to manage and maintain the Mongo DB. In this example, we will demonstrate how we can use Node.js to communicate with the MongoDB server. Table Of Contents 1. Introduction 2. Project Set-Up 3. Implementation 3.1 Insert 3.2 Update 3.3 Read 3.4 Delete 4. Conclusion 1. Introduction Node.js is ...

Read More »

MongoDB insert example

The article targets at explaining how to insert the documents into a MongoDB Collection. The examples discussed in this article were developed and executed using MongoDB 3.2.6. And all these examples can be executed from the Mongo shell. Start the MongoDB instance by running ‘mongod’ process and then connect to this MongoDB instance using ‘mongo’ shell. The following table gives ...

Read More »

MongoDB Search Example

This is an example of how to query data stored in MongoDB collections. All the examples discussed in this article were developed and executed using MongoDB 3.0.3. To check the version of MongoDB you’re using, simply type version() from the Mongo shell. The following table gives an overview of the entire article: Table Of Contents 1. Introduction 2. find() and ...

Read More »

MongoDB Show Databases Example

1. Introduction MongoDB is a popular document-oriented NoSQL database developed by MongoDB Inc. In this post, we are going to see different ways to list all the available databases. To give a foreword, a database in MongoDB is technically made up of different Collections. Before we getting into how to list databases, let’s first see how to create a database ...

Read More »

MongoDB Create / Drop Database Example

In the previous tutorial we learned the installation process and basics of MongoDB. In this example we shall learn how to create, manage and delete Databases in MongoDB. 1. Create Database Creating a database is simple in MongoDB. We just need to select the database name using the below command : use <database_name> We use the show databases command to ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns