Navigation

dropStore

The dropStore command removes a data store from the Atlas Data Lake storage configuration. If existing collections reference the data store you want to remove, the command fails and returns a list of the dependent collections.

db.runCommand({ dropStore: "<store-name>" })
Parameter
Type
Description
Required?
dropStore
string
Name of the data store to remove from the Atlas Data Lake storage configuration.
yes

The command prints the following output if it succeeds. If the command fails, see Troubleshoot Errors for recommended solutions.

{ "ok" : 1, "dropped" : "<store-name>" }

The following example uses the dropStore command to remove the data store myStore from the Atlas Data Lake storage configuration.

use sample
db.runCommand({ dropStore: "myStore" })

The previous command prints the following output:

{ "ok" : 1, "dropped" : "myStore" }

If the command fails, it returns one of the following errors.

Reason: The specified data store has dependent collections and can't be removed.

{
"ok" : 0,
"errmsg" : "store has dependent collections: <database.collection>,<database.collection>,<...>",
"code" : 2,
"codeName" : "BadValue"
}

Solution: First drop the dependent collections, then re-run the dropStore command.

Reason: The specified data store doesn't exist.

{
"ok" : 0,
"errmsg" : "nonexistent store",
"code" : 2,
"codeName" : "BadValue"
}

Solution: Ensure that the data store specified in the command exists in the storage configuration. You can use the listStores command to retrieve a list of valid data stores in the storage configuration.

Give Feedback