MongoDB 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.
clear console/terminal: For Mac user command+l and window ctrl+l
show dbs
show collections
use db_name
db.createCollection('table_name')
db.dropDatabase()
db.table_name.insert({'dict/object'})
db.table_name.find()
db.table_name.find().pretty()
db.table_name.find({field_name: value})
db.post.findOne()
db.post.findOne({user_id:3})
db.table_name.find.sort({field_name: `value` like id, or value})
db.table_name.find().count()
db.post.update({ title: "I love javascript and React.JS" }, { $set: { title: "I love to javascript."}})
db.post.remove({'title': 'I love to javascript.'})
db.post.remove()
db.post.find().limit(3)
db.post.find().limit(3).pretty()
db.post.find({}, {title:1, _id:0}).limit(6).pretty()
mongodump --collection collection_name --db db_name