Class Update.PushOperatorBuilder
java.lang.Object
org.springframework.data.mongodb.core.query.Update.PushOperatorBuilder
- Enclosing class:
- Update
Builder for creating
$push modifiers- Author:
- Christoph Strobl, Thomas Darimont
-
Method Summary
Modifier and TypeMethodDescriptionatPosition(int position) Forces values to be added at the given position.atPosition(Update.Position position) Forces values to be added at given position.Propagates$eachto$pushbooleaninthashCode()slice(int count) Propagates$sliceto$push.Propagates$sortto$push.sort(Sort.Direction direction) Propagates$sortto$push.Propagatesvalue(Object)to$push
-
Method Details
-
each
Propagates$eachto$push- Parameters:
values-- Returns:
- never null.
-
slice
Propagates$sliceto$push.$slicerequires the$each operator.
If count is zero,$sliceupdates the array to an empty array.
If count is negative,$sliceupdates the array to contain only the lastcountelements.
If count is positive,$sliceupdates the array to contain only the firstcountelements.- Parameters:
count-- Returns:
- never null.
- Since:
- 1.10
-
sort
Propagates$sortto$push.$sortrequires the$eachoperator. Forces elements to be sorted by values in given direction.- Parameters:
direction- must not be null.- Returns:
- never null.
- Since:
- 1.10
-
sort
Propagates$sortto$push.$sortrequires the$eachoperator. Forces document elements to be sorted in given order.- Parameters:
sort- must not be null.- Returns:
- never null.
- Since:
- 1.10
-
atPosition
Forces values to be added at the given position.- Parameters:
position- the position offset. As of MongoDB 3.6 use a negative value to indicate starting from the end, counting (but not including) the last element of the array.- Returns:
- never null.
- Since:
- 1.7
-
atPosition
Forces values to be added at given position.- Parameters:
position- can be null which will be appended at the last position.- Returns:
- never null.
- Since:
- 1.7
-
value
Propagatesvalue(Object)to$push- Parameters:
value-- Returns:
- never null.
-
hashCode
public int hashCode() -
equals
-