Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-33393

The 'cursor' option is required, except for aggregate with the explain argument

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.2
    • Component/s: Aggregation Framework
    • Labels:
      None
    • ALL

      I have upgraded my MongoDB version from 3.4 to 3.6 and my PHP driver version is "1.6.8"
      Below query works fine on version 3.4 but now giving error "The 'cursor' option is required, except for aggregate with the explain argument".

       $cursor=$collection_discussion->aggregate([
                          [ '$match' => ['_id' => $discussion_id]],
                          [
                              '$project' => [
                                  'comments'=> [
                                      '$filter' => [
                                          'input'=> '$comments',
                                          'as'=> 'comment',
                                          'cond' => [ '$eq' => [ '$$comment.group_id',$group_id ] ]
                                      ]
                                  ]
                              ]
                          ],[
                              '$project' => [
                                  'comments'=> [
                                      '$slice' => [
                                          [
                                              '$slice' => [
                                                  '$comments',
                                                  [
                                                      '$subtract' => [ [ '$size' => [ '$comments' ] ], $list_count ]
                                                  ]
                                              ]
                                          ], $lastRecordsLimit
                                      ]
                                  ]
                              ]
                          ]
                      ]);
      

            Assignee:
            ramon.fernandez@mongodb.com Ramon Fernandez Marina
            Reporter:
            ggaikwad.amrut@gmail.com Amrut Gaikwad
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: