[SERVER-68336] Add version of AutoGetCollection which takes a struct for its optional parameters Created: 26/Jul/22  Updated: 29/Oct/23  Resolved: 15/Sep/22

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

Type: Improvement Priority: Major - P3
Reporter: Gregory Noma Assignee: Fausto Leyva (Inactive)
Resolution: Fixed Votes: 0
Labels: techdebt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-68337 Perform collectionUUID check inside o... Closed
Related
related to SERVER-63754 avoid copying NamespaceStringOrUUID v... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2022-09-05, Execution Team 2022-09-19
Participants:

 Description   

AutoGetCollection currently has three optional parameters (or more for certain of its variations), and potentially more could be added in the future. This can become unwieldy as callers may want to use a non-default option for a later parameter but not an earlier one. We can help alleviate this by adding a version of AutoGetCollection which takes an AutoGetCollectionOptions struct containing these optional parameters.



 Comments   
Comment by Githook User [ 15/Sep/22 ]

Author:

{'name': 'Faustoleyva54', 'email': 'fausto.leyva@mongodb.com', 'username': 'Faustoleyva54'}

Message: SERVER-68336 Add version of AutoGetCollection which takes a struct for its optional parameters
Branch: master
https://github.com/mongodb/mongo/commit/881ad6801b77be9529baf34f421d05f5a7ccaca4

Comment by Githook User [ 15/Sep/22 ]

Author:

{'name': 'Faustoleyva54', 'email': 'fausto.leyva@mongodb.com', 'username': 'Faustoleyva54'}

Message: SERVER-68336 Add version of AutoGetCollection which takes a struct for its optional parameters
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/a1d8d2617fab99fa2c2dd20ccddcb16573a298ab

Comment by Gregory Noma [ 19/Aug/22 ]

It might be nice to have an interface something like we have for ServiceContextMongoDTest::Options, so that users of AutoGetCollection can do something like

AutoGetCollection autoColl{opCtx, ns, MODE_X, AutoGetCollectionOptions{}.viewMode(mode).deadline(time)};

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