Navigation

listStores

Beta

The Atlas Data Lake is available as a Beta feature. The product and the corresponding documentation may change at any time during the Beta stage. For support, see Atlas Support.

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

Syntax

db.runCommand({ listStores: 1 })

Parameters

Parameter Type Description Required?
listStores int
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": [
      {
        "s3": {
          "name": "<store-name>",
          "region": "<region-name>",
          "bucket": "<bucket-name>",
          "delimiter": "<delimiter>",
          "prefix": "<prefix>"
        }
      },
      ...
    ],
    "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": [
      {
        "s3": {
          "name": "s3store",
          "region": "us-east-1",
          "bucket": "my-data-lake",
          "delimiter": "/",
          "prefix": ""
        }
      },
      {
        "s3": {
          "name": "myStore",
          "region": "us-east-1",
          "bucket": "my-data-lake",
          "delimiter": "/",
          "prefix": "/test"
        }
      }
    ],
    "id": NumberLong(0),
    "ns": "sample.$cmd.listStores"
  }
}
←   createStore dropStore  →