mongodb-patterns
Document modeling, aggregation pipeline, indexing strategy, change streams, and multi-document transactions.
Profile →npx skills add vibeeval/vibecosystem --skill mongodb-patterns --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# MongoDB Patterns Document database design and query optimization for MongoDB. ## Document Modeling Strategies ```typescript // EMBED when: 1:1 or 1:few, data read together, child has no independent lifecycle interface Order { _id: ObjectId customerId: ObjectId status: 'pending' | 'paid' | 'shipped' items: OrderItem[] // Embedded - always read with order shippingAddress: Address // Embedded - 1:1 createdAt: Date } interface OrderItem { productId: ObjectId name: string // Denormalized - avoid join at read time price: number // Snapshot at purchase time quantity: number } // REFERENCE when: 1:many (unbounded), independent queries, shared across documents interface Product { _id: ObjectId name: string price: number categoryId: ObjectId // Reference - category queried independently reviews: never // DON'T embed - unbounded array } // Bucket pattern: group time-series data into fixed-size documents interface SensorBucket { _id: ObjectId sensorId: string startTime: Date endTime: Date count: number // Track bucket fullness measurements: { // Embed up to 200 per bucket timestamp: Date value: number }[] } ``` ## Indexing Strategy ```typescript // Compound index: field order matters (ESR ru
- Document Modeling Strategies
- Indexing Strategy
- Aggregation Pipeline
- Change Streams (Real-time Reactivity)
- Multi-Document Transactions
- Checklist
- Anti-Patterns
What does the mongodb-patterns skill do?
Document modeling, aggregation pipeline, indexing strategy, change streams, and multi-document transactions.
How do I install it?
Run `npx skills add vibeeval/vibecosystem --skill mongodb-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From vibeeval/vibecosystem, a repository with 521 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.