Suggest Function
Unanswered
Artois Hound posted this in #help-forum
Artois HoundOP
Hello everyone, I would like to get some advice or perhaps if you do have some material you could share, would be lovely. What I am trying to build is a suggestion function that would automatically suggest users that exist in the database as the user is trying to input their username. I am using Next.js (Typescript) + MongoDB if that's of any help. I have been trying to look around and find some relevant tutorial for MongoDB, but I might just not know the right way to search for it.
4 Replies
Isnt that just using the find method to find user in the user database? Are you using mongoose?
@aardani Isnt that just using the find method to find user in the user database? Are you using mongoose?
Artois HoundOP
Yes, but I'm not sure I can do find on every single keystroke and even if I could, it would probably lag up the servers from all those requests. I was thinking that there might be some special method people use for this.
Barbary Lion
check out convex, it has a database as well as search functionality
@Artois Hound Yes, but I'm not sure I can do find on every single keystroke and even if I could, it would probably lag up the servers from all those requests. I was thinking that there might be some special method people use for this.
Well in that case create a debouncer that would only send request after n second