T
- the type of document to update. In practice this doesn't actually apply to updates but is here for consistency with the other
write modelspublic final class UpdateOneModel<T> extends WriteModel<T>
Constructor | Description |
---|---|
UpdateOneModel(Bson filter,
Bson update) |
Construct a new instance.
|
UpdateOneModel(Bson filter,
Bson update,
UpdateOptions options) |
Construct a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
Bson |
getFilter() |
Gets the query filter.
|
UpdateOptions |
getOptions() |
Gets the options to apply.
|
Bson |
getUpdate() |
Gets the document specifying the updates to apply to the matching document.
|
String |
toString() |
public UpdateOneModel(Bson filter, Bson update)
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.public UpdateOneModel(Bson filter, Bson update, UpdateOptions options)
filter
- a document describing the query filter, which may not be null.update
- a document describing the update, which may not be null. The update to apply must include only update operators.options
- the options to applypublic Bson getFilter()
public Bson getUpdate()
public UpdateOptions getOptions()