mongoose Query LIKE

Introduction In SQL, we have the LIKE operator that is used to match a pattern in a string. It is very useful while performing CRUD operations on a database. 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 … Continued

mongoose Pagination with NodeJS and MongoDB

Pagination Pagination is a process in which a document is divided into discrete pages. In simple words, if we have a document containing a large amount of data, and we wish not to print all of it in once, we divide this data into “pages”. These pages contain data according to the limit specified. In … Continued

How to use the mongoose update query in NodeJS

Introduction Out of all the CRUD operations, the Update operation should be handled with utmost care. There could be hundreds of records in a database. One mistake and you end up updating a wrong record. This can lead to further problems. So the most important part of an Update operation is where we match the … Continued

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

Node Js MongoDB Join Query

Introduction MongoDB is a NoSQL database and there are no joins in NoSQL. But MongoDB provides few ways to use joins. There are several joins in SQL but the most frequently used is the inner join. In this article, we will discuss how to perform an inner join operation in MongoDB. But first, we will … 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.