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

Views should drop 'singleBatch' if 'limit' is 1

    • Fully Compatible
    • Integration 2016-08-29

      As a special case, when transforming a find into an aggregation for a query on a view, the singleBatch option will be dropped if specified when the limit is exactly 1. This allows queries that specify {limit: 1, singleBatch: true} to be sent against a view; without this, the aggregation system would reject the transformed command.

      This allows some driver implementations of find_one() to work with views.

      Original Description

      Drivers that implement the CRUD specification may send the singleBatch option to implement methods like find_one() (for example, PyMongo does this).

      This works for the find command, but the aggregation command does not support it. This makes it impossible to perform a find_one on a view namespace, as it translates all query operations into aggregations.

            Assignee:
            kyle.suarez@mongodb.com Kyle Suarez
            Reporter:
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: