INS Assignments
INS Assignments
{
"_id": ObjectId("product_id"),
"name": "Laptop",
"description": "High-performance laptop",
"price": 1200,
"category_id": ObjectId("category_id"),
"stock": 50
}
2. Categories Collection
Stores product categories.
{
"_id": ObjectId("category_id"),
"name": "Electronics"
}
3. Orders Collection
Stores customer orders, linking products with quantities.
{
"_id": ObjectId("order_id"),
"customer_name": "John Doe",
"customer_email": "[email protected]",
"order_date": ISODate("2024-02-09T12:00:00Z"),
"items": [
{
"product_id": ObjectId("product_id"),
"quantity": 2,
"price": 1200
}
],
"total_price": 2400,
"status": "Pending"
}
if __name__ == "__main__":
add_task("Buy groceries")
add_task("Complete assignment", "in progress")
print("\nAll Tasks:")
get_tasks()
delete_task("Complete assignment")
print("\nTasks After Deletion:")
get_tasks()
{
"_id": ObjectId("product_id"),
"name": "Laptop",
"description": "High-performance laptop",
"price": 1200,
"category_id": ObjectId("category_id"),
"stock": 50
}
2. Categories Collection
Stores product categories.
{
"_id": ObjectId("category_id"),
"name": "Electronics"
}
3. Orders Collection
Stores customer orders, linking products with quantities.
{
"_id": ObjectId("order_id"),
"customer_name": "John Doe",
"customer_email": "[email protected]",
"order_date": ISODate("2024-02-09T12:00:00Z"),
"items": [
{
"product_id": ObjectId("product_id"),
"quantity": 2,
"price": 1200
}
],
"total_price": 2400,
"status": "Pending"
}