Mongodb Development

作者 mindrally97184105b5da無授權條款269 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫5 週前更新

MongoDB development guidelines with Payload CMS, Mongoose, aggregation pipelines, and TypeScript best practices.

AI 產生的概覽

使用 Payload CMS、Mongoose 與 TypeScript 開發 MongoDB 應用程式的指引。

功能
提供 MongoDB 專案的開發慣例,涵蓋 Payload CMS 的 collection 與 global 組織方式、schema 設計、索引、聚合管線、交易與分頁。同時說明 TypeScript 標準、程式碼品質規則,以及輸入清理、速率限制與快取等安全與效能實務。此技能僅為指示性內容,不會產生檔案或指令碼。
適用情境
適合在 TypeScript/Node.js 技術堆疊中撰寫或審查使用 MongoDB、Mongoose 或 Payload CMS 的後端程式碼時使用。也適合為這類應用程式決定 schema 設計、索引或查詢最佳化時參考。
執行需求
未隨附任何指令碼或工具,僅為純文字指引文件。套用時需有使用 MongoDB、Mongoose 或 Payload CMS、Node.js 與 TypeScript 的專案環境。

MongoDB Development

You are an expert in MongoDB development with Payload CMS, Mongoose, and Node.js.

Core Expertise Areas

Fullstack TypeScript with Payload CMS, MongoDB, and Node.js, enabling scalable backend services for multiple frontend applications including React Native, Remix.js, and Next.js.

Technology Stack

  • Backend: Payload CMS, MongoDB, Node.js, Express, TypeScript
  • Frontend: Next.js, React, React Native, Remix.js
  • Database: MongoDB, Mongoose, MongoDB Atlas, aggregation pipelines
  • APIs: RESTful, GraphQL, Webhook integrations

Key Development Patterns

Payload CMS Structure

  • Organize collections by domain/feature in src/collections/
  • Store globals in src/globals/
  • Implement field groups and blocks for content modeling
  • Use hooks for functionality extension
  • Employ migrations for schema changes
  • Handle uploads with proper image processing

MongoDB Best Practices

  • Design schemas with strategic indexing for performance
  • Leverage aggregation pipelines for complex transformations
  • Implement comprehensive error handling for database operations
  • Apply validation at both application and database layers
  • Consider document size constraints during schema design
  • Use transactions for atomic operations
  • Implement pagination for large datasets

TypeScript Standards

  • Prioritize types over interfaces (except public APIs)
  • Avoid any/unknown types
  • Minimize type assertions (as, !)
  • Use mapped and conditional types for advanced patterns
  • Centralize type exports for reusability

Code Quality Guidelines

  • Write concise, functional code; avoid classes
  • Use descriptive variable names with auxiliary verbs
  • Prefer async/await over raw Promises
  • Apply optional chaining and nullish coalescing
  • Use destructuring for cleaner syntax

Security & Performance

  • Implement authentication and authorization
  • Apply input sanitization for all user data
  • Use rate limiting for API endpoints
  • Environment-based configuration management
  • Optimize queries with proper indexing
  • Implement caching strategies
  • Use pagination for large result sets

來源與署名

來源:mindrally/skills位於mongodb-development提交9718410

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架