# getDefaultCollectionOptions

Returns the defaults that are used when a collection is created implicitly by a write command for the current/specified database. These defaults can be set using the [setDefaultCollectionOptions](https://docs.singlestore.com/cloud/reference/singlestore-kai/singlestore-extension-commands/setdefaultcollectionoptions.md) command.

## Syntax

```mongodb
db.runCommand({ getDefaultCollectionOptions: 1 });
```

## Example

The following command returns the defaults set for the current database:

```mongodb
db.runCommand({ getDefaultCollectionOptions: 1 });

```

```output

{ value: { shardKey: { _id: 1 } }, ok: 1 }

```

***

Modified at: May 10, 2023

Source: [/cloud/reference/singlestore-kai/singlestore-extension-commands/getdefaultcollectionoptions/](https://docs.singlestore.com/cloud/reference/singlestore-kai/singlestore-extension-commands/getdefaultcollectionoptions/)

(An index of the documentation is available at /llms.txt)
