CreateCollectionOptions class
Constructors
-
CreateCollectionOptions({bool? capped, int? size, bool? autoIndexId, int? max, Map<String, dynamic>? storageEngine, Map? validator, String? validationLevel, String? validationAction, Map<String, Object>? indexOptionDefaults, CollationOptions? collation, WriteConcern? writeConcern, })
-
Properties
-
autoIndexId
→ bool?
-
Used to retrieve the serverStatus
Optional. Specify false to disable the automatic creation of an index on
the _id field.
finalinherited
-
capped
→ bool
-
To create a capped collection, specify true.
If you specify true, you must also set a maximum size in the size field.
finalinherited
-
collation
→ CollationOptions?
-
Specifies the default collation for the collection or the view.
finalinherited
-
A user-provided comment to attach to this command. Once set,
this comment appears alongside records of this command in the following
locations:
finalinherited
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
indexOptionDefaults
→ Map<String, dynamic>?
-
Allows users to specify a default configuration for indexes when creating
a collection.
The indexOptionDefaults option accepts a storageEngine document, which should take the following form:
finalinherited
-
max
→ int?
-
The maximum number of documents allowed in the capped collection.
The size limit takes precedence over this limit. If a capped collection
reaches the size limit before it reaches the maximum number of documents,
MongoDB removes old documents.
If you prefer to use the max limit, ensure that the size limit,
which is required for a capped collection, is sufficient to contain
the maximum number of documents.
finalinherited
-
pipeline
→ List?
-
An array that consists of the aggregation pipeline stage(s).
create creates the view by applying the specified pipeline to the viewOn
collection or view.
finalinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
size
→ int?
-
Specify a maximum size in bytes for a capped collection.
Once a capped collection reaches its maximum size,
MongoDB removes the older documents to make space for the new documents.
The size field is required for capped collections and ignored for other
collections. (ex. for 60KB, 60 * 1024)
finalinherited
-
storageEngine
→ Map<String, dynamic>?
-
Available for the WiredTiger storage engine only.
Allows users to specify configuration to the storage engine on a
per-collection basis when creating a collection.
The value of the storageEngine option should take the following form:
finalinherited
-
validationAction
→ String?
-
Determines whether to error on invalid documents or just warn about the
violations but allow invalid documents to be inserted.
finalinherited
-
validationLevel
→ String?
-
Determines how strictly MongoDB applies the validation rules to existing
documents during an update.
finalinherited
-
validator
→ Map?
-
Allows users to specify validation rules or expressions for the
collection. For more information, see Schema Validation.
finalinherited
-
viewOn
→ String?
-
The name of the source collection or view from which to create the view.
The name is not the full namespace of the collection or view;
i.e. does not include the database name and implies the same database as
the view to create.
You must create views in the same database as the source collection.
finalinherited
-
writeConcern
→ WriteConcern?
-
A document that expresses the write concern for the operation.
Omit to use the default write concern.
finalinherited