Home > database >  New people for help, mongo database the.findall (). ToList () about 800000 data takes more than 20 s
New people for help, mongo database the.findall (). ToList () about 800000 data takes more than 20 s

Time:09-29

Public static List GetAll (string the connectionString, string dbName, string collectionName)
T: where EntityBase
{

Var db=GetMongoDatabase (the connectionString, dbName);
Var collection=db. GetCollection (collectionName);

Return the collection. The.findall (). ToList ();
}

CodePudding user response:

Make sure this is the network consumption for 20 seconds, take each takes up much consumption data

CodePudding user response:

Explain () have a look, can use the index to optimize the first

CodePudding user response:

Well, why to put so much in one data into the list, this is the page and use a cursor or iterator
  • Related