0

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)]);
Elangovan
  • 3,469
  • 4
  • 31
  • 38
Abhishek_YII
  • 19
  • 1
  • 3
  • Here is the mongo query but while converting in symfony2,not able to do db.test.aggregate([ {$group: { _id: {$substr: ['$bookingdatetime', 5, 2]}, numberofbookings: {$sum: 1} }} ]) – Abhishek_YII Sep 09 '17 at 06:35
  • @lalit-agarwal can you please help in the above query. – Abhishek_YII Sep 09 '17 at 06:46

0 Answers0