I have a collection named Stock_Data_Revise_Nyse
which has some relevant data and i am making reports using jasper ireporter but when i execute this given query it only returns me value field with appropriate value and rest _id.Date,_id.Stock
returns null
.
This query is running perfectly fine in Mongo Shell.
noticed:- If i use single group by then aggregation works fine in Jasper but when i use double group by like i have used here it returns null for that field.
I have searched many forums but hardly found any answer.
Any Kind Of Help Would Be Appreciated.
{ runCommand: {
aggregate : "Stock_Data_Revise_Nyse",
pipeline : [
{$project:{Symbol_1:1,Name:1,Change:1,Date:{$substr:["$UTC_Timestmp",0,10]}}},
{$match:{"Date":"16-01-2013"}},
{$group:{
_id:{Date:"$Date",Stock:"$Symbol_1"},
value:{$sum:"$Change"}
}},
{$sort:{"value":-1}},
{$limit:5}
]
}}