{"id":19925327,"url":"https://github.com/vidhya0501/day35task35_be_mongodb_task_vidhya","last_synced_at":"2026-04-15T13:31:40.327Z","repository":{"id":224944980,"uuid":"764656723","full_name":"Vidhya0501/Day35Task35_BE_MongoDB_Task_Vidhya","owner":"Vidhya0501","description":"MongoDB queries to display product details based on the requirement.","archived":false,"fork":false,"pushed_at":"2024-02-28T13:55:54.000Z","size":1857,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T10:30:51.980Z","etag":null,"topics":["database","json","mongo","mongodb"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vidhya0501.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-28T13:31:22.000Z","updated_at":"2024-02-28T14:00:54.000Z","dependencies_parsed_at":"2024-02-28T15:02:10.628Z","dependency_job_id":null,"html_url":"https://github.com/Vidhya0501/Day35Task35_BE_MongoDB_Task_Vidhya","commit_stats":null,"previous_names":["vidhya0501/day35task35_be_mongodb_task_vidhya"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Vidhya0501/Day35Task35_BE_MongoDB_Task_Vidhya","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vidhya0501%2FDay35Task35_BE_MongoDB_Task_Vidhya","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vidhya0501%2FDay35Task35_BE_MongoDB_Task_Vidhya/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vidhya0501%2FDay35Task35_BE_MongoDB_Task_Vidhya/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vidhya0501%2FDay35Task35_BE_MongoDB_Task_Vidhya/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vidhya0501","download_url":"https://codeload.github.com/Vidhya0501/Day35Task35_BE_MongoDB_Task_Vidhya/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vidhya0501%2FDay35Task35_BE_MongoDB_Task_Vidhya/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31842852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T13:28:40.153Z","status":"ssl_error","status_checked_at":"2026-04-15T13:28:29.396Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","json","mongo","mongodb"],"created_at":"2024-11-12T22:21:54.626Z","updated_at":"2026-04-15T13:31:40.310Z","avatar_url":"https://github.com/Vidhya0501.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"MongoDB\n\nCreate database and insert documents in collection.\n\nuse productDatabase\n\ndb.products.insertMany()\n\n\n1. Find all the information about each products\n\ndb.products.find().pretty();\n\n\n2. Find the product price which are between 400 to 800\n\ndb.products.find({product_price:{$gte:400,$lte:800}}).pretty();\n\n\n3. Find the product price which are not between 400 to 600\n db.products.find({product_price:{$not:{$gte:400,$lte:600}}}).pretty();\n\n\n4. List the four product which are greater than 500 in price \n db.products.find({product_price:{$gt:500}}).limit(4).pretty();\n\nOnly three products are available with price greater than 500.\n\nIf we give greater than or equal to 500 then we can get four products.\n db.products.find({product_price:{$gte:500}}).limit(4).pretty();\n\n\n5. Find the product name and product material of each products\n\n\ndb.products.find({},{product_name:1,product_material:1}).pretty();\n\n\n\n6. Find the product with a row id of 10\n\n db.products.findOne({id:\"10\"});\n\n\n7. Find only the product name and product material\n\n\n db.products.find({},{_id:0,product_name:1,product_material:1}).pretty();\n\n\n8. Find all products which contain the value of soft in product material \n\n db.products.find({product_material:{$eq:\"Soft\"}}).pretty();\n\n\n\n9. Find products which contain product color indigo  and product price 492.00\n\nNone. No products have product color “indigo” and product price “492.00”.\n\nBut if we can retrieve products which have either product color “indigo” or product price “492.00”. \n\ndb.products.find({$or:[{product_color:{$eq:\"indigo\"}},{product_price:{$eq:492.00}}]}).pretty();\n\n\n\n10. Delete the products which product price value are same\n\n\n\n var pricesToDelete=db.products.aggregate([{$group:{_id:\"$product_price\",count:{$sum:1},docs:{$push:\"$_id\"}}},{$match:{count:{$gt:1}}}]).toArray();\n pricesToDelete.forEach(function(priceGroup){db.products.deleteMany({_id:{$in:priceGroup.docs}});});\n\n\nInitially we have 25 products, in that product_prices 47 and 36 occur twice.\nAfter deleting those now we have 21 products.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvidhya0501%2Fday35task35_be_mongodb_task_vidhya","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvidhya0501%2Fday35task35_be_mongodb_task_vidhya","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvidhya0501%2Fday35task35_be_mongodb_task_vidhya/lists"}