You can dynamically generate collection names that map to data to your Atlas cluster or AWS S3 Bucket. To dynamically generate collection names, specify the wildcard (*), as the value for the collection name setting in your federated database instance storage configuration.
You can use the storageSetConfig command to configure the settings for generating wildcard (*) collections.
To learn how to generate a wildcard collection in your Data Store, Select your federated database instance Cloud provider from the dropdown menu:
Generate Wildcard Collections for S3 Buckets
You can dynamically generate collection names that map to data in your S3 bucket. To dynamically generate collection names, specify the wildcard, *, as the value for the collection name setting in your federated database instance storage configuration.
You can use the storageSetConfig command to configure the settings for generating wildcard (*) collections.
To generate wildcard collections in your federated database instance storage configuration that map to data in your S3 bucket, configure the following settings in your federated database instance storage configuration:
Specify
*as the value for thedatabases.[n].collections.[n].namesetting.Specify the
collectionName()function as the value for thedatabases.[n].collections.[n].dataSources.[n].pathsetting.Optional. Specify the maximum number of collections to include in the database in the
databases.[n].maxWildcardCollectionssetting. By default, Atlas Data Federation generates up to100wildcard collections in the database.
Example
"databases" : [ { "name" : "<db-name>", "collections" : [ { "name" : "*", "dataSources" : [ { "storeName" : "<s3-store-name>", "path" : "{collectionName()}" } ] } ], "maxWildcardCollections" : <integer>, } ]
You can also use the create (Data Federation Command) administration command and the federated database instance User Interface JSON Editor to configure the settings for generating wildcard collections. You can't use the federated database instance User Interface Visual Editor to configure the settings for generating wildcard collections.
Generate Wildcard Collections for Atlas Clusters
You can dynamically generate collection names that map to data in your Atlas cluster. To dynamically generate collection names, specify the wildcard, *, as the value for the collection name setting in your federated database instance storage configuration.
You can use the storageSetConfig command to configure the settings for generating wildcard (*) collections.
For the Atlas data store, you can generate the following wildcard collections and databases in your federated database instance storage configuration:
Wildcard collections for a specific database
Wildcard databases with one wildcard collection
Note
You can also dynamically generate collection names that match a regex pattern.
To generate wildcard collections in your federated database instance storage configuration that map to data in your Atlas cluster, configure the following settings in your federated database instance storage configuration:
Specify
*as the value for thedatabases.[n].collections.[n].namefield.Omit the
databases.[n].collections.[n].dataSources.[n].collectionfield.Optional. Use the
databases.[n].collections.[n].dataSources.[n].collectionRegexfield to generate wildcard collection names that match a regex pattern.
Example
"databases" : [ { "name" : "<db-name>", "collections" : [ { "name" : "*", "dataSources" : [ { "storeName" : "<atlas-store-name>", "database" : "<atlas-db-name>", "collectionRegex" : "<regex-pattern>" } ] } ] } ]
You can also use the create (Data Federation Command) administration command and the federated database instance User Interface to configure the settings for generating wildcard collections.
To dynamically generate databases with one wildcard collection in your federated database instance storage configuration, configure the following settings in your federated database instance storage configuration:
Specify
*as the value for thedatabases.[n].namefield.Specify
*as the value for thedatabases.[n].collections.[n].namefield.Optional. Use the
databases.[n].collections.[n].dataSources.[n].collectionRegexfield to generate wildcard collection names that match a regex pattern.Example
"databases" : [ { "name" : "*", "collections" : [ { "name" : "*", "dataSources" : [ { "storeName" : "<atlas-store-name>", "collectionRegex" : "<regex-pattern>" } ] } ] } ] You can use the
create(Data Federation Command) administration command also to configure the settings for generating wildcard collection for wildcard databases. You can't use the federated database instance User Interface to configure the settings for generating wildcard collection for wildcard databases.Dynamically generated databases:
Can exist alongside explicitly defined databases. However, Atlas Data Federation won't include dynamically generated databases with names that conflict with databases that are explicitly defined in the storage configuration.
Can only be from a single Atlas cluster. Atlas Data Federation won't dynamically generate databases from multiple Atlas clusters or other data stores.