public class CreateCollectionOptions
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
autoIndex |
private boolean |
capped |
private Collation |
collation |
private IndexOptionDefaults |
indexOptionDefaults |
private long |
maxDocuments |
private long |
sizeInBytes |
private Bson |
storageEngineOptions |
private java.lang.Boolean |
usePowerOf2Sizes |
private ValidationOptions |
validationOptions |
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.
|
java.lang.Boolean |
isUsePowerOf2Sizes()
Deprecated.
As of MongoDB 3.0, power of 2 sizes is ignored by the MongoDB server
|
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(java.lang.Boolean usePowerOf2Sizes)
Deprecated.
As of MongoDB 3.0, power of 2 sizes is ignored by the MongoDB server
|
CreateCollectionOptions |
validationOptions(ValidationOptions validationOptions)
Sets the validation options for documents being inserted or updated in a collection
|
private boolean autoIndex
private long maxDocuments
private boolean capped
private long sizeInBytes
private java.lang.Boolean usePowerOf2Sizes
private Bson storageEngineOptions
private IndexOptionDefaults indexOptionDefaults
private ValidationOptions validationOptions
private Collation collation
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.@Deprecated public java.lang.Boolean isUsePowerOf2Sizes()
@Deprecated public CreateCollectionOptions usePowerOf2Sizes(java.lang.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