1 数据库操作
1 切换或创建数据库
use yourDB;
2 删除数据库
db.dropDatabase();
2 Collection聚集集合
1 创建集合
db.createCollection(“collName”);
3 集合查询
1 查询所有记录
db.userInfo.find();
2 查询age = 22的记录
db.userInfo.find({"age": 22});
3 查询age>22的记录
db.userInfo.find({age: {$gt: 22}});
4查询age<22的记录
db.userInfo.find({age: {$lt: 22}});
5查询age>=25的记录
db.userInfo.find({age: {$gte: 25}});