Home > database >  Nodejs mongo query 10 w sorted data under the speed problem
Nodejs mongo query 10 w sorted data under the speed problem

Time:09-25

Recently to return after 10 w + data sorting, but the query efficiency is low, after added index, query time from 1700 ms to 1800 ms, after screening, time loss in the toArray this method, consult everybody a great god, and is there any way can replace toArray method, or other less time,

Query

FinlRankings (query, opt, sort, callback) {
The collection (" test "). The find (query, opt.) sort (sort). ToArray ((err, docs)=& gt; The callback (err, docs));
}

CodePudding user response:

Embracing Mongo calculation "this article introduced many algorithm skills, may wish to consult
  • Related