Requirements
Networking
Certain ports must be accessible to connect to Formal Resources. You can listen on multiple ports simultaneously for various Resources. For accessing MongoDB, you may assign any port except 8080 (Connector’s health check port). Ensure your security groups are configured to allow traffic on the designated port.Database health check
Formal periodically assesses the health of the database. We test the connection to theadmin database (authSource and defaultauthdb are not specified by default in our generated URI).
Connect to MongoDB
mongosh
To connect usingmongosh, execute the following command:
You can access your Formal Credentials in the Control Plane.
You are free to use any preferred client.
Smart Routing
Formal MongoDB features Smart Routing, allowing the linkage of an unlimited number of Resources over the same port (e.g. 27017). Provide the name of the resource following the database name:Policy Evaluation
Formal supports the following policy evaluation stages for MongoDB:- Session: Evaluate and enforce policies at connection time
- Post-Request: Evaluate and enforce policies after data retrieval