public class UpdateOptions
extends java.lang.Object
Settings to control update operation in NitriteCollection.
NitriteCollection.update(Filter, Document, UpdateOptions)| Constructor and Description |
|---|
UpdateOptions() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isJustOnce()
Indicates if only one document will be updated or all of them.
|
boolean |
isUpsert()
Indicates if the update operation will insert a new document if it
does not find any existing document to update.
|
void |
setJustOnce(boolean justOnce)
Indicates if only one document will be updated or all of them.
|
void |
setUpsert(boolean upsert)
Indicates if the update operation will insert a new document if it
does not find any existing document to update.
|
java.lang.String |
toString() |
static UpdateOptions |
updateOptions(boolean upsert)
Creates a new
UpdateOptions. |
static UpdateOptions |
updateOptions(boolean upsert,
boolean justOnce)
Creates a new
UpdateOptions. |
public static UpdateOptions updateOptions(boolean upsert)
Creates a new UpdateOptions.
upsert - the upsert flagUpdateOptions.public static UpdateOptions updateOptions(boolean upsert, boolean justOnce)
Creates a new UpdateOptions.
upsert - the upsert flagjustOnce - the justOnce flagUpdateOptions.@Generated(value="lombok") public java.lang.String toString()
toString in class java.lang.Object@Generated(value="lombok") public boolean isUpsert()
Indicates if the update operation will insert a new document if it does not find any existing document to update.
filter fails to find a document to update.
true if a new document to insert; otherwise, false.NitriteCollection.update(Filter, Document, UpdateOptions)@Generated(value="lombok") public void setUpsert(boolean upsert)
Indicates if the update operation will insert a new document if it does not find any existing document to update.
upsert - a value indicating, if a new document to insert in case the
filter fails to find a document to update.NitriteCollection.update(Filter, Document, UpdateOptions)@Generated(value="lombok") public boolean isJustOnce()
Indicates if only one document will be updated or all of them.
true if only one document to update; otherwise, false.@Generated(value="lombok") public void setJustOnce(boolean justOnce)
Indicates if only one document will be updated or all of them.
justOne - a value indicating if only one document to update or all.