MongoDB

Junghoo Cho

cho@cs.ucla.edu

MongoDB

Document in MongoDB (1)

Document in MongoDB (2)

MongoDB vs RDB

MongoDB document

RDB relation

MongoDB Demo

show dbs;
use demo;
show collections;
db.books.insertOne({title: "MongoDB", likes: 100});
db.books.find();
show collections;
show dbs;
db.books.insertMany([{title: "a"}, {title: "b"}]);
db.books.find();
db.books.find({likes: 100});
db.books.find({likes: {$gt: 10}});
db.books.updateOne({title: "MongoDB"}, {$set: { likes: 200 }});
db.books.find();
db.books.deleteOne({title: "a"});
db.books.drop();
show collections;
show dbs;

Basic MongoDB Commands (1)

Basic MongoDB Commands (2)

Basic MongoDB Commands (3)

Basic MongoDB Commands (4)

Basic MongoDB Commands (4)

More on MongoDB