public final class UpdateRequest extends WriteRequest
WriteRequest.Type
Constructor | Description |
---|---|
UpdateRequestβ(BsonDocument filter,
BsonDocument update,
WriteRequest.Type updateType) |
Construct a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
UpdateRequest |
arrayFiltersβ(List<BsonDocument> arrayFilters) |
Sets the array filters option
|
UpdateRequest |
collationβ(Collation collation) |
Sets the collation options
|
List<BsonDocument> |
getArrayFiltersβ() |
Returns the array filters option
|
Collation |
getCollationβ() |
Returns the collation options
|
BsonDocument |
getFilterβ() |
Gets the query filter for the update.
|
WriteRequest.Type |
getTypeβ() |
Gets the type of the write.
|
BsonDocument |
getUpdateβ() |
Gets the update.
|
boolean |
isMultiβ() |
Gets whether this update will update all documents matching the filter.
|
boolean |
isUpsertβ() |
Gets whether this update will insert a new document if no documents match the filter.
|
UpdateRequest |
multiβ(boolean isMulti) |
Sets whether this will update all documents matching the query filter.
|
UpdateRequest |
upsertβ(boolean isUpsert) |
Sets whether this update will insert a new document if no documents match the filter.
|
public UpdateRequestβ(BsonDocument filter, BsonDocument update, WriteRequest.Type updateType)
filter
- the non-null query filterupdate
- the non-null update operationsupdateType
- the update type, which must be either UPDATE or REPLACEpublic WriteRequest.Type getTypeβ()
WriteRequest
getType
in class WriteRequest
public BsonDocument getFilterβ()
public BsonDocument getUpdateβ()
public boolean isMultiβ()
public UpdateRequest multiβ(boolean isMulti)
isMulti
- whether this will update all documents matching the query filterpublic boolean isUpsertβ()
public UpdateRequest upsertβ(boolean isUpsert)
isUpsert
- whether this update will insert a new document if no documents match the filterpublic Collation getCollationβ()
public UpdateRequest collationβ(Collation collation)
A null value represents the server default.
collation
- the collation options to usepublic UpdateRequest arrayFiltersβ(List<BsonDocument> arrayFilters)
arrayFilters
- the array filters, which may be nullpublic List<BsonDocument> getArrayFiltersβ()