Meteorjs在出版物中汇总

时间:2015-05-05 09:47:14

标签: meteor

对于这个系列:

{
    room: 'room1',
    owner: 'user1',
    time: 'time1'
},

{
    room: 'room1',
    owner: 'user1',
    time: 'time2'
},

{
    room: 'room2',
    owner: 'user1',
    time: 'time3'
},

{
    room: 'room2',
    owner: 'user1',
    time: 'time4'
},

{
    room: 'room3',
    owner: 'user1',
    time: 'time5'
},

{
    room: 'room3',
    owner: 'user1',
    time: 'time6'
}

如何发布数据以便为每个房间返回最长时间的文档:

{
    room: 'room1',
    owner: 'user1',
    time: 'time2'
},

{
    room: 'room2',
    owner: 'user1',
    time: 'time4'
},

{
    room: 'room3',
    owner: 'user1',
    time: 'time6'
}

0 个答案:

没有答案