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,
ReplaceOptions options)
Construct a new instance.
|
ReplaceOneModel(Bson filter,
T replacement,
UpdateOptions options)
Deprecated.
use
ReplaceOneModel(Bson, Object, ReplaceOptions) instead |
| Modifier and Type | Method and 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.
|
java.lang.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()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2010 - 2023 Adobe. All Rights Reserved