Package com.mongodb.client.model
Class PushOptions
java.lang.Object
com.mongodb.client.model.PushOptions
The options to apply to a $push update operator.
- Since:
- 3.1
- See Also:
- MongoDB documentation
- $push
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the position at which to add the pushed values in the array.getSlice()
Gets the slice value, which is the limit on the number of array elements allowed.getSort()
Gets the sort direction for sorting array elements that are not documents.Gets the sort direction for sorting array elements that are documents.int
hashCode()
Sets the position at which to add the pushed values in the array.Sets the limit on the number of array elements allowed.Sets the sort direction for sorting array elements that are not documents.sortDocument
(Bson sortDocument) Sets the sort direction for sorting array elements that are documents.toString()
-
Constructor Details
-
PushOptions
public PushOptions()
-
-
Method Details
-
getPosition
Gets the position at which to add the pushed values in the array.- Returns:
- the position, which may be null
- MongoDB documentation
- $position
-
position
Sets the position at which to add the pushed values in the array.- Parameters:
position
- the position- Returns:
- this
- MongoDB documentation
- $position
-
getSlice
Gets the slice value, which is the limit on the number of array elements allowed.- Returns:
- the slice value representing the limit on the number of array elements allowed
- MongoDB documentation
- $slice
-
slice
Sets the limit on the number of array elements allowed.- Parameters:
slice
- the limit- Returns:
- this
- MongoDB documentation
- $slice
-
getSort
Gets the sort direction for sorting array elements that are not documents.- Returns:
- the sort direction
- MongoDB documentation
- $sort
- reference/operator/update/sort/#sort-array-elements-that-are-not-documents
-
sort
Sets the sort direction for sorting array elements that are not documents.- Parameters:
sort
- the sort direction- Returns:
- this
- Throws:
IllegalStateException
- if sortDocument property is already set- MongoDB documentation
- $sort
- reference/operator/update/sort/#sort-array-elements-that-are-not-documents
-
getSortDocument
Gets the sort direction for sorting array elements that are documents.- Returns:
- the sort document
- MongoDB documentation
- $sort
-
sortDocument
Sets the sort direction for sorting array elements that are documents.- Parameters:
sortDocument
- the sort document- Returns:
- this
- Throws:
IllegalStateException
- if sort property is already set- MongoDB documentation
- $sort
-
equals
-
hashCode
public int hashCode() -
toString
-