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

Order by is not working in 3.2.3

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.2.3
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      The query:

      { "Keys.Queryables" : { "$in" : [/^PostType\|ArticlePost\|en_GB_/] }, "Keys.SortId" : { "$lt" : ObjectId("56d061a36afc7d277434ca87") } }
      

      The sorting order:

      {"Keys.Queryables": -1}
      

      or

      {"Keys.Queryables": 1}
      

      Notice that the documents are returned in the same order regardless of requesting ascending or descending.

      See the documents and indexes in the attached Word document.

      Show
      The query: { "Keys.Queryables" : { "$in" : [/^PostType\|ArticlePost\|en_GB_/] }, "Keys.SortId" : { "$lt" : ObjectId("56d061a36afc7d277434ca87") } } The sorting order: {"Keys.Queryables": -1} or {"Keys.Queryables": 1} Notice that the documents are returned in the same order regardless of requesting ascending or descending. See the documents and indexes in the attached Word document.

      Description

      I query on a collection with three documents, expecting to get documents back ordered by the "Keys.Queryables" field.

      This works as expected in 2.6.1, but in 3.2.3 the documents are always returned in ascending order.

        Attachments

        1. Query Bug.docx
          22 kB
        2. Query Bug with no pipe symbol.docx
          27 kB

          Issue Links

            Activity

              People

              Assignee:
              david.storch David Storch
              Reporter:
              itwebtf@saxobank.com ITWEBTF SAXOBANK
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: