{"id":15111508,"url":"https://github.com/suganyarajes/mongodb-query-day35","last_synced_at":"2026-01-18T19:01:52.361Z","repository":{"id":242668162,"uuid":"810169770","full_name":"suganyarajes/MongoDb-Query-Day35","owner":"suganyarajes","description":"MongoDB is a NoSQL database that provides high performance, high availability, and easy scalability through a flexible document-oriented data model.","archived":false,"fork":false,"pushed_at":"2024-06-04T09:37:32.000Z","size":4285,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T14:26:39.461Z","etag":null,"topics":["databases","json","mongodb","nosql","products","query"],"latest_commit_sha":null,"homepage":"https://github.com/suganyarajes/MongoDb-Query-Day35.git","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/suganyarajes.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,"publiccode":null,"codemeta":null}},"created_at":"2024-06-04T07:21:38.000Z","updated_at":"2024-06-04T09:37:35.000Z","dependencies_parsed_at":"2024-06-04T10:39:45.901Z","dependency_job_id":"2c7875a3-274a-4b67-bb9b-76cae508ab83","html_url":"https://github.com/suganyarajes/MongoDb-Query-Day35","commit_stats":null,"previous_names":["suganyarajes/mongodb-query-day35"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suganyarajes%2FMongoDb-Query-Day35","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suganyarajes%2FMongoDb-Query-Day35/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suganyarajes%2FMongoDb-Query-Day35/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suganyarajes%2FMongoDb-Query-Day35/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suganyarajes","download_url":"https://codeload.github.com/suganyarajes/MongoDb-Query-Day35/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247371336,"owners_count":20928187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["databases","json","mongodb","nosql","products","query"],"created_at":"2024-09-26T00:20:38.247Z","updated_at":"2026-01-18T19:01:52.347Z","avatar_url":"https://github.com/suganyarajes.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# MongoDB Product Queries\nThis repository contains a set of MongoDB queries to interact with a product database. The database is populated using a JSON file containing various products with attributes such as product name, price, material, and color.\n\nSetup\nClone the Repository\ngit clone https://github.com/suganyarajes/MongoDb-Query-Day35.git\n\n#Import the Product JSON\n\nEnsure MongoDB is installed and running on your machine. Import the products.json into your MongoDB instance using the following command:\nmongoimport --db freshtohome --collection products --file products.json --jsonArray\n\n#MongoDB Queries\nHere are the MongoDB queries to perform various tasks on the products collection:\n\n1.Find all the information about each product:\ndb.products.find({})\n\n2.Find the product price which is between 400 to 800:\ndb.products.find({ \"product_price\": { \"$gte\": 400, \"$lte\": 800 } })\n\n3.Find the product price which is not between 400 to 600:\ndb.products.find({ \"$or\": [{ \"product_price\": { \"$lt\": 400 } }, { \"product_price\": { \"$gt\": 600 } }] })\n\n4.List the four products which are greater than 500 in price:\ndb.products.find({ \"product_price\": { \"$gt\": 500 } }).limit(4)\n\n5.Find the product name and product material of each product:\ndb.products.find({}, { \"product_name\": 1, \"product_material\": 1, \"_id\": 0 })\n\n6.Find the product with a row id of 10:\ndb.products.find({ \"id\": \"10\" })\n\n7.Find only the product name and product material:\ndb.products.find({}, { \"product_name\": 1, \"product_material\": 1, \"_id\": 0 })\n\n8.Find all products which contain the value \"soft\" in product material:\ndb.products.find({ \"product_material\": { \"$regex\": /soft/i } })\n\n9.Find products which contain product color \"indigo\" and product price 492.00:\ndb.products.find({ \"product_color\": \"indigo\", \"product_price\": 492.00 })\n\n10.Delete the products which product price value is 28:\ndb.products.deleteMany({ \"product_price\": 28 })\n\nNotes\nEnsure you replace the collection and database names if they differ in your setup.\nThe field names used in the queries (e.g., product_price, product_name, product_material) should match the field names in your imported JSON data.\nThe id field in query 6 is assumed to be a string. If it's stored as a different type, adjust the query accordingly.\nContributing\nFeel free to submit issues or pull requests if you have suggestions for improvements or additional queries.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuganyarajes%2Fmongodb-query-day35","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuganyarajes%2Fmongodb-query-day35","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuganyarajes%2Fmongodb-query-day35/lists"}