Package dev.morphia.query
Class PushOptions
- java.lang.Object
-
- dev.morphia.query.PushOptions
-
public class PushOptions extends Object
The options to apply to a $push update operator.- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor Description PushOptions()Creates an empty options class
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PushOptionsoptions()Helper method to create a PushOptions instancePushOptionsposition(int position)Sets the position for the updatePushOptionsslice(int slice)Sets the slice value for the updatePushOptionssort(int sort)Sets the sort value for the updatePushOptionssort(String field, int direction)Sets the sort value for the update
-
-
-
Method Detail
-
position
public PushOptions position(int position)
Sets the position for the update- Parameters:
position- the position in the array for the update- Returns:
- this
-
slice
public PushOptions slice(int slice)
Sets the slice value for the update- Parameters:
slice- the slice value for the update- Returns:
- this
-
sort
public PushOptions sort(int sort)
Sets the sort value for the update- Parameters:
sort- the sort value for the update- Returns:
- this
-
sort
public PushOptions sort(String field, int direction)
Sets the sort value for the update- Parameters:
field- the field to sort bydirection- the direction of the sort- Returns:
- this
-
options
public static PushOptions options()
Helper method to create a PushOptions instance- Returns:
- the new PushOptions instance
-
-