Anyone know a way to estimate the percent complete a query is in MongoDB? If I’m running a long query, it’d be nice to say, OK, it’s 40% done.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Option 1: Split long operation into small operations.
Almost always you can split long operation into smaller operations. Lets say if you need update 1.000.000 of documents you can run update operation that will update all documents at once or you can update 50.000 at once.(after each 50.000 + 5% was done)
Option 2: Make fake progress.
Approximately estimate operation duration and make fake progress bar.
In general I don’t believe that there is a database that support callbacks that’s will notify you about performed percent of an operation. Mongodb does not support it as well, as @user196251 said.