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. js清空前后空格

    function trim(sValue){                var lastValue=this.replace(/(^\s*)|(\s*$)/g,"");     ...

  2. centOS 6.4 vsftpd 配置

    ###########配置流程########### 1 新建一个ftp用户,为了跟vsftp的虚拟用户对应 #useradd  -d /home/vftpuser   -s /sbin/nologi ...

  3. 新浪微博登录接口(PHP版)

    CI框架下 新浪微博登录接口完整版说明:本贴只适合CI框架.功能实现:登录接口跳转链接成功,获取用户信息(包括最重要的u_id)成功,将用户与本地平台连接起来,用户登录成功后信息的存储,本地数据库第三 ...

  4. MySQL - “Timeout error occurred trying to start MySQL Daemon”解决方法

    前几天,网站出现Many connections的问题,进入mysql,show full processlist发现有154个进程,晕....直接service mysqld restart 但是不 ...

  5. juery mobile select下来菜单选项提交form问题

    注意: data-native-menu="false"  虽然具有渲染作用,但是无法进行js提交. <script type="text/javascript&q ...

  6. Computer Talker with C# z

    Using the Code Add a textbox named 'txtWords' to a form. Add a button named 'btnSpeak' to a form. Ad ...

  7. source insight添加汇编文件.s

    (1) 做ARM嵌入式开发时,有时得整汇编代码,但在SIS里建立PROJECT并ADD TREE的时候,根据默认设置并不会把该TREE里面所有汇编文件都包含进来,默认只加了.inc和.asm后缀的, ...

  8. 查找类class所在的jar包

    CTRL+SHIFT+R 意思是输入关键字搜索当前工程的 对象. CTRL+SHIFT+T 输入关键字搜索当前工程的类.

  9. 解决vsftpd 2.2.2读取目录列表失败的问题

    该错误是由iptables的配置引起的,临时的解决方法是执行如下命令: [root@localhost soft]# modprobe ip_nat_ftp 再次登陆列表正常啦! 但当你重新启动服务器 ...

  10. IntelliJ 一键添加双引号

    IntelliJ IDEA(目前最新版本为2016.2.5) 不直接支持一键向选取内容添加双引号,但可以通过配置 Live Template 实现此功能. 以下为配置方法(针对2016.2.5版,其它 ...