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

Order by is not working in 3.2.3

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 3.2.3
    • Querying
    • None
    • ALL
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: