Class Expressions
java.lang.Object
dev.morphia.aggregation.expressions.Expressions
Defines helper methods for various expressions.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentExpression
document()
Creates a new DocumentExpression.static DocumentExpression
Creates a new DocumentExpression.static Expression
Deprecated, for removal: This API element is subject to removal in a future version.static FilterExpression
static Expression
Returns a value without parsing.static Expression
meta()
Returns the metadata associated with a document in a pipeline operations, e.g.static dev.morphia.aggregation.expressions.impls.MetaExpression
meta
(MetadataKeyword metadataKeyword) Returns the metadata associated with a document in a pipeline operations, e.g.static dev.morphia.aggregation.expressions.impls.ValueExpression
Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
document
Creates a new DocumentExpression.- Returns:
- the new expression
- Since:
- 2.3
-
document
Creates a new DocumentExpression.- Parameters:
name
- the first field nameexpression
- the first field value- Returns:
- the new expression
- Since:
- 2.3
-
field
Deprecated, for removal: This API element is subject to removal in a future version.Creates a field expression for the given value. If the value does not already start with '$', it will be prepended automatically.- Parameters:
name
- the field name- Returns:
- the new expression
-
filter
- Parameters:
input
- An expression that resolves to an array.cond
- An expression that resolves to a boolean value used to determine if an element should be included in the output array. The expression references each element of the input array individually with the variable name specified in as.- Returns:
- MongoDB documentation
- Aggregration Expression: $filter
-
literal
Returns a value without parsing. Use for values that the aggregation pipeline may interpret as an expression.- Parameters:
value
- the value- Returns:
- the new expression
- MongoDB documentation
- Aggregration Expression: $literal
-
meta
Returns the metadata associated with a document in a pipeline operations, e.g. "textScore" when performing text search.- Returns:
- the new expression
- MongoDB documentation
- Aggregration Expression: $meta
-
meta
public static dev.morphia.aggregation.expressions.impls.MetaExpression meta(MetadataKeyword metadataKeyword) Returns the metadata associated with a document in a pipeline operations, e.g. "textScore" when performing text search.- Parameters:
metadataKeyword
- the keyword to use- Returns:
- the new expression
- Since:
- 3.0
- Since server release
- 4.4
- MongoDB documentation
- Aggregration Expression: $meta
-
value
@Deprecated(since="3.0", forRemoval=true) public static dev.morphia.aggregation.expressions.impls.ValueExpression value(@Nullable Object value) Deprecated, for removal: This API element is subject to removal in a future version.Returns a value without parsing. Note that this is different fromliteral(Object)
in that the given value will dropped directly in to the pipeline for use/evaluation in whatever context the value is used.- Parameters:
value
- the value- Returns:
- the new expression
-