Skip to content

Commit 6b43b1c

Browse files
committed
docs: Add replSet config to readme
1 parent 68f9e2d commit 6b43b1c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

readme.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,25 @@ module.exports = {
103103
};
104104
```
105105

106+
To use mongo as a replica set you must add the `replSet` config object and set
107+
`count` and `storageEngine` fields:
108+
109+
```js
110+
module.exports = {
111+
mongodbMemoryServerOptions: {
112+
binary: {
113+
skipMD5: true,
114+
},
115+
autoStart: false,
116+
instance: {},
117+
replSet: {
118+
count: 3,
119+
storageEngine: 'wiredTiger',
120+
},
121+
},
122+
};
123+
```
124+
106125
### 3. Configure MongoDB client
107126

108127
Library sets the `process.env.MONGO_URL` for your convenience, but using of `global.__MONGO_URI__` is preferable as it works with ` useSharedDBForAllJestWorkers: false`

0 commit comments

Comments
 (0)