Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(mongo-memory-instance-opts): add file
- Loading branch information
Showing
3 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
id: mongo-memory-instance-opts | ||
title: 'MongoMemoryInstanceOpts' | ||
--- | ||
|
||
API Documentation of `MongoMemoryInstanceOpts`-Interface | ||
|
||
## Values for `MongoMemoryInstanceOpts` | ||
|
||
Inherits from [`MongoMemoryInstanceOptsBase`](#values-for-mongomemoryinstanceoptsbase). | ||
|
||
### auth | ||
|
||
Typings: `auth?: boolean` | ||
Default: `false` | ||
|
||
Set which option auth argument to add: | ||
|
||
- if `true`, add `--auth` | ||
- if `false`, add `--noauth` | ||
|
||
This options gets automatically set (overwritten) when using `createAuth`. | ||
|
||
### dbName | ||
|
||
Typings: `dbName?: string` | ||
|
||
Previously set the `dbName` for the `getUri` calls, but currently unused. | ||
|
||
### ip | ||
|
||
Typings: `ip?: string` | ||
|
||
Set the ip to bind to, if defined will add the argument `--bind_ip` with the input string. | ||
|
||
### replSet | ||
|
||
Typings: `replSet?: string` | ||
|
||
Set the ReplSet name to use, if defined will add the argument `--replSet` with the input string. | ||
|
||
### keyfileLocation | ||
|
||
Typings: `keyfileLocation?: string` | ||
|
||
Set a custom location for where the keyfile for authentication will be stored, if defined will add the argument `--keyfile` with the input string. | ||
Only has a effect when used in a [`MongoMemoryReplSet`](../classes/mongo-memory-replset.md) and `auth` is enabled. | ||
This option will get automatically set when not manually defined. | ||
|
||
## Values for `MongoMemoryInstanceOptsBase` | ||
|
||
### args | ||
|
||
Typings: `args?: string[]` | ||
|
||
Set extra Arguments to add to the started instance, will likely overwrite arguments set by other options, depending on how the binary parses arguments. | ||
|
||
### port | ||
|
||
Typings: `port?: number` | ||
|
||
When set, adds the `--port` argument with the input. | ||
This options will get automatically set with a free port that is found. | ||
|
||
### dbPath | ||
|
||
Typings: `dbPath?: string` | ||
|
||
When set, adds the `--dbpath` argument with the input. | ||
This option will automatically be set with a directory generated by [`tmp`](https://www.npmjs.com/package/tmp). | ||
|
||
### storageEngine | ||
|
||
Typings: `storageEngine?: StorageEngine` | ||
Default: `ephemeralForTest` | ||
|
||
Set which storage engine to use, uses [`StorageEngine`](#helper-type-storageengine). | ||
|
||
### replicaMemberConfig | ||
|
||
Typings: `replicaMemberConfig?: ReplicaMemberConfig` | ||
|
||
Set custom a custom Replica Member Config, uses [`ReplicaMemberConfig`](TODO). | ||
Only has a effect when started with [`MongoMemoryReplSet`](../classes/mongo-memory-replset.md). | ||
|
||
## Helper Type `StorageEngine` | ||
|
||
Typings: `StorageEngine = 'devnull' | 'ephemeralForTest' | 'mmapv1' | 'wiredTiger'` | ||
|
||
Storage Engines supported by mongodb, see [MongoDB Storage Engines](https://www.mongodb.com/docs/manual/core/storage-engines/). | ||
|
||
Custom Explanation: | ||
|
||
- `devnull` is a storage engine which discards everything and cannot be read from. | ||
- `ephemeralForTest` is a in-memory storage engine, which stores everything in RAM, which is great to use when wanting a simple database testing backend, is not the same as the Enterprise In-Memory Engine | ||
- `mmapv1` is storage engine which stores data on disk, was removed in mongodb 4.2 | ||
- `wiredTiger` is a storage engine which stores data on disk. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters