How to use the mongoose $lte operator

Introduction In this article we’ll be discussing the mongoose $lte operator, what it does, and how to use it with a simple demonstration. Mongoose provides several methods that can be used while performing CRUD operations. In most cases, we have to provide a query to get the desired results. A query is specified inside curly … Continued

How to Use Advanced Queries in MongoDB

Introduction When you’re working with data that’s stored in MongoDB, there are times when the task at hand is more complex and you need to perform advanced queries. Fortunately, MongoDB offers a variety of methods and operators to get the job done. In this article, we’ll show you several examples of how to use advanced … Continued

How to use the mongoose findOneAndReplace function

Introduction Mongoose provides a few methods for replacing documents in a collection. One of these methods is findOneAndReplace(). This method finds a document according to the query and then replaces it with another document. It is quite similar to the replaceOne() method. But there is a difference in options. In both of these methods, we … Continued

How to use the mongoose $gte operator

Introduction A query is an important part of CRUD operations. In most cases, we have to provide a query to get the desired results. A query is specified inside curly brackets. The complexity of a query depends upon the requirements. It can be simple and it can be complicated as well. For example, if we … Continued

How to use the ODM mongoose with your db

Introduction MongoDB is one of the most popular NoSQL databases. It stores data in BSON format (an extension of JSON). It is faster than SQL databases and handles unstructured data very efficiently. MongoDB is often used with NodeJS. Node.js is a javascript runtime environment that executes javascript outside the browser. Both MongoDB and Node.js are … Continued

Easy to follow mongoose example with NodeJS

Introduction In this article, we will discuss an easy to following mongoose example with NodeJS. We will create four API endpoints in NodeJS and mongoose, each of them performing certain CRUD operations on a MongoDB database. Setup connection So let’s start by setting up a server and a connection with the MongoDB database. 123456789101112131415161718var mongoose … Continued

mongoose replaceOne

Introduction The CRUD update operation is one that should be handled with the utmost care. The update operation modifies the data in a database. Even a small mistake can create many problems. So, the update operations should be performed carefully. Data in MongoDB can be updated using various methods. There are several methods that are … Continued

Geospatial in MongoDB

Introduction GeoJSON is an open-source format containing simple geographical features and is based on JavaScript Object Notation. It is used to format shapes in a coordinate space and multiple types are supported by MongoDB to permit storing of geospatial data. This tutorial will cover the various ways of using geospatial in MongoDB and explain the … Continued

Filter MongoDB Array Elements

Introduction Unlike some databases, MongoDB documents sometimes contain fields that have values as arrays. Sometimes a document that contains specific information inside these arrays needs to be checked. This tutorial will explain how to filter MongoDB array elements to extract and project only the necessary data, and not the entire array. Prerequisites MongoDB must be … Continued

Redis Example with Python

Introduction Redis, standing for REmote DIctionary Server, is a type of key-value NoSQL server. Redis is designed to support disk storage for persistence, retaining data after power is shut off, and stores data so it can be cached and accessed quickly. Redis supports multiple data types, including strings, hashes, lists and sets. This tutorial 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.