[SERVER-42099] allow passing hint to findAndModify for update operations Created: 07/Jul/19  Updated: 29/Oct/23  Resolved: 01/Nov/19

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Improvement Priority: Major - P3
Reporter: Asya Kamsky Assignee: Bernard Gorman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-681 Allow passing hint to findAndModify u... Closed
Related
related to SERVER-44367 Allow hinting the delete command Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2019-11-04, Query 2019-11-18
Participants:

 Description   

Similar to just resolved SERVER-1599 we should allow hint to be passed to findAndModify when the remove parameter is false.



 Comments   
Comment by Bernard Gorman [ 24/Jan/20 ]

jmikola: yes, this is likely to make it into 4.4. The work itself is minimal, it's just a matter of when it will be scheduled since we're currently so busy on higher-priority projects. We may backport it for completeness if we end up finishing it shortly after branching.

Comment by Jeremy Mikola [ 24/Jan/20 ]

bernard.gorman: Does that mean it's likely to land in the 4.4 release? It'd be trivial to allow support for findAndModify delete operations following SPEC-1398, but drivers would definitely appreciate a heads up on whether we'll need to add support for hint on regular delete commands as that's likely to warrant its own, more significant, spec change (similar to SPEC-1334).

Comment by Bernard Gorman [ 24/Jan/20 ]

jmikola: done. SERVER-44367 has been added to our Q1 Quick Wins, so this functionality should be added soon.

Comment by Jeremy Mikola [ 24/Jan/20 ]

While testing SPEC-1398, I just realized that this implementation prohibits hint for findAndModify commands using the remove option (i.e. findOneAndDelete in the drivers' CRUD API). I see that support for hint and deletes (for both the delete command and findAndModify will be handled down the road in SERVER-44367.

In the meantime, can the issue title/description be revised to clarify that this issue only pertains to non-remove findAndModify operations?

Comment by Githook User [ 01/Nov/19 ]

Author:

{'name': 'Bernard Gorman', 'username': 'gormanb', 'email': 'bernard.gorman@mongodb.com'}

Message: SERVER-42099 Allow passing a hint to findAndModify
Branch: master
https://github.com/mongodb/mongo/commit/55a303afc7c3d11897da9cc9ef14849cc0db34d1

Generated at Thu Feb 08 04:59:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.