SIENTIAPDE-1166
feat: add TTL index functionality to MongoDB activities and update requirements - Updated MongoDB class to accept TTL index duration in seconds. - Implemented create_collection_with_ttl_index method to create collections with TTL indexes. - Added environment variable for TTL index duration in connectors_config. - Updated tests to cover new TTL index functionality and ensure proper behavior. - Bumped sientia-dataops-library version to 1.3.4 in requirements.txt.
This commit is contained in:
@@ -18,7 +18,8 @@ def build_mongodb_config():
|
||||
connection_string = f'mongodb://{username}:{password}@{uri}'
|
||||
return {
|
||||
'connection_string': connection_string,
|
||||
'database_name': getenv('MONGODB_DATABASE_NAME', 'sientia')
|
||||
'database_name': getenv('MONGODB_DATABASE_NAME', 'sientia'),
|
||||
'ttl_index_seconds': int(getenv('MONGODB_TTL_INDEX_HOURS', '1')) * 3600
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user