{"id":30020762,"url":"https://github.com/suhailroushan13/mongodb-methods","last_synced_at":"2025-08-06T02:12:20.281Z","repository":{"id":295160523,"uuid":"624584234","full_name":"suhailroushan13/MongoDB-Methods","owner":"suhailroushan13","description":"MongoDB is a NoSQL document-oriented database system. It provides a rich set of methods and functions to interact with the database. Here are some of the most commonly used methods in MongoDB","archived":false,"fork":false,"pushed_at":"2023-04-15T02:53:05.000Z","size":18,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-24T00:37:54.386Z","etag":null,"topics":["config","database","db","mongodb","mongoose","nosql-database"],"latest_commit_sha":null,"homepage":"https://github.com/suhailroushan13/MongoDB-Methods","language":"JavaScript","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/suhailroushan13.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,"zenodo":null}},"created_at":"2023-04-06T19:53:47.000Z","updated_at":"2024-02-24T07:13:41.000Z","dependencies_parsed_at":"2025-05-24T00:37:55.731Z","dependency_job_id":"4fb113a2-a40d-4a0f-92e0-d4b31b624e87","html_url":"https://github.com/suhailroushan13/MongoDB-Methods","commit_stats":null,"previous_names":["suhailroushan13/mongodb-methods"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suhailroushan13/MongoDB-Methods","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhailroushan13%2FMongoDB-Methods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhailroushan13%2FMongoDB-Methods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhailroushan13%2FMongoDB-Methods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhailroushan13%2FMongoDB-Methods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suhailroushan13","download_url":"https://codeload.github.com/suhailroushan13/MongoDB-Methods/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhailroushan13%2FMongoDB-Methods/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269005891,"owners_count":24343408,"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","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["config","database","db","mongodb","mongoose","nosql-database"],"created_at":"2025-08-06T02:12:19.643Z","updated_at":"2025-08-06T02:12:20.276Z","avatar_url":"https://github.com/suhailroushan13.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MongoDB-Methods\n\n### MongoDB is a NoSQL document-oriented database system. It provides a rich set of methods and functions to interact with the database. Here are some of the most commonly used methods in MongoDB:\n\n## Collection Management\n\n- `db.collection()`: Returns a reference to a collection.\n- `collection.countDocuments()`: Returns the number of documents in a collection.\n- `collection.createIndex()`: Creates an index on a collection.\n- `collection.deleteMany()`: Deletes multiple documents from a collection.\n- `collection.deleteOne()`: Deletes a single document from a collection.\n- `collection.drop()`: Drops a collection from a database.\n- `collection.find()`: Returns a cursor to a set of documents in a collection.\n- `collection.findOne()`: Returns a single document from a collection.\n- `collection.findOneAndDelete()`: Deletes a single document and returns it.\n- `collection.findOneAndReplace()`: Replaces a single document and returns it.\n- `collection.findOneAndUpdate()`: Updates a single document and returns it.\n- `collection.insertMany()`: Inserts multiple documents into a collection.\n- `collection.insertOne()`: Inserts a single document into a collection.\n- `collection.replaceOne()`: Replaces a single document in a collection.\n- `collection.updateMany()`: Updates multiple documents in a collection.\n- `collection.updateOne()`: Updates a single document in a collection.\n\n## Installation\n\n```bash\ngit clone git@github.com:suhailroushan13/MongoDB-Methods.git\ncd MongoDB-Methods\nnpm install\n\n```\n\n- Add Your MongoDB URI in Config Folder in default.json file\n- Add Your Collection Name in 3rd Parameter in Models Folder inside index.js file\n  const userModel = new mongoose.model(\"Suhail\", userSchema, \"methods\");\n  change the collection Name from methods to \"YOUR-COLLECTION-NAME\"\n\n- To Test Methods \n```bash\n#Example\nnode ./controllers/insertMany.js \nnode ./controllers/insertOne.js \n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhailroushan13%2Fmongodb-methods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuhailroushan13%2Fmongodb-methods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhailroushan13%2Fmongodb-methods/lists"}