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β()