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.useProjection
insteadDefines a projection for use in aggregation
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Projection
add(Object... args)
Deprecated, for removal: This API element is subject to removal in a future version.Creates an addition projectionstatic Projection
divide(Object arg1, Object arg2)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a division projectionstatic 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 $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.String
getSource()
Deprecated, for removal: This API element is subject to removal in a future version.String
getTarget()
Deprecated, for removal: This API element is subject to removal in a future version.boolean
isSuppressed()
Deprecated, for removal: This API element is subject to removal in a future version.static Projection
list(Object... args)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a list projectionstatic Projection
mod(Object arg1, Object arg2)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a modulo projectionstatic Projection
multiply(Object... args)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a multiplication projectionstatic Projection
projection(String field)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a projection on a fieldstatic 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.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 itstatic 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 arraystatic Projection
subtract(Object arg1, Object arg2)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a subtraction projectionProjection
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 stageString
toString()
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
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
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
public String getSource()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the projected field name
-
getTarget
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
-
-