Options
All
  • Public
  • Public/Protected
  • All
Menu

nestjs-keyset-paginator - v3.0.4

Index

References

default

Renames and re-exports Paginator

Type aliases

TYPE_MONGO_FIELD_NAME

TYPE_MONGO_FIELD_NAME: string | string[]

TYPE_STRING_NUM_ARRAY

TYPE_STRING_NUM_ARRAY: (string | number)[]

Variables

REGEX_MONGO_FIELD_NAME

REGEX_MONGO_FIELD_NAME: RegExp = ...

Functions

Const generatePaginationFilter

  • generatePaginationFilter(filter: filterDto[]): {}

Const generatePaginationNextKey

  • generatePaginationNextKey(arr_start_keys: startKeyDto[]): {}

Const generatePaginationNextKeyDtoArr

  • generatePaginationNextKeyDtoArr(next_key: any): any[]

Const generatePaginationQuery

  • generatePaginationQuery(query: any, sort?: any, nextKey?: any): { nextKeyFn: (items: any) => { _id: any }; paginatedQuery: any }
  • Parameters

    • query: any
    • Optional sort: any
    • Optional nextKey: any

    Returns { nextKeyFn: (items: any) => { _id: any }; paginatedQuery: any }

    • nextKeyFn: (items: any) => { _id: any }
        • (items: any): { _id: any }
        • Parameters

          • items: any

            array of items

          Returns { _id: any }

          • _id: any
    • paginatedQuery: any

Const paginate

  • paginate(model: Model<any, {}, {}, {}>, skip?: number, limit?: number, start_key?: startKeyDto[], sort_field?: string, sort_order?: number, filter?: filterDto[], projection?: projectionDto[]): Promise<{ docs: any; next_key: any[] }>
  • Parameters

    • model: Model<any, {}, {}, {}>

      Mongoose model

    • skip: number = 0
    • limit: number = 10
    • Optional start_key: startKeyDto[]
    • Optional sort_field: string
    • Optional sort_order: number
    • Optional filter: filterDto[]
    • Optional projection: projectionDto[]

    Returns Promise<{ docs: any; next_key: any[] }>

Generated using TypeDoc