MongoDB Developer Associate Certification
The MongoDB Certified Developer Associate certification validates your knowledge of MongoDB fundamentals and your ability to build applications using MongoDB. This certification demonstrates expertise in document data modeling, CRUD operations, aggregation, indexing, and MongoDB best practices.
MongoDB powers modern applications with its flexible document model, horizontal scalability, and developer-friendly features.
- Backend developers building MongoDB applications
- Full-stack developers using MEAN/MERN stacks
- Database developers transitioning to NoSQL
- Software engineers working with document databases
- Anyone building modern data-driven applications
Exam Format
Exam Topics
MongoDB Fundamentals
Document Model:
- Understand JSON/BSON data format
- Work with embedded documents
- Use arrays and nested structures
- Handle data types (String, Number, Date, ObjectId, etc.)
Collections and Databases:
- Create and manage databases
- Create and drop collections
- Understand capped collections
- Use database and collection naming conventions
MongoDB Shell:
- Use mongosh for database operations
- Execute commands and queries
- Import/export data
- Administer MongoDB instances
CRUD Operations
Create Documents:
// insertOne
db.users.insertOne({
name: "John Doe",
email: "[email protected]",
age: 30,
hobbies: ["reading", "gaming"]
})
// insertMany
db.users.insertMany([
{ name: "Alice", email: "[email protected]" },
{ name: "Bob", email: "[email protected]" }
])
Read Documents:
// findOne
db.users.findOne({ name: "John Doe" })
// find with projection
db.users.find(
{ age: { $gte: 25 } },
{ name: 1, email: 1, _id: 0 }
)
// Query operators
db.products.find({
$and: [
{ price: { $gte: 10, $lte: 100 } },
{ category: "electronics" }
]
})
// Array queries
db.posts.find({
tags: { $in: ["mongodb", "nosql"] }
})
Update Documents:
// updateOne
db.users.updateOne(
{ name: "John Doe" },
{
$set: { age: 31 },
$push: { hobbies: "coding" }
}
)
// updateMany
db.products.updateMany(
{ category: "electronics" },
{ $mul: { price: 0.9 } } // 10% discount
)
// replaceOne
db.users.replaceOne(
{ _id: ObjectId("...") },
{ name: "New Name", email: "[email protected]" }
)
Delete Documents:
// deleteOne
db.users.deleteOne({ name: "John Doe" })
// deleteMany
db.products.deleteMany({ stock: 0 })
Aggregation Framework
Basic Pipeline:
db.orders.aggregate([
// Stage 1: Match
{ $match: { status: "completed" } },
// Stage 2: Group
{
$group: {
_id: "$customerId",
totalSpent: { $sum: "$amount" },
orderCount: { $sum: 1 }
}
},
// Stage 3: Sort
{ $sort: { totalSpent: -1 } },
// Stage 4: Limit
{ $limit: 10 }
])
Advanced Aggregation:
db.sales.aggregate([
// Unwind array
{ $unwind: "$items" },
// Lookup (join)
{
$lookup: {
from: "products",
localField: "items.productId",
foreignField: "_id",
as: "productDetails"
}
},
// Project
{
$project: {
date: 1,
productName: { $arrayElemAt: ["$productDetails.name", 0] },
quantity: "$items.quantity",
revenue: {
$multiply: ["$items.quantity", "$items.price"]
}
}
},
// Group by date
{
$group: {
_id: {
$dateToString: { format: "%Y-%m-%d", date: "$date" }
},
totalRevenue: { $sum: "$revenue" },
totalItems: { $sum: "$quantity" }
}
}
])
Indexing
Create Indexes:
// Single field index
db.users.createIndex({ email: 1 })
// Compound index
db.products.createIndex({ category: 1, price: -1 })
// Multikey index (on arrays)
db.posts.createIndex({ tags: 1 })
// Text index
db.articles.createIndex({ content: "text" })
// Geospatial index
db.locations.createIndex({ coordinates: "2dsphere" })
// TTL index (auto-delete after time)
db.sessions.createIndex(
{ createdAt: 1 },
{ expireAfterSeconds: 3600 }
)
// Unique index
db.users.createIndex({ email: 1 }, { unique: true })
// Partial index
db.orders.createIndex(
{ customerId: 1 },
{ partialFilterExpression: { status: "active" } }
)
Index Management:
// List indexes
db.collection.getIndexes()
// Drop index
db.collection.dropIndex("email_1")
// Get index usage stats
db.collection.aggregate([
{ $indexStats: {} }
])
Schema Design
Embedded Documents:
// One-to-few: Embed
{
_id: ObjectId("..."),
name: "John Doe",
addresses: [
{
type: "home",
street: "123 Main St",
city: "New York"
},
{
type: "work",
street: "456 Office Ave",
city: "New York"
}
]
}
References:
// One-to-many: Reference
// User collection
{
_id: ObjectId("user1"),
name: "John Doe"
}
// Orders collection
{
_id: ObjectId("order1"),
userId: ObjectId("user1"),
total: 99.99
}
Hybrid Approach:
// One-to-squillions: Embed summary, reference details
{
_id: ObjectId("product1"),
name: "Laptop",
reviewSummary: {
count: 1547,
avgRating: 4.5
},
topReviews: [
{ author: "Alice", rating: 5, text: "Great!" }
// Top 3-5 reviews embedded
]
// Full reviews in separate collection with productId reference
}
Transactions
Multi-Document Transactions:
const session = db.getMongo().startSession()
session.startTransaction()
try {
const accountsCollection = session.getDatabase("bank").accounts
const transfersCollection = session.getDatabase("bank").transfers
// Debit account
accountsCollection.updateOne(
{ accountId: "A123" },
{ $inc: { balance: -100 } },
{ session }
)
// Credit account
accountsCollection.updateOne(
{ accountId: "B456" },
{ $inc: { balance: 100 } },
{ session }
)
// Record transfer
transfersCollection.insertOne(
{
from: "A123",
to: "B456",
amount: 100,
timestamp: new Date()
},
{ session }
)
session.commitTransaction()
} catch (error) {
session.abortTransaction()
throw error
} finally {
session.endSession()
}
Data Modeling Patterns
Polymorphic Pattern:
// Different types in same collection
{
_id: ObjectId("..."),
type: "circle",
radius: 5
}
{
_id: ObjectId("..."),
type: "rectangle",
width: 10,
height: 5
}
Bucket Pattern:
// Time-series data grouped into buckets
{
_id: ObjectId("..."),
sensorId: "sensor123",
date: ISODate("2025-01-01"),
readings: [
{ time: ISODate("2025-01-01T00:00:00Z"), temp: 20.5 },
{ time: ISODate("2025-01-01T00:01:00Z"), temp: 20.6 },
// ... more readings for this hour
]
}
Computed Pattern:
// Pre-calculate frequently accessed values
{
_id: ObjectId("..."),
title: "Blog Post",
views: 1547,
likes: 234,
comments: 89,
engagementScore: 1870 // Pre-calculated
}
Drivers and Application Development
Node.js Driver
const { MongoClient } = require('mongodb')
const uri = "mongodb://localhost:27017"
const client = new MongoClient(uri)
async function run() {
try {
await client.connect()
const database = client.db("myapp")
const collection = database.collection("users")
// Insert
await collection.insertOne({
name: "Alice",
email: "[email protected]"
})
// Find
const user = await collection.findOne({ name: "Alice" })
console.log(user)
// Update
await collection.updateOne(
{ name: "Alice" },
{ $set: { verified: true } }
)
// Delete
await collection.deleteOne({ name: "Alice" })
} finally {
await client.close()
}
}
run().catch(console.error)
Python Driver (PyMongo)
from pymongo import MongoClient
client = MongoClient('mongodb://localhost:27017/')
db = client.myapp
collection = db.users
# Insert
collection.insert_one({
'name': 'Bob',
'email': '[email protected]'
})
# Find
user = collection.find_one({'name': 'Bob'})
print(user)
# Update
collection.update_one(
{'name': 'Bob'},
{'$set': {'verified': True}}
)
# Delete
collection.delete_one({'name': 'Bob'})
Study Resources
Official MongoDB Resources
Recommended Courses
- 🎓 MongoDB Basics (M001) - Free MongoDB University course
- 🎓 MongoDB for Developers (M220) - Language-specific development
- 🎓 MongoDB Performance (M201) - Indexing and optimization
Practice Resources
- 🔬 MongoDB Atlas Free Tier - Cloud MongoDB for practice
- 🔬 MongoDB Compass - GUI for exploring data
- 📝 MongoDB University Practice Exams - Included with courses
Practice Questions
Test your NoSQL database knowledge.
FAQ
No, but familiarity with MongoDB Atlas (cloud offering) is beneficial.
The exam is language-agnostic. Know JavaScript for shell commands. Driver knowledge (Node.js, Python, Java) helps but isn't required for all questions.
6-12 months of MongoDB development recommended.
Different paradigm. MongoDB is flexible but requires good schema design knowledge.
3 years. Recertify to maintain status.
MongoDB Success Tips:
- Complete M001, M121, M201 courses
- Build real applications with MongoDB
- Practice aggregation pipelines
- Master indexing strategies
- Understand document modeling patterns
MongoDB certification demonstrates modern database expertise essential for cloud-native application development!
CertPractice Team
Expert certification guides and study tips