Skip to content

Database

To report bugs, please use our SERVER JIRA project.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback

1 result found

  1. Add $sort as an array operator in the agg framework

    $filter and $map and $reduce allowed us to stop using $unwind all the time. I know $sort is likely the most computationally expensive peer function to $filter and $map but there are so many times that I have a field with an array of things (scalars or objects) and I need either the whole array in a sorted order or the first or last thing in the sort, for which I would use $arrayElemAt:[ {$sort: {input: ... }}, 0 ] . I see the $sort function signature looking almost like $filter:
    {$sort: {input: <expr that evals to array>,
    as: "gg"…

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

  • Don't see your idea?

Feedback and Knowledge Base