[SERVER-65222] Collection.deleteOne() ignores hint Created: 04/Apr/22  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Daniel Gomez Ferro Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Query Execution
Operating System: ALL
Steps To Reproduce:

(function() {
       "use strict";
 
       const coll = db['deleteone_ignores_hint'];
       coll.drop();
       coll.insertOne({_id:1});
       db.runCommand({delete: coll.getName(), 
                 deletes: [{q: {_id:1}, limit: 1, hint: {$natural:1}}]}); // This uses the hint.
       assert.eq(0, coll.aggregate( [ { $indexStats: { } }]).toArray()[0].accesses.ops);
 
       coll.deleteOne({_id:1},{hint:{$natural:1}}); // This doesn't.
       assert.eq(0, coll.aggregate( [ { $indexStats: { } }]).toArray()[0].accesses.ops)
})();

Participants:

 Description   

The method deleteOne() accepts a hint but currently it is ignored, at least when using the $natural parameter.


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