Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MongoDriver

Organizes communication with MongoDB.

Hierarchy

  • MongoDriver

Implements

Index

Constructors

constructor

Properties

Protected connection

connection: Connection

dataTypeDefaults

dataTypeDefaults: DataTypeDefaults

Default values of length, precision and scale depends on column data type. Used in the cases when length/precision/scale is not specified by user.

Optional database

database: string

Master database used to perform all write queries.

isReplicated

isReplicated: boolean = false

Indicates if replication is enabled.

Optional maxAliasLength

maxAliasLength: number

No documentation specifying a maximum length for identifiers could be found for MongoDB.

mongodb

mongodb: any

Underlying mongodb library.

options

Connection options.

Optional queryRunner

queryRunner: MongoQueryRunner

Mongodb does not require to dynamically create query runner each time, because it does not have a regular connection pool as RDBMS systems have.

spatialTypes

spatialTypes: ColumnType[] = []

Gets list of spatial column data types.

supportedDataTypes

supportedDataTypes: ColumnType[] = []

Mongodb does not need to have column types because they are not used in schema sync.

treeSupport

treeSupport: boolean = false

Indicates if tree tables are supported by this driver.

Protected validOptionNames

validOptionNames: string[] = ["poolSize","ssl","sslValidate","sslCA","sslCert","sslKey","sslPass","sslCRL","autoReconnect","noDelay","keepAlive","keepAliveInitialDelay","connectTimeoutMS","family","socketTimeoutMS","reconnectTries","reconnectInterval","ha","haInterval","replicaSet","secondaryAcceptableLatencyMS","acceptableLatencyMS","connectWithNoPrimary","authSource","w","wtimeout","j","forceServerObjectId","serializeFunctions","ignoreUndefined","raw","bufferMaxEntries","readPreference","pkFactory","promiseLibrary","readConcern","maxStalenessSeconds","loggerLevel",// Do not overwrite BaseConnectionOptions.logger// "logger","promoteValues","promoteBuffers","promoteLongs","domainsEnabled","checkServerIdentity","validateOptions","appname",// omit auth - we are building url from username and password// "auth""authMechanism","compression","fsync","readPreferenceTags","numberOfRetries","auto_reconnect","minSize","monitorCommands","useNewUrlParser"]

Valid mongo connection options NOTE: Keep sync with MongoConnectionOptions Sync with http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html

withLengthColumnTypes

withLengthColumnTypes: ColumnType[] = []

Gets list of column data types that support length by a driver.

withPrecisionColumnTypes

withPrecisionColumnTypes: ColumnType[] = []

Gets list of column data types that support precision by a driver.

withScaleColumnTypes

withScaleColumnTypes: ColumnType[] = []

Gets list of column data types that support scale by a driver.

Methods

afterConnect

  • afterConnect(): Promise<void>

Protected buildConnectionOptions

  • buildConnectionOptions(): any

Protected buildConnectionUrl

  • buildConnectionUrl(): string
  • Builds connection url that is passed to underlying driver to perform connection to the mongodb database.

    Returns string

buildTableName

  • buildTableName(tableName: string, schema?: string, database?: string): string
  • Build full table name with database name, schema name and table name. E.g. "myDB"."mySchema"."myTable"

    Parameters

    • tableName: string
    • Optional schema: string
    • Optional database: string

    Returns string

connect

  • connect(): Promise<void>

createFullType

createGeneratedMap

createParameter

  • createParameter(parameterName: string, index: number): string

createQueryRunner

createSchemaBuilder

disconnect

  • disconnect(): Promise<void>

escape

  • escape(columnName: string): string

escapeQueryWithParameters

findChangedColumns

getColumnLength

isReturningSqlSupported

  • isReturningSqlSupported(): boolean

isUUIDGenerationSupported

  • isUUIDGenerationSupported(): boolean

Protected loadDependencies

  • loadDependencies(): any

normalizeDefault

normalizeIsUnique

normalizeType

  • normalizeType(column: object): string
  • Creates a database type from a given column metadata.

    Parameters

    • column: object
      • Optional length?: number | string
      • Optional precision?: number | null
      • Optional scale?: number
      • Optional type?: ColumnType

    Returns string

obtainMasterConnection

  • obtainMasterConnection(): Promise<any>

obtainSlaveConnection

  • obtainSlaveConnection(): Promise<any>

prepareHydratedValue

  • prepareHydratedValue(value: any, columnMetadata: ColumnMetadata): any

preparePersistentValue

  • preparePersistentValue(value: any, columnMetadata: ColumnMetadata): any

Protected validateOptions

Object literals

mappedDataTypes

mappedDataTypes: object

Mongodb does not need to have a strong defined mapped column types because they are not used in schema sync.

cacheDuration

cacheDuration: "int" = "int"

cacheId

cacheId: "int" = "int"

cacheIdentifier

cacheIdentifier: "int" = "int"

cacheQuery

cacheQuery: "int" = "int"

cacheResult

cacheResult: "int" = "int"

cacheTime

cacheTime: "int" = "int"

createDate

createDate: "int" = "int"

createDateDefault

createDateDefault: string = ""

metadataDatabase

metadataDatabase: "int" = "int"

metadataName

metadataName: "int" = "int"

metadataSchema

metadataSchema: "int" = "int"

metadataTable

metadataTable: "int" = "int"

metadataType

metadataType: "int" = "int"

metadataValue

metadataValue: "int" = "int"

migrationId

migrationId: "int" = "int"

migrationName

migrationName: "int" = "int"

migrationTimestamp

migrationTimestamp: "int" = "int"

treeLevel

treeLevel: "int" = "int"

updateDate

updateDate: "int" = "int"

updateDateDefault

updateDateDefault: string = ""

version

version: "int" = "int"

Generated using TypeDoc