สร้าง mongodb cluster บน mongoDB Atlas และเชื่อมต่อกับ Mongo Cluster
db.products.insertMany([
{
_id: new ObjectId("64a36318574fd20cd8fb9798"),
sku: 111,
product_name: "Stero Speakers",
price: 100,
stock: 5,
product_attributes: { color: "black", size: "5x5x5", weight: "5lbs" },
},
{
_id: new ObjectId("64a36318574fd20cd8fb9799"),
sku: 121,
product_name: "Bread",
price: 2,
stock: 50,
product_attributes: {
type: "white",
calories: 100,
weight: "24g",
crust: "soft",
},
},
{
_id: new ObjectId("64a36318574fd20cd8fb979a"),
sku: 131,
product_name: "Milk",
price: 3,
stock: 20,
product_attributes: {
type: "2%",
calories: 120,
weight: "1L",
brand: "Dairy Farmers",
},
},
]);
{
"product_attributes.crust": false,
}