When find request is executed with pagination actual find and count requests are executed sequentially.
|
const results = await this._collection.find(query, options); |
|
if (!hasPaging) { |
|
return { |
|
results, |
|
}; |
|
} |
|
|
|
const countOptions = {}; |
|
if (options.session) countOptions.session = options.session; |
|
const count = await this._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