Package com.mongodb.bulk
Class UpdateRequest
java.lang.Object
com.mongodb.bulk.WriteRequest
com.mongodb.bulk.UpdateRequest
Deprecated.
An update to one or more documents.
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class com.mongodb.bulk.WriteRequest
WriteRequest.Type
-
Constructor Summary
ConstructorsConstructorDescriptionUpdateRequest
(BsonDocument filter, BsonValue update, WriteRequest.Type updateType) Deprecated.Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionarrayFilters
(List<BsonDocument> arrayFilters) Deprecated.Sets the array filters optionDeprecated.Sets the collation optionsDeprecated.Returns the array filters optionDeprecated.Returns the collation optionsDeprecated.Gets the query filter for the update.getType()
Deprecated.Gets the type of the write.Deprecated.Deprecated.Gets the update.boolean
isMulti()
Deprecated.Gets whether this update will update all documents matching the filter.boolean
isUpsert()
Deprecated.Gets whether this update will insert a new document if no documents match the filter.multi
(boolean isMulti) Deprecated.Sets whether this will update all documents matching the query filter.upsert
(boolean isUpsert) Deprecated.Sets whether this update will insert a new document if no documents match the filter.
-
Constructor Details
-
UpdateRequest
Deprecated.Construct a new instance.- Parameters:
filter
- the non-null query filterupdate
- the non-null update operationsupdateType
- the update type, which must be either UPDATE or REPLACE
-
-
Method Details
-
getType
Deprecated.Description copied from class:WriteRequest
Gets the type of the write.- Specified by:
getType
in classWriteRequest
- Returns:
- the type
-
getFilter
Deprecated.Gets the query filter for the update.- Returns:
- the filter
-
getUpdate
Deprecated.usegetUpdateValue()
insteadGets the update.- Returns:
- the update
-
getUpdateValue
Deprecated.Gets the update. Note: Starting with server version 4.2+, the update can be either a document or a pipeline.- Returns:
- the update
- Since:
- 3.11
-
isMulti
public boolean isMulti()Deprecated.Gets whether this update will update all documents matching the filter. The default is true.- Returns:
- whether this update will update all documents matching the filter
-
multi
Deprecated.Sets whether this will update all documents matching the query filter.- Parameters:
isMulti
- whether this will update all documents matching the query filter- Returns:
- this
-
isUpsert
public boolean isUpsert()Deprecated.Gets whether this update will insert a new document if no documents match the filter. The default is false.- Returns:
- whether this update will insert a new document if no documents match the filter
-
upsert
Deprecated.Sets whether this update will insert a new document if no documents match the filter.- Parameters:
isUpsert
- whether this update will insert a new document if no documents match the filter- Returns:
- this
-
getCollation
Deprecated.Returns the collation options- Returns:
- the collation options
- Since:
- 3.4
-
collation
Deprecated.Sets the collation optionsA null value represents the server default.
- Parameters:
collation
- the collation options to use- Returns:
- this
- Since:
- 3.4
-
arrayFilters
Deprecated.Sets the array filters option- Parameters:
arrayFilters
- the array filters, which may be null- Returns:
- this
- Since:
- 3.6
-
getArrayFilters
Deprecated.Returns the array filters option- Returns:
- the array filters, which may be null
- Since:
- 3.6
-
getUpdateValue()
instead