I am new to mongodb and spring data, and experimenting with mongodb, is it possible to have pivot operation as mentioned pivot in mongodb using spring data. I have data of this form:
Name| SumPrice| type|year
A| 50.0| Retail|2015
B| 467.0| Online|2015
A| 1456.0| Direct|2015
B| 1149.53| Direct|2015
C| 273.20| Online|2014
C| 110.0| Direct|2014
For this I created a java class :
class SampleReport{
private String name;
private Double sumUnitPrice;
private String type;
private Integer year;
}
I want to pivot w.r.t. type and want the data of the form :
Name |Retail| Online | Direct| year
A| 50.0 | 0.0| 1456.0 | 2015
B| 0.0| 467.0| 1149.53| 2015
C| 0.0| 273.20| 110.0| 2014
The example you mentioned in the spring data web site is not clear for me or too complex to my understanding, Please lemme know how to do the same for the above example with spring-data. Any answers
Regards
Kris