DevOps

Mastering MongoDB Read/Write Redirection Using URI Manipulation

If you’ve been working with MongoDB for a while, you already know it’s famous for being scalable, highly available, and flexible. That last part—the flexible document model—is what draws a lot of developers in. But here’s the thing: when you’re dealing with a replica set, the real magic (and sometimes headaches) happens with how reads […]

Java/JVMNode.jsSoftware development

MONGOOSE Tips and Tricks for Uncommon Cases

Mongoose is an object modelling package for Node that essentially works like an ORM for many popular languages much like Hibernate is for JAVA. Below are some of the mongoose special scenario(s) I stepped upon while working on the project. It took me some time to figure it out. Hopefully below details would prove helpful […]

Node.js

High performance find query using lean() in mongoose

Using lean() in mongoose provides high performance queries.

Sakshi Tyagi
Sakshi Tyagi
Read

Node.js

_id With Mongoose

Let us take a very common use-case: “There will be a registration page for users, where users will provide their required details along with their picture”. Details would be saved to MongoDB while the pictures would be uploaded to Cloudinary or S3 with user unique id.” Suppose we have User Schema as given below: [js] […]

Amit Kumar
Amit Kumar
Read

Node.js

Getting started with Mongoose !!

Mongoose is a Node.js package that gives you an interface to play with mongo database. Mongoose has all sets of methods that help you to connect and access data stored in database. It translates data from database in javaScript object which you can provide to your application. We will move step by step to know how […]

Node.js

Validation with Mongoose

In one of our Node.js projects, we used Mongoose module to interact with MongoDB. Mongoose provides us four types of built-in validation on schema as below: 1. Required: We can mark a field as required, which must be provided. 2. Limit: If field is type of Number in Schema, then we can restrict maximum and […]

Amit Kumar
Amit Kumar
Read
Services