[DOCS-16083] Investigate changes in SERVER-74725: Query SortPattern does not check for duplicate fields Created: 28/Apr/23  Updated: 13/Nov/23  Resolved: 17/Oct/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: 7.1.0-rc0
Fix Version/s: 7.1.0-rc0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Jocelyn Mendez
Resolution: Fixed Votes: 0
Labels: query
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-74725 Query SortPattern does not check for ... Closed
Participants:
Days since reply: 40 weeks, 5 days ago

 Description   
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.


Generated at Thu Feb 08 08:14:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.