{"id":20003252,"url":"https://github.com/mbrsagor/mongodb","last_synced_at":"2026-05-05T01:37:31.522Z","repository":{"id":111135690,"uuid":"220994380","full_name":"mbrsagor/MongoDB","owner":"mbrsagor","description":"Mongo DB basic documentations ","archived":false,"fork":false,"pushed_at":"2020-08-16T09:40:49.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T13:25:23.607Z","etag":null,"topics":["database","mongodb","mongos"],"latest_commit_sha":null,"homepage":"","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/mbrsagor.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":"2019-11-11T14:04:19.000Z","updated_at":"2021-02-05T13:09:59.000Z","dependencies_parsed_at":"2023-06-05T20:15:48.987Z","dependency_job_id":null,"html_url":"https://github.com/mbrsagor/MongoDB","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FMongoDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FMongoDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FMongoDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FMongoDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrsagor","download_url":"https://codeload.github.com/mbrsagor/MongoDB/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241441856,"owners_count":19963493,"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":["database","mongodb","mongos"],"created_at":"2024-11-13T05:24:47.860Z","updated_at":"2026-05-05T01:37:31.477Z","avatar_url":"https://github.com/mbrsagor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MongoDB DB Documentations \n\n### What is MongoDB?\nMongoDB is a leading open-source N0SQL database, document-oriented database program that is written in C++. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License.\n\n\u003e clear console/terminal: For Mac user command+l and window ctrl+l\n\n##### How to show list of database?\n``` show dbs```\n\n##### How list of tables.\n```show collections```\n\n##### Create Database.\n```use db_name```\n\n##### Create table.\n```db.createCollection('table_name')```\n\n##### Delete/Drop database.\n```db.dropDatabase()```\n\n##### Insert in a database.\n```db.table_name.insert({'dict/object'})```\n\n##### Query data.\n```db.table_name.find()```\n\n##### Query data in nice alignment.\n```db.table_name.find().pretty()```\n\n##### Filter data.\n```db.table_name.find({field_name: value})```\n\n##### Filter one.\n```db.post.findOne()```\n\n##### Filter one spesific.\n```db.post.findOne({user_id:3})```\n\n##### Sort data.\n```db.table_name.find.sort({field_name: `value` like id, or value})```\n\n##### How count data in a table?\n```db.table_name.find().count()```\n\n##### Update data into collection.\n```db.post.update({ title: \"I love javascript and React.JS\" }, { $set: { title: \"I love to javascript.\"}})```\n\n##### Remove/Delete data into a collection.\n```db.post.remove({'title': 'I love to javascript.'})```\n\n##### Remove/Delete data into all collection.\n```db.post.remove()```\n\n##### How to use limit function?\n```db.post.find().limit(3)```\n\n##### Limit with pretty.\n```db.post.find().limit(3).pretty()```\n\n##### Filter by title using limit\n```db.post.find({}, {title:1, _id:0}).limit(6).pretty()```\n\n##### Backup database.\n```mongodump --collection collection_name --db db_name```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrsagor%2Fmongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrsagor%2Fmongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrsagor%2Fmongodb/lists"}