Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Connector<TModel, TSelector, TOptions, TRawCollection>

A database abstraction compatible with Vulcan

Type parameters

  • TModel: VulcanDocument = any

  • TSelector = any

  • TOptions = any

  • TRawCollection = any

Hierarchy

  • Connector

Index

Methods

_filter

  • _filter(input: FilterableInput<TModel>, context: any): Promise<{ filteredFields: any[]; options: TOptions; selector: TSelector }>
  • Compute the relevant selectors

    Parameters

    Returns Promise<{ filteredFields: any[]; options: TOptions; selector: TSelector }>

count

  • count(selector?: TSelector): Promise<number>
  • Parameters

    • Optional selector: TSelector

    Returns Promise<number>

create

  • create(data: Partial<TModel>): Promise<TModel>
  • Parameters

    • data: Partial<TModel>

    Returns Promise<TModel>

delete

  • delete(selector: TSelector): Promise<true>
  • Parameters

    • selector: TSelector

    Returns Promise<true>

find

  • find(selector?: TSelector, options?: TOptions): Promise<TModel[]>
  • Find data in the database

    Parameters

    • Optional selector: TSelector
    • Optional options: TOptions

    Returns Promise<TModel[]>

findOne

  • findOne(selector?: TSelector, options?: TOptions): Promise<null | TModel>
  • Parameters

    • Optional selector: TSelector
    • Optional options: TOptions

    Returns Promise<null | TModel>

findOneById

  • findOneById(_id: any): Promise<null | TModel>
  • Parameters

    • _id: any

    Returns Promise<null | TModel>

getRawCollection

  • getRawCollection(): TRawCollection
  • Returns TRawCollection

update

  • update(selector: TSelector, modifier: Object, options?: { removeEmptyStrings: boolean }): Promise<TModel>
  • Parameters

    • selector: TSelector
    • modifier: Object
    • Optional options: { removeEmptyStrings: boolean }
      • removeEmptyStrings: boolean

    Returns Promise<TModel>

Generated using TypeDoc