Logo Mongodb Manual
Back to index
  • Introduction
    • Getting Started
    • Create an Atlas Free Tier Cluster
    • Databases and Collections
      • Views
      • Capped Collections
    • Documents
    • BSON Types
    • Comparison/Sort Order
    • MongoDB Extended JSON
  • Installation
    • Install MongoDB Community Edition
      • Install on Linux
        • Install on Red Hat
          • Install using .tgz Tarball
        • Install on SUSE
          • Install using .tgz Tarball
        • Install on Amazon
          • Install using .tgz Tarball
        • Install on Ubuntu
          • Install using .tgz Tarball
          • Troubleshoot Ubuntu Installation
        • Install on Debian
          • Install using .tgz Tarball
      • Install on macOS
        • Install using .tgz Tarball
      • Install on Windows
        • Install using msiexec.exe
    • Install MongoDB Enterprise
      • Install on Linux
        • Install on Red Hat
          • Install using .tgz Tarball
        • Install on Ubuntu
          • Install using .tgz Tarball
        • Install on Debian
          • Install using .tgz Tarball
        • Install on SUSE
          • Install using .tgz Tarball
        • Install on Amazon
          • Install using .tgz Tarball
      • Install on macOS
      • Install on Windows
        • Install using msiexec.exe
    • Verify Integrity of MongoDB Packages
  • The mongo Shell
    • Configure the mongo Shell
    • Access the mongo Shell Help
    • Write Scripts for the mongo Shell
    • Data Types in the mongo Shell
    • mongo Shell Quick Reference
  • MongoDB CRUD Operations
    • Insert Documents
      • Insert Methods
    • Query Documents
      • Query on Embedded/Nested Documents
      • Query an Array
      • Query an Array of Embedded Documents
      • Project Fields to Return from Query
      • Query for Null or Missing Fields
      • Iterate a Cursor in the mongo Shell
    • Update Documents
      • Update Methods
    • Delete Documents
      • Delete Methods
    • Bulk Write Operations
    • Retryable Writes
    • SQL to MongoDB Mapping Chart
    • Text Search
      • Text Indexes
      • Text Search Operators
      • Text Search in the Aggregation Pipeline
      • Text Search Languages
    • Geospatial Queries
      • Find Restaurants with Geospatial Queries
      • GeoJSON Objects
    • Read Isolation (Read Concern)
      • Read Concern "local"
      • Read Concern "available"
      • Read Concern "majority"
      • Read Concern "linearizable"
    • Write Acknowledgement (Write Concern)
    • MongoDB CRUD Concepts
      • Atomicity and Transactions
      • Read Isolation, Consistency, and Recency
        • Causal Consistency and Read and Write Concerns
      • Distributed Queries
      • Perform Two Phase Commits
      • Linearizable Reads via findAndModify
      • Query Plans
      • Query Optimization
        • Evaluate Performance of Current Operations
        • Optimize Query Performance
        • Write Operation Performance
        • Explain Results
      • Analyze Query Performance
      • Tailable Cursors
  • Aggregation
    • Aggregation Pipeline
      • Aggregation Pipeline Optimization
      • Aggregation Pipeline Limits
      • Aggregation Pipeline and Sharded Collections
      • Example with ZIP Code Data
      • Example with User Preference Data
    • Map-Reduce
      • Map-Reduce and Sharded Collections
      • Map-Reduce Concurrency
      • Map-Reduce Examples
      • Perform Incremental Map-Reduce
      • Troubleshoot the Map Function
      • Troubleshoot the Reduce Function
    • Aggregation Reference
      • Aggregation Pipeline Quick Reference
      • Aggregation Commands
      • Aggregation Commands Comparison
      • Variables in Aggregation Expressions
      • SQL to Aggregation Mapping Chart
  • Data Models
    • Data Modeling Introduction
    • Schema Validation
    • Data Modeling Concepts
      • Data Model Design
      • Operational Factors and Data Models
    • Data Model Examples and Patterns
      • Model Relationships Between Documents
        • Model One-to-One Relationships with Embedded Documents
        • Model One-to-Many Relationships with Embedded Documents
        • Model One-to-Many Relationships with Document References
      • Model Tree Structures
        • Model Tree Structures with Parent References
        • Model Tree Structures with Child References
        • Model Tree Structures with an Array of Ancestors
        • Model Tree Structures with Materialized Paths
        • Model Tree Structures with Nested Sets
      • Model Specific Application Contexts
        • Model Data for Atomic Operations
        • Model Data to Support Keyword Search
        • Model Monetary Data
        • Model Time Data
    • Data Model Reference
      • Database References
  • Indexes
    • Single Field Indexes
    • Compound Indexes
    • Multikey Indexes
      • Multikey Index Bounds
    • Text Indexes
      • Specify a Language for Text Index
      • Specify Name for text Index
      • Control Search Results with Weights
      • Limit the Number of Entries Scanned
    • 2dsphere Indexes
      • Query a 2dsphere Index
    • 2d Indexes
      • Create a 2d Index
      • Query a 2d Index
      • 2d Index Internals
      • Calculate Distance Using Spherical Geometry
    • geoHaystack Indexes
      • Create a Haystack Index
      • Query a Haystack Index
    • Hashed Indexes
    • Index Properties
      • TTL Indexes
        • Expire Data from Collections by Setting TTL
      • Unique Indexes
      • Partial Indexes
      • Case Insensitive Indexes
      • Sparse Indexes
    • Index Build Operations on a Populated Collection
      • Build Indexes on Replica Sets
      • Build Indexes on Sharded Clusters
    • Index Intersection
    • Manage Indexes
    • Measure Index Use
    • Indexing Strategies
      • Create Indexes to Support Your Queries
      • Use Indexes to Sort Query Results
      • Ensure Indexes Fit in RAM
      • Create Queries that Ensure Selectivity
    • Indexing Reference
  • Security
    • Security Checklist
    • Authentication
      • Users
        • Add Users
      • Authentication Mechanisms
        • SCRAM
        • 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
        • Deploy New Replica Set With Keyfile Access Control
        • Enforce Keyfile Access Control in a Replica Set
        • Enforce Keyfile Access Control in a Replica Set without Downtime
        • Deploy Sharded Cluster with Keyfile Access Control
        • Enforce Keyfile Access Control in Sharded Cluster
        • Enforce Authentication in an Existing Sharded Cluster Without Downtime
        • 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
      • Collection-Level Access Control
    • TLS/SSL (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
    • Security Reference
      • Built-In Roles
      • system.roles Collection
      • system.users Collection
      • Resource Document
      • Privilege Actions
      • System Event Audit Messages
    • Create a Vulnerability Report
  • Change Streams
    • Change Streams Production Recommendations
    • Change Events
  • Replication
    • Replica Set Members
      • Replica Set Primary
      • Replica Set Secondary Members
        • Priority 0 Replica Set Members
        • Hidden Replica Set Members
        • Delayed Replica Set Members
      • Replica Set Arbiter
    • Replica Set Oplog
    • Replica Set Data Synchronization
    • Replica Set Deployment Architectures
      • Three Member Replica Sets
      • Replica Sets Distributed Across Two or More Data Centers
    • Replica Set High Availability
      • Replica Set Elections
      • Rollbacks During Replica Set Failover
    • Replica Set Read and Write Semantics
      • Write Concern for Replica Sets
      • Read Preference
      • Server Selection Algorithm
    • Replica Set Deployment Tutorials
      • Deploy a Replica Set
      • Deploy a Replica Set for Testing and Development
      • Deploy a Geographically Redundant Replica Set
      • Add an Arbiter to Replica Set
      • Convert a Standalone to a Replica Set
      • Add Members to a Replica Set
      • Remove Members from Replica Set
      • Replace a Replica Set Member
    • Member Configuration Tutorials
      • Adjust Priority for Replica Set Member
      • Prevent Secondary from Becoming Primary
      • Configure a Hidden Replica Set Member
      • Configure a Delayed Replica Set Member
      • Configure Non-Voting Replica Set Member
      • Convert a Secondary to an Arbiter
    • Replica Set Maintenance Tutorials
      • Change the Size of the Oplog
      • Perform Maintenance on Replica Set Members
      • Force a Member to Become Primary
      • Resync a Member of a Replica Set
      • Configure Replica Set Tag Sets
      • Reconfigure a Replica Set with Unavailable Members
      • Manage Chained Replication
      • Change Hostnames in a Replica Set
      • Configure a Secondary’s Sync Target
    • Replication Reference
      • Replica Set Configuration
      • Replica Set Protocol Versions
      • Troubleshoot Replica Sets
      • The local Database
      • Replica Set Member States
      • Read Preference Reference
      • Master Slave Replication
  • Sharding
    • Sharded Cluster Components
      • Shards
      • Config Servers (metadata)
      • Router (mongos)
    • Shard Keys
    • Hashed Sharding
    • Ranged Sharding
    • Deploy a Sharded Cluster
    • Zones
      • 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
    • Data Partitioning with Chunks
      • Create Chunks in a Sharded Cluster
      • Split Chunks in a Sharded Cluster
      • Merge Chunks in a Sharded Cluster
      • Modify Chunk Size in a Sharded Cluster
    • Balancer
      • Manage Sharded Cluster Balancer
      • Migrate Chunks in a Sharded Cluster
    • Administration
      • Config Server Administration
        • Replace a Config Server
      • View Cluster Configuration
      • Restart a Sharded Cluster
      • Migrate a Sharded Cluster to Different Hardware
      • Add Shards to a Cluster
      • Remove Shards from an Existing Sharded Cluster
      • Clear jumbo Flag
      • Back Up Cluster Metadata
      • Convert Sharded Cluster to Replica Set
      • Convert a Replica Set to a Sharded Cluster
      • Convert a Shard Standalone to a Shard Replica Set
    • Sharding Reference
      • Operational Restrictions
      • Troubleshoot Sharded Clusters
      • Config Database
  • Administration
    • Production Notes
    • Operations Checklist
    • Development Checklist
    • Performance
      • Database Profiler
        • Database Profiler Output
      • Disable Transparent Huge Pages (THP)
      • UNIX ulimit Settings
    • Configuration and Maintenance
      • Run-time Database Configuration
      • Upgrade to the Latest Revision of MongoDB
      • Manage mongod Processes
      • Terminate Running Operations
      • Rotate Log Files
    • Data Center Awareness
      • Workload Isolation in MongoDB Deployments
      • Zones
        • 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 Backup Methods
      • Back Up and Restore with Filesystem Snapshots
      • Back Up and Restore with MongoDB Tools
      • Restore a Replica Set from MongoDB Backups
      • Backup and Restore Sharded Clusters
        • Back Up a Sharded Cluster with File System Snapshots
        • Back Up a Sharded Cluster with Database Dumps
        • Schedule Backup Window for Sharded Clusters
        • Restore a Sharded Cluster
      • Recover a Standalone after an Unexpected Shutdown
    • Monitoring for MongoDB
      • Monitor MongoDB With SNMP on Linux
      • Monitor MongoDB Windows with SNMP
      • Troubleshoot SNMP
  • Storage
    • Storage Engines
      • WiredTiger Storage Engine
        • Change Standalone to WiredTiger
        • Change Replica Set to WiredTiger
        • Change Sharded Cluster to WiredTiger
      • MMAPv1 Storage Engine
      • In-Memory Storage Engine
    • Journaling
      • Manage Journaling
    • GridFS
    • FAQ: MongoDB Storage
  • Frequently Asked Questions
    • FAQ: MongoDB Fundamentals
    • FAQ: Indexes
    • FAQ: Concurrency
    • FAQ: Sharding with MongoDB
    • FAQ: Replication and Replica Sets
    • FAQ: MongoDB Storage
    • FAQ: MongoDB Diagnostics
  • Reference
    • Operators
      • Query and Projection Operators
        • Comparison Query Operators
          • $eq
          • $gt
          • $gte
          • $in
          • $lt
          • $lte
          • $ne
          • $nin
        • Logical Query Operators
          • $and
          • $not
          • $nor
          • $or
        • Element Query Operators
          • $exists
          • $type
        • Evaluation Query Operators
          • $expr
          • $jsonSchema
          • $mod
          • $regex
          • $text
          • $where
        • Geospatial Query Operators
          • $geoIntersects
          • $geoWithin
          • $near
          • $nearSphere
          • $box
          • $center
          • $centerSphere
          • $geometry
          • $maxDistance
          • $minDistance
          • $polygon
          • $uniqueDocs
        • Array Query Operators
          • $all
          • $elemMatch (query)
          • $size
        • Bitwise Query Operators
          • $bitsAllClear
          • $bitsAllSet
          • $bitsAnyClear
          • $bitsAnySet
        • $comment
        • Projection Operators
          • $ (projection)
          • $elemMatch (projection)
          • $meta
          • $slice (projection)
      • Update Operators
        • Field Update Operators
          • $currentDate
          • $inc
          • $min
          • $max
          • $mul
          • $rename
          • $set
          • $setOnInsert
          • $unset
        • Array Update Operators
          • $ (update)
          • $[]
          • $[<identifier>]
          • $addToSet
          • $pop
          • $pull
          • $push
          • $pullAll
          • $each
          • $position
          • $slice
          • $sort
        • Bitwise Update Operator
          • $bit
      • Aggregation Pipeline Stages
        • $addFields (aggregation)
        • $bucket (aggregation)
        • $bucketAuto (aggregation)
        • $collStats (aggregation)
        • $count (aggregation)
        • $currentOp (aggregation)
        • $facet (aggregation)
        • $geoNear (aggregation)
        • $graphLookup (aggregation)
        • $group (aggregation)
        • $indexStats (aggregation)
        • $limit (aggregation)
        • $listLocalSessions
        • $listSessions
        • $lookup (aggregation)
        • $match (aggregation)
        • $out (aggregation)
        • $project (aggregation)
        • $redact (aggregation)
        • $replaceRoot (aggregation)
        • $sample (aggregation)
        • $skip (aggregation)
        • $sort (aggregation)
        • $sortByCount (aggregation)
        • $unwind (aggregation)
      • Aggregation Pipeline Operators
        • $abs (aggregation)
        • $add (aggregation)
        • $addToSet (aggregation)
        • $allElementsTrue (aggregation)
        • $and (aggregation)
        • $anyElementTrue (aggregation)
        • $arrayElemAt (aggregation)
        • $arrayToObject (aggregation)
        • $avg (aggregation)
        • $ceil (aggregation)
        • $cmp (aggregation)
        • $concat (aggregation)
        • $concatArrays (aggregation)
        • $cond (aggregation)
        • $dateFromParts (aggregation)
        • $dateToParts (aggregation)
        • $dateFromString (aggregation)
        • $dateToString (aggregation)
        • $dayOfMonth (aggregation)
        • $dayOfWeek (aggregation)
        • $dayOfYear (aggregation)
        • $divide (aggregation)
        • $eq (aggregation)
        • $exp (aggregation)
        • $filter (aggregation)
        • $first (aggregation)
        • $floor (aggregation)
        • $gt (aggregation)
        • $gte (aggregation)
        • $hour (aggregation)
        • $ifNull (aggregation)
        • $in (aggregation)
        • $indexOfArray (aggregation)
        • $indexOfBytes (aggregation)
        • $indexOfCP (aggregation)
        • $isArray (aggregation)
        • $isoDayOfWeek (aggregation)
        • $isoWeek (aggregation)
        • $isoWeekYear (aggregation)
        • $last (aggregation)
        • $let (aggregation)
        • $literal (aggregation)
        • $ln (aggregation)
        • $log (aggregation)
        • $log10 (aggregation)
        • $lt (aggregation)
        • $lte (aggregation)
        • $map (aggregation)
        • $max (aggregation)
        • $mergeObjects (aggregation)
        • $meta (aggregation)
        • $min (aggregation)
        • $millisecond (aggregation)
        • $minute (aggregation)
        • $mod (aggregation)
        • $month (aggregation)
        • $multiply (aggregation)
        • $ne (aggregation)
        • $not (aggregation)
        • $objectToArray (aggregation)
        • $or (aggregation)
        • $pow (aggregation)
        • $push (aggregation)
        • $range (aggregation)
        • $reduce (aggregation)
        • $reverseArray (aggregation)
        • $second (aggregation)
        • $setDifference (aggregation)
        • $setEquals (aggregation)
        • $setIntersection (aggregation)
        • $setIsSubset (aggregation)
        • $setUnion (aggregation)
        • $size (aggregation)
        • $slice (aggregation)
        • $split (aggregation)
        • $sqrt (aggregation)
        • $stdDevPop (aggregation)
        • $stdDevSamp (aggregation)
        • $strcasecmp (aggregation)
        • $strLenBytes (aggregation)
        • $strLenCP (aggregation)
        • $substr (aggregation)
        • $substrBytes (aggregation)
        • $substrCP (aggregation)
        • $subtract (aggregation)
        • $sum (aggregation)
        • $switch (aggregation)
        • $toLower (aggregation)
        • $toUpper (aggregation)
        • $trunc (aggregation)
        • $type (aggregation)
        • $week (aggregation)
        • $year (aggregation)
        • $zip (aggregation)
      • Query Modifiers
        • $comment
        • $explain
        • $hint
        • $maxScan
        • $max
        • $maxTimeMS
        • $min
        • $orderby
        • $query
        • $returnKey
        • $showDiskLoc
        • $natural
    • Database Commands
      • Aggregation Commands
        • aggregate
        • count
        • distinct
        • group
        • mapReduce
      • Geospatial Commands
        • geoNear
        • geoSearch
      • Query and Write Operation Commands
        • delete
        • eval
        • find
        • findAndModify
        • getLastError
        • getMore
        • getPrevError
        • insert
        • parallelCollectionScan
        • resetError
        • update
      • Query Plan Cache Commands
        • planCacheClear
        • planCacheClearFilters
        • planCacheListFilters
        • planCacheListPlans
        • planCacheListQueryShapes
        • planCacheSetFilter
      • Authentication Commands
        • authenticate
        • authSchemaUpgrade
        • copydbgetnonce
        • getnonce
        • logout
      • User Management Commands
        • createUser
        • dropAllUsersFromDatabase
        • dropUser
        • grantRolesToUser
        • revokeRolesFromUser
        • updateUser
        • usersInfo
      • Role Management Commands
        • createRole
        • dropRole
        • dropAllRolesFromDatabase
        • grantPrivilegesToRole
        • grantRolesToRole
        • invalidateUserCache
        • revokePrivilegesFromRole
        • revokeRolesFromRole
        • rolesInfo
        • updateRole
      • Replication Commands
        • applyOps
        • isMaster
        • replSetAbortPrimaryCatchUp
        • replSetFreeze
        • replSetGetConfig
        • replSetGetStatus
        • replSetInitiate
        • replSetMaintenance
        • replSetReconfig
        • replSetResizeOplog
        • replSetStepDown
        • replSetSyncFrom
        • resync
      • Sharding Commands
        • addShard
        • addShardToZone
        • balancerStart
        • balancerStatus
        • balancerStop
        • checkShardingIndex
        • cleanupOrphaned
        • enableSharding
        • flushRouterConfig
        • getShardMap
        • getShardVersion
        • isdbgrid
        • listShards
        • medianKey
        • moveChunk
        • movePrimary
        • mergeChunks
        • removeShard
        • removeShardFromZone
        • setShardVersion
        • shardCollection
        • shardingState
        • split
        • splitChunk
        • splitVector
        • unsetSharding
        • updateZoneKeyRange
      • Sessions Commands
        • endSessions
        • killAllSessions
        • killAllSessionsByPattern
        • killSessions
        • refreshSessions
        • startSession
      • Administration Commands
        • clean
        • clone
        • cloneCollection
        • cloneCollectionAsCapped
        • collMod
        • compact
        • connPoolSync
        • convertToCapped
        • copydb
        • create
        • createIndexes
        • currentOp
        • drop
        • dropDatabase
        • dropIndexes
        • filemd5
        • fsync
        • fsyncUnlock
        • getParameter
        • killCursors
        • killOp
        • listCollections
        • listDatabases
        • listIndexes
        • logRotate
        • reIndex
        • renameCollection
        • repairDatabase
        • setFeatureCompatibilityVersion
        • setParameter
        • shutdown
        • touch
      • Diagnostic Commands
        • availableQueryOptions
        • buildInfo
        • collStats
        • connPoolStats
        • connectionStatus
        • cursorInfo
        • dataSize
        • dbHash
        • dbStats
        • diagLogging
        • driverOIDTest
        • explain
        • features
        • getCmdLineOpts
        • getLog
        • hostInfo
        • isSelf
        • listCommands
        • netstat
        • ping
        • profile
        • serverStatus
        • shardConnPoolStats
        • top
        • validate
        • whatsmyuri
      • System Events Auditing Commands
        • logApplicationMessage
    • mongo Shell Methods
      • Collection Methods
        • db.collection.aggregate()
        • db.collection.bulkWrite()
        • db.collection.copyTo()
        • db.collection.count()
        • db.collection.createIndex()
        • db.collection.createIndexes()
        • db.collection.dataSize()
        • db.collection.deleteOne()
        • db.collection.deleteMany()
        • db.collection.distinct()
        • db.collection.drop()
        • db.collection.dropIndex()
        • db.collection.dropIndexes()
        • db.collection.ensureIndex()
        • db.collection.explain()
        • db.collection.find()
        • db.collection.findAndModify()
        • db.collection.findOne()
        • db.collection.findOneAndDelete()
        • db.collection.findOneAndReplace()
        • db.collection.findOneAndUpdate()
        • db.collection.getIndexes()
        • db.collection.getShardDistribution()
        • db.collection.getShardVersion()
        • db.collection.group()
        • db.collection.insert()
        • db.collection.insertOne()
        • db.collection.insertMany()
        • db.collection.isCapped()
        • db.collection.latencyStats()
        • db.collection.mapReduce()
        • db.collection.reIndex()
        • db.collection.remove()
        • db.collection.renameCollection()
        • db.collection.replaceOne()
        • db.collection.save()
        • db.collection.stats()
        • db.collection.storageSize()
        • db.collection.totalIndexSize()
        • db.collection.totalSize()
        • db.collection.update()
        • db.collection.updateOne()
        • db.collection.updateMany()
        • db.collection.watch()
        • db.collection.validate()
      • Cursor Methods
        • cursor.addOption()
        • cursor.allowPartialResults()
        • cursor.batchSize()
        • cursor.close()
        • cursor.isClosed()
        • cursor.collation()
        • cursor.comment()
        • cursor.count()
        • cursor.explain()
        • cursor.forEach()
        • cursor.hasNext()
        • cursor.hint()
        • cursor.isExhausted()
        • cursor.itcount()
        • cursor.limit()
        • cursor.map()
        • cursor.max()
        • cursor.maxScan()
        • cursor.maxTimeMS()
        • cursor.min()
        • cursor.next()
        • cursor.noCursorTimeout()
        • cursor.objsLeftInBatch()
        • cursor.pretty()
        • cursor.readConcern()
        • cursor.readPref()
        • cursor.returnKey()
        • cursor.showRecordId()
        • cursor.size()
        • cursor.skip()
        • cursor.sort()
        • cursor.tailable()
        • cursor.toArray()
      • Database Methods
        • db.adminCommand()
        • db.aggregate()
        • db.cloneCollection()
        • db.cloneDatabase()
        • db.commandHelp()
        • db.copyDatabase()
        • db.createCollection()
        • db.createView()
        • db.currentOp()
        • db.dropDatabase()
        • db.eval()
        • db.fsyncLock()
        • db.fsyncUnlock()
        • db.getCollection()
        • db.getCollectionInfos()
        • db.getCollectionNames()
        • db.getLastError()
        • db.getLastErrorObj()
        • db.getLogComponents()
        • db.getMongo()
        • db.getName()
        • db.getPrevError()
        • db.getProfilingLevel()
        • db.getProfilingStatus()
        • db.getReplicationInfo()
        • db.getSiblingDB()
        • db.help()
        • db.hostInfo()
        • db.isMaster()
        • db.killOp()
        • db.listCommands()
        • db.logout()
        • db.printCollectionStats()
        • db.printReplicationInfo()
        • db.printShardingStatus()
        • db.printSlaveReplicationInfo()
        • db.repairDatabase()
        • db.resetError()
        • db.runCommand()
        • db.serverBuildInfo()
        • db.serverCmdLineOpts()
        • db.serverStatus()
        • db.setLogLevel()
        • db.setProfilingLevel()
        • db.shutdownServer()
        • db.stats()
        • db.version()
      • Query Plan Cache Methods
        • db.collection.getPlanCache()
        • PlanCache.clear()
        • PlanCache.clearPlansByQuery()
        • PlanCache.getPlansByQuery()
        • PlanCache.help()
        • PlanCache.listQueryShapes()
      • Bulk Operation Methods
        • db.collection.initializeOrderedBulkOp()
        • db.collection.initializeUnorderedBulkOp()
        • Bulk()
        • Bulk.execute()
        • Bulk.find()
        • Bulk.find.arrayFilters()
        • Bulk.find.collation()
        • Bulk.find.remove()
        • Bulk.find.removeOne()
        • Bulk.find.replaceOne()
        • Bulk.find.updateOne()
        • Bulk.find.update()
        • Bulk.find.upsert()
        • Bulk.getOperations()
        • Bulk.insert()
        • Bulk.tojson()
        • Bulk.toString()
      • User Management Methods
        • db.auth()
        • db.changeUserPassword()
        • db.createUser()
        • db.dropUser()
        • db.dropAllUsers()
        • db.getUser()
        • db.getUsers()
        • db.grantRolesToUser()
        • db.removeUser()
        • db.revokeRolesFromUser()
        • db.updateUser()
      • Role Management Methods
        • db.createRole()
        • db.dropRole()
        • db.dropAllRoles()
        • db.getRole()
        • db.getRoles()
        • db.grantPrivilegesToRole()
        • db.revokePrivilegesFromRole()
        • db.grantRolesToRole()
        • db.revokeRolesFromRole()
        • db.updateRole()
      • Replication Methods
        • rs.add()
        • rs.addArb()
        • rs.conf()
        • rs.freeze()
        • rs.help()
        • rs.initiate()
        • rs.printReplicationInfo()
        • rs.printSlaveReplicationInfo()
        • rs.reconfig()
        • rs.remove()
        • rs.status()
        • rs.stepDown()
        • rs.syncFrom()
      • Sharding Methods
        • sh.addShard()
        • sh.addShardTag()
        • sh.addShardToZone()
        • sh.addTagRange()
        • sh.disableBalancing()
        • sh.enableBalancing()
        • sh.disableAutoSplit
        • sh.enableAutoSplit
        • sh.enableSharding()
        • sh.getBalancerHost()
        • sh.getBalancerState()
        • sh.removeTagRange()
        • sh.removeRangeFromZone()
        • sh.help()
        • sh.isBalancerRunning()
        • sh.moveChunk()
        • sh.removeShardTag()
        • sh.removeShardFromZone()
        • sh.setBalancerState()
        • sh.shardCollection()
        • sh.splitAt()
        • sh.splitFind()
        • sh.startBalancer()
        • sh.status()
        • sh.stopBalancer()
        • sh.waitForBalancer()
        • sh.waitForBalancerOff()
        • sh.waitForPingChange()
        • sh.updateZoneKeyRange()
      • Object Constructors and Methods
        • BulkWriteResult()
        • Date()
        • ObjectId
        • ObjectId.getTimestamp()
        • ObjectId.toString()
        • ObjectId.valueOf()
        • UUID()
        • WriteResult()
        • WriteResult.hasWriteError()
        • WriteResult.hasWriteConcernError()
      • Connection Methods
        • connect()
        • Mongo()
        • Mongo.getDB()
        • Mongo.getReadPrefMode()
        • Mongo.getReadPrefTagSet()
        • Mongo.isCausalConsistency()
        • Mongo.setCausalConsistency()
        • Mongo.setReadPref()
        • Mongo.startSession()
        • Session
        • SessionOptions
      • Native Methods
        • cat()
        • cd()
        • copyDbpath()
        • getHostName()
        • getMemInfo()
        • hostname()
        • listFiles()
        • load()
        • ls()
        • md5sumFile()
        • mkdir()
        • pwd()
        • quit()
        • removeFile()
        • resetDbpath()
        • sleep()
        • setVerboseShell()
        • version()
        • _isWindows()
        • _rand()
    • MongoDB Package Components
      • mongod
      • mongos
      • mongo
      • mongod.exe
      • mongos.exe
      • mongodump
      • mongorestore
      • bsondump
      • mongoimport
      • mongoexport
      • mongostat
      • mongotop
      • mongoperf
      • mongoreplay
      • mongoldap
      • mongofiles
      • install_compass
    • Configuration File Options
    • MongoDB Server Parameters
    • MongoDB Limits and Thresholds
    • Explain Results
    • System Collections
    • Connection String URI Format
    • Collation
      • Collation Locales and Default Parameters
    • MongoDB Wire Protocol
    • Log Messages
    • Exit Codes and Statuses
    • Glossary
    • Default MongoDB Port
    • Server Sessions
  • Release Notes
    • Release Notes for MongoDB 3.6
      • 3.6 Changelog
      • Compatibility Changes in MongoDB 3.6
      • Upgrade a Standalone to 3.6
      • Upgrade a Replica Set to 3.6
      • Upgrade a Sharded Cluster to 3.6
      • Downgrade 3.6 Standalone to 3.4
      • Downgrade 3.6 Replica Set to 3.4
      • Downgrade 3.6 Sharded Cluster to 3.4
    • Release Notes for MongoDB 3.4
      • 3.4 Changelog
      • Compatibility Changes in MongoDB 3.4
      • Upgrade a Standalone to 3.4
      • Upgrade a Replica Set to 3.4
      • Upgrade a Sharded Cluster to 3.4
      • Downgrade MongoDB 3.4 to 3.2
        • Downgrade 3.4 Standalone to 3.2
        • Downgrade 3.4 Replica Set to 3.2
        • Downgrade 3.4 Sharded Cluster to 3.2
    • Release Notes for MongoDB 3.2
      • 3.2 Changelog
      • Compatibility Changes in MongoDB 3.2
        • JavaScript Changes in MongoDB 3.2
      • Upgrade MongoDB to 3.2
      • Downgrade MongoDB from 3.2
    • Release Notes for MongoDB 3.0
      • 3.0 Changelog
      • Compatibility Changes in MongoDB 3.0
      • Upgrade MongoDB to 3.0
      • Upgrade to SCRAM
      • Downgrade MongoDB from 3.0
    • Release Notes for MongoDB 2.6
      • 2.6 Changelog
      • Compatibility Changes in MongoDB 2.6
      • Upgrade MongoDB to 2.6
      • Upgrade User Authorization Data to 2.6 Format
      • Downgrade MongoDB from 2.6
    • Release Notes for MongoDB 2.4
      • 2.4 Changelog
      • JavaScript Changes in MongoDB 2.4
      • Upgrade MongoDB to 2.4
      • Compatibility and Index Type Changes in MongoDB 2.4
    • Release Notes for MongoDB 2.2
    • Release Notes for MongoDB 2.0
    • Release Notes for MongoDB 1.8
    • Release Notes for MongoDB 1.6
    • Release Notes for MongoDB 1.4
    • Release Notes for MongoDB 1.2.x
    • MongoDB Versioning
  • Technical Support
Home API Docs Tools
Home
API Docs
Tools

Frequently Asked Questions

FAQ pages in this section:

  • FAQ: MongoDB Fundamentals
  • FAQ: Indexes
  • FAQ: Concurrency
  • FAQ: Sharding with MongoDB
  • FAQ: Replication and Replica Sets
  • FAQ: MongoDB Storage
  • FAQ: MongoDB Diagnostics
Name Mongodb Manual
Version
Language
Badge
Last Updated 2021-07-07T13:06:03
扫码关注公众号

Docs4dev®

如果你在使用过程中遇到任何问题,可以在 这里 提issue。

蜀ICP备14021783号-6

Copyright © Docs4dev all right reserved, powered by Docs4dev