安装好Mongo然后将.mongorc.js放到系统的家目录。可以导入log.json作为测试数据,进行测试。
db.SQL("select * from log limit 0,10");
db.SQL("select user,service,ip,code,tcount from log limit 0,10");
db.SQL("select * from log where user='淘宝' order by tcount desc limit 0,10");
db.SQL("select * from log where user='淘宝' or (user='京东' and service like 'query.*') limit 0,10");
db.SQL("select user,service,sum(tcount) from log group by user,service order by msum asc limit 0,10");