Symfony+mongodb+ODM get the records group by month , date format in db "2017-09-08"

442 views Asked by At

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)]);
0

There are 0 answers