Package com.mongodb.client.model
Class DBCollectionFindAndModifyOptions
java.lang.Object
com.mongodb.client.model.DBCollectionFindAndModifyOptions
The oprtions for find and modify operations.
- Since:
- 3.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarrayFilters
(List<? extends com.mongodb.DBObject> arrayFilters) Sets the array filters optionbypassDocumentValidation
(Boolean bypassDocumentValidation) Sets the bypassDocumentValidationcollation
(com.mongodb.client.model.Collation collation) Sets the collationList<? extends com.mongodb.DBObject>
Returns the array filters optionReturns the bypassDocumentValidationcom.mongodb.client.model.Collation
Returns the collation optionslong
getMaxTime
(TimeUnit timeUnit) Gets the maximum execution time on the server for this operation.com.mongodb.DBObject
Returns the projectioncom.mongodb.DBObject
getSort()
Returns the sortcom.mongodb.DBObject
Returns the updatecom.mongodb.WriteConcern
Returns the writeConcernboolean
isRemove()
Returns the removeboolean
isUpsert()
Returns the upsertSets the maximum execution time on the server for this operation.projection
(com.mongodb.DBObject projection) Sets the projectionremove
(boolean remove) Sets the removeboolean
Returns the returnNewreturnNew
(boolean returnNew) Sets the returnNewsort
(com.mongodb.DBObject sort) Sets the sortupdate
(com.mongodb.DBObject update) Sets the updateupsert
(boolean upsert) Sets the upsertwriteConcern
(com.mongodb.WriteConcern writeConcern) Sets the writeConcern
-
Constructor Details
-
DBCollectionFindAndModifyOptions
public DBCollectionFindAndModifyOptions()Construct a new instance
-
-
Method Details
-
getProjection
@Nullable public com.mongodb.DBObject getProjection()Returns the projection- Returns:
- the projection
-
projection
Sets the projection- Parameters:
projection
- the projection- Returns:
- this
-
getSort
@Nullable public com.mongodb.DBObject getSort()Returns the sort- Returns:
- the sort
-
sort
Sets the sort- Parameters:
sort
- the sort- Returns:
- this
-
isRemove
public boolean isRemove()Returns the remove- Returns:
- the remove
-
remove
Sets the remove- Parameters:
remove
- the remove- Returns:
- this
-
getUpdate
@Nullable public com.mongodb.DBObject getUpdate()Returns the update- Returns:
- the update
-
update
Sets the update- Parameters:
update
- the update- Returns:
- this
-
isUpsert
public boolean isUpsert()Returns the upsert- Returns:
- the upsert
-
upsert
Sets the upsert- Parameters:
upsert
- the upsert- Returns:
- this
-
returnNew
public boolean returnNew()Returns the returnNew- Returns:
- the returnNew
-
returnNew
Sets the returnNew- Parameters:
returnNew
- the returnNew- Returns:
- this
-
getBypassDocumentValidation
Returns the bypassDocumentValidation- Returns:
- the bypassDocumentValidation
-
bypassDocumentValidation
Sets the bypassDocumentValidation- Parameters:
bypassDocumentValidation
- the bypassDocumentValidation- Returns:
- this
-
getMaxTime
Gets the maximum execution time on the server for this operation. The default is 0, which places no limit on the execution time.- Parameters:
timeUnit
- the time unit to return the result in- Returns:
- the maximum execution time in the given time unit
- MongoDB documentation
- Max Time
-
maxTime
Sets the maximum execution time on the server for this operation.- Parameters:
maxTime
- the max timetimeUnit
- the time unit, which may not be null- Returns:
- this
- MongoDB documentation
- Max Time
-
getWriteConcern
@Nullable public com.mongodb.WriteConcern getWriteConcern()Returns the writeConcern- Returns:
- the writeConcern
- Since server release
- 3.2
-
writeConcern
public DBCollectionFindAndModifyOptions writeConcern(@Nullable com.mongodb.WriteConcern writeConcern) Sets the writeConcern- Parameters:
writeConcern
- the writeConcern- Returns:
- this
- Since server release
- 3.2
-
getCollation
public com.mongodb.client.model.Collation getCollation()Returns the collation options- Returns:
- the collation options
- Since server release
- 3.4
-
collation
Sets the collation- Parameters:
collation
- the collation- Returns:
- this
- Since server release
- 3.4
-
arrayFilters
public DBCollectionFindAndModifyOptions arrayFilters(List<? extends com.mongodb.DBObject> arrayFilters) Sets the array filters option- Parameters:
arrayFilters
- the array filters, which may be null- Returns:
- this
- Since:
- 3.6
- Since server release
- 3.6
-
getArrayFilters
Returns the array filters option- Returns:
- the array filters, which may be null
- Since:
- 3.6
- Since server release
- 3.6
-