MongoDB Manual
  • 3.4 (current)
  • 3.2
  • 3.0
  • 2.6
  • 2.4
  • 2.2

  • Introduction
    • 数据库和集合
      • Views
      • 限制集
    • 文档
    • BSON 类型
    • Comparison/Sort Order
    • MongoDB Extended JSON
  • Installation
    • Install MongoDB Community Edition
      • Install on Linux
        • Install on Red Hat
        • Install on SUSE
        • Install on Amazon
        • Install on Ubuntu
        • Install on Debian
        • Install From Tarball
      • Install on OS X
      • Install on Windows
    • Install MongoDB Enterprise
      • Install on Linux
        • Install on Red Hat
        • Install on Ubuntu
        • Install on Debian
        • Install on SUSE
        • Install on Amazon
        • Install From Tarball
      • Install on OS X
      • Install on Windows
    • Verify Integrity of MongoDB Packages
  • mongo shell
    • 配置 mongo Shell
    • 获取``mongo`` Shell的帮助
    • Write Scripts for the mongo Shell
    • Data Types in the mongo Shell
    • mongo Shell Quick Reference
  • MongoDB CRUD 操作
    • 插入文档
    • 查询文档
      • 返回查询的映射字段
      • 查询值为Null或不存在的字段
      • 在 mongo 命令行里迭代游标
    • 更新文档
    • 删除文档
    • Bulk Write Operations
    • SQL到MongoDB映射表
    • Read Isolation (Read Concern)
    • Write Acknowlegement (Write Concern)
    • MongoDB CRUD 概念
      • 原子性和事务处理
      • 读隔离、一致性和时近性
      • 分布式查询
      • 分布式写操作
      • 执行两个阶段的提交
      • Linearizable Reads via findAndModify
      • 查询计划
      • Query Optimization
        • 评估当前操作的性能
        • 优化查询性能
        • 写操作性能
        • Explain Results
      • 分析查询性能
      • Tailable Cursors
  • 聚合
    • 聚合管道
      • 聚合管道的优化
      • 聚合管道的限制
      • 聚合管道和分片集合
      • Example with ZIP Code Data
      • Example with User Preference Data
    • 映射化简
      • Map-Reduce和分片集合
      • Map Reduce并发
      • Map-Reduce 例子
      • 对增量数据做Map-Reduce
      • 验证Map函数
      • 验证Reduce函数
    • 聚合指南
      • 聚合管道快速指南
      • Aggregation Commands
      • Aggregation Commands Comparison
      • Variables in Aggregation Expressions
      • SQL to Aggregation Mapping Chart
  • 文本索引
    • 文本检索
    • 文本检索操作符
    • 在聚合管道中使用文本搜索
    • 使用基本技术Rosette语义平台的文本索引
    • 文本搜索语言
  • 数据模型
    • 数据模型设计介绍
    • Document Validation
    • 数据建模理论
      • 数据模型设计
      • MongoDB特性和数据模型的关系
    • 数据模型例子与范式
      • 文档关系建模
        • 一对一关系建模:内嵌文档模型
        • 一对多关系建模: 内嵌文档模型
        • 一对多关系建模: 文档引用模式
      • 树结构建模
        • 树结构建模:父文档引用
        • 树结构建模: 子文档引用
        • 树结构建模: 祖先数组
        • 树结构建模: 物化路径
        • 树结构建模: 嵌套集合
      • 具体应用建模举例
        • 原子性事务建模
        • 关键词搜索建模
        • 货币数据建模
        • Model Time Data
    • Data Model Reference
      • Database References
  • Administration
    • 生产环境指南
    • Operations Checklist
    • Development Checklist
    • Performance
      • Database Profiler
        • 数据库 Profiler输出
      • Disable Transparent Huge Pages (THP)
      • UNIX系统下 ulimit 的设置
    • Configuration and Maintenance
      • Run-time Database Configuration
      • Upgrade to the Latest Revision of MongoDB
      • 管理 mongod 进程
      • Terminate Running Operations
      • Rotate Log Files
    • 数据中心意识
      • MongoDB部署中的分离操作
      • 区域
        • Manage Shard Zones
        • Segmenting Data by Location
        • Tiered Hardware for Varying SLA or SLO
        • Segmenting Data by Application or Customer
        • Distributed Local Writes for Insert Only Workloads
      • Manage Shard Zones
    • MongoDB备份方案
      • Back Up and Restore with Filesystem Snapshots
      • Back Up and Restore with MongoDB Tools
      • Restore a Replica Set from MongoDB Backups
      • 备份和恢复集群
        • Back Up a Sharded Cluster with File System Snapshots
        • Back Up a Sharded Cluster with Database Dumps
        • 集群的备份时间安排
        • 恢复集群
      • Recover a Standalone after an Unexpected Shutdown
    • MongoDB监控
      • Monitor MongoDB With SNMP on Linux
      • Monitor MongoDB Windows with SNMP
      • Troubleshoot SNMP
  • Indexes
    • 单键索引
    • 复合索引
    • 多键索引
      • Multikey Index Bounds
    • 文本索引
      • 指定文本索引的语言
      • 为 文本 索引指定名称
      • 通过权重控制搜索结果
      • 限制被扫描项的数量
    • 2dsphere 索引
      • Find Restaurants with Geospatial Queries
      • 查询 2dsphere 索引
      • GeoJSON Objects
    • 2d 索引
      • 创建一个 2d 索引
      • 查询 2d 索引
      • 2d 索引原理
      • 使用球面几何计算距离
    • Hashed Indexes
    • 索引属性
      • TTL索引
        • 通过设置TTL使集合中的数据过期
      • 唯一索引
      • Partial Indexes
      • Case Insensitive Indexes
      • 稀疏索引
    • Index Build
      • 在复制集上创建索引
    • 索引交集
    • Manage Indexes
    • 衡量索引的使用情况
    • 索引策略
      • 创建索引以支持查询
      • 使用索引来排序查询结果
      • 确保索引与内存相适应
      • 创建能确保选择力的查询
    • 索引参考
  • 存储
    • Storage Engines
      • WiredTiger Storage Engine
        • 将单机模式下的 MongoDB 存储引擎切换到WiredTiger
        • 将复制集模式下的 MongoDB 存储引擎切换到 WiredTiger
        • Change Sharded Cluster to WiredTiger
          • Change Config Servers to WiredTiger
      • MMAPv1 Storage Engine
      • 内存存储引擎
    • Journaling
      • Manage Journaling
    • GridFS
    • FAQ: MongoDB存储
  • 安全
    • Security Checklist
    • 认证
      • Users
        • Add Users
      • Authentication Mechanisms
        • SCRAM-SHA-1
        • MONGODB-CR
        • x.509
          • Use x.509 Certificates to Authenticate Clients
      • Enterprise Authentication Mechanisms
        • Kerberos Authentication
          • Configure MongoDB with Kerberos Authentication on Linux
          • Configure MongoDB with Kerberos Authentication on Windows
          • Troubleshoot Kerberos Authentication
          • Configure MongoDB with Kerberos Authentication and Active Directory Authorization
        • LDAP Proxy Authentication
          • Authenticate Using SASL and LDAP with ActiveDirectory
          • Authenticate Using SASL and LDAP with OpenLDAP
          • Authenticate and Authorize Users Using Active Directory via Native LDAP
        • LDAP Authorization
      • Internal Authentication
        • Enforce Keyfile Access Control in a Replica Set
        • Enforce Keyfile Access Control in a Replica Set without Downtime
        • 使用Keyfile存取控制部署复制集
        • Enforce Keyfile Access Control in Sharded Cluster
        • Deploy Sharded Cluster with Keyfile Access Control
        • Use x.509 Certificate for Membership Authentication
        • Upgrade from Keyfile Authentication to x.509 Authentication
    • Enable Auth
      • Manage Users and Roles
      • Change Your Password and Custom Data
    • Role-Based Access Control
      • Built-In Roles
      • User-Defined Roles
      • 集合层访问控制
    • Encryption
      • Transport Encryption
        • Configure mongod and mongos for TLS/SSL
        • TLS/SSL Configuration for Clients
        • Upgrade a Cluster to Use TLS/SSL
        • Configure MongoDB for FIPS
      • Encryption at Rest
        • Configure Encryption
        • Rotate Encryption Keys
    • Auditing
      • Configure Auditing
      • Configure Audit Filters
    • Security Hardening
      • MongoDB Configuration Hardening
      • Hardening Network Infrastructure
        • Configure Linux iptables Firewall for MongoDB
        • Configure Windows netsh Firewall for MongoDB
    • Implement Field Level Redaction
    • 安全参考文献
      • 内置角色
      • system.roles Collection
      • system.users集合
      • Resource Document
      • Privilege Actions
      • 系统事件审计信息
    • Create a Vulnerability Report
  • 复制
    • 复制集成员
      • 复制集主节点
      • 复制集从节点
        • 优先级为0的复制集成员
        • 隐藏节点
        • 延时节点
      • 投票节点
    • 复制集Oplog
    • 复制集的数据同步
    • 复制集架构
      • 三个节点的复制集
      • Replica Sets Distributed Across Two or More Data Centers
    • 复制集的高可用
      • 复制集选举
      • 故障切换时的回滚
    • 主从复制
    • 复制集的读与写
      • 复制集的安全写级别
      • 复制集读选项
      • Server Selection Algorithm
    • 复制集指南
      • 复制集部署指南
        • 部署复制集
        • 部署一个用于测试和开发的复制集
        • 异地分布式复制集的部署
        • 为复制集添加投票节点
        • 将单节点转为复制集
        • 为复制集新增节点
        • 移除复制集的节点
        • 更换复制集节点
      • 节点配置指南
        • 修改复制集节点的优先级
        • 禁止从节点升职为主节点
        • 配置一个隐藏节点
        • 配置一个延时复制节点
        • 配置一个不参与投票的节点
        • 将从节点转换为投票节点
      • 复制集维护教程
        • 修改Oplog大小
        • 对复制集节点进行维护
        • 强制指定某个节点为主节点
        • 复制集成员的重新同步
        • 配置复制集标签设置
        • 为有不可用节点的复制集重设复制集配置
        • 管理链式复制
        • 为复制集节点修改主机名
        • 配置从节点的同步来源
      • 复制集故障排除
    • 复制集参考
      • Replica Set Configuration
      • The local Database
      • Replica Set Member States
      • Read Preference Reference
  • 分片
    • 集群组件
      • 分片
      • Config Servers (metadata)
      • Router (mongos)
    • 片键
    • Hashed Sharding
      • Deploy Sharded Cluster using Hashed Sharding
    • Ranged Sharding
      • Deploy Sharded Cluster using Ranged Sharding
    • 区域
      • Manage Shard Zones
      • Segmenting Data by Location
      • Tiered Hardware for Varying SLA or SLO
      • Segmenting Data by Application or Customer
      • Distributed Local Writes for Insert Only Workloads
    • Administration
      • Data Partitioning with Chunks
        • 在集群中创建数据块
        • 在集群中分裂数据块
        • 在集群中合并数据块
        • 修改集群中数据块的大小
      • Config Server Administration
        • Replace a Config Server
        • Upgrade Config Servers to Replica Set
        • Upgrade Config Servers to Replica Set (Downtime)
      • Balancer Administration
        • 管理集群均衡过程
        • 在集群中迁移数据块
      • 查看集群配置
      • 迁移集群到新的硬件系统中
      • 向集群中添加分片
      • 从集群中删除分片
      • Clear jumbo Flag
      • Back Up Cluster Metadata
      • 将一个集群转化为复制集
      • Convert a Replica Set to a Sharded Cluster
    • 分片参考文献
      • Operational Restrictions
      • 排除集群故障
      • Config Database
  • 常见问题
    • FAQ: MongoDB基础知识
    • FAQ:索引
    • FAQ: 并发
    • FAQ:MongoDB 分片
    • FAQ:复制和复制集
    • FAQ: MongoDB存储
    • FAQ:MogoDB 诊断
  • Reference
    • Operators
      • Query and Projection Operators
        • Comparison Query Operators
          • $eq
          • $gt
          • $gte
          • $lt
          • $lte
          • $ne
          • $in
          • $nin
        • Logical Query Operators
          • $or
          • $and
          • $not
          • $nor
        • Element Query Operators
          • $exists
          • $type
        • Evaluation Query Operators
          • $mod
          • $regex
          • $text
          • $where
        • Geospatial Query Operators
          • $geoWithin
          • $geoIntersects
          • $near
          • $nearSphere
          • $geometry
          • $minDistance
          • $maxDistance
          • $center
          • $centerSphere
          • $box
          • $polygon
          • $uniqueDocs
        • Query Operator Array
          • $all
          • $elemMatch (query)
          • $size
        • Bitwise Query Operators
          • $bitsAllSet
          • $bitsAnySet
          • $bitsAllClear
          • $bitsAnyClear
        • $comment
        • Projection Operators
          • $ (projection)
          • $elemMatch (projection)
          • $meta
          • $slice (projection)
      • Update Operators
        • Field Update Operators
          • $inc
          • $mul
          • $rename
          • $setOnInsert
          • $set
          • $unset
          • $min
          • $max
          • $currentDate
        • Array Update Operators
          • $ (update)
          • $addToSet
          • $pop
          • $pullAll
          • $pull
          • $pushAll
          • $push
          • $each
          • $slice
          • $sort
          • $position
        • Bitwise Update Operator
          • $bit
        • Isolation Update Operator
          • $isolated
      • Aggregation Pipeline Operators
        • Pipeline Aggregation Stages
          • $collStats (aggregation)
          • $project (aggregation)
          • $match (aggregation)
          • $redact (aggregation)
          • $limit (aggregation)
          • $skip (aggregation)
          • $unwind (aggregation)
          • $group (aggregation)
          • $sample (aggregation)
          • $sort (aggregation)
          • $geoNear (aggregation)
          • $lookup (aggregation)
          • $out (aggregation)
          • $indexStats (aggregation)
          • $facet (aggregation)
          • $bucket (aggregation)
          • $bucketAuto (aggregation)
          • $sortByCount (aggregation)
          • $addFields (aggregation)
          • $replaceRoot (aggregation)
          • $count (aggregation)
          • $graphLookup (aggregation)
        • Boolean Aggregation Operators
          • $and (aggregation)
          • $or (aggregation)
          • $not (aggregation)
        • Set Operators (Aggregation)
          • $setEquals (aggregation)
          • $setIntersection (aggregation)
          • $setUnion (aggregation)
          • $setDifference (aggregation)
          • $setIsSubset (aggregation)
          • $anyElementTrue (aggregation)
          • $allElementsTrue (aggregation)
        • Comparison Aggregation Operators
          • $cmp (aggregation)
          • $eq (aggregation)
          • $gt (aggregation)
          • $gte (aggregation)
          • $lt (aggregation)
          • $lte (aggregation)
          • $ne (aggregation)
        • Arithmetic Aggregation Operators
          • $abs (aggregation)
          • $add (aggregation)
          • $ceil (aggregation)
          • $divide (aggregation)
          • $exp (aggregation)
          • $floor (aggregation)
          • $ln (aggregation)
          • $log (aggregation)
          • $log10 (aggregation)
          • $mod (aggregation)
          • $multiply (aggregation)
          • $pow (aggregation)
          • $sqrt (aggregation)
          • $subtract (aggregation)
          • $trunc (aggregation)
        • String Aggregation Operators
          • $concat (aggregation)
          • $indexOfBytes (aggregation)
          • $indexOfCP (aggregation)
          • $split (aggregation)
          • $strcasecmp (aggregation)
          • $strLenBytes (aggregation)
          • $strLenCP (aggregation)
          • $strcasecmp (aggregation)
          • $substr (aggregation)
          • $substrBytes (aggregation)
          • $substrCP (aggregation)
          • $toLower (aggregation)
          • $toUpper (aggregation)
        • Text Search Aggregation Operators
          • $meta (aggregation)
        • Array Aggregation Operators
          • $arrayElemAt (aggregation)
          • $concatArrays (aggregation)
          • $filter (aggregation)
          • $indexOfArray (aggregation)
          • $isArray (aggregation)
          • $range (aggregation)
          • $reverseArray (aggregation)
          • $reduce (aggregation)
          • $size (aggregation)
          • $slice (aggregation)
          • $zip (aggregation)
          • $in (aggregation)
        • Aggregation Variable Operators
          • $map (aggregation)
          • $let (aggregation)
        • Aggregation Literal Operators
          • $literal (aggregation)
        • Date Aggregation Operators
          • $dayOfYear (aggregation)
          • $dayOfMonth (aggregation)
          • $dayOfWeek (aggregation)
          • $year (aggregation)
          • $month (aggregation)
          • $week (aggregation)
          • $hour (aggregation)
          • $minute (aggregation)
          • $second (aggregation)
          • $millisecond (aggregation)
          • $dateToString (aggregation)
          • $isoDayOfWeek (aggregation)
          • $isoWeek (aggregation)
          • $isoWeekYear (aggregation)
        • Conditional Aggregation Operators
          • $cond (aggregation)
          • $ifNull (aggregation)
          • $switch (aggregation)
        • Data Type Aggregation Operators
          • $type (aggregation)
        • Group Accumulator Operators
          • $sum (aggregation)
          • $avg (aggregation)
          • $first (aggregation)
          • $last (aggregation)
          • $max (aggregation)
          • $min (aggregation)
          • $push (aggregation)
          • $addToSet (aggregation)
          • $stdDevPop (aggregation)
          • $stdDevSamp (aggregation)
      • Query Modifiers
        • $comment
        • $explain
        • $hint
        • $maxScan
        • $maxTimeMS
        • $max
        • $min
        • $orderby
        • $returnKey
        • $showDiskLoc
        • $snapshot
        • $query
        • $natural
    • Database Commands
      • Aggregation Commands
        • aggregate
        • count
        • distinct
        • group
        • mapReduce
      • Geospatial Commands
        • geoNear
        • geoSearch
      • Query and Write Operation Commands
        • find
        • insert
        • update
        • delete
        • findAndModify
        • getMore
        • getLastError
        • getPrevError
        • resetError
        • eval
        • parallelCollectionScan
      • Query Plan Cache Commands
        • planCacheListFilters
        • planCacheSetFilter
        • planCacheClearFilters
        • planCacheListQueryShapes
        • planCacheListPlans
        • planCacheClear
      • Authentication Commands
        • logout
        • authenticate
        • copydbgetnonce
        • getnonce
        • authSchemaUpgrade
      • User Management Commands
        • createUser
        • updateUser
        • dropUser
        • dropAllUsersFromDatabase
        • grantRolesToUser
        • revokeRolesFromUser
        • usersInfo
      • Role Management Commands
        • createRole
        • updateRole
        • dropRole
        • dropAllRolesFromDatabase
        • grantPrivilegesToRole
        • revokePrivilegesFromRole
        • grantRolesToRole
        • revokeRolesFromRole
        • rolesInfo
        • invalidateUserCache
      • Replication Commands
        • replSetFreeze
        • replSetGetStatus
        • replSetInitiate
        • replSetMaintenance
        • replSetReconfig
        • replSetStepDown
        • replSetSyncFrom
        • resync
        • applyOps
        • isMaster
        • replSetGetConfig
      • 分片命令
        • flushRouterConfig
        • addShard
        • balancerStart
        • balancerStatus
        • balancerStop
        • cleanupOrphaned
        • checkShardingIndex
        • enableSharding
        • listShards
        • removeShard
        • getShardMap
        • getShardVersion
        • mergeChunks
        • setShardVersion
        • 分片集合
        • 分片状态
        • unsetSharding
        • split
        • splitChunk
        • splitVector
        • medianKey