Skip to content

Commit 7bd2a13

Browse files
committed
docs: comprehensive documentation updates for discovery and authentication features
- Add new discovery.md page documenting comprehensive discovery functionality - Basic project discovery and ApplyDocument conversion - Database-level resource enumeration (databases, collections, indexes, roles) - Resource filtering and selection options - Performance optimization with caching and parallel discovery - Security features and best practices - Complete workflow examples and troubleshooting guide - Update database.md for new authentication model - Document three authentication methods: temporary user, manual credentials, direct connection - Add requirement for --collection parameter in database creation - Update examples to reflect new authentication patterns - Update infra.md to reference discovery features - Link to comprehensive discovery documentation - Highlight key discovery capabilities - Update index.md to feature discovery as core capability - Update _config.yml navigation to include discovery page These changes reflect the comprehensive discovery enhancements and new authentication model implemented in the test infrastructure and core functionality.
1 parent 8293f3d commit 7bd2a13

5 files changed

Lines changed: 516 additions & 46 deletions

File tree

docs/_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ navigation:
3737
url: /
3838
- title: Authentication
3939
url: /auth/
40+
- title: Discovery
41+
url: /discovery/
4042
- title: Atlas Commands
4143
url: /atlas/
4244
- title: Database Commands

docs/database.md

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,40 @@ Use `database` commands for granular database-specific operations and `atlas` co
2929

3030
---
3131

32-
## Connection methods
32+
## Authentication Methods
3333

34-
Matlas supports two ways to connect to MongoDB databases:
34+
Matlas supports three authentication methods for database operations:
3535

36-
### Direct connection
36+
### Method 1: Temporary User (Recommended)
3737
```bash
38-
--connection-string "mongodb+srv://user:pass@cluster.mongodb.net/"
38+
--cluster <cluster-name> --project-id <project-id> --use-temp-user
39+
```
40+
- **How it works**: Creates a temporary Atlas database user with required permissions
41+
- **Automatic cleanup**: User is automatically deleted after operation
42+
- **Security**: Uses Atlas API keys, no permanent credentials needed
43+
- **Best for**: Automation, CI/CD pipelines, one-off operations
44+
45+
### Method 2: Manual User Credentials
46+
```bash
47+
--cluster <cluster-name> --project-id <project-id> --username <user> --password <pass>
3948
```
49+
- **How it works**: Uses existing database user credentials
50+
- **Requirements**: Both username and password must be provided
51+
- **Best for**: Using existing database users with specific permissions
4052

41-
### Via Atlas cluster
53+
### Method 3: Direct Connection String
4254
```bash
43-
--cluster <cluster-name> --project-id <project-id>
55+
--connection-string "mongodb+srv://user:pass@cluster.mongodb.net/"
4456
```
57+
- **How it works**: Direct MongoDB connection with embedded credentials
58+
- **Full control**: Complete control over connection parameters
59+
- **Best for**: Custom connection requirements, external clusters
60+
61+
## Connection Requirements
4562

46-
**Note:** When using Atlas cluster connection, you can optionally use `--use-temp-user` to create a temporary database user for the operation.
63+
**Database Creation**: All database creation operations require the `--collection` parameter because MongoDB databases are created lazily when the first collection is added. This ensures the database is immediately visible in Atlas UI.
64+
65+
**Authentication**: You must use exactly one authentication method per command. Mixing methods (e.g., `--use-temp-user` with `--username`) will result in an error.
4766

4867
---
4968

@@ -60,13 +79,29 @@ matlas database list --cluster <name> --project-id <id> [--use-temp-user] [--dat
6079

6180
### Create database
6281
```bash
63-
# Direct connection
64-
matlas database create <database-name> --connection-string "mongodb+srv://user:pass@host/"
82+
# Direct connection (requires collection for immediate visibility)
83+
matlas database create <database-name> \
84+
--connection-string "mongodb+srv://user:pass@host/" \
85+
--collection <collection-name>
6586

66-
# Via Atlas cluster
67-
matlas database create <database-name> --cluster <name> --project-id <id>
87+
# Via Atlas cluster with temporary user (recommended)
88+
matlas database create <database-name> \
89+
--cluster <name> \
90+
--project-id <id> \
91+
--collection <collection-name> \
92+
--use-temp-user
93+
94+
# Via Atlas cluster with manual credentials
95+
matlas database create <database-name> \
96+
--cluster <name> \
97+
--project-id <id> \
98+
--collection <collection-name> \
99+
--username <db-user> \
100+
--password <db-password>
68101
```
69102

103+
**Important**: Database creation requires the `--collection` parameter because MongoDB databases are created lazily when the first collection is added. This ensures the database is immediately visible in Atlas UI.
104+
70105
### Delete database
71106
```bash
72107
# Direct connection

0 commit comments

Comments
 (0)