# MongooseService Service

Module
import { MongooseService } from "@tsed/mongoose"
Source/packages/mongoose/src/services/MongooseService.ts

# Overview

class MongooseService {
    readonly connections: Map<string, Mongoose.Connection>;
/**
 *
 * @returns <span class="token punctuation">{</span>Promise&lt;"mongoose".Connection&gt;<span class="token punctuation">}</span>
 */
<span class="token function">connect</span><span class="token punctuation">(</span>id<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">,</span> url<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">,</span> connectionOptions<span class="token punctuation">:</span> Mongoose.ConnectionOptions<span class="token punctuation">,</span> isDefault?<span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">)</span><span class="token punctuation">:</span> Promise&lt;<span class="token keyword">any</span>&gt;<span class="token punctuation">;</span>
/**
 *
 * @returns <span class="token punctuation">{</span>"mongoose".Connection<span class="token punctuation">}</span>
 */
<span class="token function">get</span><span class="token punctuation">(</span>id?<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">)</span><span class="token punctuation">:</span> Mongoose.Connection | undefined<span class="token punctuation">;</span>
/**
 *
 * @param <span class="token punctuation">{</span><span class="token keyword">string</span><span class="token punctuation">}</span> id
 * @returns <span class="token punctuation">{</span><span class="token keyword">boolean</span><span class="token punctuation">}</span>
 */
<span class="token function">has</span><span class="token punctuation">(</span>id?<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">boolean</span><span class="token punctuation">;</span>
<span class="token function">closeConnections</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> Promise&lt;<span class="token keyword">void</span>&gt;<span class="token punctuation">;</span>

}