mongoose typescript global promise

Solutions on MaxInterview for mongoose typescript global promise by the best coders in the world

showing results for - "mongoose typescript global promise"
Pia
10 Jun 2018
1import mongoose from 'mongoose'
2import consola from 'consola'
3import q from 'q'
4
5export const mongooseConnection = (): void => {
6	mongoose.Promise = q.Promise
7
8	mongoose.connect(process.env.MONGO_URI, {
9		minPoolSize: 1,
10		maxPoolSize: 20,
11		compression: { compressors: ['zlib'] },
12		useUnifiedTopology: true,
13		useNewUrlParser: true,
14		useFindAndModify: false,
15		socketTimeoutMS: 60000,
16		serverSelectionTimeoutMS: 60000,
17		loggerLevel: 'error'
18	})
19
20	mongoose.connection.on('connecting', () => consola.info('database connecting'))
21	mongoose.connection.on('connected', () => consola.success('database connected'))
22	mongoose.connection.on('disconnecting', () => consola.info('database disconnecting'))
23	mongoose.connection.on('disconnected', () => consola.info('database disconnected'))
24	mongoose.connection.on('error', () => consola.error('database error'))
25}
26
queries leading to this page
typescript with mongoosemongoose example typescripthow to use mongoose with tsmongoose joi typescriptmongoose 2b typescriptmongoose schema typescript typetypescript mongoosemongoose typescript referencehow to add typescript types to mongoose node jsmongoose use schema typescript expresstypescript mongoose exanoketypescript mongoose schema typenode mongoose typescriptmongoose node typescriptmongoose schema this typescriptmongoose examples typescriptmongoose typescript typestypescript mongoose schema createtypescript create mongoose schemadefine mongoose schema in typescriptdoes mongoose support typescriptmongoose typescript nodejsmongoose typescript thisworking with mongoose typescriptuse mongoose tstypescript this mongoose schemamongoose typescript schemamongoose typescript tutorialmongoose schema 2b typescripttypescript mongoose examplemongoose typescript createmongo db mongoose typescriptnode js mongoose typescripttypescript mongoose nodejs exampleschema with typescript mongoosemongoose schema in typescript 40expose mongoose typescriptmongoose schema with typescripttypescript mongoose createuse monggose typescriptcreate mongoose schema typescriptmongodb mongoose typescriptusing typescript with mongoosemongoose methods typescripttypescript mongoose tutorialmongoose typescript schemasts mongoose type schemamongoose with tsmongoose typescript guidemongoose in typescripttypescript mongoose schematypescript mongoose examplesuse mongoose in typescriptmongoose node with typescriptmongoose schema typescriptmongoose create typescriptconnecting mongoose in typescriptmongoose typescript examplemongoose with typescripttypes for mongodb and mongoose typescriptconnect mongoose with node js typescriptmongoose with typescript examplehow to use mongoose with typescriptmongoose with typescript project codenode js typescript mongoosemongoose cli typescriptusing mongoose with mongodb in typescriptuse of mongoose with typescriptexample mongoose typescripttypscript with typegoosemongoose typescriptexpress mongo mongoose typescriptmongoose and typescriptts use mongoose schematypescript and mongoosedoes mongoose work well with typescriptmongoose types in typscriptmongoose types typescriptmongoose typescript definitionuse mongoose with typescriptmoangoose typescriptmongoose typescript global promise