For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
See how MongoDB 9.0 delivers up to 2x higher throughput.
MongoDB Branding Shape
Register now >
Docs Menu

rs.freeze() (mongosh method)

rs.freeze(seconds)

Makes the current replica set member ineligible to become primary for the period specified.

Important

mongosh Method

This page documents a mongosh method. This is not the documentation for database commands or language-specific drivers, such as Node.js.

For the database command, see the replSetFreeze command.

For MongoDB API drivers, refer to the language-specific MongoDB driver documentation.

The rs.freeze() method has the following parameter:

Parameter
Type
Description

seconds

number

The duration the member is ineligible to become primary.

This method is available in deployments hosted in the following environments:

Rate this page