Symfony query not working for mongodb+ODM, here is the query that i am using but something wrong to with the format.
$getRecordForMonth =
$this->get('doctrine_mongodb.odm.default_aggregation_query')
->getCollection('AppBundle:project')->createAggregateQuery()
->group(['_id' => ['substr' => ['$createddt', 5, 2], 'count' => sum(1)]);