On this page
In MongoDB Realm, an environment represents a collection of environment values that corresponds with a stage in your development process. For example, many organizations use different environment values for Development and Production.
When you deploy a Realm app, you can specify the environment that this application represents. If you do not
specify the environment, the Realm app defaults to
Realm supports the following environments:
These values are specific to the environment that the app represents. For
example, you'd store your
Production environment values in a
production.json file in the
/environments directory, and your
Development environment values in a
development.json file. When
you specify the environment for your Realm app, Realm uses the
corresponding environment values.
Each Realm app represents a single environment in your development process.
This means that a typical development process is likely to have a minimum
of three Realm apps at any given time;
Production. If you use unique applications to test different feature
branches, you might have many versions of
apps -- one for each branch.
You can use environments in your CI/CD pipeline. You might create an
automated process to generate a new
Testing app when a developer on
your team opens a pull request to merge development work to staging.
You can use
realm-cli to automate creating a new Realm app, setting the environment to
testing, and importing
your updated app configuration.
For a complete example CI/CD pipeline that manages testing, deployment, and other tasks for a real application, see: How to Build CI/CD Pipelines for MongoDB Realm Apps using GitHub Actions.