Skip to content

ema / config / MongoConfig

Class: MongoConfig

Defined in: packages/ema/src/config.ts:43

MongoDB configuration.

Examples

yaml
# Configure to use memory MongoDB in config.yaml
mongo:
  kind: "memory"
  db_name: "ema"
yaml
# Configure to use remote MongoDB in config.yaml
mongo:
  kind: "remote"
  uri: "mongodb://localhost:27017"
  db_name: "ema"

Constructors

Constructor

ts
new MongoConfig(
   kind, 
   uri, 
   db_name): MongoConfig;

Defined in: packages/ema/src/config.ts:44

Parameters

kind

The MongoDB kind.

If under development mode, it will be "memory" by default. If under production mode, it will be "remote" by default.

"memory" | "remote"

uri

string = "mongodb://localhost:27017"

The MongoDB URI.

Unused if mongo kind is set to "memory".

db_name

string = "ema"

The MongoDB database name.

Returns

MongoConfig

Properties

db_name

ts
readonly db_name: string = "ema";

Defined in: packages/ema/src/config.ts:61

The MongoDB database name.


kind

ts
readonly kind: "memory" | "remote" = "memory";

Defined in: packages/ema/src/config.ts:51

The MongoDB kind.

If under development mode, it will be "memory" by default. If under production mode, it will be "remote" by default.


uri

ts
readonly uri: string = "mongodb://localhost:27017";

Defined in: packages/ema/src/config.ts:57

The MongoDB URI.

Unused if mongo kind is set to "memory".