FinchDBConfig class
MongoDB database configuration for the Finch framework. FinchDBConfig manages MongoDB connection settings with built-in support for authentication, replica sets, and connection string generation. This is the primary database configuration for document-based operations. Configuration priority:
- Constructor parameters (highest)
- Environment variables
- Default values (lowest) Environment variables:
- MONGO_INITDB_ROOT_USERNAME: MongoDB root username
- MONGO_INITDB_ROOT_PASSWORD: MongoDB root password
- MONGO_INITDB_ROOT_AUTH: Authentication database (default: admin)
- MONGO_CONNECTION: MongoDB host (default: localhost)
- MONGO_PORT: MongoDB port (default: 27017)
- MONGO_INITDB_DATABASE: Database name
The link property automatically generates a MongoDB connection string
in the format:
mongodb://user:pass@host:port/dbName/?authSource=authExample:
final dbConfig = FinchDBConfig(
host: 'localhost',
port: '27017',
user: 'finch_user',
pass: 'secure_password',
dbName: 'finch_db',
enable: true,
);
// Auto-generated connection string:
// mongodb://finch_user:secure_password@localhost:27017/finch_db/?authSource=admin
Constructors
Properties
- auth ↔ String
-
latefinal
- dbName ↔ String
-
latefinal
- enable ↔ bool
-
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
- host ↔ String
-
latefinal
- link → String
-
no setter
- pass ↔ String
-
latefinal
- port ↔ String
-
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- user ↔ String
-
latefinal
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
defaultLanguages
→ const Map<
String, String>