计算年初至今和月初至今并比较mongodb中的年初至今销售额和月初至今

时间:2016-08-17 08:58:30

标签: spring mongodb spring-data-mongodb mongodb-java

我想计算年初至今和月初至今,并在报告中分别比较年初至今的销售额和月初至今的销售趋势以及约1000名客户,如果有,请告诉我们。 mongodb-3.2中有很多api,因为我们在Mongodb -3.2中拥有大约5000万的销售数据。文件采用以下格式:

 if (allText.IndexOf(@"\r\n ") != -1)
 {
     allText = Regex.Replace(allText, @"\r\n ", @"\n ");                                     
     if ( allText.IndexOf(@"\n ") != -1)
     {
     }
 }

2003年的预期产量w.r.t.公司名称:

{"customerName":"C1", "transactionDate":"2000-01-01", "unitsSold":100,"revenue":1000, "companyName":"D1"}
 {"customerName":"C2", "transactionDate":"2000-01-01", "unitsSold":100,"revenue":2000, "companyName":"D2"}
{"customerName":"C3", "transactionDate":"2000-01-01", "unitsSold":100,"revenue":3000, "companyName":"D3"}
{"customerName":"C1", "transactionDate":"2001-01-01", "unitsSold":100,"revenue":4000, "companyName":"D1"}
{"customerName":"C2", "transactionDate":"2001-01-01", "unitsSold":100,"revenue":5000, "companyName":"D2"}
{"customerName":"C3", "transactionDate":"2001-01-01", "unitsSold":100,"revenue":6000, "companyName":"D3"}
{"customerName":"C1", "transactionDate":"2002-01-01", "unitsSold":100,"revenue":5000, "companyName":"D1"}
{"customerName":"C2", "transactionDate":"2002-01-01", "unitsSold":100,"revenue":4000, "companyName":"D2"}
{"customerName":"C3", "transactionDate":"2002-01-01", "unitsSold":100,"revenue":3000, "companyName":"D3"}
{"customerName":"C1", "transactionDate":"2003-01-01", "unitsSold":100,"revenue":2000, "companyName":"D1"}
{"customerName":"C2", "transactionDate":"2003-01-01", "unitsSold":100,"revenue":1000, "companyName":"D1"}

依此类推,等2002年和

我们必须计算年初至今,月初至今,销售季度和趋势w.r.t.公司名称。 我们还必须计算年初至今,月初至今,销售季度和趋势w.r.t.客户名称。

请使用mongodb-java / mongodb / spring-data-mongodb api了解如何进行此计算。 问候 克里斯

0 个答案:

没有答案