AdministrationConfiguration Files
MongoDB Configuration
Configure the MongoDB database connection settings for your Gigantics instance.
Configuration Properties
The MongoDB configuration section in your config/default.yaml file controls how Gigantics connects to the database:
mongodb:
host: localhost
port: 27017
dbname: gigantics
username: ''
password: ''Property Details
host
- Type: String
- Default:
'localhost' - Description: The hostname or IP address of your MongoDB server. Can also be a full MongoDB URI.
port
- Type: Number
- Default:
27017 - Description: The port number MongoDB is listening on.
dbname
- Type: String
- Default:
'gigantics' - Description: The name of the database Gigantics will use to store its data.
username
- Type: String
- Default:
'' - Description: The username for authentication with MongoDB (if required).
password
- Type: String
- Default:
'' - Description: The password for authentication with MongoDB (if required).
Examples
Local MongoDB Connection
mongodb:
host: localhost
port: 27017
dbname: gigantics
username: ''
password: ''Remote MongoDB Connection
mongodb:
host: mongodb.yourcompany.com
port: 27017
dbname: gigantics_prod
username: 'gigantics_user'
password: 'secure_password'MongoDB Atlas Connection
mongodb:
host: 'mongodb+srv://username:password@cluster0.example.mongodb.net/gigantics'
port: 27017
dbname: gigantics
username: ''
password: ''MongoDB with Authentication
mongodb:
host: localhost
port: 27017
dbname: gigantics
username: 'admin'
password: 'secure_admin_password'Connection URI Generation
Gigantics automatically generates the MongoDB connection URI based on your configuration:
- If
hoststarts with'mongodb://', it uses the host as the full URI - If both
usernameandpasswordare provided, it creates a URI with authentication:mongodb://username:password@host:port - Otherwise, it creates a simple URI:
mongodb://host:port
Best Practices
- Security: Always use authentication in production environments
- Backups: Ensure your MongoDB instance has proper backup procedures
- Performance: Consider MongoDB performance tuning for large datasets
- Network: Ensure the MongoDB server is accessible from the Gigantics server
- Version: Use MongoDB version 4.0 or higher as recommended
Testing Configuration Changes
After modifying MongoDB configuration, restart the application:
./gig stop
./gig startCheck the logs for any connection errors. A successful connection will show database initialization messages.