Relative Content

Tag Archive for javascriptparse-platform

Parse aggregate pipeline to match objects with a valid pointer field

const query = new Parse.Query(“TimeSpent”); const pipeline = [ { $match: { date: { $gte: new Date(startDate), $lte: new Date(endDate) }, parent: { $exists: true } } }, { $group: { _id: ‘$staff’, minutes: { $sum: “$minutes” } } } ]; try { const results = await query.aggregate(pipeline); return results; } catch (error) { console.error(‘Error […]