public class UpdateOpsImpl<T> extends Object implements UpdateOperations<T>
Constructor and Description |
---|
UpdateOpsImpl(Class<T> type,
Mapper mapper) |
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) |
UpdateOperations<T> |
addAll(String fieldExpr,
List<?> values,
boolean addDups)
adds the values to an array field
|
UpdateOperations<T> |
dec(String fieldExpr)
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
|
com.mongodb.DBObject |
getOps() |
UpdateOperations<T> |
inc(String fieldExpr)
increments the numeric field by 1
|
UpdateOperations<T> |
inc(String fieldExpr,
Number value)
increments the numeric field by value (negatives are allowed)
|
boolean |
isIsolated() |
UpdateOperations<T> |
isolated()
Enables isolation (so this update happens in one shot, without yielding)
|
UpdateOperations<T> |
max(String fieldExpr,
Number value)
sets the numeric field to value if it is greater than the current value.
|
UpdateOperations<T> |
min(String fieldExpr,
Number value)
sets the numeric field to value if it is less than the current value.
|
UpdateOperations<T> |
removeAll(String fieldExpr,
List<?> values)
removes the values from the array field
|
UpdateOperations<T> |
removeAll(String fieldExpr,
Object value)
removes the value from the array field
|
UpdateOperations<T> |
removeFirst(String fieldExpr)
removes the first value from the array
|
UpdateOperations<T> |
removeLast(String fieldExpr)
removes the last value from the array
|
UpdateOperations<T> |
set(String fieldExpr,
Object value)
sets the field value
|
UpdateOperations<T> |
setOnInsert(String fieldExpr,
Object value)
sets the field on insert.
|
void |
setOps(com.mongodb.DBObject ops) |
UpdateOperations<T> |
unset(String fieldExpr)
removes the field
|
public UpdateOperations<T> enableValidation()
UpdateOperations
enableValidation
in interface UpdateOperations<T>
public UpdateOperations<T> disableValidation()
UpdateOperations
disableValidation
in interface UpdateOperations<T>
public UpdateOperations<T> isolated()
UpdateOperations
isolated
in interface UpdateOperations<T>
public boolean isIsolated()
public void setOps(com.mongodb.DBObject ops)
public com.mongodb.DBObject getOps()
public UpdateOperations<T> add(String fieldExpr, Object value)
UpdateOperations
add
in interface UpdateOperations<T>
public UpdateOperations<T> add(String fieldExpr, Object value, boolean addDups)
add
in interface UpdateOperations<T>
public UpdateOperations<T> addAll(String fieldExpr, List<?> values, boolean addDups)
UpdateOperations
addAll
in interface UpdateOperations<T>
public UpdateOperations<T> dec(String fieldExpr)
UpdateOperations
dec
in interface UpdateOperations<T>
public UpdateOperations<T> inc(String fieldExpr)
UpdateOperations
inc
in interface UpdateOperations<T>
public UpdateOperations<T> inc(String fieldExpr, Number value)
UpdateOperations
inc
in interface UpdateOperations<T>
public UpdateOperations<T> max(String fieldExpr, Number value)
UpdateOperations
max
in interface UpdateOperations<T>
public UpdateOperations<T> min(String fieldExpr, Number value)
UpdateOperations
min
in interface UpdateOperations<T>
public UpdateOperations<T> removeAll(String fieldExpr, Object value)
UpdateOperations
removeAll
in interface UpdateOperations<T>
public UpdateOperations<T> removeAll(String fieldExpr, List<?> values)
UpdateOperations
removeAll
in interface UpdateOperations<T>
public UpdateOperations<T> removeFirst(String fieldExpr)
UpdateOperations
removeFirst
in interface UpdateOperations<T>
public UpdateOperations<T> removeLast(String fieldExpr)
UpdateOperations
removeLast
in interface UpdateOperations<T>
public UpdateOperations<T> set(String fieldExpr, Object value)
UpdateOperations
set
in interface UpdateOperations<T>
public UpdateOperations<T> setOnInsert(String fieldExpr, Object value)
UpdateOperations
setOnInsert
in interface UpdateOperations<T>
public UpdateOperations<T> unset(String fieldExpr)
UpdateOperations
unset
in interface UpdateOperations<T>
Copyright © 2016. All rights reserved.