Skip to content

mongodb

Use when working with MongoDB — document modeling, queries, aggregation pipelines, Atlas setup, or Mongoose ODM. Also use when deciding between MongoDB and relational databases or debugging MongoDB-specific issues.

ModelSource
sonnetpack: database
Full Reference

┏━ 🔧 mongodb ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when working with MongoDB — document model… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

your friendly armadillo is here to serve you

ItemValue
Current serverMongoDB 8.2
Node.js driverv7.x (npm i mongodb)
Mongoose ODMv9.x (npm i mongoose)
Atlas connectionmongodb+srv://<user>:<pass>@<cluster>.mongodb.net/<db>
Default port27017
TierCostStorageOps/sec
Free (M0)$0512 MBshared
Flex$8–$30/mo5 GB base100–500
Dedicated (M10+)$57+/mocustomcustom

Serverless and M2/M5 tiers are deprecated — all migrated to Flex as of mid-2025.

Load the file that matches the task:

I want to…File
Create Atlas cluster, network access, users, connection string, pricingreference/atlas-setup.md
Install driver or Mongoose, connection caching, v7/v9 breaking changesreference/client-setup.md
Embed vs reference, schema patterns, 16 MB limitreference/document-modeling.md
insertOne/Many, find, update operators, delete, query operators, error codesreference/crud-operations.md
Pipeline stages, $lookup joins, $facet, time-seriesreference/aggregation-pipeline.md
Index types, compound ESR rule, explain plansreference/indexing.md
Schema+model, virtuals, hooks, populate, lean queriesreference/mongoose-odm.md
Serverless connection pooling, maxPoolSize, cold starts, NoSQL injection, TLS, encryptionreference/serverless-and-security.md

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.