mongDB 的使用
首先是启动 mongdb的service ,不启用的话,使用mong shell 连接的现象是:






create both the notify database and the notify collection
field and value pairs. Documents are analogous to structures in
programming languages that associate keys with values (e.g.
dictionaries, hashes, maps, and associative arrays). Formally, MongoDB
documents are BSON documents. BSON is a binary representation
of JSON with additional type information. In the documents, the
value of a field can be any of the BSON data types, including other
documents, arrays, and arrays of documents.
collection is a group of related documents that have a set of shared
common indexes. Collections are analogous to a table in relational
databases.



skips, and sort orders.
specify a sort().
syntax as queries to select documents to update.
$match pipeline stage provides access to MongoDB
queries.
db.inventory.find( { type: typeValue } );
针对Collection inventory 的字段 type 建立索引。
db.inventory.ensureIndex( { type: 1 } )
建立索引的语句是:db.collection.ensureIndex(keys, options)
在这里我们可以通过:db.collection.find({。。。条件。。。}).explain();
来看到输出的结果,分析读取的效率
aggregation features. For example, MongoDB can return counts of the
number of documents that match a query, or return the number of
distinct values for a field, or process a collection of documents using
a versatile stage-based data processing pipeline or map-reduce
operations.
mongDB 的使用的更多相关文章
- solr+mongo-connector+mongdb+tomcat集成
话题:solr安装 一.下载solr 本例采用4.10.3版本. Solr所有版本下载地址:http://archive.apache.org/dist/lucene/solr/ 下载完成后,解压的目 ...
- [MongDB] 主从架构--官方极力不推荐
一.缘由: 看着数据库大家庭都有主从模式,想着Mongodb应该也不会落下.但从官网看来,先是早先舍弃了Master-Master模式,现在又在不推荐 Master-Slave模式,这是要标新立异呀. ...
- MongDB/C# 杂项
1.MongDB的时间类型字段输出时为UTC的解决方法:保存到数据库中的数据还是按UTC存的,读出来的就按标识值读 [BsonDateTimeOptions(Kind = DateTimeKind.L ...
- HBase与MongDB等NoSQL数据库对照
HBase概念学习(十)HBase与MongDB等NoSQL数据库对照 转载请注明出处: jiq•钦's technical Blog - 季义钦 一.开篇 淘宝之前使用的存储层架构一直是MySQL数 ...
- go语言mongdb管道使用
原始json: { "listsn": "", "code": "fwq_add", "detail" ...
- HBase概念学习(十)HBase与MongDB等NoSQL数据库对照
转载请注明出处: jiq•钦's technical Blog - 季义钦 一.开篇 淘宝之前使用的存储层架构一直是MySQL数据库,配合以MongDB,Tair等存储. MySQL因为开源,而且生态 ...
- mongdb创建自增主键(primary key)的相关讨论 - Jason.Zhi
根据mongodb官方文档介绍,如果在插入(insert)操作时,没有指定主键id,那么它会自动给插入行自动附上一个主键id.看起来不错,但是详细看看,就会发现这个id值有点复杂. 如下图: mong ...
- mongdb Java demo
接触MONGDB,感觉用起来还挺好.今天做了一个小demo. 一.启动mongdb的服务
- springMVC+ mongdb + redis +Jedis 环境搭建
环境信息: JDK1.7 : Eclipse 4.4.1 ; mongdb + mongVUE:mongDB的安装 redis的下载和安装:window下安装redis maven3.0.5 新建ma ...
随机推荐
- golang中channel的超时处理
并发中超时处理是必不可少的,golang没有提供直接的超时处理机制,但可以利用select机制来解决超时问题. func timeoutFunc() { //首先,实现并执行一个匿名的超时等待函数 t ...
- [转] git reset简介
http://blog.csdn.net/hudashi/article/details/7664464 http://guibin.iteye.com/blog/1014369 http://hi. ...
- Android四大图片缓存(Imageloader,Picasso,Glide,Fresco)原理、特性对比
四大图片缓存基本信息 Universal ImageLoader 是很早开源的图片缓存,在早期被很多应用使用. Picasso 是 Square 开源的项目,且他的主导者是 JakeWharton,所 ...
- 异步tcp通信——APM.Server 消息推送服务的实现
消息推送服务 服务器推送目前流行就是私信.发布/订阅等模式,基本上都是基于会话映射,消息对列等技术实现的:高性能.分布式可以如下解决:会话映射可采用redis cluster等技术实现,消息对列可使用 ...
- Servlet学习--练习示例总结
醉了醉了..本来想测试下Servlet生命周期的,然后调了好久的错误,还是没成功,不知道为什么不能这样做 贴上代码: import java.io.IOException; import java.i ...
- 创建一个流(Stream)可以让Bitmap或Image保存到流里面(转)
创建一个流(Stream)可以让Bitmap或Image使用save方法将已经在bitmap上生成的图像 保存到流里面?不需要直接在硬盘上生成文件 -------------------------- ...
- Asp.Net 母版页
背景:回顾下以前用到过的asp.net控件 介绍: 使用 ASP.NET 母版页可以为应用程序中的页创建一致的布局.单个母版页可以为应用程序中的所有页(或一组页)定义所需的外观和标准行为.然后可以创建 ...
- 【USACO 1.2.4】回文平方数
[题目描述] 回文数是指从左向右念和从右向左念都一样的数.如12321就是一个典型的回文数. 给定一个进制B(2<=B<=20,由十进制表示),输出所有的大于等于1小于等于300(十进制下 ...
- js 日期修改
很早之前在CSDN上发的博客,现在CSDN上得少了,就把这个转到园子里来 //重写toString方法,将时间转换为Y-m-d H:i:s格式 Date.prototype.toString = fu ...
- underscorejs-reject学习
2.9 reject 2.9.1 语法: _.reject(list, predicate, [context]) 2.9.2 说明: 前边我们已经学习了filter方法,那么我们在学习reject之 ...