Basics of MongoDB

This MongoDB Cheatsheet is my best friend.

MongoDB Concepts

  1. Documents
  2. Collections: just like tables in SQL.
  3. Database

MongoShell

Some examples:

// show the databases
show dbs

// show collections
show collections

//set any database to current database
use database_name

// insert entry
db.database_name.insert( an_object_2_be_the_entry )

// read document
db.database_name.findOne({'some_field':'value_of_field'})
db.database_name.fidn()

// prettify
db.database_name.find().pretty()

Planted: by ;

References:
wiki/computation/basics-of-mongodb Links to:

L Ma (2018). 'Basics of MongoDB', Datumorphism, 10 April. Available at: https://datumorphism.leima.is/wiki/computation/basics-of-mongodb/.