When find request is executed with pagination actual find and count requests are executed sequentially.
| constresults=awaitthis._collection.find(query,options); |
| if(!hasPaging){ |
| return{ |
| results, |
| }; |
| } |
| |
| constcountOptions={}; |
| if(options.session)countOptions.session=options.session; |
| constcount=awaitthis._collection.count(query,countOptions); |
Instead this could be performed in parallel noticeably improving performance for long-running DB requests
When find request is executed with pagination actual find and count requests are executed sequentially.
node-mongo/src/mongo-query-service.js
Lines 32 to 41 in 7f13742
Instead this could be performed in parallel noticeably improving performance for long-running DB requests