MongoDB Basics


Not CompletedHow to Create a MongoDB Collection

Now that we have our database created and we have a user now we can start creating collections.

Not CompletedGuide to Inserting Documents into a MongoDB Collection

Now that we have our collection built out we can start adding documents into our database. I'm going to open up sublime text and let's start writing out the script that is going to insert a book into our book collection.

Not CompletedHow to Insert Many Documents into a MongoDB Collection

In the last guide, we walked through how you can insert documents into a Mongo collection and that's great but that only allowed us to insert one at a time.

Not CompletedHow to Query All Documents in a MongoDB Collection with the find() Method

So far in this course, we have focused primarily on just adding documents but that's only one part of how Mongo is used. We also need to be able to retrieve those. What we can do is we have a number of different find methods in Mongo that make it very straightforward to query documents.

Not CompletedHow to Query for Specific Documents in a MongoDB Collection

As helpful as it is to be able to perform a find query on an entire collection more often than not you're going to be performing some type of query based off of a value in that collection.

Not CompletedIntroduction to MongoDB Projections

In the past few guides as we've been going through some of the various querying functions that are available in Mongo you may have noticed something that might be kind of strange if you remember back where we run some command like db.books.find() do you notice how all of the attributes are brought back.

Not CompletedQuery for a Portion of a Nested Array Element in a Document Using $slice

Now that you're familiar with how projections work in Mongo what we can do is we can actually dive down even further to be able to be more explicit with what gets returned back for nested collections.

Not CompletedHow to Delete Documents in MongoDB

So far we've gone through a number of ways to query documents in Mongo. We've also talked about inserting either single or multiple documents.

Not CompletedHow to Include Nested Fields in a find Query

In production applications that utilize Mongo's database a very common pattern that you'll see is that your documents start to get pretty big and you start to have a number of nested collections. It's one of the top reasons why you actually use a document based system like Mongo because you have the flexibility and then you also have the ability to nest as many items as you want.

Not CompletedUsing the findOne Method in MongoDB to Query for a Single Document

This is going to be a quick guide on how to drill down and become more specific with our search queries. Specifically, in being more specific with how many elements get returned.

Not CompletedHow to Query for a Portion of a String in a MongoDB Document

This is going to be a very important guide and that's because this is going to be one of the guides we're get into some very similar code that you're going to see in production applications that use Mongo.

Not CompletedHow to Check if a Field Exists in a MongoDB Document

In this guide, we're going to walk through how we can check to see if a field exists or if it doesn't inside of Mongo.

Quizzes


MongoDB Basics
    Unsupported Browser

    devCamp does not support ancient browsers.
    Install a modern version for best experience.