Skip to main content
rule official · GitHub

mongo-dba — GitHub Copilot rule: what it does, how to install

Configures GitHub Copilot for MongoDB DBA tasks: manages replica sets, tunes indexes, handles backups, and enforces security practices for MongoDB 7.x+.

Install into GitHub Copilot · Manually: put the files in place All methods and platforms ↓
.github/instructions/mongo-dba.instructions.md
Open on GitHub

What mongo-dba does

This rule configures GitHub Copilot as a dedicated MongoDB database administrator. The assistant guides cluster and replica set setups, collection creation, and database profiling. For data protection, it prioritizes TLS encryption alongside SCRAM-SHA authentication.

The instructions make the assistant prioritize GUI tooling over manual terminal work. Copilot suggests the MongoDB for VS Code extension or MongoDB Compass unless you explicitly request shell syntax. It also enforces compatibility with MongoDB 7.x+. Whenever deprecated elements like MMAPv1 or ensureIndex appear, the model flags them and recommends modern options like WiredTiger and createIndexes.

Copilot defaults to graphical tools here. If you need raw shell scripts, specify that directly in your prompt.

What it helps with

  • Configure SCRAM-SHA authentication and TLS encryption
  • Schedule backups and restores using mongodump and mongorestore
  • Optimize slow queries via profiling and indexing strategies
  • Replace deprecated commands like ensureIndex for MongoDB 7.x+

Example prompts for the agent

  • How do I set up mongodump backups using SCRAM-SHA authentication?
  • Review index strategies for my collection to fix slow queries
  • Help upgrade our replica set configuration for MongoDB 7.x

How to install mongo-dba

Manually: put the files in place

.github/instructions/mongo-dba.instructions.md

The applyTo field sets which files it applies to

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about mongo-dba

How do I install mongo-dba in GitHub Copilot?

Place the rule file at .github/instructions/mongo-dba.instructions.md in the root of your project repository.

What does mongo-dba do?

It instructs GitHub Copilot to behave as a MongoDB database administrator. It points to official documentation, highlights modern alternatives for removed features, and encourages auditable setups.

Will Copilot provide MongoDB shell commands?

By default, the assistant prioritizes MongoDB Compass and the VS Code extension. It provides manual shell commands only when you explicitly request them.

Source text

mongo-dba.instructions.md · MIT
---
applyTo: "**"
description: 'Instructions for customizing GitHub Copilot behavior for MONGODB DBA chat mode.'
---

# MongoDB DBA Chat Mode Instructions

## Purpose
These instructions guide GitHub Copilot to provide expert assistance for MongoDB Database Administrator (DBA) tasks when the mongodb-dba.agent.md chat mode is active.

## Guidelines
- Always recommend installing and enabling the MongoDB for VS Code extension for full database management capabilities.
- Focus on database administration tasks: Cluster and Replica Set Management, Database and Collection Creation, Backup/Restore (mongodump/mongorestore), Performance Tuning (indexes, profiling), Security (authentication, roles, TLS), Upgrades and Compatibility with MongoDB 7.x+
- Use official MongoDB documentation links for reference and troubleshooting.
- Prefer tool-based database inspection and management (MongoDB Compass, VS Code extension) over manual shell commands unless explicitly requested.
- Highlight deprecated or removed features and recommend modern alternatives (e.g., MMAPv1 → WiredTiger).
- Encourage secure, auditable, and performance-oriented solutions (e.g., enable auditing, use SCRAM-SHA authentication).

## Example Behaviors
- When asked about connecting to a MongoDB cluster, provide steps using the recommended VS Code extension or MongoDB Compass.
- For performance or security questions, reference official MongoDB best practices (e.g., index strategies, role-based access control).
- If a feature is deprecated in MongoDB 7.x+, warn the user and suggest alternatives (e.g., ensureIndex → createIndexes).

## Testing
- Test this chat mode with Copilot to ensure responses align with these instructions and provide actionable, accurate MongoDB DBA guidance.

© github · MIT · github/awesome-copilot

Similar IDE rules

All IDE rules for Data and databases →

From the same set770

The whole set →
oop-design-patterns A GitHub Copilot rule that steers code generation and refactoring toward GoF design patterns and SOLID principles in object-oriented code. ★ 40,418repo stars no-heredoc A rule that stops the agent from writing files through terminal heredocs and redirections, because those commands corrupt content in VS Code. ★ 40,418repo stars nestjs This rule feeds GitHub Copilot a set of NestJS conventions: modules, DI, DTOs and validation. Useful when the agent writes TypeScript server code. ★ 40,418repo stars moodle This rule tells Copilot how to write Moodle code: Frankenstyle namespaces, Mustache templates, mandatory security functions. Useful when you build plugins or themes. ★ 40,418repo stars mcp-m365-copilot Guides the development of declarative Microsoft 365 Copilot agents using the Model Context Protocol. Standardizes manifests, authentication flows, and Adaptive Cards. ★ 40,418repo stars langchain-python A GitHub Copilot instruction file that steers the agent toward LangChain patterns: Runnable, LCEL, chat models, retrievers and vector stores. Useful when your Python code talks to LangChain. ★ 40,418repo stars kubernetes-manifests Configures GitHub Copilot to generate production-ready Kubernetes manifests. Enforces standard labels, hardened security contexts, resource limits, and health probes. ★ 40,418repo stars joyride-workspace-automation Guides GitHub Copilot to build project-specific VS Code scripts with ClojureScript and Joyride. It enforces REPL-driven development directly inside the editor runtime. ★ 40,418repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor