Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-16083

Investigate changes in SERVER-74725: Query SortPattern does not check for duplicate fields

      Original Downstream Change Summary

      Previously there was no error thrown by the server when a user would send a BSON object with a sort order that contained a field twice. This ticket introduces a new validation rule to ensure we have only valid sort order (e.g. only having the field in there once). This is ONLY for users that would submit a BSON object directly. If a JSON based interface is used there is no change in behavior as the JSON libraries already deduplicate the field.

      Description of Linked Ticket

      The SortPattern constructors do not check for duplicate paths being in the sort pattern, e.g.

      {a:1, b:1, a:1}

      . This is something we should check for and disallow. There may be existing places in our codebase where a sort pattern with duplicate field names are created by accident.

            Assignee:
            jocelyn.mendez@mongodb.com Jocelyn Mendez
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 1 day ago