Package dev.morphia.aggregation
Class Projection
- java.lang.Object
-
- dev.morphia.aggregation.Projection
-
@Deprecated(since="2.0", forRemoval=true) public final class Projection extends Object
Deprecated, for removal: This API element is subject to removal in a future version.useProjectioninsteadDefines a projection for use in aggregation
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Projectionadd(Object... args)Deprecated, for removal: This API element is subject to removal in a future version.Creates an addition projectionstatic Projectiondivide(Object arg1, Object arg2)Deprecated, for removal: This API element is subject to removal in a future version.Creates a division projectionstatic Projectionexpression(String operator, Object... args)Deprecated, for removal: This API element is subject to removal in a future version.Provides access to arbitrary expressions taking an array of arguments, such as $concatList<Object>getArguments()Deprecated, for removal: This API element is subject to removal in a future version.List<Projection>getProjections()Deprecated, for removal: This API element is subject to removal in a future version.StringgetSource()Deprecated, for removal: This API element is subject to removal in a future version.StringgetTarget()Deprecated, for removal: This API element is subject to removal in a future version.booleanisSuppressed()Deprecated, for removal: This API element is subject to removal in a future version.static Projectionlist(Object... args)Deprecated, for removal: This API element is subject to removal in a future version.Creates a list projectionstatic Projectionmod(Object arg1, Object arg2)Deprecated, for removal: This API element is subject to removal in a future version.Creates a modulo projectionstatic Projectionmultiply(Object... args)Deprecated, for removal: This API element is subject to removal in a future version.Creates a multiplication projectionstatic Projectionprojection(String field)Deprecated, for removal: This API element is subject to removal in a future version.Creates a projection on a fieldstatic Projectionprojection(String field, Projection projection, Projection... subsequent)Deprecated, for removal: This API element is subject to removal in a future version.Creates a projection on a field with subsequent projects applied.static Projectionprojection(String field, String projectedField)Deprecated, for removal: This API element is subject to removal in a future version.Creates a projection on a field and renames itstatic Projectionsize(Object expression)Deprecated, for removal: This API element is subject to removal in a future version.Counts and returns the total the number of items in an arraystatic Projectionsubtract(Object arg1, Object arg2)Deprecated, for removal: This API element is subject to removal in a future version.Creates a subtraction projectionProjectionsuppress()Deprecated, for removal: This API element is subject to removal in a future version.Marks this field to be suppressed from the output of this stageStringtoString()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
-
Method Detail
-
add
public static Projection add(Object... args)
Deprecated, for removal: This API element is subject to removal in a future version.Creates an addition projection- Parameters:
args- the projection arguments- Returns:
- the projection
- MongoDB documentation
- Aggregration Expression: $add
-
divide
public static Projection divide(Object arg1, Object arg2)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a division projection- Parameters:
arg1- subtraction argumentarg2- subtraction argument- Returns:
- the projection
- MongoDB documentation
- Aggregration Expression: $divide
-
expression
public static Projection expression(String operator, Object... args)
Deprecated, for removal: This API element is subject to removal in a future version.Provides access to arbitrary expressions taking an array of arguments, such as $concat- Parameters:
operator- the operator for the projectionargs- the projection arguments- Returns:
- the projection
-
list
public static Projection list(Object... args)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a list projection- Parameters:
args- the projection arguments- Returns:
- the projection
-
mod
public static Projection mod(Object arg1, Object arg2)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a modulo projection- Parameters:
arg1- subtraction argumentarg2- subtraction argument- Returns:
- the projection
- MongoDB documentation
- Aggregration Expression: $mod
-
multiply
public static Projection multiply(Object... args)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a multiplication projection- Parameters:
args- the projection arguments- Returns:
- the projection
- MongoDB documentation
- Aggregration Expression: $multiply
-
projection
public static Projection projection(String field)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a projection on a field- Parameters:
field- the field- Returns:
- the projection
-
projection
public static Projection projection(String field, String projectedField)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a projection on a field and renames it- Parameters:
field- the fieldprojectedField- the new field name- Returns:
- the projection
-
projection
public static Projection projection(String field, Projection projection, Projection... subsequent)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a projection on a field with subsequent projects applied.- Parameters:
field- the fieldprojection- the project to applysubsequent- the other projections to apply- Returns:
- the projection
-
size
public static Projection size(Object expression)
Deprecated, for removal: This API element is subject to removal in a future version.Counts and returns the total the number of items in an array- Parameters:
expression- The argument for $size can be any expression as long as it resolves to an array.- Returns:
- the projection
- MongoDB documentation
- Aggregration Expression: $size
-
subtract
public static Projection subtract(Object arg1, Object arg2)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a subtraction projection- Parameters:
arg1- subtraction argumentarg2- subtraction argument- Returns:
- the projection
- MongoDB documentation
- Aggregration Expression: $subtract
-
getArguments
@Nullable public List<Object> getArguments()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the arguments for the projection
-
getProjections
@Nullable public List<Projection> getProjections()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- any projections applied to this field
-
getSource
@Nullable public String getSource()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the projected field name
-
getTarget
@Nullable public String getTarget()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the source field of the projection
-
isSuppressed
public boolean isSuppressed()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- true if this field is suppressed from the output
-
suppress
public Projection suppress()
Deprecated, for removal: This API element is subject to removal in a future version.Marks this field to be suppressed from the output of this stage- Returns:
- this
-
-