|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.mongodb.core.aggregation.ProjectionOperation.ProjectionOperationBuilder
public static class ProjectionOperation.ProjectionOperationBuilder
Builder for ProjectionOperations on a field.
| Constructor Summary | |
|---|---|
ProjectionOperation.ProjectionOperationBuilder(String name,
ProjectionOperation operation,
org.springframework.data.mongodb.core.aggregation.ProjectionOperation.ProjectionOperationBuilder.OperationProjection previousProjection)
Creates a new ProjectionOperation.ProjectionOperationBuilder for the field with the given name on top of the given
ProjectionOperation. |
|
| Method Summary | |
|---|---|
ProjectionOperation |
as(String alias)
Allows to specify an alias for the previous projection operation. |
ProjectionOperation.ProjectionOperationBuilder |
divide(Number number)
Generates an $divide expression that divides the previously mentioned field by the given number. |
ProjectionOperation.ProjectionOperationBuilder |
minus(Number number)
Generates an $subtract expression that subtracts the given number to the previously mentioned field. |
ProjectionOperation.ProjectionOperationBuilder |
mod(Number number)
Generates an $mod expression that divides the previously mentioned field by the given number and returns
the remainder. |
ProjectionOperation.ProjectionOperationBuilder |
multiply(Number number)
Generates an $multiply expression that multiplies the given number with the previously mentioned field. |
ProjectionOperation |
nested(Fields fields)
Defines a nested field binding for the current field. |
ProjectionOperation.ProjectionOperationBuilder |
plus(Number number)
Generates an $add expression that adds the given number to the previously mentioned field. |
ProjectionOperation |
previousOperation()
Projects the result of the previous operation onto the current field. |
ProjectionOperation.ProjectionOperationBuilder |
project(String operation,
Object... values)
Adds a generic projection for the current field. |
com.mongodb.DBObject |
toDBObject(AggregationOperationContext context)
Turns the AggregationOperation into a DBObject by using the given
AggregationOperationContext. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProjectionOperation.ProjectionOperationBuilder(String name,
ProjectionOperation operation,
org.springframework.data.mongodb.core.aggregation.ProjectionOperation.ProjectionOperationBuilder.OperationProjection previousProjection)
ProjectionOperation.ProjectionOperationBuilder for the field with the given name on top of the given
ProjectionOperation.
name - must not be null or empty.operation - must not be null.previousProjection - the previous operation projection, may be null.| Method Detail |
|---|
public ProjectionOperation previousOperation()
_id as what would be held in it by default will now go into the field just projected into.
public ProjectionOperation nested(Fields fields)
fields - must not be null.
public ProjectionOperation as(String alias)
string -
public ProjectionOperation.ProjectionOperationBuilder plus(Number number)
$add expression that adds the given number to the previously mentioned field.
number -
public ProjectionOperation.ProjectionOperationBuilder minus(Number number)
$subtract expression that subtracts the given number to the previously mentioned field.
number -
public ProjectionOperation.ProjectionOperationBuilder multiply(Number number)
$multiply expression that multiplies the given number with the previously mentioned field.
number -
public ProjectionOperation.ProjectionOperationBuilder divide(Number number)
$divide expression that divides the previously mentioned field by the given number.
number -
public ProjectionOperation.ProjectionOperationBuilder mod(Number number)
$mod expression that divides the previously mentioned field by the given number and returns
the remainder.
number -
public com.mongodb.DBObject toDBObject(AggregationOperationContext context)
AggregationOperationAggregationOperation into a DBObject by using the given
AggregationOperationContext.
toDBObject in interface AggregationOperation
public ProjectionOperation.ProjectionOperationBuilder project(String operation,
Object... values)
operation - the operation key, e.g. $add.values - the values to be set for the projection operation.
|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||