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>
| 构造器和说明 |
|---|
ReplaceOneModel(Bson filter,
T replacement)
Construct a new instance.
|
ReplaceOneModel(Bson filter,
T replacement,
UpdateOptions options)
Construct a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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()