T - The Java type used in the updatespublic interface UpdateOperations<T>
A nicer interface to the update operations in monogodb. All these operations happen at the server and can cause the server and client version of the Entity to be different
| Modifier and Type | Method and Description |
|---|---|
UpdateOperations<T> |
add(String fieldExpr,
Object value)
adds the value to an array field
|
UpdateOperations<T> |
add(String fieldExpr,
Object value,
boolean addDups)
adds the value to an array field
|
UpdateOperations<T> |
addAll(String fieldExpr,
List<?> values,
boolean addDups)
adds the values to an array field
|
UpdateOperations<T> |
dec(String field)
Decrements the numeric field by 1
|
UpdateOperations<T> |
disableValidation()
Turns off validation (for all calls made after)
|
UpdateOperations<T> |
enableValidation()
Turns on validation (for all calls made after); by default validation is on
|
UpdateOperations<T> |
inc(String field)
Increments the numeric field by 1
|
UpdateOperations<T> |
inc(String field,
Number value)
increments the numeric field by value (negatives are allowed)
|
UpdateOperations<T> |
isolated()
Enables isolation (so this update happens in one shot, without yielding)
|
UpdateOperations<T> |
max(String field,
Number value)
Sets the numeric field to value if it is greater than the current value.
|
UpdateOperations<T> |
min(String field,
Number value)
sets the numeric field to value if it is less than the current value.
|
UpdateOperations<T> |
removeAll(String field,
List<?> values)
removes the values from the array field
|
UpdateOperations<T> |
removeAll(String field,
Object value)
removes the value from the array field
|
UpdateOperations<T> |
removeFirst(String field)
removes the first value from the array
|
UpdateOperations<T> |
removeLast(String field)
removes the last value from the array
|
UpdateOperations<T> |
set(String field,
Object value)
sets the field value
|
UpdateOperations<T> |
setOnInsert(String field,
Object value)
sets the field on insert.
|
UpdateOperations<T> |
unset(String field)
removes the field
|
UpdateOperations<T> add(String fieldExpr, Object value)
fieldExpr - the field to updatevalue - the value to addUpdateOperations<T> add(String fieldExpr, Object value, boolean addDups)
UpdateOperations<T> addAll(String fieldExpr, List<?> values, boolean addDups)
UpdateOperations<T> dec(String field)
field - the field to updateUpdateOperations<T> disableValidation()
UpdateOperations<T> enableValidation()
UpdateOperations<T> inc(String field)
field - the field to updateUpdateOperations<T> inc(String field, Number value)
field - the field to updatevalue - the value to increment byUpdateOperations<T> isolated()
UpdateOperations<T> max(String field, Number value)
field - the field to updatevalue - the value to useUpdateOperations<T> min(String field, Number value)
field - the field to updatevalue - the value to useUpdateOperations<T> removeAll(String field, Object value)
field - the field to updatevalue - the value to useUpdateOperations<T> removeAll(String field, List<?> values)
field - the field to updatevalues - the values to useUpdateOperations<T> removeFirst(String field)
field - the field to updateUpdateOperations<T> removeLast(String field)
field - the field to updateUpdateOperations<T> set(String field, Object value)
field - the field to updatevalue - the value to useUpdateOperations<T> setOnInsert(String field, Object value)
field - the field to updatevalue - the value to useUpdateOperations<T> unset(String field)
field - the field to update