mongoDB知识汇总
2015-08-11 16:11
519 查看
Agenda
Traits
Agility,Scalability,high-performance
Free and open-source
NoSQL database
JSON-like
Document-oriented database(schema flexible)
Document Database
A record in MongoDB is a document, which is a data structure composed of field and value pairs. MongoDB are similar to JSON objects.
SQL to MongoDB Mapping Chart
The following table presents the various SQL terminology and concepts and the corresponding MongoDB terminology and concepts.
Connect to MongoDB
MongoDB default port is 27017, and default local host is 127.0.0.1
MongoClient mongo
= new MongoClient ("hostname", 27017);
DB db = mongo.getDB("dataqueuenode");
DBCollection collection = db.getCollection("entity");
MongoDB CRUD in java
BasicDBObject query = new BasicDBObject();
query.put("type" , "S2F");
query.put("subtype" , "SQL Orders");
query.put("state" , "disputed");
Query Document
collection.findone(DBObject o); // search one specific record
collection.find(DBObject o); //search all specific records
Remove Document
collection.remove(DBObject o); // remove specific records
Insert Document
collection.insert(DBObject arr); // insert record
Modify Document
collection.update(DBObject q , DBObject o ); //update record
* @param q the selection criteria for the update
* @param o the modifications to apply
MongoDB command
Reference
doc: http://docs.mongodb.org/manual/core/crud-introduction
One Shell for MongoDB
MongoVUE
MongoDB中条件操作符有:
(>) 大于 - $gt
(<) 小于 - $lt
(>=) 大于等于 - $gte
(<= ) 小于等于 - $lte
>db.testtable.find({age : {$gt : 22}})
Traits
Agility,Scalability,high-performance
Free and open-source
NoSQL database
JSON-like
Document-oriented database(schema flexible)
Document Database
A record in MongoDB is a document, which is a data structure composed of field and value pairs. MongoDB are similar to JSON objects.
SQL to MongoDB Mapping Chart
The following table presents the various SQL terminology and concepts and the corresponding MongoDB terminology and concepts.
Connect to MongoDB
MongoDB default port is 27017, and default local host is 127.0.0.1
MongoClient mongo
= new MongoClient ("hostname", 27017);
DB db = mongo.getDB("dataqueuenode");
DBCollection collection = db.getCollection("entity");
MongoDB CRUD in java
BasicDBObject query = new BasicDBObject();
query.put("type" , "S2F");
query.put("subtype" , "SQL Orders");
query.put("state" , "disputed");
Query Document
collection.findone(DBObject o); // search one specific record
collection.find(DBObject o); //search all specific records
Remove Document
collection.remove(DBObject o); // remove specific records
Insert Document
collection.insert(DBObject arr); // insert record
Modify Document
collection.update(DBObject q , DBObject o ); //update record
* @param q the selection criteria for the update
* @param o the modifications to apply
MongoDB command
Reference
doc: http://docs.mongodb.org/manual/core/crud-introduction
One Shell for MongoDB
MongoVUE
MongoDB中条件操作符有:
(>) 大于 - $gt
(<) 小于 - $lt
(>=) 大于等于 - $gte
(<= ) 小于等于 - $lte
>db.testtable.find({age : {$gt : 22}})
相关文章推荐
- mongodb连接不及时关闭的错误
- 【Mongodb】3.0 配置身份验证db.createUser()说明
- MongoDB安装及连接
- mongodb
- 使用Java 连接MongoDB3.X 3.04 带 auth 认证
- MongoDB数据类型
- MongoDB 3.X Crud 增删查改
- MongoDB与内存
- mongodb官网文档阅读笔记:write concern
- Mongodb-使用javaDriver 实现增删改查
- MongoDB CUD文档
- supervisor监控mongoDb
- 使用NoSQL Manager for MongoDB客户端连接mongodb
- mongodb 3.0下载安装、配置及mongodb最新特性、基本命令教程详细介绍
- mongodb中处理插入数据去重问题
- Mongodb简单的分片搭建与测试
- Spring整合MongoDB
- python连接mongodb并操作
- 【MongoDB】MongoDB笔记—常用命令
- 【MongoDB数据库】Java MongoDB CRUD Example