Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Aggregator<T1, T2, T3, T4>

Superclass for all data aggregators. Creates a structured method for pulling and normalizing data from the database into usable Aggregation objects.

Type parameters

Hierarchy

  • Aggregator

Index

Constructors

constructor

Properties

aggregationGenerator

aggregationGenerator: AggregationGenerator<T1, T2, T3, T4>

entity

entity: T1

Database entity that serves as the "base" of the aggregation. For example, this would be an instance of ProfileEntity for an aggregation of all reviews by a profile

redisClient

redisClient: RedisHelper

spotifyId

spotifyId: string

Methods

aggregate

  • aggregate(normalized?: boolean): Promise<T2>
  • Parameters

    • Default value normalized: boolean = true

      if data in returned aggregation should be normalized using [[EntityAggregator.normalize]]

    Returns Promise<T2>

redisKey

  • redisKey(normalized: boolean): string
  • generates a unique & predictable cache key for the aggregation

    Parameters

    • normalized: boolean

    Returns string

Static csvHeader

Static csvHeaderFromArray

  • csvHeaderFromArray(fields: string[]): CsvHeaders

Static fields

Static stripLabels

Static writeToCsv

  • writeToCsv<A1, A2, A3, A4>(aggregation: A2 | A2[], aggregationGenerator: AggregationGenerator<A1, A2, A3, A4>, fileName: string, baseDir: string): Promise<void>

Generated using TypeDoc