Database
db={"col1":[{"name":"variable1","startTime":"variable2","endTime":"variable3","classes":"variable4","section":"variable"}],"col2":[{"name":"variable1","startTime":"variable2","endTime":"variable3","classes":"variable4","section":"variable"}]}
Query
db.col1.aggregate([{"$unionWith":{coll:"col2",pipeline:[]}},{"$group":{"_id":{"Name":"$Name","startTime":"$startTime","endTime":"$endTime"},"count":{"$sum":1},"doc":{"$first":"$$ROOT"}}},{"$match":{"$expr":{"$gt":["$count",1]}}},{"$replaceRoot":{"newRoot":"$doc"}},{"$out":"newCollectionWithDuplicates"}])