System Collections
On this page
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 also stores some additional instance-local metadata in the
local database local.replset.*
namespace, specifically for replication purposes and in the config
database for sessions information.
Collections
System collections include these collections stored in the admin
database:
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.users
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 theadmin.system.roles
collection.
admin.system.version
The
admin.system.version
collection stores metadata to support internal operations. Do not modify this collection unless specifically instructed to in this documentation or by a MongoDB support engineer.
System collections include these collections stored in the config
database:
config.system.indexBuilds
The
indexBuilds
collection stores information related to in-progress index builds.
config.system.preimages
Stores previous versions of modified documents from collections with the changeStreamPreAndPostImages option enabled. The
config.system.preimages
collection is automatically purged when the pre-images expire. For details, seechangeStreamOptions.preAndPostImages.expireAfterSeconds
.
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.Do not modify this collection.
Important
When you upgrade to MongoDB 8.0, if you have any
system.buckets
collections that are not time-series collections, you might need todrop
orrename
those collections before you upgrade, depending on your 8.0 patch release:- MongoDB 8.0.5 and later
- You do not need to drop
system.buckets
collections that aren't time-series collections before you upgrade. However, you must drop or rename them after you complete your upgrade. - MongoDB 8.0.4 and earlier
- You must drop or rename
system.buckets
collections that aren't time-series collections before you upgrade. Allsystem.buckets
collections must have valid time series options configured before you upgrade to versions 8.0.0 - 8.0.4.
To determine whether you have
system.buckets
collections that are not time-series collections, use thedb.getCollectionInfos()
method with a filter:db.getCollectionInfos( { $and: [ { name: { $regex: /^system\.buckets/ } }, { 'options.timeseries': { $exists: false } } ] } )
<database>.system.profile
The
<database>.system.profile
collection stores database profiling information. For information on profiling, see Database Profiler.
<database>.system.js
The
<database>.system.js
collection stores special JavaScript code for use in server side JavaScript. See Store a JavaScript Function on the Server for more information.
<database>.system.views
The
<database>.system.views
collection contains information about each view in the database.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.