I have collection containing date field. I\'m Grouping records by week and other related fields.
This is my aggregation query:
With MongoDB 3.6
{ '$project' : { 'firstDateOfWeek': { '$dateFromString': { 'dateString': { '$concat': [ { '$toString': '$_id.year' }, '-', { '$toString': '$_id.week' } ] }, 'format': "%G-%V" } } } }