Synopsis剧情简介
MongoDB stores system information in collections that use the MongoDB将系统信息存储在使用<database>.system.* namespace, which MongoDB reserves for internal use. Do not create collections that begin with system.<database>.system.*命名空间的集合中,MongoDB保留该命名空间供内部使用。不要创建以system开头的集合。
MongoDB also stores some additional instance-local metadata in the local database MongoDB还在本地数据库local.replset.* namespace, specifically for replication purposes and in the config database for sessions information.local.replset.*命名空间中存储了一些额外的实例本地元数据,专门用于复制目的,并在配置数据库中存储了会话信息。
Collections集合
System collections include these collections stored in the 系统集合包括存储在admin database:admin数据库中的这些集合:
admin.system.rolesTheadmin.system.rolescollection stores custom roles that administrators create and assign to users to provide access to specific resources.admin.system.roles集合存储管理员创建并分配给用户的自定义角色,以提供对特定资源的访问。
admin.system.usersTheadmin.system.userscollection stores the user's authentication credentials as well as any roles assigned to the user. Users may define authorization roles in theadmin.system.rolescollection.admin.system.users集合存储用户的身份验证凭据以及分配给用户的任何角色。用户可以在admin.system.roles集合中定义授权角色。
admin.system.versionTheadmin.system.versioncollection stores metadata to support internal operations. Do not modify this collection unless specifically instructed to in this documentation or by a MongoDB support engineer.admin.system.version集合存储元数据以支持内部操作。除非本文档或MongoDB支持工程师特别指示,否则不要修改此集合。
System collections include these collections stored in the 系统集合包括存储在config database:config数据库中的这些集合:
config.system.indexBuildsTheindexBuildscollection stores information related to in-progress index builds.indexBuilds集合存储与正在进行的索引构建相关的信息。
config.system.preimagesStores previous versions of modified documents from collections with the changeStreamPreAndPostImages option enabled. The在启用config.system.preimagescollection is automatically purged when the pre-images expire.changeStreamPreAndPostImages选项的情况下,存储集合中已修改文档的先前版本。预映像过期时,config.system.preimages集合会自动清除。For details, see有关详细信息,请参阅changeStreamOptions.preAndPostImages.expireAfterSeconds.changeStreamOptions.preAndPostImages.expireAfterSeconds。
Database-Specific Collections数据库特定集合
System collections also include these collections stored directly in each database:系统集合还包括直接存储在每个数据库中的这些集合:
<database>.system.profileThe<database>.system.profilecollection stores database profiling information. For information on profiling, see Database Profiler.<database>.system.profile集合存储数据库分析信息。有关分析的信息,请参阅数据库分析器。
<database>.system.jsThe<database>.system.jscollection 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.viewsThe<database>.system.viewscollection contains information about each view in the database.<database>.system.views集合包含有关数据库中每个视图的信息。Starting in MongoDB 5.0, for featureCompatibilityVersion set to从MongoDB 5.0开始,对于设置为“5.0”或更高版本的"5.0"or greater, users can no longer write directly to the<database>.system.viewscollection.featureCompatibilityVersion,用户不能再直接写入<database>.system.views集合。