Mongodb Commands Cheat Sheet



Apr 2, 2016 - This Pin was discovered by Mahbubul Islam. Discover (and save!) your own Pins on Pinterest. MongoDB Cheat Sheet There are many GUI tools to connect to MongoDB databases and browse but sometimes you need to get to the command line. That moment when something has gone wrong on the database server, and you need to SSH 4-levels deep in order to debug a problem with a database can leave you stuck.

  1. Mongodb Commands Cheat Sheet Pdf
  2. Mongodb Commands Cheat Sheet
  3. Mongodb Commands Pdf

Mongodb Commands Cheat Sheet Pdf

Cheat Sheet

There are many GUI tools to connect to MongoDB databases and browse but sometimes you need to get to the command line. That moment when something has gone wrong on the database server, and you need to SSH 4-levels deep in order to debug a problem with a database can leave you stuck.

Mongodb

In this cheat sheet you can get a quick refresher on:

  • Starting the mongo shell
  • Navigating around Mongo
  • Working with a collection
  • Changing groups of documents
  • Working with individual documents and Indexes
  • Dangers to avoid

Created for personal use by Red Hat’s own Cian Clarke, we’ve cleaned it up a bit for your use.

Cheat Sheet Excerpt

Navigating around Mongo

Here are the most used commands, operations and queries.

Description
Shows all databases available on this server
Switches to a database called acmegro- cery. Creates this database if it doesn’t already exist.
Show all collections in the current db (first `use ‹someDb›`)
Show all users for the current DB
Show the roles defined for the current DB

Want to see more? Get the full cheat sheet.

Please enable JavaScript to view the comments powered by Disqus.

The cheat-sheet exists to showcase how things are done; the MongoDB.Entities way.

Choose a category on the left to start browsing.

Mongodb Commands Cheat Sheet

If you're interested in contributing to the cheat-sheet section of the documentation, please send in your PR's to the cheat-sheet branch of the github repository.

  • Only add non-existing code
  • Add your contribution to the appropriate category
  • Create new categories if needed
  • Only use the domain/context of a bookshop or library which would have entities such as:
    • Author
    • Book
    • Publisher
    • Editor
    • Genre
    • etc.
  • Optionally add your name/github profile link right below your code like: Contributed by: YourName

Mongodb Commands Pdf

  • Clone the repo and checkout the cheat-sheet branch
  • Download DocFX from here
  • Add DocFX to your system path or place the executable in the MongoDB.Entities > Documentation folder
  • Change the current working directory to MongoDB.Entities > Documentation folder
  • Run DocFX with the command docfx --serve
  • Open a browser and visit: http://localhost:8080
  • Make your changes to the markdown files inside MongoDB.Entities > Documentation > cheat-sheet folder
  • To see your changes in the browser, CTRL+C and run docfx --serve again