Package org.springframework.data.mongodb.core.aggregation.ProjectionOperation

Examples of org.springframework.data.mongodb.core.aggregation.ProjectionOperation.ProjectionOperationBuilder


  }

  public void arithmenticProjectionOperationWithoutAlias() {

    String fieldName = "a";
    ProjectionOperationBuilder operation = new ProjectionOperation().and(fieldName).plus(1);
    DBObject dbObject = operation.toDBObject(Aggregation.DEFAULT_CONTEXT);
    DBObject projectClause = DBObjectTestUtils.getAsDBObject(dbObject, PROJECT);
    DBObject oper = exctractOperation(fieldName, projectClause);

    assertThat(oper.containsField(ADD), is(true));
    assertThat(oper.get(ADD), is((Object) Arrays.<Object> asList("$a", 1)));
View Full Code Here

TOP

Related Classes of org.springframework.data.mongodb.core.aggregation.ProjectionOperation.ProjectionOperationBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.