Support a way to pass a hint to update command to use a specific index for update query filter. Work done under this ticket will not prevent misuse of hinting, as reported by SERVER-26413.
Original description:
Change the behavior on the server for update to look for the special fields: $query, $sortby, $limit, $hint. If these are found treat them the same as the Op_Query does.
This will allow sorting (so you can update the right element), $limit (so you can just update some of them), $hint (so you can force the right index) in addition to the normal $query part.
This should be backwards compatible. It will either be a $query + other $ options, or just the query, without options (like it is now).
- is depended on by
-
DRIVERS-751 support ability to pass hint to update
- Closed
- is related to
-
SERVER-15802 Query optimizer should always use equality predicate over unique index when possible
- Closed
-
SERVER-4796 Add limit/max to remove command
- Backlog
-
SERVER-7944 add index hint support for operations that read indexes
- Closed
-
SERVER-2677 Allow count to work with query hints
- Closed
- related to
-
SERVER-26413 Hinting an incompatible partial index can return incomplete results
- Backlog
-
SERVER-7105 Please provide a way to use $hint for Update/FindAndModify, and/or fix the Query Optimizer
- Closed
-
SERVER-25716 multi-update in the presence of an error gives incorrect nModified / nMatched value
- Closed
-
SERVER-54824 Size estimate of UpdateOpEntry in mongos should account for optional hint
- Closed