OPTIONS
翻译或纠错本页面

系统集合

概要

MongoDB有一个存储系统信息的集合,利用它内部的 <database>.system.* namespace 命令来使用该集合。不要用 system. 开头的名称来创建集合。

MongoDB也会将一些附加的元数据存储在 local database ,特别是在复制集中。

集合

系统集合包括了存储在 admin 数据库中的集合:

admin.system.roles

2.6 新版功能.

The admin.system.roles collection stores custom roles that administrators create and assign to users to provide access to specific resources.

admin.system.users

在 2.6 版更改.

The admin.system.users collection stores the user’s authentication credentials as well as any roles assigned to the user. Users may define authorization roles in the admin.system.roles collection.

admin.system.version

2.6 新版功能.

存储用户证书文档的架构版本

系统集合还包括直接存储在每个数据库中的这些集合:

<database>.system.namespaces

The <database>.system.namespaces collection contains information about all of the database’s collections. Additional namespace metadata exists in the database.ns files and is opaque to database users.

<database>.system.indexes

The <database>.system.indexes collection lists all the indexes in the database. Add and remove data from this collection via the ensureIndex() and dropIndex()

<database>.system.profile

The <database>.system.profile collection stores database profiling information. For information on profiling, see Database Profiling.

<database>.system.js

The <database>.system.js collection holds special JavaScript code for use in server side JavaScript. See Store a JavaScript Function on the Server for more information.

ON THIS PAGE