Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution Stats in Aggregate #198

Open
arichiardi opened this issue Apr 1, 2020 · 2 comments
Open

Execution Stats in Aggregate #198

arichiardi opened this issue Apr 1, 2020 · 2 comments

Comments

@arichiardi
Copy link

Hi there!

Still new to Mongo but I wanted to get the execution time of my aggregate queries and while I am using explain-aggregate function, I cannot really see the executionStats section returned from it.

My Mongo is from the 3.6.17-xenial docker image.

Is there any way to access that information?

@arichiardi
Copy link
Author

I found that this article would actually work but how to chain calls in monger?

https://dzone.com/articles/mongo-aggregates-and-how-to-explain-aggregate-quer

@mjrb
Copy link
Contributor

mjrb commented Sep 4, 2021

as the article suggests you have to run explain with the executionStats option which unfortunately doesn't seem to be supported by the java driver :'( here the api only allows AggregateOptions not any explain options. You could potentially profile your query using the MongoDB shell and then using it in your clojure application. if you really want to do it in clojure you can manually use the raw runCommand interface through java interrop but that would be a bit painful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants