Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions docs/.vuepress/sidebar-menus/learning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,10 @@ export default [{
children: [
{ link: '/learning/solutions/database-management/index.md', text: 'Solution Summary' },
{ link: '/learning/solutions/database-management/db-and-autodiag.md', text: 'Databases + Auto Diagnostics' },
{ link: '/learning/solutions/database-management/postgres-reindex.md', text: 'Reindex PostgreSQL Database' },
{ link: '/learning/solutions/database-management/postgres-backup-restore.md', text: 'Backup and Restore PostgreSQL' },
{ link: '/learning/solutions/database-management/postgres-storedprocedure.md', text: 'Executing PostgreSQL Stored Procedures' },
{ link: '/learning/solutions/database-management/postgres-reindex.md', text: 'PostgreSQL Reindex Database' },
{ link: '/learning/solutions/database-management/postgres-backup-restore.md', text: 'PostgreSQL Backup and Restore' },
{ link: '/learning/solutions/database-management/postgres-storedprocedure.md', text: 'PostgreSQL Executing Stored Procedures' },
{ link: '/learning/solutions/database-management/mongo-example.md', text: 'MongoDB Executing Commands' },
]
},
{
Expand Down
1 change: 1 addition & 0 deletions docs/learning/solutions/database-management/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ To see example content listed below check out the [Getting Started with Solution
| <img src="/assets/img/postgres-logo.png" width="30" height="30"> [Postgres - Backup and Restore](/learning/solutions/database-management/postgres-backup-restore.md) |
| <img src="/assets/img/postgres-logo.png" width="30" height="30"> [Postgres - Reindex a database](/learning/solutions/database-management/postgres-reindex.md) |
| <img src="/assets/img/postgres-logo.png" width="30" height="30"> [Postgres - Execute a Stored Procedure](/learning/solutions/database-management/postgres-storedprocedure.md) |
| <img src="/assets/img/mongodb-logo.png" width="30" height="30"> [MongoDB - Build an Example Database](/learning/solutions/database-management/postgres-storedprocedure.md) |
Comment thread
fdevans marked this conversation as resolved.
Outdated

43 changes: 43 additions & 0 deletions docs/learning/solutions/database-management/mongo-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# MongoDB - Build an Example Database

This solution demonstrates how to use the MongoDB plugin in Rundeck through a practical example job. The example creates a sample database structure that you can use to test and learn MongoDB operations within Rundeck.

## Pre-requisites & Environment Setup

- Environment setup with active Enterprise Runner
- MongoDB installed and accessible from your Enterprise Runner
- MongoDB user with appropriate permissions for database operations
- Password stored in KeyStorage (default path: keys/mongodb)
- Be sure to select a runner before starting the job. No Runners are selected by default.

## MongoDB Plugin Overview

The MongoDB plugin allows you to execute MongoDB commands directly from Rundeck jobs. Each step in the job demonstrates different capabilities of the plugin:

### Key Plugin Parameters

For specific docs on these parameters check out the [Plugin documentation](/manual/jobs/job-plugins/workflow-steps/mongodb.md). The list below explains how the default job definition is configured.

- Database Deployment: Default "MongoDB". If you are using Atlas this will need to be changed.
- MongoDB Server: Default "mongodb". The runner will use this DNS name to connect to the MongoDB Server. Adjust for your environment or ensure "mongodb" resolves to the host you want to connect to.
- Database Name: Default "ecommerce_db".
- Username: Default "admin". If you need to use a different user change this value
- Password from Key Storage: Default "keys/mongodb". If the path to your stored MongoDB password in KeyStorage is different use the selection tool to pick it.
- MongoDB Command: The MongoDB command the step will execute

## Example Job Structure

The example job demonstrates these operations in sequence, creating a sample e-commerce database:

1. Database cleanup/creation
2. Collection creation
3. Sample data insertion
4. Index creation
5. Verification query

## Troubleshooting

Common issues and their solutions:

- **Connection Failures:** Verify MongoDB host accessibility from the Enterprise Runner
- **Authentication Errors:** Check user permissions and KeyStorage path
Loading