This API implements index, schema, and migration management services for a MongoDB database. Schemas are described using the stage0 Simple Schema standard.
- Mongo Compass - MongoDB GUI client
- Docker - For containerized deployment
- Clone the repository:
git clone https://github.com/agile-learning-institute/stage0_mongodb_api.git
cd stage0_mongodb_api
- Install dependencies:
pipenv install
- Configure environment variables:
export MONGO_DB_NAME=your_database
export MONGO_CONNECTION_STRING=your_connection_string
export INPUT_FOLDER=path/to/configs
export AUTO_PROCESS=true
export EXIT_AFTER_PROCESSING=false
- Run the API:
pipenv run local
The API is configured through environment variables:
Variable | Description | Default |
---|---|---|
MONGO_DB_NAME |
MongoDB database name | - |
MONGO_CONNECTION_STRING |
MongoDB connection string | - |
INPUT_FOLDER |
Directory containing configurations | - |
AUTO_PROCESS |
Process configurations on startup | false |
EXIT_AFTER_PROCESSING |
Exit after processing or expose API | false |
The API provides endpoints for managing MongoDB collections, including:
- Collection configuration
- Schema management
- Index management
- Data migrations
For detailed API examples, see CURL_EXAMPLES.md.
name: sample
versions:
- version: "1.0.0.0"
testData: "sample-1.0.0.1"
addIndexes:
- name: nameIndex
keys:
userName: 1
options:
unique: true
Reference Documentation - Complete Reference documentation
We welcome contributions! Please see CONTRIBUTING.md for development guidelines and workflow.
This project is licensed under the MIT License - see the LICENSE file for details.