public class CreateCollectionOptions extends Object
Constructor and Description |
---|
CreateCollectionOptions() |
Modifier and Type | Method and Description |
---|---|
CreateCollectionOptions |
autoIndex(boolean autoIndex)
Gets if auto-index is to be enabled on the collection
|
CreateCollectionOptions |
capped(boolean capped)
sets whether the collection is capped.
|
CreateCollectionOptions |
collation(Collation collation)
Sets the collation options
|
Collation |
getCollation()
Returns the collation options
|
IndexOptionDefaults |
getIndexOptionDefaults()
Gets the index option defaults for the collection.
|
long |
getMaxDocuments()
Gets the maximum number of documents allowed in a capped collection.
|
long |
getSizeInBytes()
Gets the maximum size in bytes of a capped collection.
|
Bson |
getStorageEngineOptions()
Gets the storage engine options document for the collection.
|
ValidationOptions |
getValidationOptions()
Gets the validation options for documents being inserted or updated in a collection
|
CreateCollectionOptions |
indexOptionDefaults(IndexOptionDefaults indexOptionDefaults)
Sets the index option defaults for the collection.
|
boolean |
isAutoIndex()
Gets if auto-index is enabled
|
boolean |
isCapped()
Gets whether the collection is capped.
|
Boolean |
isUsePowerOf2Sizes()
Gets whether the usePowerOf2Sizes allocation strategy is turned on for this collection.
|
CreateCollectionOptions |
maxDocuments(long maxDocuments)
Sets the maximum number of documents allowed in a capped collection.
|
CreateCollectionOptions |
sizeInBytes(long sizeInBytes)
Gets the maximum size of in bytes of a capped collection.
|
CreateCollectionOptions |
storageEngineOptions(Bson storageEngineOptions)
Sets the storage engine options document defaults for the collection
|
CreateCollectionOptions |
usePowerOf2Sizes(Boolean usePowerOf2Sizes)
Sets whether the usePowerOf2Sizes allocation strategy is turned on for this collection.
|
CreateCollectionOptions |
validationOptions(ValidationOptions validationOptions)
Sets the validation options for documents being inserted or updated in a collection
|
public boolean isAutoIndex()
public CreateCollectionOptions autoIndex(boolean autoIndex)
autoIndex
- true if auto-index is enabledpublic long getMaxDocuments()
public CreateCollectionOptions maxDocuments(long maxDocuments)
maxDocuments
- the maximum number of documents allowed in capped collectionpublic boolean isCapped()
public CreateCollectionOptions capped(boolean capped)
capped
- whether the collection is cappedpublic long getSizeInBytes()
public CreateCollectionOptions sizeInBytes(long sizeInBytes)
sizeInBytes
- the maximum size of a capped collection.public Boolean isUsePowerOf2Sizes()
public CreateCollectionOptions usePowerOf2Sizes(Boolean usePowerOf2Sizes)
usePowerOf2Sizes
- true if the usePowerOf2Sizes allocation strategy is turned on for this collectionpublic Bson getStorageEngineOptions()
public CreateCollectionOptions storageEngineOptions(Bson storageEngineOptions)
storageEngineOptions
- the storage engine optionspublic IndexOptionDefaults getIndexOptionDefaults()
public CreateCollectionOptions indexOptionDefaults(IndexOptionDefaults indexOptionDefaults)
indexOptionDefaults
- the index option defaultspublic ValidationOptions getValidationOptions()
public CreateCollectionOptions validationOptions(ValidationOptions validationOptions)
validationOptions
- the validation optionspublic Collation getCollation()
public CreateCollectionOptions collation(Collation collation)
A null value represents the server default.
collation
- the collation options to use