2
我有一个负载的流星集合中的日期。目前我只是以10的限制返回它们,但我需要将它们返回到最后一周(7天)。我的问题是每天的项目数量不一样,所以我不能每天都拿同样的数字。我使用流星js。下面是一些数据的例子和代码我使用返回它:MomentJs只返回在流星的最后一周内的日期
{
_id: "a68JFTrCFabQe5qQ2",
createdAt: Tue Dec 15 2015 09:32:36 GMT+1100 (AUS Eastern Summer Time),
user: "7uXThqXFkjkMpDrcb"
}
//This data gets to the client with the following:
getDay: function(day){
return Time.find({today: day}, {limit: 10}).fetch();
}
//Instead of limiting it by 10 I need items from the last 7 days only.
谢谢!