Navigation

listStores

The listStores command lists all data stores in the Atlas Data Lake storage configuration.

Syntax

db.runCommand({ listStores: 1 })

Parameters

ParameterTypeDescriptionRequired?
listStoresint
Indicates that all data stores be listed.
Value must be 1.
yes

Output

The command prints the following output if it succeeds.

{
  "ok": 1,
  "cursor": {
    "firstBatch": [
      {
        "name": "<store-name>",
        "provider": "s3",
        "region": "<region-name>",
        "bucket": "<bucket-name>",
        "delimiter": "<delimiter>",
        "prefix": "<prefix>"
      },
      {
        "name": "<store-name>",
        "provider": "atlas",
        "clusterName": "<cluster-name>",
        "projectId": "<project-id>"
      },
      ...
    ],
    "id": NumberLong(0),
    "ns": "<database>.$cmd.listStores"
  }
}

Example

The following example uses the listStores command to list all data stores in an Atlas Data Lake storage configuration.

use sample
db.runCommand({ listStores: 1 })

The previous command prints the following:

{
  "ok": 1,
  "cursor": {
    "firstBatch": [
      {
        "name": "s3store",
        "provider": "s3",
        "region": "us-east-1",
        "bucket": "my-data-lake",
        "delimiter": "/",
        "prefix": ""
      },
      {
        "name" : "atlasStore",
        "provider" : "atlas",
        "clusterName" : "myTestCluster",
        "projectId" : "<project-id>"
      }
    ],
    "id": NumberLong(0),
    "ns": "sample.$cmd.listStores"
  }
}