Filter Array Elements in MongoDB

Introduction If you’re using MongoDB to store and manage your data, you’ve probably noticed the database’s flexible document structure. In MongoDB, a field can have an array as a value. When you construct a MongoDB query, you may want to refine your results, filtering an array to return only specific elements. Fortunately, it’s easy to … Continued

Delete MongoDB Document

Introduction When you store and manage your data in MongoDB, there will be times when you need to delete one or more documents from a collection. Fortunately, this task is easy to accomplish with a simple command. In this article, we’ll show you how to delete a MongoDB document and provide examples that cover a … Continued

Update MongoDB Using Set Operator

Introduction When you’re working with data stored in MongoDB, there are many situations in which you’ll need to update the value of a field in a collection. For example, an employee may have been promoted to a new position, and that information needs to be updated in a MongoDB document. Perhaps a student moved to … Continued

Connecting Kotlin and MongoDB

Introduction If you’re working with the Kotlin programming language and you want your apps to interact with a MongoDB database, you’ll need to create the right connections between these two technologies. Fortunately, it only requires a few simple steps to accomplish this task. In this article, we’ll walk you through the process of connecting Kotlin … Continued

Build an Application in NodeJS, Express and MongoDB – Part 2

Introduction This article is the second in our two-part series explaining how to build an application using NodeJS, Express and MongoDB. In our first article, we reviewed some of the essential steps needed to get started in the project: installing, setting up and configuring everything you’ll need. We also reviewed some important code used in … Continued

Build an Application in NodeJS Express and MongoDB – Part 1

Introduction If you’re building applications using NodeJS and the Express framework, you may want to interact with a MongoDB database from your code. Fortunately, this task is easy to accomplish using the Mongoose package for Javascript. In this first article of our two-part series, we’ll show you how to create an application using NodeJS, Express … Continued

How to Use mongoose remove

Introduction If you need to delete data from your MongoDB database, it’s important to proceed with caution. Deleting data is a permanent operation, so there’s no real margin for error. Mongoose, the Javascript framework commonly used to communicate with MongoDB from a Node.JS application, provides a number of ways to handle deletions. It offers two … Continued

MongoDB Projection

Introduction Sometimes, as a DBA or technical administrator, you may only want to see records that match certain attributes. When you have a need to do that, MongoDB projection is a useful operator you’ll want to try. With projection, you can query a collection to return those documents with the fields you specify. Any collection … Continued

How to use Mongoose Save

Introduction The insert() and insertMany() methods are both valuable functions for inserting documents into an established MongoDB collection. An additional and worthwhile method that can be used to easily insert documents into a Mongoose collection is the save() method. The save() method is designed to insert documents by calling the instance of that document, meaning … Continued

The mongoose model

Introduction MongoDB is referred to as a schemaless database, meaning the number and type of columns do not need to be specified before inserting data. However, because it is schema free, MongoDB does not provide support for creating schemas, validation or abstraction. Mongoose is an Object Modeling Library, or ODM, that supports the methods and … 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.