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

$sample doesn't support variables or expression operators

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • 4.2.2
    • Aggregation Framework
    • Query Optimization

    Description

      The current $sample stage only accept a number type for the size parameter, per: https://github.com/mongodb/mongo/blob/master/src/mongo/db/pipeline/document_source_sample.cpp#L102

      It would be nice to allow variables/expressions in the same way that they are almost universally available within aggregation.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            luke.prochazka@mongodb.com Luke Prochazka
            Votes:
            3 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated: