For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

Deploy a Federated Database Instance Data Store

A federated database instance data store connects Atlas to a cloud storage source so you can run federated queries across your data. You can deploy a data store to AWS S3, Azure Blob Storage, Google Cloud Storage, HTTP or HTTPS endpoints, or an Atlas cluster.

To deploy a federated database instance Data Store, select your data store from the dropdown menu:

Deploy a Federated Database Instance in AWS S3

This page describes how to deploy a federated database instance for accessing data in AWS S3.

To deploy a federated database instance, you must have Project Owner access to the project.

Important

Users with Organization Owner access must add themselves as a Project Owner to the project before deploying their federated database instance.

Before deploying your federated database instance in your AWS S3 bucket, you have to complete the following steps:

  1. Create a MongoDB Atlas account, if you do not have one already.

  2. Configure the AWS CLI to access your AWS account. Alternatively, you must have access to the AWS Management Console with permission to create IAM roles.

To create a new Data Federation database using the Atlas CLI, run the following command:

atlas dataFederation create <name> [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas dataFederation create.

Deploy a Federated Database Instance in AWS S3

This page describes how to deploy a federated database instance for accessing data in AWS S3.

To deploy a federated database instance, you must have Project Owner access to the project.

Important

Users with Organization Owner access must add themselves as a Project Owner to the project before deploying their federated database instance.

Before deploying your federated database instance in your AWS S3 bucket, you have to complete the following steps:

  1. Create a MongoDB Atlas account, if you do not have one already.

  2. Configure the AWS CLI to access your AWS account. Alternatively, you must have access to the AWS Management Console with permission to create IAM roles.

1
2
3
  1. Click the Create New Federated Database dropdown

  2. Select Manual setup from the menu

4
  1. Select AWS as your cloud provider

  2. Type in your federated database instance name

  3. Click Continue

IMPORTANT: Your federated database instance name defaults to FederatedDatabaseInstance[n]. Once your federated database instance is created, you cannot rename it.

5
  • For a visual interface, click Visual.

  • For editing directly in the JSON file, click JSON Editor.

6
  1. Select the dataset for your federated database instance from the Data Sources section.

    Click Add Data Sources to select your data store.

  2. Specify your data store.

    Choose Amazon S3 to configure a federated database instance for data in AWS S3 buckets.

    Corresponds to stores.[n].provider JSON configuration setting.

  3. Select an AWS IAM role for Atlas.

    You can select an existing AWS IAM role that Atlas is authorized for from the role selection dropdown list or choose Authorize an AWS IAM Role to authorize a new role.

    If you selected an existing role that Atlas is authorized for, proceed to the next step to list your AWS S3 buckets.

    If you are authorizing Atlas for an existing role or are creating a new role, complete the following steps before proceeding to the next step:

    1. Select Authorize an AWS IAM Role to authorize a new role or select an existing role from the dropdown and click Next.

    2. Use the AWS ARN and unique External ID in the Add Atlas to the trust relationships of your AWS IAM role section to add Atlas to the trust relationships of an existing or new AWS IAM role.

      In the Atlas UI, click and expand one of the following:

      • The Create New Role with the AWS CLI shows how to use the ARN and the unique External ID to add Atlas to the trust relationships of a new AWS IAM role. Follow the steps in the Atlas UI for creating a new role. To learn more, see Create New Role with the AWS CLI.

        When authorizing a new role, if you quit the Configure a New Data Lake workflow:

        • Before validating the role, Atlas will not create the federated database instance. You can go to the Atlas Integrations page to authorize a new role. You can resume the workflow when you have the AWS IAM role ARN.

        • After validating the role, Atlas will not create the federated database instance. However, the role is available in the role selection dropdown and can be used to create a federated database instance. You do not need to authorize the role again.

      • The Add Trust Relationships to an Existing Role shows how to use the ARN and the unique External ID to add Atlas to the trust relationships of an existing AWS IAM role. Follow the steps in the Atlas UI for adding Atlas to the trust relationship to an existing role. To learn more, see Add Trust Relationships to an Existing Role .

      IMPORTANT: If you modify your custom AWS role ARN in the future, verify that the access policy for the role includes the appropriate access to the S3 resources for the federated database instance.

      For further information, see

    3. Click Next.

  4. Enter the S3 bucket information.

    1. Enter the name of your S3 bucket.

      Corresponds to stores.[n].bucket JSON configuration setting.

    2. Specify whether the bucket is Read-only or both Read and write.

      Atlas can only query Read-only buckets; if you wish to query and save query results to your S3 bucket, choose Read and write. To save query results to your S3 bucket, the role policy that grants Atlas access to your AWS resources must include the s3:PutObject and s3:DeleteObject permissions in addition to the s3:ListBucket, s3:GetObject, s3:GetObjectVersion, and s3:GetBucketLocation permissions, which grant read access. See step 4 below to learn more about assigning access policy to your AWS IAM role.

    3. Select the region of the S3 bucket.

      Corresponds to stores.[n].region JSON configuration setting.

      IMPORTANT: You can't create a federated database instance if Atlas Data Federation is unable to retrieve the region of the specified S3 bucket.

    4. Optional. Specify a prefix that Data Federation should use when searching the files in the S3 bucket. If omitted, Data Federation does a recursive search for all files from the root of the S3 bucket.

      Corresponds to stores.[n].prefix JSON configuration setting.

    5. Click Next.

  5. Assign an access policy to your AWS IAM role.

    1. Follow the steps in the Atlas user interface to assign an access policy to your AWS IAM role.

      Your role policy for read-only or read and write access should look similar to the following:

      {
      "Version": "2012-10-17",
      "Statement": [
      {
      "Effect": "Allow",
      "Action": [
      "s3:ListBucket",
      "s3:GetObject",
      "s3:GetObjectVersion",
      "s3:GetBucketLocation"
      ],
      "Resource": [
      <role arn>
      ]
      }
      ]
      }
    2. Click Next.

  6. Define the path structure for your files in the S3 bucket and click Next.

    For example:

    s3://<bucket-name>/<path>/<to>/<files>/<filename>.<file-extension>

    To add additional paths to data on your S3 bucket, click Add Data Source and enter the path. To learn more about paths, see Define Path Syntax for Data Stores.

    Corresponds to databases.[n].collections.[n].dataSources.[n].path JSON configuration setting.

  7. Create the virtual databases, collections, and views and map the databases, collections, and views to your data store.

    1. (Optional) Click the for the:

      • Database to edit the database name. Defaults to VirtualDatabase[n].

        Corresponds to databases.[n].name JSON configuration setting.

      • Collection to edit the collection name. Defaults to VirtualCollection[n].

        Corresponds to databases.[n].collections.[n].name JSON configuration setting.

      • View to edit the view name.

      You can click:

      • Add Database to add databases and collections.

      • associated with the database to add collections to the database.

      • associated with the collection to add views on the collection. To create a view, you must specify:

        • The name of the view.

        • The pipeline to apply to the view.

          The view definition pipeline cannot include the $out or the $merge stage. If the view definition includes nested pipeline stages such as $lookup or $facet, this restriction applies to those nested pipelines as well.

        To learn more about views, see:

      • associated with the database, collection, or view to remove it.

    2. Select AWS S3 from the dropdown in the Data Sources section.

    3. Drag and drop the data store to map with the collection.

      Corresponds to databases.[n].collections.[n].dataSources JSON configuration setting.

7
8

Deploy a Federated Database Instance in Microsoft Azure

This page describes how to deploy a federated database instance for accessing data in your Azure Blob Storage containers.

Before you begin, complete the following prerequisites:

To create a new Data Federation database using the Atlas CLI, run the following command:

atlas dataFederation create <name> [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas dataFederation create.

Deploy a Federated Database Instance in Microsoft Azure

This page describes how to deploy a federated database instance for accessing data in your Azure Blob Storage containers.

Before you begin, complete the following prerequisites:

1
2
3
  1. Click the Create New Federated Database dropdown.

  2. Select Manual Setup.

4

You can select AWS, Azure, or Google Cloud. Once your federated database instance is created, you can't change the cloud provider where Atlas Data Federation processes your queries.

If you are configuring a federated database instance for data in an Azure Blob Storage container, you can't choose a cloud provider that is different from the cloud provider that is hosting your data. That is, you must choose Azure.

5

Defaults to FederatedDatabaseInstance[n]. Once your federated database instance is created, you can't change its name.

6
  • For a guided experience, click Visual Editor.

  • To edit the raw JSON, click JSON Editor.

7
  1. Select the dataset for your federated database instance from the Data Sources section.

    Click Add Data Sources to select your data store.

  2. Specify your data store.

    Choose Azure to configure a federated database instance for data in Azure Blob Storage containers.

    Corresponds to stores.[n].provider JSON configuration setting.

  3. Select an Azure Service Principal for Atlas.

    You can select an existing Azure Service Principal that Atlas is authorized for from the Service Principal dropdown or choose Authorize an Azure Service Principal to authorize a new service principal.

    If you selected an existing service principal that Atlas is authorized for, proceed to the next step.

    If you are authorizing Atlas for an existing service principal or are creating a new service principal, complete the following steps before proceeding to the next step:

    1. Select Authorize an Azure Service Principal to authorize a new or existing service principal and click Continue.

      Use the Azure Service Principal AppId in the Add Atlas to your Azure Service Principal section to grant Atlas access through an existing or new Azure Service Principal.

    2. Follow the steps in the PowerShell or AzureCLI tab in the Atlas UI to create a new service prinicpal or modify an existing service principal.

    3. Enter the tenant ID and Service Principal ID in the respective fields after completing the steps in the Atlas UI.

    4. Click Validate and Finish to proceed to the next step.

  4. Configure access to your Azure Blob Storage.

    In the Configure Azure Blob Storage page, you must configure Azure Storage Account credential delegation and Storage Container access. To do these:

    1. Enter your Storage Account Resource ID in the Storage Account Credential Delegation field.

      To learn more, see Get the resource ID for a storage account.

    2. Copy and run the command from the Storage Account Credential Delegation step in your Azure PowerShell to set up the credentials delegation.

    3. Specify whether the storage container allows Read only or Read and write operations.

      Atlas can only query Read-only containers; if you wish to query and save query results to your Azure Blob Storage container, choose Read and write.

      Atlas Data Federation doesn't support writes to your Azure Blob Storage container using $out.

    4. Enter your Storage Container name.

    5. Copy and run the command shown from the Storage Container Access step in your Azure PowerShell to set up blob container access.

    6. Click Continue.

  5. Define the path structure for your files in the Azure Blob Storage container and click Next.

    1. Enter the storage path to your Azure Blob Storage container.

      For example:

      https://<storage-account>.blob.core.windows.net/<container>/<file-name>

      To add additional paths to data on your Azure Blob Storage container, click Add Data Source and enter the path. To learn more about paths, see Define Path Syntax for Data Stores.

      Corresponds to databases.[n].collections.[n].dataSources.[n].path JSON configuration setting.

    2. Optional. Specify the partition fields that Data Federation should use when searching the files in the Azure Blob Storage container and the field value type.

      If omitted, Data Federation does a recursive search for all files from the root of the Azure Blob Storage container. If you don't select a specific field value type, Data Federation adds any value in that path in all queries.

      Corresponds to stores.[n].prefix and databases.[n].collections.[n].dataSources.[n].path JSON configuration settings.

  6. Create the virtual databases, collections, and views and map the databases, collections, and views to your data store.

    1. (Optional) Click the for the:

      • Database to edit the database name. Defaults to VirtualDatabase[n].

        Corresponds to databases.[n].name JSON configuration setting.

      • Collection to edit the collection name. Defaults to VirtualCollection[n].

        Corresponds to databases.[n].collections.[n].name JSON configuration setting.

      • View to edit the view name.

      You can click:

      • Add Database to add databases and collections.

      • associated with the database to add collections to the database.

      • associated with the collection to add views on the collection. To create a view, you must specify:

        • The name of the view.

        • The pipeline to apply to the view.

          The view definition pipeline cannot include the $out or the $merge stage. If the view definition includes nested pipeline stages such as $lookup or $facet, this restriction applies to those nested pipelines as well.

        To learn more about views, see:

      • associated with the database, collection, or view to remove it.

    2. Select Azure Blob Storage from the dropdown in the Data Sources section.

    3. Drag and drop the data store to map with the collection.

      Corresponds to databases.[n].collections.[n].dataSources JSON configuration setting.

8

To add other data stores for federated queries, see:

Note

You can't create an AWS data store for running federated queries across different cloud providers.

9

Deploy a Federated Database Instance in Google Cloud

This page describes how to deploy a federated database instance for accessing data in your Google Cloud Storage buckets.

To deploy a federated database instance, you must have Project Owner access to the project.

Important

Users with Organization Owner access must add themselves as a Project Owner to the project before deploying their federated database instance.

Before you begin, you will need to:

To create a new Data Federation database using the Atlas CLI, run the following command:

atlas dataFederation create <name> [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas dataFederation create.

Deploy a Federated Database Instance in Google Cloud

This page describes how to deploy a federated database instance for accessing data in your Google Cloud Storage buckets.

To deploy a federated database instance, you must have Project Owner access to the project.

Important

Users with Organization Owner access must add themselves as a Project Owner to the project before deploying their federated database instance.

Before you begin, you will need to:

1
2
3
  1. Click the Create New Federated Database dropdown.

  2. Select Manual Setup.

4

You can select AWS, Azure, or Google Cloud. Once your federated database instance is created, you can't change the cloud provider where Atlas Data Federation processes your queries.

You must configure your federated database instance on the same cloud provider as the data stores to which your federated database instance maps.

5

Defaults to FederatedDatabaseInstance[n]. Once your federated database instance is created, you can't change its name.

6
  • For a guided experience, click Visual Editor.

  • To edit the raw JSON, click JSON Editor.

7
  1. Select the dataset for your federated database instance from the Data Sources section.

    Click Add Data Sources to select your data store.

  2. Specify your data store.

    Choose Google Cloud Storage to configure a federated database instance for data in Google Cloud Storage buckets.

    Corresponds to stores.[n].provider JSON configuration setting.

  3. Select a Google Cloud Service Account for Atlas.

    You can select an existing Google Cloud Service Account that Atlas is authorized for from the role selection dropdown list or choose Create a Google Service Account.

    If you selected an existing account that Atlas is authorized for, click Next and proceed to the next step to list your Google Cloud Storage buckets.

    If you are creating a new service account, select Create a Google Service Account and click Next.

  4. In the Configure Google Cloud Storage modal, follow the provided instructions to configure the Google Cloud CLI, then click Next.

  5. Configure Google Cloud Storage.

    1. Enter the name of your Google Cloud Storage bucket.

      Corresponds to the stores.[n].bucket JSON configuration setting.

    2. Specify whether the bucket is Read-only or both Read and write.

      Atlas can only query Read-only buckets; if you wish to query and save query results to your Google Cloud Storage bucket, choose Read and write.

    3. Select the region of the Google Cloud Storage bucket.

      Corresponds to the stores.[n].region JSON configuration setting.

      Note

      You can't create a federated database instance if Atlas Data Federation is unable to retrieve the region of the specified Google Cloud Storage bucket.

    4. Grant access to your Google Cloud project.

      1. In the Google Cloud console for the project that hosts your Google Cloud Storage bucket, navigate to IAM and Admin, then navigate to IAM.

      2. Click Grant Access. In the modal that appears, in the New principals field, enter the Google Cloud Service Account associated with your federated database instance.

      3. To grant read-only access to the bucket, apply the storage.viewer role. To grant read-write access to the bucket, additionally apply the storage.editor role.

    5. Optional. Specify a prefix that Data Federation should use when searching the files in the Google Cloud Storage bucket. If omitted, Data Federation does a recursive search for all files from the root of the Google Cloud Storage bucket.

      Corresponds to the stores.[n].prefix JSON configuration setting.

    6. Click Validate and finish.

  6. Define the path structure for your files in the Google Cloud Storage bucket and click Next.

    For example:

    https://storage.googleapis.com/<path>/<to>/<files>/<filename>.<file-extension>

    To add additional paths to data on your Google Cloud Storage bucket, click Add Data Source and enter the path. To learn more about paths, see Define Path Syntax for Data Stores.

    Corresponds to the databases.[n].collections.[n].dataSources.[n].path JSON configuration setting.

  7. Create the virtual databases, collections, and views and map the databases, collections, and views to your data store.

    1. (Optional) Click the for the:

      • Database to edit the database name. Defaults to VirtualDatabase[n].

        Corresponds to databases.[n].name JSON configuration setting.

      • Collection to edit the collection name. Defaults to VirtualCollection[n].

        Corresponds to databases.[n].collections.[n].name JSON configuration setting.

      • View to edit the view name.

      You can click:

      • Add Database to add databases and collections.

      • associated with the database to add collections to the database.

      • associated with the collection to add views on the collection. To create a view, you must specify:

        • The name of the view.

        • The pipeline to apply to the view.

          The view definition pipeline cannot include the $out or the $merge stage. If the view definition includes nested pipeline stages such as $lookup or $facet, this restriction applies to those nested pipelines as well.

        To learn more about views, see:

      • associated with the database, collection, or view to remove it.

    2. Select Google Cloud Storage from the dropdown in the Data Sources section.

    3. Drag and drop the data store to map with the collection.

      Corresponds to databases.[n].collections.[n].dataSources JSON configuration setting.

8

To add other data stores for federated queries, see:

Note

You can't connect an Azure Blob Storage data store for running federated queries across cloud providers.

9

Deploy a Federated Database Instance in an HTTP Data Store

This page describes how to deploy a federated database instance for accessing data in an HTTP data store.

To deploy a federated database instance, you must have Project Owner access to the project.

Important

Users with Organization Owner access must add themselves as a Project Owner to the project before deploying their federated database instance.

Before you begin, you will need to:

  • Create a MongoDB Atlas account, if you do not have one already.

  • Format your data store using one of the supported data formats.

    Note

    If your file format is CSV or TSV, you must include a header row in your data. See CSV and TSV for more information.

  • Make your data store accessible over the public Internet.

Important

  • If your HTTP data store is not accessible over HTTPS, you must use the JSON Editor to configure your data store. In your JSON configuration, you must set the stores.[n].allowInsecure setting to true.

  • Atlas Data Federation does not support HTTP data store URLs that require authentication.

To create a new Data Federation database using the Atlas CLI, run the following command:

atlas dataFederation create <name> [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas dataFederation create.

Deploy a Federated Database Instance in an HTTP Data Store

This page describes how to deploy a federated database instance for accessing data in an HTTP data store.

To deploy a federated database instance, you must have Project Owner access to the project.

Important

Users with Organization Owner access must add themselves as a Project Owner to the project before deploying their federated database instance.

Before you begin, you will need to:

  • Create a MongoDB Atlas account, if you do not have one already.

  • Format your data store using one of the supported data formats.

    Note

    If your file format is CSV or TSV, you must include a header row in your data. See CSV and TSV for more information.

  • Make your data store accessible over the public Internet.

Important

  • If your HTTP data store is not accessible over HTTPS, you must use the JSON Editor to configure your data store. In your JSON configuration, you must set the stores.[n].allowInsecure setting to true.

  • Atlas Data Federation does not support HTTP data store URLs that require authentication.

1
2
3
  1. Click the Create New Federated Database dropdown.

  2. Select Manual Setup.

4

You can select AWS, Azure, or Google Cloud. Once your federated database instance is created, you can't change the cloud provider where Atlas Data Federation processes your queries.

5

Defaults to FederatedDatabaseInstance[n]. Once your federated database instance is created, you can't change its name.

6
  • For a guided experience, click Visual Editor.

  • To edit the raw JSON, click JSON Editor.

7
  1. Select the dataset for your federated database instance from the Data Sources section.

    Click Add Data Sources to select your data store.

  2. Specify your data store.

    Choose HTTP(S) to configure a federated database instance for data in publicly accessible HTTP and HTTPS URLs.

    Corresponds to stores.[n].provider JSON configuration setting.

  3. Enter a name for your HTTP data store into the HTTP(S) Store Name field.

    Note

    The data store's name must be unique within your federated database instance.

    Corresponds to stores.[n].name JSON configuration setting.

  4. Enter the publicly accessible URL of the file where data is stored.

    Atlas Data Federation supports JSON, BSON, CSV, TSV, Avro (gzipped or uncompressed), Parquet, and ORC file types.

    Tip

    Click Use Sample URL to add a sample HTTP data store.

    For each additional HTTP data store that you want to add, click Add Another URL, then enter the HTTP data store URLs.

    Corresponds to stores.[n].urls JSON configuration setting.

  5. Click Next to configure virtual databases and collections.

  6. Create the virtual databases, collections, and views and map the databases, collections, and views to your data store.

    1. (Optional) Click the for the:

      • Database to edit the database name. Defaults to VirtualDatabase[n].

        Corresponds to databases.[n].name JSON configuration setting.

      • Collection to edit the collection name. Defaults to VirtualCollection[n].

        Corresponds to databases.[n].collections.[n].name JSON configuration setting.

      • View to edit the view name.

      You can click:

      • Add Database to add databases and collections.

      • associated with the database to add collections to the database.

      • associated with the collection to add views on the collection. To create a view, you must specify:

        • The name of the view.

        • The pipeline to apply to the view.

          The view definition pipeline cannot include the $out or the $merge stage. If the view definition includes nested pipeline stages such as $lookup or $facet, this restriction applies to those nested pipelines as well.

        To learn more about views, see:

      • associated with the database, collection, or view to remove it.

    2. Select HTTP from the dropdown in the Data Sources section.

    3. Drag and drop the data store to map with the collection.

      Corresponds to databases.[n].collections.[n].dataSources JSON configuration setting.

8

To add other data stores for federated queries, see:

9

Deploy a Federated Database Instance with Atlas Cluster Data

This page describes how to deploy a federated database instance for accessing data in an Atlas cluster.

To deploy a federated database instance, you must have Project Owner access to the project.

Important

Users with Organization Owner access must add themselves as a Project Owner to the project before deploying their federated database instance.

Before you begin, you will need to:

  • Create a MongoDB Atlas account, if you do not have one already.

  • Create an Atlas Cluster, if you do not have one already. Atlas Data Federation supports Atlas clusters deployed to AWS, Azure, or Google Cloud.

    Note

    To use your Atlas cluster as a data store, you must deploy it to the same project as your federated database instance.

  • Add data to at least one collection on your Atlas cluster if you have not already.

To create a new Data Federation database using the Atlas CLI, run the following command:

atlas dataFederation create <name> [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas dataFederation create.

Deploy a Federated Database Instance with Atlas Cluster Data

This page describes how to deploy a federated database instance for accessing data in an Atlas cluster.

To deploy a federated database instance, you must have Project Owner access to the project.

Important

Users with Organization Owner access must add themselves as a Project Owner to the project before deploying their federated database instance.

Before you begin, you will need to:

  • Create a MongoDB Atlas account, if you do not have one already.

  • Create an Atlas Cluster, if you do not have one already. Atlas Data Federation supports Atlas clusters deployed to AWS, Azure, or Google Cloud.

    Note

    To use your Atlas cluster as a data store, you must deploy it to the same project as your federated database instance.

  • Add data to at least one collection on your Atlas cluster if you have not already.

1
2
3
  1. Click the Create New Federated Database dropdown.

  2. Select Manual Setup.

4

You can select AWS, Azure, or Google Cloud. Once your federated database instance is created, you can't change the cloud provider where Atlas Data Federation processes your queries.

If you want to query data in an Atlas cluster, we recommend that you select that same cloud provider as the cloud provider for your cluster. To query data in object storage such as AWS S3 or Azure Blob Storage, you must select the same cloud for your federated database instance as the cloud for your object storage.

5

Defaults to FederatedDatabaseInstance[n]. Once your federated database instance is created, you can't change its name.

6
  • For a guided experience, click Visual Editor.

  • To edit the raw JSON, click JSON Editor.

7
  1. Select the dataset for your federated database instance from the Data Sources section.

    Click Add Data Sources to select your data store.

  2. Specify your data source.

    1. Choose Atlas Cluster to configure a federated database instance for data on your Atlas cluster.

      Corresponds to stores.[n].provider JSON configuration setting.

    2. Select the Atlas cluster that you want to use as a data store in the Provide Namespaces in this project section.

      Corresponds to stores.[n].clusterName JSON configuration setting.

    3. Expand the databases and select the collections that you want to add to your federated database instance.

      To filter the databases and collections, enter text into the Search database or collection field. The dialog box displays only databases and collections with names that match your search criteria.

      Corresponds to the databases.[n].collections.[n].dataSources.[n].database and databases.[n].collections.[n].dataSources.[n].collection JSON configuration settings.

    4. Optional. Specify the Cluster Read Preference settings by expanding the section.

      Corresponds to stores.[n].readPreference.

      Field Name
      Description

      Read Preference Mode

      Specifies the replica set member to which you want to route the read requests. You can choose one of the following from the dropdown:

      • primary - to route all read requests to the replica set primary

      • primaryPreferred - to route all read requests the replica set primary and to secondary members only if primary is unavailable

      • secondary - to route all read requests to the secondary members of the replica set

      • secondaryPreferred - to route all read requests to the secondary members of the replica set and the primary on sharded clusters only if secondary members are unavailable

      • nearest - to route all read requests to random eligible replica set member, irrespective of whether that member is a primary or secondary

      IMPORTANT If you add an Atlas cluster as a store, the default value is secondary.

      If you don't set anything in your federated database instance storage configuration, the default value is nearest. To learn more, see Read preference mode.

      Corresponds to stores.[n].readPreference.mode.

      TagSets

      Specifies the list of tags or tag specification documents that contain name and value pairs for the replica set member to which you want to route read requests. To learn more, see Read Preference Tag Sets.

      Corresponds to stores.[n].readPreference.tagSets.

      Maxstaleness Seconds

      Specifies the maximum replication lag, or "staleness", for reads from secondaries. To learn more, see Read Preference maxStalenessSeconds.

      Corresponds to stores.[n].readPreference.maxStalenessSeconds.

    5. Click Next.

  3. Create the virtual databases, collections, and views and map the databases, collections, and views to your data store.

    1. (Optional) Click the for the:

      • Database to edit the database name. Defaults to VirtualDatabase[n].

        Corresponds to databases.[n].name JSON configuration setting.

      • Collection to edit the collection name. Defaults to VirtualCollection[n].

        Corresponds to databases.[n].collections.[n].name JSON configuration setting.

      • View to edit the view name.

      You can click:

      • Add Database to add databases and collections.

      • associated with the database to add collections to the database.

      • associated with the collection to add views on the collection. To create a view, you must specify:

        • The name of the view.

        • The pipeline to apply to the view.

          The view definition pipeline cannot include the $out or the $merge stage. If the view definition includes nested pipeline stages such as $lookup or $facet, this restriction applies to those nested pipelines as well.

        To learn more about views, see:

      • associated with the database, collection, or view to remove it.

    2. Select Atlas Cluster from the dropdown in the Data Sources section.

    3. Drag and drop the data store to map with the collection.

      Corresponds to databases.[n].collections.[n].dataSources JSON configuration setting.

8

To add other data stores for federated queries, see:

9
Rate this page