在mongodb中,我希望根据并发时间戳获得会话中最后一页的退出页面数

在mongodb中,我希望根据并发时间戳获得会话中最后一页的退出页面数,mongodb,Mongodb,我有一个“Session”集合,我希望根据并发时间戳获得退出页面的计数,其中它是会话中的最后一个页面 { “_id”:“51D0DF0B0714F3F3B0A0762092BD5993_tlpns1c2b1”, “loginId”:“-19015907”, “页数”:{ “consumermx”:{ “客户”:{ “活动收入活动”:数字长(137808683000), “memberProfile_editAccountProfile”:号码长(1378086286000), “memberDa

我有一个“Session”集合,我希望根据并发时间戳获得退出页面的计数,其中它是会话中的最后一个页面

{
“_id”:“51D0DF0B0714F3F3B0A0762092BD5993_tlpns1c2b1”,
“loginId”:“-19015907”,
“页数”:{
“consumermx”:{
“客户”:{
“活动收入活动”:数字长(137808683000),
“memberProfile_editAccountProfile”:号码长(1378086286000),
“memberDashboard_editDashboard”:数字长(137808628000)
}
}
}
}
{
“_id”:“E447A3356202AFFB2B67908895EFC191_tlpns1c6b16”,
“loginId”:“-22851219”,
“页数”:{
“consumermx”:{
“客户”:{
“item_editNewSearchByCategory”:编号长(1378086288000),
“memberProfile_editAccountProfile”:编号长(1378086345000),
“memberProfile_editPreferencesAssociation”:编号长(1378086279000),
“ssoClient_登录”:号码长(1378086225000)
}
}
}
}

以下是我尝试过但没有成功的方法:

db.Session.aggregate([
{$match:{“pages.consumermx.NFCU.memberProfile_editAccountProfile”:
{$gte:1378353600000,$lte:1378440000000},
{$sort:{“pages.consumermx.NFCU.memberProfile_editAccountProfile”:-1},
{$limit:1},
{$group:{{u id:null,计数:{$sum:1}}
])

什么是并发时间戳?我猜它应该是“curent”。我指的是时间戳的格式。例如,1378086225000表示“09/01/2013 21:43:45”,您可能需要使用聚合框架。你试过了吗?以下是我试过但没用的: