T - the type of document to replace. This can be of any type for which a Codec is registeredpublic final class ReplaceOneModel<T> extends WriteModel<T>
| Constructor and Description |
|---|
ReplaceOneModel(Bson filter,
T replacement)
Construct a new instance.
|
ReplaceOneModel(Bson filter,
T replacement,
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.
|
T |
getReplacement()
Gets the document which will replace the document matching the query filter.
|
public ReplaceOneModel(Bson filter, T replacement)
filter - a document describing the query filter, which may not be null.replacement - the replacement documentpublic ReplaceOneModel(Bson filter, T replacement, UpdateOptions options)
filter - a document describing the query filter, which may not be null.replacement - the replacement documentoptions - the options to applypublic Bson getFilter()
public T getReplacement()
public UpdateOptions getOptions()