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 ...
随机推荐
- iOS 实现时间线列表效果
之前看到美团的订单详情页面很有特色,于是决定模仿一下这个效果. 其实就是简单的 TableView 技巧,下面我们就来一步一步实现它. 画个泡泡 首先到 Sketch 里画出气泡的效果 很简单,一个圆 ...
- 转载:IntelliJ Idea 常用快捷键列表
IntelliJ Idea 常用快捷键列表 (http://www.open-open.com/lib/view/open1396578860887.html) Ctrl+Shift + Enter, ...
- 《Android群英传》读书笔记 (2) 第三章 控件架构与自定义控件详解 + 第四章 ListView使用技巧 + 第五章 Scroll分析
第三章 Android控件架构与自定义控件详解 1.Android控件架构下图是UI界面架构图,每个Activity都有一个Window对象,通常是由PhoneWindow类来实现的.PhoneWin ...
- 模板-->中国剩余定理[互质版本]
如果有相应的OJ题目,欢迎同学们提供相应的链接 相关链接 所有模板的快速链接 扩展欧几里得extend_gcd模板 poj_1006_Biorhythms,my_ac_code 简单的测试 None ...
- Overload和Override的区别?
Overload和Override的区别? Override是重写:方法名称.参数个数,类型,顺序,返回值类型都是必须和父类方法一致的.它的关系是父子关系Overload是重载:方法名称不变,其余的都 ...
- PHP 关于文件操作的简单介绍
文件操作一直是Web程序员头疼的地方,而文件操作在CMS这样的系统中又是必须的.如今,PHP文件操作的函数内容已经非常强大,文件这部分也是学习PHP非常重要的一部分,希望大家不要忽略.这篇文章会简单介 ...
- flash与php 交互(as传参给php)
一种 不传参 直接读取PHP文件 btn.addEventListener(MouseEvent.CLICK,loadTxt);function loadTxt(evt:MouseEvent):voi ...
- oracle事务特性详解
原子性 事务是一个完整的操作.事务的各步操作是不可分的(原子的):要么都执行,要么都不执行. -- 创建表 create table account_money ( id number(4) not ...
- flash文件运动节奏的控制
flash里面,比较难的是控制运动的节奏.参考了几个韩国网站的fla源文件,提出以下几个建议与参考. 1,flash文件里面,每秒的帧数 设置为 120,或者一个比较大的数字(90,60).普通的文件 ...
- python3 解析apk图标
有两处值小点,一是如何解压缩,另一个是如何写文件,第二点上我找的是phthon2的代码,一直写文件的时候报不是字符串的问题,将打开方式加上"b“的模式搞定 print文件出来直接删除了,原因 ...


