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 and 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 and 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.
|
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()