Package dev.morphia.query
Class UpdateOpsImpl<T>
- java.lang.Object
-
- dev.morphia.query.UpdateBase<T>
-
- dev.morphia.query.UpdateOpsImpl<T>
-
- Type Parameters:
T
- the type to update
- All Implemented Interfaces:
UpdateOperations<T>
@Deprecated(since="2.0", forRemoval=true) public class UpdateOpsImpl<T> extends UpdateBase<T> implements UpdateOperations<T>
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Summary
Constructors Constructor Description UpdateOpsImpl(Datastore datastore, Class<T> type, Mapper mapper)
Deprecated, for removal: This API element is subject to removal in a future version.Creates an UpdateOpsImpl for the type given.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description UpdateOperations<T>
addToSet(String field, Iterable<?> values)
Deprecated, for removal: This API element is subject to removal in a future version.adds the values to an array field if they doesn't already exist in the arrayUpdateOperations<T>
addToSet(String field, Object value)
Deprecated, for removal: This API element is subject to removal in a future version.adds the value to an array field if it doesn't already exist in the arrayUpdateOperations<T>
addToSet(String field, List<?> values)
Deprecated, for removal: This API element is subject to removal in a future version.adds the values to an array field if they doesn't already exist in the arrayUpdateOperations<T>
dec(String field)
Deprecated, for removal: This API element is subject to removal in a future version.Decrements the numeric field by 1UpdateOperations<T>
dec(String field, Number value)
Deprecated, for removal: This API element is subject to removal in a future version.Decrements the numeric field by value (must be a positive Double, Float, Long, or Integer).UpdateOperations<T>
disableValidation()
Deprecated, for removal: This API element is subject to removal in a future version.Turns off validation (for all calls made after)UpdateOperations<T>
enableValidation()
Deprecated, for removal: This API element is subject to removal in a future version.Turns on validation (for all calls made after); by default validation is onorg.bson.Document
getOps()
Deprecated, for removal: This API element is subject to removal in a future version.UpdateOperations<T>
inc(String field)
Deprecated, for removal: This API element is subject to removal in a future version.Increments the numeric field by 1UpdateOperations<T>
inc(String field, Number value)
Deprecated, for removal: This API element is subject to removal in a future version.increments the numeric field by value (negatives are allowed)UpdateOperations<T>
max(String field, Number value)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the numeric field to value if it is greater than the current value.UpdateOperations<T>
min(String field, Number value)
Deprecated, for removal: This API element is subject to removal in a future version.sets the numeric field to value if it is less than the current value.UpdateOperations<T>
push(String field, Object value)
Deprecated, for removal: This API element is subject to removal in a future version.Adds new values to an array field.UpdateOperations<T>
push(String field, Object value, PushOptions options)
Deprecated, for removal: This API element is subject to removal in a future version.Adds new values to an array field at the given positionUpdateOperations<T>
push(String field, List<?> values)
Deprecated, for removal: This API element is subject to removal in a future version.Adds new values to an array field.UpdateOperations<T>
push(String field, List<?> values, PushOptions options)
Deprecated, for removal: This API element is subject to removal in a future version.Adds new values to an array field at the given positionprotected UpdateOperations<T>
remove(String fieldExpr, boolean firstNotLast)
Deprecated, for removal: This API element is subject to removal in a future version.UpdateOperations<T>
removeAll(String field, Object value)
Deprecated, for removal: This API element is subject to removal in a future version.removes the value from the array fieldUpdateOperations<T>
removeAll(String field, List<?> values)
Deprecated, for removal: This API element is subject to removal in a future version.removes the values from the array fieldUpdateOperations<T>
removeFirst(String field)
Deprecated, for removal: This API element is subject to removal in a future version.removes the first value from the arrayUpdateOperations<T>
removeLast(String field)
Deprecated, for removal: This API element is subject to removal in a future version.removes the last value from the arrayUpdateOperations<T>
set(String field, Object value)
Deprecated, for removal: This API element is subject to removal in a future version.sets the field valueUpdateOperations<T>
setOnInsert(String field, Object value)
Deprecated, for removal: This API element is subject to removal in a future version.sets the field on insert.void
setOps(org.bson.Document ops)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the operations for this UpdateOpsImplUpdateOperations<T>
unset(String field)
Deprecated, for removal: This API element is subject to removal in a future version.removes the field-
Methods inherited from class dev.morphia.query.UpdateBase
add, getCollection, getDatastore, getQuery, getUpdates, toDocument, toString
-
-
-
-
Constructor Detail
-
UpdateOpsImpl
public UpdateOpsImpl(Datastore datastore, Class<T> type, Mapper mapper)
Deprecated, for removal: This API element is subject to removal in a future version.Creates an UpdateOpsImpl for the type given.- Parameters:
datastore
- the datastore to usetype
- the type to updatemapper
- the Mapper to use
-
-
Method Detail
-
addToSet
public UpdateOperations<T> addToSet(String field, Object value)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
adds the value to an array field if it doesn't already exist in the array- Specified by:
addToSet
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatevalue
- the value to add- Returns:
- this
-
addToSet
public UpdateOperations<T> addToSet(String field, List<?> values)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
adds the values to an array field if they doesn't already exist in the array- Specified by:
addToSet
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatevalues
- the values to add- Returns:
- this
-
addToSet
public UpdateOperations<T> addToSet(String field, Iterable<?> values)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
adds the values to an array field if they doesn't already exist in the array- Specified by:
addToSet
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatevalues
- the values to add- Returns:
- this
-
dec
public UpdateOperations<T> dec(String field)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
Decrements the numeric field by 1- Specified by:
dec
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to update- Returns:
- this
-
dec
public UpdateOperations<T> dec(String field, Number value)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
Decrements the numeric field by value (must be a positive Double, Float, Long, or Integer).- Specified by:
dec
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatevalue
- the value to decrement by- Returns:
- this
-
disableValidation
public UpdateOperations<T> disableValidation()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
Turns off validation (for all calls made after)- Specified by:
disableValidation
in interfaceUpdateOperations<T>
- Returns:
- this
-
enableValidation
public UpdateOperations<T> enableValidation()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
Turns on validation (for all calls made after); by default validation is on- Specified by:
enableValidation
in interfaceUpdateOperations<T>
- Returns:
- this
-
inc
public UpdateOperations<T> inc(String field)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
Increments the numeric field by 1- Specified by:
inc
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to update- Returns:
- this
-
inc
public UpdateOperations<T> inc(String field, Number value)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
increments the numeric field by value (negatives are allowed)- Specified by:
inc
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatevalue
- the value to increment by- Returns:
- this
-
max
public UpdateOperations<T> max(String field, Number value)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
Sets the numeric field to value if it is greater than the current value.- Specified by:
max
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatevalue
- the value to use- Returns:
- this
-
min
public UpdateOperations<T> min(String field, Number value)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
sets the numeric field to value if it is less than the current value.- Specified by:
min
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatevalue
- the value to use- Returns:
- this
-
push
public UpdateOperations<T> push(String field, Object value)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
Adds new values to an array field.- Specified by:
push
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatedvalue
- the value to add- Returns:
- this
-
push
public UpdateOperations<T> push(String field, Object value, PushOptions options)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
Adds new values to an array field at the given position- Specified by:
push
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatedvalue
- the value to addoptions
- the options to apply to the push- Returns:
- this
-
push
public UpdateOperations<T> push(String field, List<?> values)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
Adds new values to an array field.- Specified by:
push
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatedvalues
- the values to add- Returns:
- this
-
push
public UpdateOperations<T> push(String field, List<?> values, PushOptions options)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
Adds new values to an array field at the given position- Specified by:
push
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatedvalues
- the values to addoptions
- the options to apply to the push- Returns:
- this
-
removeAll
public UpdateOperations<T> removeAll(String field, Object value)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
removes the value from the array field- Specified by:
removeAll
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatevalue
- the value to use- Returns:
- this
-
removeAll
public UpdateOperations<T> removeAll(String field, List<?> values)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
removes the values from the array field- Specified by:
removeAll
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatevalues
- the values to use- Returns:
- this
-
removeFirst
public UpdateOperations<T> removeFirst(String field)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
removes the first value from the array- Specified by:
removeFirst
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to update- Returns:
- this
-
removeLast
public UpdateOperations<T> removeLast(String field)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
removes the last value from the array- Specified by:
removeLast
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to update- Returns:
- this
-
set
public UpdateOperations<T> set(String field, Object value)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
sets the field value- Specified by:
set
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatevalue
- the value to use- Returns:
- this
-
setOnInsert
public UpdateOperations<T> setOnInsert(String field, Object value)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
sets the field on insert.- Specified by:
setOnInsert
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to updatevalue
- the value to use- Returns:
- this
-
unset
public UpdateOperations<T> unset(String field)
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:UpdateOperations
removes the field- Specified by:
unset
in interfaceUpdateOperations<T>
- Parameters:
field
- the field to update- Returns:
- this
-
getOps
public org.bson.Document getOps()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the operations listed
-
setOps
public void setOps(org.bson.Document ops)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the operations for this UpdateOpsImpl- Parameters:
ops
- the operations
-
remove
protected UpdateOperations<T> remove(String fieldExpr, boolean firstNotLast)
Deprecated, for removal: This API element is subject to removal in a future version.
-
-