An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
January 10, 2022 06:46 pm GMT
Original Link: https://dev.to/niidark/e-commerce-store-with-search-functionality-and-filters-using-mongodb-atlas-search-e0e
E-commerce store with search functionality and filters: Using MongoDB Atlas Search.
Overview of My Submission
A fully responsible e-commerce store, with filters, sorting, search functionality and autocomplete.
Submission Category:
E-Commerce Creation
Link to Code
Getting Started
Install all the dependencies:
npm install# oryarn
Add the MONGODB_URI to .env file:
example:
MONGODB_URI=(Your connection string)
Run the development server:
npm run dev# oryarn dev
Open http://localhost:3000 with your browser.
Add products seeds:
To add the seeds you only need to go to http://localhost:3000/api/products/add-seeds (/api/products/add-seeds)
if the insert was successful, you will receive a response with a (success : true) and the data that was inserted.
Setup MongoDB Atlas Search:
1 - Create the "category_size" search index
make sure you name the index "category_size"
Index Name : "category_size"
Set the index using JSON Editor
{ "mappings": { "dynamic": false "fields": { "category": { "type": "string" }, "options": { "fields": { "options": { "fields"
Additional Resources / Info
Technologies:
Other dependencies:
Original Link: https://dev.to/niidark/e-commerce-store-with-search-functionality-and-filters-using-mongodb-atlas-search-e0e
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To