Skip to content

拓展Mongo Shell,让其支持SQL语句查询,方便开发人员进行简单数据分析和统计。

Notifications You must be signed in to change notification settings

mircode/sql-mongo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Mongo SQL


mongosql

一、安装手册

安装好Mongo然后将.mongorc.js放到系统的家目录。可以导入log.json作为测试数据,进行测试。

1、window

window

2、linux

linux

二、简单查询

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");

分组查询

About

拓展Mongo Shell,让其支持SQL语句查询,方便开发人员进行简单数据分析和统计。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published