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

Ability to use Limit() with Distinct()

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Querying
    • Labels:
    • Environment:
      all

      Description

      Ability to use Limit() with Distinct()... or any of the cursor methods for the matter (sort, count, skip, etc. although limit has the biggest impact).

      Apparently there is no simple way to currently perform the following SQL query:

      SELECT DISTINCT(myField) FROM myTable WHERE x = y LIMIT(20)

      The current Distinct() implementation only allows for bringing back ALL distinct values in the collection or matching a query, but there is no way to limit these results. This would be very convenient and there are many use cases.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                49 Vote for this issue
                Watchers:
                41 Start watching this issue

                Dates

                • Created:
                  Updated: