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?

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.