Since it's a monthly date histogram, each bucket must have a date key. That date key is the date of the beginning of the monthly bucket. For instance, 2020-11-20
is the key and the starting date of the bucket starting on that date. In that bucket, you will find all documents whose date is between 2020-11-20
and 2020-12-20
.
Same thing for the last bucket which starts on 2021-01-20
, it will contain all documents starting on that date and going through 2021-02-20
. It doesn't matter whether you have documents whose date field is specifically on those bucket key dates, those keys are just interval bounds.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…