Mongodb

MongoDB with TypeScript document types and indexes. Use when the data model is document-oriented, not when the project already standardized on Postgres plus Drizzle.

vostrikovva Updated

File contents

MongoDB + TypeScript

Type documents (interface or schema). Do not pass any through the driver.

Collection/module paths are defaults. Real directories come from the implement/tdd recon of package.json and tsconfig.json (monorepo, paths).

Defaults

  • Indexes for fields you filter/sort on. Call out missing indexes when adding queries.
  • Do not store secrets in documents. Do not print connection strings in chat.

vs Postgres

If the repo already uses Drizzle/Postgres, do not add Mongo “for variety”. Split databases only when the user wants a document store for a defined bounded context.

vostrikovva/cursor-skills/tree/main/skills/stack/mongodb commit 7928945f2b

Frequently asked questions

npx skillmds@latest add vostrikovva/mongodb