How to Convert mongoDB Query to php
db.getCollection('xyz').aggregate({ $match: {
$and: [
{ created_at: { $gt:new ISODate("2016-07-05"), $lt:new ISODate("2016-09-05") }, id: "1" }
]
} },
{ $group: { _id : "distance", sum : { $sum: "$distance" } } });