This repository is a template to create a custom mongodb_api for your system. For template usage instructions, see the template README.
This is a mongoDB Configuration API, based on the stage0_mongodb_api utility. It provides a versioned configuration as code utility for the {{product_info.product}} product.
- Docker Desktop (includes Docker Compose)
- Make which is standard on most OS's
- MongoDB Compass to verify expected configurations
The configurations here are versioned, it's important that you not change any of the existing dictionaries or types. You can update a collection configuration file to define a new version of the collection, and create a new dictionaries as needed. You can add a new version to the enumerators data file, or define new custom types as needed.
Edit the appropriate files. Then use make test
and visit http://localhost:8082. You can edit the files in place, and refresh the page to load new configurations. You may need to drop the database in order to re-test processing, but the service does not need to be restarted.
INPUT_FOLDER/
├── collections/ # Collection Configuration Files
│ ├── bot.yaml
│ ├── chain.yaml
│ ├── ...
│ └── workshop.yaml
├── data/ # Test data and Enumerators
│ ├── enumerators.json
│ ├── bot.1.0.0.1.json
│ ├── ...
│ └── workshop.1.0.0.1.yaml
└── dictionary/ # Data Dictionaries (Simple Schema)
├── types/ # Simple Schema custom types
│ ├── word.yaml
│ ├── sentence.yaml
│ └── ...
├── bot.1.0.0.1.yaml
├── ...
└── workshop.1.2.3.4.yaml
The make-test and make-prod commands both tail the API logs. You will have to press Ctrl-C to stop tailing the logs.
## Test /input configurations interactively
make test
## Build and run the container to test before making a PR
make prod
## Shut down services after testing
make down
- Open API Specifications for this API
- API curl examples if you want to do CLI based testing.
- Simple Schema standards to understand the schema language used.
- MongoDB Utility Reference has configuration details.
- {{product_info.product}} Data Catalog that initialized this repo.