ts-mongodb
Installation
SKILL.md
When to Use This Skill
Use when you need to:
- Decide whether a feature's data actually belongs in MongoDB instead of Postgres
- Choose between Mongoose and the native
mongodbdriver for a Node/TypeScript backend - Define a MongoDB schema/model with TypeScript types, with or without Mongoose
- Keep
ObjectIdand driver-specific types out of the rest of the app - Subscribe to real-time data changes with
watch(), or decide that polling is simpler
Trigger keywords: MongoDB, Mongoose, mongodb driver, ObjectId, collection, document, change stream, watch(), aggregation pipeline, NoSQL, ensureIndex, explain(), schema.
Freshness rule: the native driver's typed API (Collection<T>) and Mongoose's
TypeScript inference (InferSchemaType) both move across majors — recheck each
package's own docs before pinning a version.