[GODRIVER-2355] Add $explain support Created: 22/Mar/22  Updated: 29/Mar/22  Resolved: 29/Mar/22

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Unknown
Reporter: Peter Ivanov Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by GODRIVER-2356 Add support for $explain Closed

 Description   

The essence of request is very simple: to add `explain` as a natively supported feature.

Currently the only way to do it seems to be to call a `Database.RunCommand()`, which requires manually constructing the query document. Primitives like `operation.NewFind()` do not expose enough to construct query document with it. 

As a result, not only does using `explain` require extra effort, it is prone to mistakes when the query being explained will end up being not the same query as you would execute using the normal driver API. 

Use cases that I know of include diagnostic tools and testing mechanisms that validate existing queries in regard of conforming with indexes and sharding. 

 


Generated at Thu Feb 08 08:38:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.