Database

[{"attributes":{"created":"2019-04-25T07:06:02Z"}},{"attributes":{"created":"2019-04-25T07:06:02Z"}}]

Query

db.collection.aggregate([{$group:{_id:{$year:{$toDate:"$attributes.created"}},num_publications:{$sum:1}}}])

Result