美文网首页
MongoDB 总览

MongoDB 总览

作者: yangxg | 来源:发表于2016-09-15 20:17 被阅读0次

先从帮助命令入手,看能做哪些事情。

    db.help()                    help on db methods
    db.mycoll.help()             help on collection methods
    sh.help()                    sharding helpers
    rs.help()                    replica set helpers
    help admin                   administrative help
    help connect                 connecting to a db help
    help keys                    key shortcuts
    help misc                    misc things to know
    help mr                      mapreduce

    show dbs                     show database names
    show collections             show collections in current database
    show users                   show users in current database
    show profile                 show most recent system.profile entries with time >= 1ms
    show logs                    show the accessible logger names
    show log [name]              prints out the last segment of log in memory, 'global' is default
    use <db_name>                set current database
    db.foo.find()                list objects in collection foo
    db.foo.find( { a : 1 } )     list objects in foo where a == 1
    it                           result of the last line evaluated; use to further iterate
    DBQuery.shellBatchSize = x   set default number of items to display on shell
    exit                         quit the mongo shell

db.help()db.mycoll.help() 从字面意思很容易看出是数据库 (database,类似关系型数据库的库) 和里面集合 (collection,类似关系型数据库的表),这两个命令内容非常多,是一系列核心操作。

sh.help():google 一番:

Sharding is a type of database partitioning that separates very large databases the into smaller, faster, more easily managed parts called data shards. The word shard means a small part of a whole.

大概是数据库体积变得非常大的时候的优化手段。

rs.help():mongodb 官网是这样介绍的:

A replica set in MongoDB is a group of mongod processes that maintain the same data set. Replica sets provide redundancy and high availability, and are the basis for all production deployments.

类似 mysql 的主从数据库概念。

help admin:一些操作文件,诊断信息的命令。

help connect:如何连接到 mongodb。

help keys:shell 可用的快捷键。

help misc

To get a list of the wrapper classes available in the mongo shell, such as BinData(), type help misc in the mongo shell

可以通过这个命令查询数据被 BinData() 包裹之后可以执行的方法。

help mr

Map-reduce is a data processing paradigm for condensing large volumes of data into useful aggregated results. For map-reduce operations, MongoDB provides the mapReduce database command.

将巨大的数据汇总成直观的结果。

剩下的都是一些比较简单的查询命令和其它命令。

相关文章

  • MongoDB 总览

    先从帮助命令入手,看能做哪些事情。 db.help() 和 db.mycoll.help() 从字面意思很容易看出...

  • IO

    总览

  • 总览

    192名朝外毕业生(13到16届)共同完成,介绍了79所大学,162个专业。 本站导航 学校(全部) 专业(全部)...

  • 总览

    1 书籍推荐 《Java设计模式》 2 分类 创建型模式 工厂方法模式 抽象工厂模式 单例模式 建造者模式 原型模...

  • 总览

    A Accelerate 加速数学和DSP函数 Accounts ...

  • 总览

    第一步是下载适用的安装包,我电脑是64位windows所以这里提供我的版本,如果你电脑是其他,那你自己想办法把 下...

  • 总览

  • 总览

  • 总览

    集成学习(ensemble learning)本身不是一个单独的机器学习算法,而是通过构建并结合多个机器学习器来完...

  • 总览

    分布式算法,cap、paxos、raft、zk等分布式缓存,redis分布式消息队列,kafkarpc,高性能ni...

网友评论

      本文标题:MongoDB 总览

      本文链接:https://www.haomeiwen.com/subject/gedbettx.html