System Collections系统集合

On this page本页内容

Synopsis提要

MongoDB stores system information in collections that use the <database>.system.* namespace, which MongoDB reserves for internal use. MongoDB在使用<database>.system.*名称空间的集合中存储系统信息,MongoDB保留该名称空间供内部使用。Do not create collections that begin with system.不要创建以system开头的集合。

MongoDB also stores some additional instance-local metadata in the local database, specifically for replication purposes and in the config database for sessions information.MongoDB还将一些额外的实例本地元数据存储在local数据库中,专门用于复制目的,并存储在配置数据库中以获取会话信息。

Collections集合

System collections include these collections stored in the admin database:系统集合包括存储在admin数据库中的这些集合:

admin.system.roles

The admin.system.roles collection stores custom roles that administrators create and assign to users to provide access to specific resources.admin.system.roles集合存储管理员创建并分配给用户的自定义角色,以提供对特定资源的访问。

admin.system.users

The admin.system.users collection stores the user's authentication credentials as well as any roles assigned to the user. admin.system.users集合存储用户的身份验证凭据以及分配给用户的任何角色。Users may define authorization roles in the admin.system.roles collection.用户可以在admin.system.roles集合中定义授权角色。

admin.system.version

The admin.system.version collection stores metadata to support internal operations. admin.system.version集合存储元数据以支持内部操作。Do not modify this collection unless specifically instructed to in this documentation or by a MongoDB support engineer.除非本文档或MongoDB支持工程师明确指示,否则不要修改此集合。

System collections include these collections stored in the config database:系统集合包括存储在config数据库中的这些集合:

config.system.indexBuilds

New in version 4.4.在版本4.4中新增

The indexBuilds collection stores information related to in-progress index builds.indexBuilds集合存储与正在进行的索引生成相关的信息。

System collections also include these collections stored directly in each database:系统集合还包括直接存储在每个数据库中的这些集合:

<database>.system.namespaces
Note注意
Removed in 4.2在4.2中删除

Starting in MongoDB 4.2, <database>.system.namespaces has been removed (access to the collection has been deprecated since 3.0). 从MongoDB 4.2开始,<database>.system.namespaces已被删除(自3.0以来,对集合的访问已被弃用)。To list the collections in a database, use the listCollections command instead.要列出数据库中的集合,请改用listCollections命令。

<database>.system.indexes
Note注意
Removed in 4.2在4.2中删除

Starting in MongoDB 4.2, <database>.system.indexes has been removed (access to the collection has been deprecated since 3.0). 从MongoDB 4.2开始,<database>.system.indexes已被删除(自3.0以来,对该集合的访问已被弃用)。To list the indexes, use the listIndexes command instead.要列出索引,请改用listIndexes命令。

<database>.system.profile

The <database>.system.profile collection stores database profiling information. <database>.system.profile集合存储数据库分析信息。For information on profiling, see Database Profiling.有关分析的信息,请参阅数据库分析

<database>.system.js

The <database>.system.js collection stores special JavaScript code for use in server side JavaScript. <database>.system.js集合存储用于服务器端JavaScript的特殊JavaScript代码。See Store a JavaScript Function on the Server for more information.有关更多信息,请参阅在服务器上存储JavaScript函数

<database>.system.views

The <database>.system.views collection contains information about each view in the database.<database>.system.views集合包含关于数据库中每个视图的信息。

Starting in MongoDB 5.0, for featureCompatibilityVersion set to "5.0" or greater, users can no longer write directly to the <database>.system.views collection.从MongoDB 5.0开始,对于设置为"5.0"或更高版本的功能兼容性版本用户不能再直接写入<database>.system.views集合。

←  Explain ResultsConnection String URI Format →