Class CreateCollectionOptions
java.lang.Object
io.vertx.ext.mongo.CreateCollectionOptions
Options for creating a collection
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()Optional.setCollation(CollationOptions collation) Specifies the default collation for the collection.setExpireAfterSeconds(Long expireAfterSeconds) Optional.setIndexOptionDefaults(JsonObject indexOptionDefaults) Optional.setMaxDocuments(Long maxDocuments) Optional.setSizeInBytes(Long sizeInBytes) Optional.setStorageEngineOptions(JsonObject storageEngineOptions) Optional.setTimeSeriesOptions(TimeSeriesOptions timeSeriesOptions) setValidationOptions(ValidationOptions validationOptions) toJson()com.mongodb.client.model.CreateCollectionOptionsReturns the mongo-java-driver specific object.toString()
-
Constructor Details
-
CreateCollectionOptions
public CreateCollectionOptions() -
CreateCollectionOptions
-
CreateCollectionOptions
-
-
Method Details
-
toJson
-
getMaxDocuments
-
setMaxDocuments
Optional. 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.- Parameters:
maxDocuments-- Returns:
- CreateCollectionOptions
-
toMongoDriverObject
public com.mongodb.client.model.CreateCollectionOptions toMongoDriverObject()Returns the mongo-java-driver specific object.- Returns:
- com.mongodb.client.model.CreateCollectionOptions
-
setCapped
Optional. To create a capped collection, specify true. If you specify true, you must also set a maximum size in the size field.- Parameters:
capped-- Returns:
- CreateCollectionOptions
-
getCapped
-
getTimeSeriesOptions
-
setTimeSeriesOptions
-
getSizeInBytes
-
setSizeInBytes
Optional. 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.- Parameters:
sizeInBytes-- Returns:
- CreateCollectionOptions
-
getStorageEngineOptions
-
setStorageEngineOptions
Optional. 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.- Parameters:
storageEngineOptions-- Returns:
- CreateCollectionOptions
-
getIndexOptionDefaults
-
setIndexOptionDefaults
Optional. Allows users to specify a default configuration for indexes when creating a collection.- Parameters:
indexOptionDefaults-- Returns:
- CreateCollectionOptions
-
getValidationOptions
-
setValidationOptions
-
getCollation
-
setCollation
Specifies the default collation for the collection. Collation allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks.- Parameters:
collation-- Returns:
- CreateCollectionOptions
-
getExpireAfterSeconds
-
setExpireAfterSeconds
Optional. A duration indicating after how long old time-series data should be deleted. Currently, applies only to time-series collections, so if this value is set then so must the time-series options.- Parameters:
expireAfterSeconds- duration, in seconds, indicating after how long old time-series data should be deleted- Returns:
- CreateCollectionOptions
-
toString
-
equals
-
hashCode
-