Skip to content
GitHub

Configuration

Config section: nosql:
Env prefix: LEX_NOSQL__

KeyTypeDefaultEnv VariableDescription
enabledbooltrueLEX_NOSQL__ENABLEDEnable NoSQL subsystem
driverstr"mongodb"LEX_NOSQL__DRIVERNoSQL driver name (mongodb, firestore)
mongodbMongoDBConfigdefaultsLEX_NOSQL__MONGODB__*MongoDB connection settings
firestoreFirestoreConfig | NonenullLEX_NOSQL__FIRESTORE__*Firestore settings (used when driver="firestore")
backendslist[NamedNoSQLConfig][]LEX_NOSQL__BACKENDS__*Named multi-backend entries
KeyTypeDefaultEnv VariableDescription
uristr"mongodb://localhost:27017"LEX_NOSQL__MONGODB__URIConnection URI
databasestr"lexigram"LEX_NOSQL__MONGODB__DATABASEDatabase name
max_pool_sizeint100LEX_NOSQL__MONGODB__MAX_POOL_SIZEMax connection pool size
min_pool_sizeint10LEX_NOSQL__MONGODB__MIN_POOL_SIZEMin connection pool size
server_selection_timeout_msint5000LEX_NOSQL__MONGODB__SERVER_SELECTION_TIMEOUT_MSServer selection timeout (ms)
connect_timeout_msint10000LEX_NOSQL__MONGODB__CONNECT_TIMEOUT_MSConnection timeout (ms)
socket_timeout_msint30000LEX_NOSQL__MONGODB__SOCKET_TIMEOUT_MSSocket timeout (ms)
retry_writesbooltrueLEX_NOSQL__MONGODB__RETRY_WRITESEnable write retries
retry_readsbooltrueLEX_NOSQL__MONGODB__RETRY_READSEnable read retries
read_preferencestr"primaryPreferred"LEX_NOSQL__MONGODB__READ_PREFERENCERead preference mode
write_concern_wstr | int"majority"LEX_NOSQL__MONGODB__WRITE_CONCERN_WWrite concern level
auth_sourcestr"admin"LEX_NOSQL__MONGODB__AUTH_SOURCEAuthentication database
KeyTypeDefaultEnv VariableDescription
project_idstr(required)LEX_NOSQL__FIRESTORE__PROJECT_IDGoogle Cloud project ID
credentials_jsonstr | NonenullLEX_NOSQL__FIRESTORE__CREDENTIALS_JSONService account JSON key (path or raw)
database_idstr"(default)"LEX_NOSQL__FIRESTORE__DATABASE_IDFirestore database ID
KeyTypeDefaultEnv VariableDescription
table_namestr"lexigram"LEX_NOSQL__DYNAMODB__TABLE_NAMEDefault table name
regionstr"us-east-1"LEX_NOSQL__DYNAMODB__REGIONAWS region
access_keystr | NonenullLEX_NOSQL__DYNAMODB__ACCESS_KEYAWS access key ID
secret_keystr | NonenullLEX_NOSQL__DYNAMODB__SECRET_KEYAWS secret access key
endpoint_urlstr | NonenullLEX_NOSQL__DYNAMODB__ENDPOINT_URLCustom endpoint (e.g., http://localhost:8000)
pk_fieldstr"_id"LEX_NOSQL__DYNAMODB__PK_FIELDPartition key attribute name

Named backends follow the same env pattern with an index: LEX_NOSQL__BACKENDS__0__NAME, LEX_NOSQL__BACKENDS__0__DRIVER, etc.


nosql:
driver: mongodb
mongodb:
uri: mongodb://localhost:27017
database: myapp
nosql:
driver: mongodb
mongodb:
uri: mongodb://admin:${MONGODB_PASSWORD}@cluster0.example.mongodb.net
database: myapp
max_pool_size: 50
retry_writes: true
write_concern_w: majority
nosql:
backends:
- name: primary
driver: mongodb
primary: true
mongodb:
uri: mongodb://primary:27017
database: app
- name: analytics
driver: mongodb
mongodb:
uri: mongodb://analytics:27017
database: analytics
Terminal window
export LEX_NOSQL__MONGODB__URI="mongodb://prod-cluster:27017"
export LEX_NOSQL__MONGODB__DATABASE="production_db"
export LEX_NOSQL__DRIVER="mongodb"