Examples of Aggregation


Examples of org.springframework.data.mongodb.core.aggregation.Aggregation

        .and("dateValue").extractDayOfWeek().as("dayOfWeek") //
        .andExpression("dateValue + 86400000").extractDayOfYear().as("dayOfYearPlus1Day") //
        .andExpression("dateValue + 86400000").project("dayOfYear").as("dayOfYearPlus1DayManually") //
    ;

    Aggregation agg = newAggregation(dateProjection);
    AggregationResults<DBObject> result = mongoTemplate.aggregate(agg, ObjectWithDate.class, DBObject.class);

    assertThat(result.getMappedResults(), hasSize(1));
    DBObject dbo = result.getMappedResults().get(0);
View Full Code Here

Examples of org.springframework.data.mongodb.core.aggregation.Aggregation

    items.add( new Item(2, 42.0, "Item #2") );
    order.setItems(items);
    repo.save(order);

    // when
    Aggregation agg =  newAggregation(
        project("items").andExclude("_id")
        );
    AggregationResults<Order> result =  template.aggregate(agg, Order.class, Order.class);
   
   
View Full Code Here

Examples of org.springframework.data.mongodb.core.aggregation.Aggregation

    items.add( new Item(2, 42.0, "Item #2") );
    order.setItems(items);
    repo.save(order);

    // when
    Aggregation agg =  newAggregation(
        project("items").andExclude("_id")
        );
    AggregationResults<Order> result =  template.aggregate(agg, Order.class, Order.class);
   
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.