diff --git a/docs/api/interfaces/mongo-memory-instance-opts.md b/docs/api/interfaces/mongo-memory-instance-opts.md index bd0627ace..52e978cb1 100644 --- a/docs/api/interfaces/mongo-memory-instance-opts.md +++ b/docs/api/interfaces/mongo-memory-instance-opts.md @@ -80,7 +80,7 @@ Set which storage engine to use, uses [`StorageEngine`](#helper-type-storageengi Typings: `replicaMemberConfig?: ReplicaMemberConfig` -Set custom a custom Replica Member Config, uses [`ReplicaMemberConfig`](TODO). +Set custom a custom Replica Member Config, uses [`ReplicaMemberConfig`](./mongo-memory-instance-replicamemberconfig.md). Only has a effect when started with [`MongoMemoryReplSet`](../classes/mongo-memory-replset.md). ## Helper Type `StorageEngine` diff --git a/docs/api/interfaces/mongo-memory-instance-replicamemberconfig.md b/docs/api/interfaces/mongo-memory-instance-replicamemberconfig.md new file mode 100644 index 000000000..66bbe0b37 --- /dev/null +++ b/docs/api/interfaces/mongo-memory-instance-replicamemberconfig.md @@ -0,0 +1,66 @@ +--- +id: mongo-memory-instance-replicamemberconfig +title: 'ReplicaMemberConfig' +--- + +API Documentation of `ReplicaMemberConfig`-Interface + +## Values + +### arbiterOnly + +Typings: `arbiterOnly?: boolean` +Default: `false` + +Set a member to be a arbiter, see [MongoDB ReplSet Arbiter](https://www.mongodb.com/docs/manual/core/replica-set-arbiter/) and [MongoDB add an Arbiter to the ReplSet](https://www.mongodb.com/docs/manual/tutorial/add-replica-set-arbiter/). + +### buildIndexes + +Typings: `buildIndexes?: boolean` +Default: `true` + +Set whether to automatically build indexes. + +### hidden + +Typings: `hidden?: boolean` +Default: `true` + +Set a the instance to not show up in the command `hello`. + +### priority + +Typings: `priority?: number` +Default: `1` + +Set the priority in becoming a Primary. Higher is more likely. `0` is only for arbiters. + +### tags + +Typings: `tags?: any` +Default: `null` + +Set custom tags for a member, see [MongoDB ReplSet tags](https://www.mongodb.com/docs/manual/tutorial/configure-replica-set-tag-sets/). + +### slaveDelay + +Typings: `slaveDelay?: number` +Default: `0` + +Set how long behind the secondary members should be behind the primary, for more see [MongoDB 4.x Configure a Delayed Replica Set Member](https://www.mongodb.com/docs/v4.2/tutorial/configure-a-delayed-replica-set-member/). +This option is only for MongoDB `4.x`, for `5.0` or higher use [`secondaryDelaySecs`](#secondarydelaysecs). + +### secondaryDelaySecs + +Typings: `secondaryDelaySecs?: number` +Default: `0` + +Set how long behind the secondary members should be behind the primary, for more see [MongoDB Configure a Delayed Replica Set Member](https://www.mongodb.com/docs/manual/tutorial/configure-a-delayed-replica-set-member/). +This option is a for MongoDB `5.0` or higher. + +### votes + +Typings: `votes?: number` +Default: `1` + +Set how many votes this member has for electing a primary. Arbiters only have a static vote of `1`. diff --git a/website/sidebars.js b/website/sidebars.js index 27a7b0ec1..f1c81a3e6 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -14,6 +14,7 @@ module.exports = { 'api/interfaces/mongo-memory-server-automaticauth', 'api/interfaces/mongo-memory-server-createuser', 'api/interfaces/mongo-memory-instance-opts', + 'api/interfaces/mongo-memory-instance-replicamemberconfig', ], }, guides: {