Skip to content

MongooseService

@tsed/mongoose

Usage

typescript
import { MongooseService } from "@tsed/mongoose";

See /packages/orm/mongoose/src/types/services/MongooseService.ts.

Overview

ts
class MongooseService {
    readonly connections: Map<string, Mongoose.Connection>;
    logger: Logger;
    connect(id: string, url: string, connectionOptions: ConnectOptions, isDefault?: boolean): Promise<any>;
    get(id?: string): Mongoose.Connection | undefined;
    has(id?: string): boolean;
    closeConnections(): Promise<void>;
}

readonly connections

ts
readonly connections: Map<string, Mongoose.Connection>;

logger

ts
logger: Logger;

connect

ts
connect(id: string, url: string, connectionOptions: ConnectOptions, isDefault?: boolean): Promise<any>;

get

ts
get(id?: string): Mongoose.Connection | undefined;

has

ts
has(id?: string): boolean;

closeConnections

ts
closeConnections(): Promise<void>;

Released under the MIT License.