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

Why do we allow empty sortBy for $top/$topN/$bottom/$bottomN?

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization

      While investigating BF-35556, I realized that we allow empty sortBy for $top/$topN/$bottom/$bottomN. But $top/$topN/$bottom/$bottomN accumulator specification says that sortBy is required. I can hardly imagine that such accumulator produces meaningful results for customers since results would not be deterministic.

      SERVER-96458 has an example in comments.

      Is it just an oversight or are there use cases?

      If it's just an oversight, can we forbid empty sortBy?

            Assignee:
            Unassigned Unassigned
            Reporter:
            yoonsoo.kim@mongodb.com Yoon Soo Kim
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: