[SERVER-83392] Use getElement in min/max implementation Created: 17/Nov/23  Updated: 04/Dec/23  Resolved: 04/Dec/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Foteini Alvanaki Assignee: Foteini Alvanaki
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: QE 2023-11-27, QE 2023-12-11
Participants:

 Description   

Currently there is a built-in method for finalize min/max ("finalizeMinMax") which returns the first/last element from a multiset. There is also a built-in method for finalize MinN/MaxN ("finalizeMinNMaxN"), which returns an array with the first/last N elements in a multiset. Instead of having two separate built-ins, we will re-use "finalizeMinNMaxN" for min/max with N=0. Since the "finalizeMinNMaxN" returns an array we will get the element from that array using the "getElement" method.



 Comments   
Comment by Githook User [ 04/Dec/23 ]

Author:

{'name': 'fotiniAlvanaki', 'email': '78495594+fotiniAlvanaki@users.noreply.github.com', 'username': 'fotiniAlvanaki'}

Message: SERVER-83392 Use getElement and existing builtin insted of adding new… (#17120)

GitOrigin-RevId: 277b0eb8884ff36bff2966c5319b3884c3563c06
Branch: master
https://github.com/mongodb/mongo/commit/76ad7ce813f7b3402df979a0c733d2c095579394

Generated at Thu Feb 08 06:52:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.