摘要: 通过find方法查询集合中的文档信息 find() 查询所有文档信息,返回FindIterable<Document> 我们可以通过FindIterable的forEach方法取得document信息 MongoClient mongoClient = new MongoClient(); Mong 阅读全文
posted @ 2016-08-23 09:54 Simple° 阅读(48954) 评论(1) 推荐(1) 编辑
摘要: 在mongodb中,表(Table)被称之为集合(Collection),记录(Record)被称为文档(Document) 首先连接到数据库 阅读全文
posted @ 2016-08-22 15:08 Simple° 阅读(8210) 评论(0) 推荐(0) 编辑
摘要: import com.mongodb.MongoClient; MongoClient mongoClient = new MongoClient(); 连接MongoDB实例,默认为localhost,27017端口MongoClient还提供了其他的构造方法 MongoClient mongoClient1 = new MongoClient("localhost"); MongoCli... 阅读全文
posted @ 2016-08-22 14:47 Simple° 阅读(6495) 评论(0) 推荐(0) 编辑
摘要: 首先,maven中常用的几个命令: clean 清空target目录 compile 编译 package 打包到target目录 install 打包到本地仓库 clean: 在eclipse的run as - maven build,在Goals输入clean,点击run 控制台输出: 我的项目 阅读全文
posted @ 2016-08-05 23:42 Simple° 阅读(337) 评论(0) 推荐(0) 编辑