DEV Community

christosmito
christosmito

Posted on • Edited on

Questions about personal project. MongoDB(Mongoose)

Hello! I am considering to start a personal project both for demonstration and learning purposes. The technologies I am going to use is node.js(express.js) mongoDB(mongoose) and puppeteer. The project is that, I will scrape some sites and store the information in a database. For instance I will scrape some websites that sell tech stuff. I have some questions about the implementation.
1) What is better? To store all the data to one single model or to construct different models for different categories. For example I will have a model for mobile phones a model for laptops and so on, or just one big model with a category attribute and write the category in it.
2) Is any package or tutorial about partial text search in mongoDB or is better to use something like elasticSearch?
3) In my example is it possible when the user search for a “general” product to return only the categories and not all the related products? For example if I search for iphone 11 in this site https://www.skroutz.gr/c/40/kinhta-thlefwna.html?keyphrase=iphone+11 it will return only the deferent categories about iphone 11 and not all the products from all the stores. Is it possible in mongoDB?

Top comments (0)