Skip to content

Commit 9f114ab

Browse files
committed
docs(replset-opts): add file
1 parent dc6b4c8 commit 9f114ab

File tree

3 files changed

+95
-1
lines changed

3 files changed

+95
-1
lines changed

docs/api/classes/mongo-memory-replset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Will Throw an Error if `state` is not `stopped`
206206

207207
Typings: `protected _replSetOpts!: Required<ReplSetOpts>`
208208

209-
Stores the options used for the ReplSet Initiation
209+
Stores the options used for the ReplSet Initiation, uses [`ReplSetOpts`](../interfaces/replset-opts.md).
210210

211211
### _keyfiletmp
212212

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
id: replset-opts
3+
title: 'ReplSetOpts'
4+
---
5+
6+
API Documentation of `ReplSetOpts`-Interface
7+
8+
## Values
9+
10+
### auth
11+
12+
Typings: `auth?: boolean | AutomaticAuth`
13+
Default: `false`
14+
15+
Set wheter to enable Authentication, with configuration from [`AutomaticAuth`](./mongo-memory-server-automaticauth.md).
16+
17+
Also see [`MongoMemoryInstanceOpts.auth`](./mongo-memory-instance-opts.md#auth).
18+
19+
### args
20+
21+
Typings: `args?: string[]`
22+
Default: `[]`
23+
24+
Set custom arguments to passs to the `mongod` binary.
25+
26+
Also see [`MongoMemoryInstanceOpts.args`](./mongo-memory-instance-opts.md#args).
27+
28+
### dbName
29+
30+
Typings: `dbName?: string`
31+
Default: `""`
32+
33+
**Currently unused**.
34+
35+
Set a custom dbname to use in `getUri`.
36+
37+
Also see [`MongoMemoryInstanceOpts.dbName`](./mongo-memory-instance-opts.md#dbname).
38+
39+
### ip
40+
41+
Typings: `ip?: string`
42+
Default: `"127.0.0.1"`
43+
44+
Set which ip to bind to.
45+
46+
Also see [`MongoMemoryInstanceOpts.ip`](./mongo-memory-instance-opts.md#ip).
47+
48+
### name
49+
50+
Typings: `name?: string`
51+
Default: `"testset"`
52+
53+
Set which replset name to use.
54+
55+
See [MongoDB `replication.replSetName`](https://www.mongodb.com/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName)
56+
57+
### spawn
58+
59+
Typings: `spawn?: SpawnOptions`
60+
Default: `{}`
61+
62+
Set extra spawn options to pass to `childProcess.spawn`.
63+
64+
Also see [`MongoMemoryInstanceOpts.spawn`](./mongo-memory-instance-opts.md#spawn).
65+
66+
### storageEngine
67+
68+
Typings: `storageEngine?: StorageEngine`
69+
Default: `"ephemeralForTest"`
70+
71+
Set which Storage Engine to use, uses [`StorageEngine`](./mongo-memory-instance-opts.md#helper-type-storageengine).
72+
73+
Also see [`MongoMemoryInstanceOpts.storageEngine`](./mongo-memory-instance-opts.md#storageengine).
74+
75+
### configSettings
76+
77+
Typings: `configSettings?: MongoMemoryReplSetConfigSettings`
78+
Default: `{}`
79+
80+
Set custom ReplSet config options
81+
82+
See [MongoDB Replica Set Configuration](https://www.mongodb.com/docs/manual/reference/replica-configuration/).
83+
84+
### count
85+
86+
Typings: `count?: number`
87+
Default: `1`
88+
89+
Set how many ReplSet members to spawn, this number will be deducted from length of [`instanceOpts`](./mongo-memory-replset-opts.md#instanceopts) array.
90+
91+
:::tip
92+
It is recommended to set this number to a **odd** number, and try to never have it be **even**, see [MongoDB Deploy an Odd Number of Members](https://www.mongodb.com/docs/v5.2/core/replica-set-architectures/#deploy-an-odd-number-of-members).
93+
:::

website/sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = {
1717
'api/interfaces/mongo-memory-instance-replicamemberconfig',
1818
'api/interfaces/mongo-memory-binary-opts',
1919
'api/interfaces/mongo-memory-replset-opts',
20+
'api/interfaces/replset-opts',
2021
],
2122
},
2223
guides: {

0 commit comments

Comments
 (0)