I have a collection with 546.8m documents.
and I need to search some documents that matches the Username property.
I create this piece of foce
FilterDefinition<ProfileEntity> f = Builders<ProfileEntity>.Filter.Regex("Username", new BsonRegularExpression(profileName,"i"));
var profilesList = await collection.Find(f).Limit(25).ToListAsync();
But this is taking soo long time.
What can I do for a better performance?
Creating a index would increase the performance ina big scale?
The limit of records is fixed 25.
Using the client comand line or MongoDB Compass the search is soo fast .
When using with c# is soo slow.
Of course the between them has to be different . But I can't believe that is too much
Any ideas?