fix: preserve $meta direction in [field, direction] sort pair

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • 2
    • 2
    • Not Needed
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      spokodev has created PR #4988: fix: preserve $meta direction in [field, direction] sort pair in node-mongodb-native
      Implementation provided by the external reporter looks accurate. Tuple format of [Sort, SortDirection] fails on a valid member provided as the SortDirection { $meta: ... }

      Use Case

      As a driver user
      I want to be able to sort by meta when providing sort pairs of field & direction 
      So that I can leverage textscore sorting appropriately

      User Experience

      • Cursor sorts should be { $meta } aware as a sort direction when doing a sort off of pair values (e.g: public entry points of FindCursor.sort())
      • Today: When trying to sort using $meta, sortdirection is essentially ignored (the sort semantics of a textscore are ignored entirely)
        Expected behaviour: Textscore should be honoured with a sort pair, not ignored as a consequence of wrapping the value in an array (improperly) when passed to prepareDirection

      Dependencies

      • N/A

      Risks/Unknowns

      • None

      Acceptance Criteria

      Implementation Requirements

      •  Support meta in sortDirection

      Testing Requirements

      • Regression test for meta in sort direction should be added

      Documentation Requirements

      • No docs changes – this aligns with documentation
      • Release note for the fix crediting user

      Follow Up Requirements

      • N/A

       

            Assignee:
            Unassigned
            Reporter:
            TPM Jira Automations Bot
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: