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

$sort doesn't work in combination with $out

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 4.4.3
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Operating System:
      ALL

      Description

      Source collection with unsorted fields:

       

      Results redirected to another database are not sorted. I suspect it's a bug.

      [{'$match': {}}, {'$sort': SON([('chrom', 1), ('start', 1), ('end', 1)])}, {'$out': {'db': 'synth_BED_out', 'coll': 'bed_3_query_res.bed'}}]

       

      Results, obtained through the cursor, are sorted. It's expected by me.

      [{'$match': {}}, {'$sort': SON([('chrom', 1), ('start', 1), ('end', 1)])}]

       

        Attachments

        1. trg_srtd_table.png
          trg_srtd_table.png
          34 kB
        2. src_unsrtd_coll.png
          src_unsrtd_coll.png
          58 kB
        3. image-2021-02-05-21-49-55-431.png
          image-2021-02-05-21-49-55-431.png
          63 kB

          Activity

            People

            Assignee:
            edwin.zhou Edwin Zhou
            Reporter:
            platon.work@gmail.com Platon workaccount
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: