Type alias CreateCollectionOptions

CreateCollectionOptions: CollectionPropertiesOptions & {
    distributeShardsLike?: string;
    enforceReplicationFactor?: boolean;
    keyOptions?: CollectionKeyOptions;
    numberOfShards?: number;
    shardKeys?: string[];
    shardingStrategy?: ShardingStrategy;
    smartGraphAttribute?: string;
    smartJoinAttribute?: string;
    waitForSyncReplication?: boolean;
}

Type declaration

  • Optional distributeShardsLike?: string

    (Enterprise Edition cluster only.) If set to a collection name, sharding of the new collection will follow the rules for that collection. As long as the new collection exists, the indicated collection can not be dropped.

  • Optional enforceReplicationFactor?: boolean

    (Cluster only.) Unless set to false, the server will check whether enough replicas are available at creation time and bail out otherwise.

    Default: true

  • Optional keyOptions?: CollectionKeyOptions

    An object defining the collection's key generation.

  • Optional numberOfShards?: number

    (Cluster only.) Number of shards to distribute the collection across.

    Default: 1

  • Optional shardKeys?: string[]

    (Cluster only.) Document attributes to use to determine the target shard for each document.

    Default: ["_key"]

  • Optional shardingStrategy?: ShardingStrategy

    (Cluster only.) Sharding strategy to use.

  • Optional smartGraphAttribute?: string

    (Enterprise Edition cluster only.) Attribute used for sharding.

  • Optional smartJoinAttribute?: string

    (Enterprise Edition cluster only.) Attribute containing the shard key value of the referred-to smart join collection.

  • Optional waitForSyncReplication?: boolean

    (Cluster only.) Unless set to false, the server will wait for all replicas to create the collection before returning.

    Default: true