时间:2021-07-01 10:21:17 帮助过:23人阅读
或者
Aggregation.project().and(DateOperators.DateToString.dateOf("createTime").toString("%Y-%m-%d")).as("name"),
Aggregation.group("time").count().as("count")
dateAsFormattedString()方法会默认将当前时间转为系统默认的时区
Aggregation.project().andExpression("add(createTime,28800000)").as("time"),
Aggregation.group("time").count().as("count")
Mongodb按照日期分组统计
标签:mon tor operator str pre god ssi lis count