How to implement search on nodeJS website using mongoDB database?

Hi. I have a nodeJS web application. There are different “webpages” such as About Us - Domain.com, About Us - Domain.com, domain.com/events, how would I save all the text from all the web pages to a database and search it up when a user inputs a keyword? Basically a search function like Search Hacking with Swift – tutorials and examples for SwiftUI and UIKit ?

Hi @sound_cloud,

Welcome to MongoDB community!

MongoDB allows verious ways to search documents and we recommend segregating entities that would need to be fetched together in embedded documents.

For searches you can index “tags” arrays and search in any of the keywords

The server have different indexes like geo and text search.

However, the best full text search experience is provided via our Atlas Search product when you host your database in Atlas.

Thanks
Pavel

1 Like