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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 3.6.2
    • Aggregation Framework
    • None
    • ALL

    Description

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: