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 | Description |
---|---|
ReplaceOneModel(Bson filter,
T replacement) |
Construct a new instance.
|
ReplaceOneModel(Bson filter,
T replacement,
ReplaceOptions options) |
Construct a new instance.
|
ReplaceOneModel(Bson filter,
T replacement,
UpdateOptions options) |
Deprecated.
use
ReplaceOneModel(Bson, Object, ReplaceOptions) instead |
Modifier and Type | Method | Description |
---|---|---|
Bson |
getFilter() |
Gets the query filter.
|
UpdateOptions |
getOptions() |
Deprecated.
use
getReplaceOptions() instead |
T |
getReplacement() |
Gets the document which will replace the document matching the query filter.
|
ReplaceOptions |
getReplaceOptions() |
Gets the ReplaceOptions to apply.
|
String |
toString() |
public ReplaceOneModel(Bson filter, T replacement)
filter
- a document describing the query filter, which may not be null.replacement
- the replacement document@Deprecated public ReplaceOneModel(Bson filter, T replacement, UpdateOptions options)
ReplaceOneModel(Bson, Object, ReplaceOptions)
insteadfilter
- a document describing the query filter, which may not be null.replacement
- the replacement documentoptions
- the options to applypublic ReplaceOneModel(Bson filter, T replacement, ReplaceOptions 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()
@Deprecated public UpdateOptions getOptions()
getReplaceOptions()
insteadpublic ReplaceOptions getReplaceOptions()