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?