Author: Justin Jenkins

  • Full-Text Search in MongoDB with Relevance Scores

    Full-Text Search in MongoDB with Relevance Scores

    Do you know about MongoDB Text Search? Imagine we are building an app and want users to search by ingredients or dish names (like chocolate or zucchini bread) and get the most relevant results. But wait! We have that information in multiple places, like the recipe title or the ingredients, or tags (like “pasta” on…

  • Clean Up Old Data Automatically with MongoDB TTL Indexes

    Clean Up Old Data Automatically with MongoDB TTL Indexes

    With Big Data, comes well … a lot of data. But what if some of that data is only really useful within a certain timeframe? Think about things like: Luckily, MongoDB makes it easy to keep your collections tidy with what are called TTL indexes. TTL (Time To Live) indexes automatically delete documents after a…

  • Scaling MongoDB with Sharding: Setup Best Practices

    Scaling MongoDB with Sharding: Setup Best Practices

    In our previous post, we covered the basics of sharding (how MongoDB distributes data across multiple servers), why config servers are critical, and how balancing helps maintain efficiency. Now, we’ll go deeper into three critical areas that will determine whether your sharded cluster thrives or struggles: Let’s break these down in detail. Shard Key Selection:…

  • Scaling MongoDB with Sharding: The Basics

    Scaling MongoDB with Sharding: The Basics

    When your database starts to outgrow its capacity, you’ve got two options: scale up or scale out. Scaling up means buying bigger, beefier servers with more RAM, CPU, and disk space. Whereas scaling out (using MongoDB’s sharding feature) can be a more cost-effective and flexible solution. The Basics of Sharding In simple terms, sharding involves…

  • MongoDB Aggregations: Identifying Popular Ingredients with $unwind and $group

    MongoDB Aggregations: Identifying Popular Ingredients with $unwind and $group

    In this series, we’re exploring different MongoDB aggregation operators by applying them to a collection of recipes. MongoDB Aggregations Series As part of our exploration we are imagining you’re building a recipe website. Today we want to analyze ingredient usage across all our recipes to find the most common ingredients. By using MongoDB’s $unwind and…

  • MongoDB Aggregations: Organizing Recipes by Meal Type with $group

    MongoDB Aggregations: Organizing Recipes by Meal Type with $group

    In this series, we’re exploring different MongoDB aggregation operators by applying them to a recipe collection. I hope you’ll follow along with each post! MongoDB Aggregations Series As part of this series we are imaging you’re building a recipe website. For this post we are adding some new features to our site including allowing users…

  • MongoDB Aggregations: Finding Cooking Times with $min and $max

    MongoDB Aggregations: Finding Cooking Times with $min and $max

    In this series we will explore different operators in the MongoDB Aggregation Framework via the context of a collection of recipes. MongoDB Aggregations Series Let’s say we’re making a brand new recipes website. Knowing the cooking times can help us categorize recipes into quick meals, slow-cooked dishes, or anything in between. MongoDB’s $min and $max…

  • How to Change a MongoDB Primary to a Secondary

    How to Change a MongoDB Primary to a Secondary

    Maintaining a MongoDB Replica Set requires occasional maintenance and upgrades. Sometimes, this necessitates taking the primary node offline or converting it to a secondary node. Learn more about different Replica Set roles, Replica Sets: Member Roles and Types This guide will walk you through the steps needed to safely perform this task. Why Would You…

  • Understanding the local Database in MongoDB

    Understanding the local Database in MongoDB

    When you set up and initiate a replica set in MongoDB, all databases and collections on the primary database are replicated to the secondary nodes. However, there is one crucial exception: the local database. What is the local Database? Each mongod instance maintains its own unique copy of the local database. It contains collections that…

  • MongoDB.local NYC 2024

    MongoDB.local NYC 2024

    Last week I had the opportunity to attend MongoDB.local NYC and help out at the MongoDB Community Booth. We had a fun “scavenger hunt” around the MongoDB Community website to get a MongoDB t-shirt which saw a lot interest (everyone loves a free t-shirt!) It was great to catch up with many members of the…