how to pivot data using spring-data-mongodb

笑着哭i 提交于 2020-01-01 07:21:10

问题


I have data of this form and I referred to this link pivoting in mongodb:

    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

I want data to be transformed using spring-data-mongodb of this 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

Please lemme know how to do.

Regards

kris

来源:https://stackoverflow.com/questions/32902502/how-to-pivot-data-using-spring-data-mongodb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!