Member-only story

MongoDB Store Data

Devrim Ozcay
Before You Launch

MongoDB is a document-based NoSQL database system and is particularly suitable for big data applications and real-time applications. Below, I will provide a simple scenario and explanation of how MongoDB can be used for an e-commerce application.

Scenario: E-Commerce Application
Default Situation:
We want to manage information about users, products, and orders on an e-commerce platform.

MongoDB Data Model Design
Users Collection (users)

Each document represents a user.
Fields: user_id, name, email, password_hash, address, phone_number.

Products Collection (products)

Each document represents a product.
Fields: product_id, name, description, price, stock, category.

Orders Collection (orders)

Each document represents an order.
Fields: order_id, user_id, product_list, total_price, order_date, status.
Example Document Structures

// Users Collection Example
{
"user_id": "u123",
"name": "Devrim Özçay",
"email": "devrim@example.com",
"password_hash": "hashed_password",
"address": "1234 Main St, Ankara, Turkey",
"phone_number": "05001234567"
}
// Products Collection Example
{
"product_id": "p456",
"name": "Laptop",
"description"

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Before You Launch
Before You Launch

Published in Before You Launch

Bring Passion to market, build communities, and nurture the entrepreneurs of tomorrow

No responses yet

Write a response