Important
New database features are no longer connected to engine versions; features are now enabled independently during scheduled update windows, and “major” and “minor” releases no longer exist in Helios. Please visit the release notes to view the latest features available in your database clusters.
getDefaultCollectionOptions
On this page
Returns the defaults that are used when a collection is created implicitly by a write command for the current/specified database.
Syntax
db.runCommand({ getDefaultCollectionOptions: 1 });
Example
The following command returns the defaults set for the current database:
db.runCommand({ getDefaultCollectionOptions: 1 });
{ value: { shardKey: { _id: 1 } }, ok: 1 }Last modified: