Package io.vertx.ext.mongo
Class CreateCollectionOptions
- java.lang.Object
-
- io.vertx.ext.mongo.CreateCollectionOptions
-
public class CreateCollectionOptions extends Object
Options for creating a collection
-
-
Constructor Summary
Constructors Constructor Description CreateCollectionOptions()
CreateCollectionOptions(JsonObject json)
CreateCollectionOptions(CreateCollectionOptions other)
-
Method Summary
-
-
-
Constructor Detail
-
CreateCollectionOptions
public CreateCollectionOptions()
-
CreateCollectionOptions
public CreateCollectionOptions(CreateCollectionOptions other)
-
CreateCollectionOptions
public CreateCollectionOptions(JsonObject json)
-
-
Method Detail
-
toJson
public JsonObject toJson()
-
getMaxDocuments
public Long getMaxDocuments()
-
setMaxDocuments
public CreateCollectionOptions setMaxDocuments(Long maxDocuments)
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
public CreateCollectionOptions setCapped(Boolean capped)
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
public Boolean getCapped()
-
getTimeSeriesOptions
public TimeSeriesOptions getTimeSeriesOptions()
-
setTimeSeriesOptions
public CreateCollectionOptions setTimeSeriesOptions(TimeSeriesOptions timeSeriesOptions)
-
getSizeInBytes
public Long getSizeInBytes()
-
setSizeInBytes
public CreateCollectionOptions setSizeInBytes(Long sizeInBytes)
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
@Nullable public JsonObject getStorageEngineOptions()
-
setStorageEngineOptions
public CreateCollectionOptions setStorageEngineOptions(@Nullable JsonObject storageEngineOptions)
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
public JsonObject getIndexOptionDefaults()
-
setIndexOptionDefaults
public CreateCollectionOptions setIndexOptionDefaults(JsonObject indexOptionDefaults)
Optional. Allows users to specify a default configuration for indexes when creating a collection.- Parameters:
indexOptionDefaults
-- Returns:
- CreateCollectionOptions
-
getValidationOptions
public ValidationOptions getValidationOptions()
-
setValidationOptions
public CreateCollectionOptions setValidationOptions(ValidationOptions validationOptions)
-
getCollation
@Nullable public CollationOptions getCollation()
-
setCollation
public CreateCollectionOptions setCollation(@Nullable CollationOptions collation)
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
public Long getExpireAfterSeconds()
-
setExpireAfterSeconds
public CreateCollectionOptions setExpireAfterSeconds(Long expireAfterSeconds)
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
-
-