How to install mongoose with npm

Introduction Mongoose is an Object Data Modeling (ODM) library that is used for schema validations and managing relationships among data. Mongoose is frequently used with NodeJS and MongoDB. Understanding mongoose is very important and it is also very simple at the same time. But before we can use mongoose in our NodeJS files, we need … Continued

Understanding the mongoose __v field

Introduction Data in MongoDB is stored in JSON format. More precisely said, data is stored in BSON format. BSON format provides a variety of data types. We can insert data from mongo shell or through mongoose. In both cases, the _id field is generated automatically in each document. The _id field acts as a primary … Continued

How to use express with mongoose

Introduction Express is an important part of web application development stacks such as MEAN and MERN stack. Developing web applications is not an easy task. Backend is an important part of every web application. The backend is the connectivity to databases and it also holds APIs that interact with the databases. One important part of … Continued

How to install mongoose with npm and import into NodeJs

Introduction MongoDB and NodeJs are often used together for developing back-ends. MongoDB is a NoSQL database. To connect the database and manage relationships between data, the mongoose is used. It is an Object Data Modeling (ODM) library. It provides schema validation and also helps in managing relationships between data. In this article, we will discuss … Continued

Understanding the mongoose _id field

Introduction MongoDB is one of the most popular NoSQL databases. It stores data in the BSON format. BSON format is an extension of the JSON format that provides more data types. Have a look at the following document. 123456789{     "name" : "Rambo",     "age": 5,     "isAdopted" : false,     … Continued

How to Use Mongoose with a db

Introduction MongoDB is one of the most popular NoSQL databases. It stores data in BSON format (an extension of JSON). It is relatively faster than SQL databases and handles unstructured data very efficiently. MongoDB is often used with NodeJS. For object mapping between MongoDB and NodeJS, a library known as Mongoose is used. Mongoose is … Continued

Fetching Data from MongoDB using get in mongoose

Introduction As we all know, a database is used to store data. But it is not just that. We always don’t have static data. After setting up a database, we may need to perform many operations. We may need to add more data, or we need all the data or some data. We may also … Continued

The mongoose $in Operator

Introduction CRUD operations in mongoose are very important to understand. These operations include data retrieval, insertion, updating, and deletion. Mongoose provides several methods for such operations. All of these methods have a query and a projection part. A query specifies how the document will be filtered. Generally, it is an object. Have a look at … Continued

Use MongoDB to run JavaScript

Introduction to MongoDB and JavaScript This tutorial will explain techniques used for setting up the Mongo Shell so it can connect to MongoDB to run JavaScript code. The Mongo shell is an interactive interface that supports connecting JavaScript to MongoDB. Mongo shell can be used to perform administrative operations, including the querying and updating of … Continued

Simple Chat App using NodeJS and MongoDB Atlas Part 4

Introduction This lesson is Part 4 of the multiple-series tutorial, “Simple Chat App using NodeJS and MongoDB Atlas.” In Part 3, you learned how to code the server.js for the backend. Today’s lesson focuses on coding the index.html for the frontend. Let’s continue to use Node and MongoDB Atlas, the fully managed cloud database, to … 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.