db.getCollection("switch").aggregate([ { $match: { task: { $in: ["1cb1f8d1", "7c580d3d", "810a29dc", "b4378ac5", "d0d914b3", "db2179e1"] }, date: { $gte: ISODate("2025-02-01T00:00:00-03:00"), $lt: ISODate("2025-02-17T00:00:00-03:00") }, workspace: { $in: ["Work"] } // New filter for workspace } }, { $group: { _id: null, totalDelta: { $sum: "$delta" } } } ])