Имя коллекции получается из конфига
This commit is contained in:
parent
de05a86f59
commit
5d4fd808f3
1 changed files with 4 additions and 1 deletions
|
|
@ -1,6 +1,9 @@
|
|||
import { CouchDb } from '@app/event-emitter/couchdb-datasources/couchdb';
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import nano from 'nano';
|
||||
import configuration from '../configs/app';
|
||||
|
||||
const config = configuration();
|
||||
|
||||
@Injectable()
|
||||
export class Changes {
|
||||
|
|
@ -16,7 +19,7 @@ export class Changes {
|
|||
}
|
||||
Changes.initilized = true;
|
||||
const n = CouchDb.getCouchDb();
|
||||
const changesDbName = ''; // TODO: Загрузить из конфига
|
||||
const changesDbName = config.couchDb.dbs.changes;
|
||||
const dbs = await n.db.list();
|
||||
if (!dbs.includes(changesDbName)) {
|
||||
await n.db.create(changesDbName);
|
||||
|
|
|
|||
Loading…
Reference in a new issue