Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: if in explain plan, use find() as findOne() can not be explained
Browse files Browse the repository at this point in the history
kmruiz committed Nov 29, 2024
1 parent 3d8cdf7 commit fa289de
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -43,8 +43,14 @@ object MongoshDialectFormatter : DialectFormatter {
emitFunctionName("explain")
emitFunctionCall()
emitPropertyAccess()
if (isAggregate) {
emitFunctionName("aggregate")
} else {
emitFunctionName("find")
}
} else {
emitFunctionName(query.component<IsCommand>()?.type?.canonical ?: "find")
}
emitFunctionName(query.component<IsCommand>()?.type?.canonical ?: "find")
emitFunctionCall(long = true, {
if (isAggregate(query)) {
emitAggregateBody(query)

0 comments on commit fa289de

Please sign in to comment.