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

allow limit in $filter expression

    XMLWordPrintable

    Details

    • Sprint:
      QO 2021-09-06, Query Optimization 2021-08-09, QO 2021-09-20, QO 2021-10-04, QO 2021-10-18, QO 2021-11-01, QO 2021-08-23
    • Case:

      Description

      Currently $filter expression will return all matching array elements of its input.

      This is a request to add a "limit" option which caps the number of matches returned.

      {$filter:{
          input:[1,2,3,10,11,12,15],
          cond:{$lt:["$$this", 13]},
          limit: 2
      }}
      // result
      [1,2]
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              maddie.zechar Maddie Zechar
              Reporter:
              asya Asya Kamsky
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated: