0

I want to implement autocomplete on a stand-alone instance of MongoDB using C#. I saw MongoDB has Autocomplete search on MongoDB Atlas but I want to have it on our stand-alone instance. I also know that we can implement it using Regex like below.

var filter = builder.Regex(x => x.Name, new BsonRegularExpression(new Regex($"^{request.Term}", RegexOptions.IgnoreCase)));

Is there any more efficient way to implement it?

Mohammad Taherian
  • 1,622
  • 1
  • 15
  • 34
  • Does this answer your question? [Implement auto-complete feature using MongoDB search](https://stackoverflow.com/questions/29892947/implement-auto-complete-feature-using-mongodb-search) – Fcmam5 Jan 18 '23 at 22:48
  • @Fcmam5 No. I saw that answer. Looking for a better way. – Mohammad Taherian Jan 18 '23 at 22:53

0 Answers0