|
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.ExposedFieldsAggregationOperationContext
org.springframework.data.mongodb.core.aggregation.ProjectionOperation
public class ProjectionOperation
Encapsulates the aggregation framework $project-operation. Projection of field to be used in an
Aggregation. A projection is similar to a Field inclusion/exclusion but more powerful. It can
generate new fields, change values of given field etc.
http://docs.mongodb.org/manual/reference/aggregation/project/| Nested Class Summary | |
|---|---|
static class |
ProjectionOperation.ProjectionOperationBuilder
Builder for ProjectionOperations on a field. |
| Constructor Summary | |
|---|---|
ProjectionOperation()
Creates a new empty ProjectionOperation. |
|
ProjectionOperation(Fields fields)
Creates a new ProjectionOperation including the given Fields. |
|
| Method Summary | |
|---|---|
ProjectionOperation.ProjectionOperationBuilder |
and(String name)
Creates a new ProjectionOperation.ProjectionOperationBuilder to define a projection for the field with the given name. |
ProjectionOperation |
andExclude(String... fields)
Excludes the given fields from the projection. |
ProjectionOperation |
andInclude(Fields fields)
Includes the given fields into the projection. |
ProjectionOperation |
andInclude(String... fields)
Includes the given fields into the projection. |
protected ExposedFields |
getFields()
|
com.mongodb.DBObject |
toDBObject(AggregationOperationContext context)
Turns the AggregationOperation into a DBObject by using the given
AggregationOperationContext. |
| Methods inherited from class org.springframework.data.mongodb.core.aggregation.ExposedFieldsAggregationOperationContext |
|---|
getMappedObject, getReference, getReference |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProjectionOperation()
ProjectionOperation.
public ProjectionOperation(Fields fields)
ProjectionOperation including the given Fields.
fields - must not be null.| Method Detail |
|---|
public ProjectionOperation.ProjectionOperationBuilder and(String name)
ProjectionOperation.ProjectionOperationBuilder to define a projection for the field with the given name.
name - must not be null or empty.
public ProjectionOperation andExclude(String... fields)
fields - must not be null.
public ProjectionOperation andInclude(String... fields)
fields - must not be null.
public ProjectionOperation andInclude(Fields fields)
fields - must not be null.
protected ExposedFields getFields()
getFields in class ExposedFieldsAggregationOperationContextpublic com.mongodb.DBObject toDBObject(AggregationOperationContext context)
AggregationOperationAggregationOperation into a DBObject by using the given
AggregationOperationContext.
toDBObject in interface AggregationOperation
|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||