Skip to main content

talawa-api / Exports / setup/MongoDB

Module: setup/MongoDB

Table of contents

Functions

Functions

askForMongoDBUrl

askForMongoDBUrl(): Promise<string>

The function askForMongoDBUrl prompts the user to enter a MongoDB URL and returns the entered URL as a string.

Returns

Promise<string>

a Promise that resolves to a string.

Defined in

src/setup/MongoDB.ts:68


checkConnection

checkConnection(url): Promise<boolean>

The function checkConnection is an asynchronous function that checks the connection to a MongoDB database using the provided URL and returns a boolean value indicating whether the connection was successful or not.

Parameters

NameTypeDescription
urlstringThe url parameter is a string that represents the connection URL for the MongoDB server. It typically includes the protocol (e.g., mongodb://), the host and port information, and any authentication credentials if required.

Returns

Promise<boolean>

a Promise that resolves to a boolean value. The boolean value indicates whether the connection to the MongoDB server was successful (true) or not (false).

Defined in

src/setup/MongoDB.ts:41


checkExistingMongoDB

checkExistingMongoDB(): Promise<string | null>

Function to check if Existing MongoDB instance is running The function checkExistingMongoDB checks for an existing MongoDB connection by iterating through a list of URLs and testing the connection using the checkConnection function.

Returns

Promise<string | null>

The function checkExistingMongoDB returns a promise that resolves to a string or null.

Defined in

src/setup/MongoDB.ts:10