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

Sort internal arrays of a document

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Query

      Lets say I have a collection of Person documents. Each Person document contains array of Car JSON inside the Person document (i.e. the array is am attribute called "cars" within the Person documents). Now, suppose you to get the first 20 cars ordered by their color (assuming the cars have this attribute) for persons with age higher than 30 (assume Persons have "age" attribute). Imagine that there are many persons above 30 in the DB, so throwing the burden to the application is NOT feasible.

      IMO, This is a general case, that is needed whenever you want to apply a "pagination" feature in your application of documents that contains arrays...

      As I understand this is a limitation for the current MongoDB release, but maybe next versions may support this.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            yanai Yanai Franchi
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: