Docs HomeMongoDB Manual

System Collections系统集合

Synopsis提要

MongoDB stores system information in collections that use the <database>.system.* namespace, which MongoDB reserves for internal use. Do not create collections that begin with system.MongoDB将系统信息存储在使用<database>.system.*命名空间的集合中,MongoDB保留该命名空间供内部使用。不要创建以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还在本地数据库中存储一些额外的实例本地元数据,专门用于复制目的,并在配置数据库中存储会话信息

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集合存储与正在进行的索引生成相关的信息。

Database-Specific Collections数据库特定集合

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

<database>.system.buckets

Stores the underlying data associated to a time series collection. 存储与时间序列集合关联的基础数据。The system.buckets collection stores data in an optimized format and schema for an efficient representation of the persisted time series data.system.buckets集合以优化的格式和模式存储数据,以便有效地表示持久化的时间序列数据。

Do not modify this collection.请勿修改此集合。

<database>.system.namespaces
Note

Removed in 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

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”或更高版本的featureCompatibilityVersion,用户不能再直接写入<database>.system.views集合。