Database

[{"collection_date":"2022-12-01","created_timestamp":1668177586955,"created_by":"SYSTEM","updated_timestamp":1668177586955,"updated_by":"SYSTEM"}]

Query

db.collection.aggregate([{"$addFields":{"convertedDate":{"$toDate":"$collection_date"}}},{"$addFields":{"t":{"$isoDayOfWeek":"$convertedDate"}}},{"$project":{"convertedDate":1,"startDate":{"$dateSubtract":{"startDate":"$convertedDate","unit":"day","amount":"$t"}},"endDate":{"$dateAdd":{"startDate":"$convertedDate","unit":"day","amount":{$subtract:[6,"$t"]}}}}}])

Result