basic mongodb

*/-->

pre {
background-color: #2f4f4f;line-height: 1.6;
FONT: 10.5pt Consola,"Bitstream Vera Sans", Courier New, helvetica;
color:wheat;
}
.h3 {
margin-left: 10pt;
}

basic mongodb

Components

mongod

mongod is the primary daemon process for the MongoDB system. It handles
data requests, manages data format, and performs background management
operations.

--dbpath <path>
Specify a directory for the mongod instance to store its data.
Typical locations include: /srv/mongodb, /var/lib/mongodb or
/opt/mongodb

Unless specified, mongod will look for data files in the default
/data/db directory. (Windows systems use the \data\db direc‐
tory.) If you installed using a package management system. Check
the /etc/mongodb.conf file provided by your packages to see the
configuration of the dbpath.

--directoryperdb
Alters the storage pattern of the data directory to store each
database's files in a distinct folder. This option will create
directories within the --dbpath named for each directory.

Use this option in conjunction with your file system and device
configuration so that MongoDB will store data on a number of
distinct disk devices to increase write throughput or disk
capacity.

mongo

http://docs.mongodb.org/manual/tutorial/getting-started/

mongo

By default, mongo looks for a database server listening on port 27017 on the
localhost interface. To connect to a server on a different port or interface,
use the --port and --host options.

Select a database

db

show dbs

use mydb

Create a Collection and Insert Documents

j = { name : "mongo" }
k = { x : 3 } db.testData.insert( j )
db.testData.insert( k ) show collections db.testData.find()

Post by: Jalen Wang (转载请注明出处)

basic mongodb的更多相关文章

  1. lbs basic mongodb

    MongoDB地理位置索引常用的有两种. db.places.ensureIndex({'coordinate':'2d'}) db.places.ensureIndex({'coordinate': ...

  2. MongoDB - Introduction of the mongo Shell

    Introduction The mongo shell is an interactive JavaScript interface to MongoDB. You can use the mong ...

  3. mongostat用法

    mongostat是mongoDB自带的工具,用于检测mongodb的运行状态. mongostat用法 Test:Test/node-131 / # mongostat --help Usage: ...

  4. modSecurity规则学习(七)——防止SQL注入

    1.数字型SQL注入 /opt/waf/owasp-modsecurity-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf"] [lin ...

  5. MongoDB - basic

    mongoDB basic from:http://www.tutorialspoint.com/mongodb prject:https://github.com/chenxing12/l4mong ...

  6. DB Intro - MongoDB Basic

    mongoDB basic from:http://www.tutorialspoint.com/mongodb prject:https://github.com/chenxing12/l4mong ...

  7. 【MongoDB】The basic operation of Index in MongoDB

    In the past four blogs, we attached importance to the index, including description and comparison wi ...

  8. MySQL、MongoDB、Redis数据库Docker镜像制作

    MySQL.MongoDB.Redis数据库Docker镜像制作 在多台主机上进行数据库部署时,如果使用传统的MySQL的交互式的安装方式将会重复很多遍.如果做成镜像,那么我们只需要make once ...

  9. 搭建高可用mongodb集群(三)—— 深入副本集内部机制

    在上一篇文章<搭建高可用mongodb集群(二)—— 副本集> 介绍了副本集的配置,这篇文章深入研究一下副本集的内部机制.还是带着副本集的问题来看吧! 副本集故障转移,主节点是如何选举的? ...

随机推荐

  1. EF 存储过程(上)

    目前,EF对存储过程的支持并不完善.存在以下问题:> EF不支持存储过程返回多表联合查询的结果集.> EF仅支持返回某个表的全部字段,以便转换成对应的实体.无法支持返回部分字段的情况.&g ...

  2. Spring in action笔记

    耦合的两面性     一方面代码耦合难以测试,会出现打地鼠式的bug特性(修复一个bug,引发另一个bug) 另一方面耦合又是必须的,不同的类必须要进行适当的交互,才能实现功能. bean的四种装配方 ...

  3. js 的基础知识变量

    什么是变量? 变是一个存储和释放我的数据! 我们用var关键字来声名变量,声名多个变量时用逗号来隔开 在变量没有赋值之前,显示是一个未定义的变量! <script> var a; var ...

  4. scp命令使用

    从 本地 复制到 远程 scp /home/daisy/full.tar.gz root@172.19.2.75:/home/root (然后会提示你输入另外那台172.19.2.75主机的root用 ...

  5. iOS 9适配技巧

    中文快速导航: 1.iOS9网络适配_ATS:改用更安全的HTTPS(见Demo1) i. WHAT(什么是SSL/TLS?跟HTTP和HTTPS有什么关系) ii. WHY(以前的HTTP不是也能用 ...

  6. Hibernate过程小计

    对实体 "XXX" 的引用必须以 ';' 分隔符结尾(需要对分号进行编码) <property name="connection.url">jdbc ...

  7. Hbase案例分析(一)

    Hbase应用场景: 1 随机读或者写 2 大数据上的高并发操作,比如每秒对PB级数据进行上千次操作.(查询,删除等操作) 3 读写均是非常简单的操作,比如没有join操作 Hbase Schema设 ...

  8. 哈希,哈希表,哈希Map

    数组: 数组存储区间是连续的,占用内存严重,故空间复杂的很大.但数组的二分查找时间复杂度小,为O(1):数组的特点是:寻址容易,插入和删除困难: 链表: 链表存储区间离散,占用内存比较宽松,故空间复杂 ...

  9. bzoj 1604: [Usaco2008 Open]Cow Neighborhoods 奶牛的邻居 曼哈顿生成树

    大致题意:统计平面上由曼哈顿距离小于等于c的点对组成联通块的个数. 曼哈顿生成树的模板题.有关讲解:http://blog.csdn.net/acm_cxlove/article/details/88 ...

  10. 探索React生态圈

    原文地址:http://www.csdn.net/article/2015-08-04/2825370-react 2004年,对于前端社区来说,是里程碑式的一年.Gmail横空出世,它带来基于前端渲 ...