SHARE
TWEET

Untitled

a guest Sep 19th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { ModuleMetadata, Type } from '@nestjs/common/interfaces'
  2.  
  3. /**
  4.  * Options that ultimately need to be provided to create a MongoDB connection
  5.  */
  6. export interface MongoModuleOptions {
  7.     connectionName?: string
  8.     uri: string
  9.     dbName: string
  10.     clientOptions?: any
  11. }
  12.  
  13. export interface MongoOptionsFactory {
  14.     createMongoOptions(): Promise<MongoModuleOptions> | MongoModuleOptions
  15. }
  16.  
  17. /**
  18.  * Options available when creating the module asynchrously.  You should use only one of the
  19.  * useExisting, useClass, or useFactory options for creation.
  20.  */
  21. export interface MongoModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
  22.     /** A unique name for the container.  If not specified, a default one will be used. */
  23.     containerName?: string
  24.  
  25.     /** Reuse an injectable factory class created in another module. */
  26.     useExisting?: Type<MongoOptionsFactory>
  27.  
  28.     /**
  29.      * Use an injectable factory class to populate the module options, such as URI and database name.
  30.      */
  31.     useClass?: Type<MongoOptionsFactory>
  32.  
  33.     /**
  34.      * A factory function that will populate the module options, such as URI and database name.
  35.      */
  36.     useFactory?: (...args: any[]) => Promise<MongoModuleOptions> | MongoModuleOptions
  37.  
  38.     /**
  39.      * Inject any dependencies required by the Mongo module, such as a configuration service
  40.      * that supplies the URI and database name
  41.      */
  42.     inject?: any[]
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top