CreateCollectionOptions
public struct CreateCollectionOptions : Codable, CodingStrategyProvider
Options to use when executing a createCollection
command on a MongoDatabase
.
-
Indicates whether this will be a capped collection.
Declaration
Swift
public var capped: Bool?
-
Specifies the default collation for the collection.
Declaration
Swift
public var collation: Document?
-
Specifies the
DataCodingStrategy
to use for BSON encoding/decoding operations performed by this collection. It is the responsibility of the user to ensure that anyData
s already stored in this collection can be decoded using this strategy.Declaration
Swift
public var dataCodingStrategy: DataCodingStrategy?
-
Specifies the
DateCodingStrategy
to use for BSON encoding/decoding operations performed by this collection. It is the responsibility of the user to ensure that anyDate
s already stored in this collection can be decoded using this strategy.Declaration
Swift
public var dateCodingStrategy: DateCodingStrategy?
-
Specify a default configuration for indexes created on this collection.
Declaration
Swift
public var indexOptionDefaults: Document?
-
Maximum number of documents allowed in the collection (if capped).
Declaration
Swift
public var max: Int64?
-
Maximum size, in bytes, of this collection (if capped).
Declaration
Swift
public var size: Int64?
-
Specifies storage engine configuration for this collection.
Declaration
Swift
public var storageEngine: Document?
-
Specifies the
UUIDCodingStrategy
to use for BSON encoding/decoding operations performed by this collection. It is the responsibility of the user to ensure that anyUUID
s already stored in this collection can be decoded using this strategy.Declaration
Swift
public var uuidCodingStrategy: UUIDCodingStrategy?
-
Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted.
Declaration
Swift
public var validationAction: String?
-
Determines how strictly MongoDB applies the validation rules to existing documents during an update.
Declaration
Swift
public var validationLevel: String?
-
What validator should be used for the collection.
Declaration
Swift
public var validator: Document?
-
The name of the source collection or view from which to create the view.
Declaration
Swift
public var viewOn: String?
-
A write concern to use when executing this command. To set a read or write concern for the collection itself, retrieve the collection using
MongoDatabase.collection
.Declaration
Swift
public var writeConcern: WriteConcern?
-
init(capped:collation:dataCodingStrategy:dateCodingStrategy:indexOptionDefaults:max:pipeline:size:storageEngine:uuidCodingStrategy:validationAction:validationLevel:validator:viewOn:writeConcern:)
Convenience initializer allowing any/all parameters to be omitted or optional.
Declaration
Swift
public init( capped: Bool? = nil, collation: Document? = nil, dataCodingStrategy: DataCodingStrategy? = nil, dateCodingStrategy: DateCodingStrategy? = nil, indexOptionDefaults: Document? = nil, max: Int64? = nil, pipeline: [Document]? = nil, size: Int64? = nil, storageEngine: Document? = nil, uuidCodingStrategy: UUIDCodingStrategy? = nil, validationAction: String? = nil, validationLevel: String? = nil, validator: Document? = nil, viewOn: String? = nil, writeConcern: WriteConcern? = nil )