Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Insert document customers
- db.customers.insertOne({
- _id: "ak",
- name: "Aldino Kemal"
- });
- // Insert document products
- db.products.insertMany([
- {
- _id: 1,
- name: "Indomie Ayam Bawang",
- price: new NumberLong('2000')
- },
- {
- _id: 2,
- name: "Mie Sedap",
- price: new NumberLong('2000')
- }
- ]);
- // Insert document orders
- db.orders.insertOne({
- _id: new ObjectId(),
- total: new NumberLong(8000),
- items: [
- {
- product_id: 1,
- price: new NumberLong('2000'),
- quantity: new NumberInt(2)
- },
- {
- product_id: 2,
- price: new NumberLong('2000'),
- quantity: new NumberInt(2)
- }
- ]
- })
Add Comment
Please, Sign In to add comment