MongoDB can be used to count documents per year, or per month, etc. In traditional SQL, this would be accomplished via a COUNT and “GROUP BY” clause. In MongoDB, this can be accomplished like so: db.pictures.aggregate( { “$project”: { “y”: { “$year”: “$picture_datetime.taken”, }, “m”: { “$month”: “$picture_datetime.taken”, }, } }, { “$group”: { “_id”:… Read More