知识卡片
时间桶粒度由分组键决定
示例虽投影年/月/日/小时,实际group只用年与月,因此结果是每月邮件数。dayOfMonth表示月内日期,不是星期几;要分析周几或小时,必须选择对应字段并说明时区。投影出某个字段不等于后续已按该字段分组,按年月排序也不自动补齐没有记录的月份。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
DateBucket with each date component projected # so that these fields can be grouped on in the next stage of the pipeline "$project" : { "_id" : 0, "DateBucket" : { "year" : {"$year
参考来源
- 位置:《社交网站的数据挖掘与分析(原书第2版)》第6章《6.4 探索和可视化时序趋势》(spine104;extracted/OReilly精品图书系列共21册(《Javascript权威指南》、《机器学习:实用案例解析》、《编写可读代码的艺术》、《算法精解》等)/_epub-src/text/part0093.html;u100-ch06-035)。
- 结论依据:原文在“DateBucket”附近的定义、例子或代码支撑本卡核心说明:示例虽投影年/月/日/小时,实际group只用年与月,因此结果是每月邮件数。边界按已读前提解释;示例未执行。
- 原始内容:DateBucket with each date component projected # so that these fields can be grouped on in the next stage of the pipeline "$project" : { "_id" : 0, "DateBucket" : { "year" : {"$year