- Linux or Mac machine
- Docker installed & running
- Terminal Application
- Or simply use the Google Cloud Shell (free!)
git clone https://github.com/u1i/mongodb-getting-started
cd mongodb-getting-started
./run-mongo.sh
db
test
show databases
admin 0.000GB
config 0.000GB
local 0.000GB
use class01
switched to db class01
db.students.insert({"name": "Kelly", "email": "[email protected]"})
db.students.insert({"name": "Jason", "email": "[email protected]"})
db.students.insert({"name": "Jason", "email": "[email protected]"}, "activities": ["basketball", "table tennis"])
db.getCollectionNames()
db.students.find()
{ "_id" : ObjectId("5f5c85f67eaad73223e85fc3"), "name" : "Kelly", "email" : "[email protected]" }
{ "_id" : ObjectId("5f5c85f87eaad73223e85fc4"), "name" : "Jason", "email" : "[email protected]" }
db.students.find().pretty()
db.students.find({"name": "Jason"})
{ "_id" : ObjectId("5f5c85f87eaad73223e85fc4"), "name" : "Jason", "email" : "[email protected]" }
db.students.remove({"name": "Jason"})
db.students.remove({})
