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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.6.2
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Operating System:
      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

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: