Database
[{car:"Toyota",seller:"Jim",buyer:"Tom",timestamp:ISODate("2020-01-01T10:05:00.000Z")},{car:"Toyota 2",seller:"Jim",buyer:"Tom",timestamp:ISODate("2022-01-01T10:05:00.000Z")},{car:"BMW",seller:"Sam",buyer:"Kate",timestamp:ISODate("2021-01-01T10:05:00.000Z")},{car:"Ford",seller:"Bob",buyer:"Tony",timestamp:ISODate("2021-01-01T10:05:00.000Z")},{car:"Honda",seller:"Bob",buyer:"John",timestamp:ISODate("2021-02-01T10:05:00.000Z")}]
Query
db.collection.aggregate([{$group:{_id:"$buyer",firstTime:{$min:"$timestamp"},count:{"$sum":1}}},{$match:{count:1}},{$group:{_id:{$dateTrunc:{date:{$toDate:"$firstTime"},unit:"month",binSize:1,timezone:"GMT"}},newCarOwners:{"$sum":1}}}])