1.查看集合 show collections
2.向集合中添加数据 db.runoob.insertOne( { 'title':'remove method', 'url':'http://blog.51cto.com/suyanzhu', 'description':'this is my blog' } ) db.runoob.insertMany([ { 'title':'data1', 'url':'http://blog.51cto.com/suyanzhu', 'description':'this is data1' }, { 'title':'data2', 'url':'http://blog.51cto.com/suyanzhu', 'description':'this is data2' } ])
3.查看数据 db.runoob.find().pretty()
4.删除单个数据 db.runoob.deleteOne({'title':'remove method'})
5.查看数据 db.runoob.find().pretty() (责任编辑:IT) |