Query in Java as in Mongo shell 【Jongo】
2016-03-01 20:25
567 查看
what ?
在 java 中直接使用 shell 操作 mongodbhow ?
DB db = new MongoClient().getDB("dbname"); Jongo jongo = new Jongo(db); MongoCollection friends = jongo.getCollection("friends"); MongoCursor<Friend> all = friends.find("{name: 'Joe'}").as(Friend.class); Friend one = friends.findOne("{name: 'Joe'}").as(Friend.class);
why ?
最直接的作用是可以简化代码量在 java 中使用 shell 操作很灵活方便
性能更好
other
官方http://jongo.org/
github
https://github.com/bguerout/jongo
相关文章推荐
- Linux学习笔记:shell的初次使用
- powershell 生成随机用户信息
- shell读取文件的方法
- PowerShell图形化编程2-快速入门
- bash的基本功能(重定向、管道符、通配符)
- 运维日志排查常用shell
- Shell入门——shell特性、变量
- shell脚本手记
- Reference for shell scripting
- Linux下Shell脚本执行PHP报错:Could not open input file
- 使用xshell远程登录ubuntu使用vi编辑不能使用删除键方向键
- hbase filter shell用法
- linux初学之6——shell基础
- shell 初始化linux系统脚本
- Azure PowerShell 1.0.0以上版本在中国Azure使用的注意事项
- Linux shell中的竖线(|)——管道符号
- shell基础
- Linux shell 之 提取文件名和目录名的一些方法
- xshell中按backspace乱码问题
- android执行shell命令,top 命令解析