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$each
to$push
boolean
int
hashCode()
slice
(int count) Propagates$slice
to$push
.Propagates$sort
to$push
.sort
(Sort.Direction direction) Propagates$sort
to$push
.Propagatesvalue(Object)
to$push
-
Method Details
-
each
Propagates$each
to$push
- Parameters:
values
-- Returns:
- never null.
-
slice
Propagates$slice
to$push
.$slice
requires the$each operator
.
If count is zero,$slice
updates the array to an empty array.
If count is negative,$slice
updates the array to contain only the lastcount
elements.
If count is positive,$slice
updates the array to contain only the firstcount
elements.- Parameters:
count
-- Returns:
- never null.
- Since:
- 1.10
-
sort
Propagates$sort
to$push
.$sort
requires the$each
operator. Forces elements to be sorted by values in given direction.- Parameters:
direction
- must not be null.- Returns:
- never null.
- Since:
- 1.10
-
sort
Propagates$sort
to$push
.$sort
requires the$each
operator. 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
-