Insert
SQL : insert into users (“name”,”city”) values(“terry”,”seoul”)
Mongo DB : db.users.insert({_id:”terry”,city:”seoul”})
Select
SQL : select * from users where id=”terry”
Mongo DB : db.users.find({_id:”terry”})
Update
SQL : update users set city=”busan” where _id=”terry”
Mongo DB : db.users.update( {_id:”terry”}, {$set :{ city:”Busan” } } )
Delete
SQL : delete from users where _id=”terry”
Mongo DB : db.users.remove({_id:”terry”})
몽고 디비 간단한 쿼리입니다. Sql문과 비교하여
빠르게 이해해 봅시다 ^^
몽고 쿼리문에대해 더 알아보기
http://docs.mongodb.org/manual/crud/