Important
Helios features are now enabled during weekly update windows and are no longer directly tied to SingleStore engine releases. Refer to the release notes to view the latest features available in your Helios cluster.
setDefaultCollectionOptions
On this page
Sets the defaults that are used when a collection is created implicitly by a write command for the current database.setDefaultCollectionOptions.
Syntax
db.runCommand({setDefaultCollectionOptions: 1value : <document>|<null>})
|
Field |
Type |
Description |
|---|---|---|
|
|
Document |
Specifies the options to set. |
Example
The following example sets default collection options for the current database:
db.runCommand({setDefaultCollectionOptions: 1,value: { rowstore: true, shardKey: { _id: 1 } },});
To update only one option from the defaults while leaving others unchanged, you may need to run multiple commands.
var options = db.runCommand({ getDefaultCollectionOptions: 1 }).value;options.shardKey = { Code: 1 };db.runCommand({ setDefaultCollectionOptions: 1, value: options });
Last modified: