Challenge

Project 2

1.

a. db.customer.insert( {customerID: 1211,firstname:"Som",lastname:"Jeff",addresses:[{Koil Street, Chennai"}]);

b. db.customer.insert({normal member:"1",premium member:"5"})

c.db.carts.insert({ _id: "product_id", status:'active', quantity: 5, total: 100, products: []});

d.db.products.insertMany([{"categories":6,"brands":"new","segments":1}]);

e.db.category.insertOne([{"subcategories":3}]);

f. db.aggregateproducts.insertMany([{tags:['categories','subcategories'],like:100}]);

g. db.createcollection ("cart")

db.carts.insert({ _id: "product_id", status:'active', login: 2, logout: 0, products: []});

db.tracking:( { tracking_number: "DSD452767", status: "on",estimated_delivery: new ISODate("2023-05-31T09:14:15.656Z") },

h. db.createcollection("admin")

db.admin.inserts({"sellerid":77})

db.product.insertMany([{'categories'],like:100}]);

i. db.createcollection("seller")

db.orders.insert({ created_on: new ISODate("2012-05-17T08:14:15.656Z")});

j.db.createcollection("order")

tracking:( { tracking_number: "22122X211SD", status: "cancelled"});

payment: { method: "visa", transaction_id: "TRCID387549" }

k. db.seller.insertOne({"phone_no":3458927628,"name":"Irene","address":"Mudalivakkam"});

1.

db.collectionname.find().aggregate(field_name).sort()

db.customer.find().sort{name:1}).limit(9)

db.customer.find().limit(9).sort({name:1})

2.

db.customer.find({months:{$lt:10}};

db.checkdate.find( { status: "delivery",estimated_delivery: new ISODate("2023-06-06T08:14:15.656Z") });

3. db.orders.find({$groupby:[{$max:"orders"},{"customer_date"<80}]});

4. db.aggregatecustomers.insertMany([{titles:'cities',description:'names',by:'count',tags:['cities','names','count'],likes:50}]);

5. db.customers.aggregate([{$group:[_id:{products:"$products"},count:{$sum:1}}},{$match:{count:{"$lt":1}}}]);

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.