How to use mongoose to group by date

Introduction Dates are an important part of database work. They are often used to keep the track of records. There are a lot of ways to work with dates at the backend. MongoDB also supports date. One of the uses of dates is to group records. In mongoose, we can use the $group stage of … Continued

mongoose Query Example

Introduction There is a vast range of methods as well as operators in mongoose that could be used on MongoDB collections. Each of these methods and operators has its own specialty. In this article, we will focus on the query part of these methods and we will also discuss some of the operators. For performing … Continued

mongoose bulkWrite

Introduction Mongoose provides a vast range of methods that can be performed on a MongoDB collection. We may need to use multiple methods at a time on a collection. This can be frustrating. Writing a query and then executing it, again writing another query and then executing it. It goes on like this. So to … Continued

mongoose Regex Query

Introduction Regular expression or Regex is a very important part of programming. It is usually used to find a pattern in a string. It takes time to understand regex and because of it being a bit tough, beginners usually skip this topic. This is always a mistake because the regular expression is used frequently in … Continued

mongoose Aggregate Sum

Introduction Aggregation in MongoDB provides a vast range of very useful operators. One such operator is $sum. As the name suggests, the $sum operator is used to get the sum of numerical values. It is commonly used with $match and $group. Other available stages are $addFields (Available starting in MongoDB 3.4), $set (MongoDB 4.2), $replaceRoot … Continued

mongoose Like Operator

Introduction The LIKE operator is common is SQL. It is a very useful operator when we need to filter the data according to some text. Unfortunately, no such operator exists in MongoDB. But it does not mean we cannot achieve the functionality of the LIKE operator in MongoDB and mongoose. In this article, we will … Continued

How to use mongoose to find by id and update with an example

Introduction In this quick tutorial we will demo how to use mongoose to find by id and update with an example. The update operation is one of the CRUD operations that is used to update data in a database. Out of all the CRUD operations, the update operation should be performed very carefully. You see, … Continued

How to use NodeJs mongoose to find the object ID

Introduction Read operation is one of the CRUD operations that can be performed on a database. Mongoose provides a few methods to read the data from a database. Each method has its own specialty. We can use these methods according to our requirements. One of these methods is the findById() method. As the name suggests, … Continued

How to Perform a Node Js MongoDB Select Query

Introduction Right up-front we want to let you know that there is no select query in MongoDB. The select query is used in SQL based systems but there is an equivalent in MongoDB which we will introduce you to. How to Perform the Equivalent of a SQL Select Query with NodeJS and MongoDB Almost all … Continued

Use mongoose to find in an Array of Objects

Introduction In this tutorial we will discuss how to use mongoose to find in an array of objects. Searching in an Array of Objects In the programming world, arrays are one of the most widely used data structures. Arrays are used on both client-side and server-side. They are heavily used in NoSQL databases also. In … Continued

Keep in the know!

Subscribe to our emails and we’ll let you know what’s going on at ObjectRocket. We hate spam and make it easy to unsubscribe.