Page Contents

Home > @loopback/openapi-v3 > param > where

param.where() function

Sugar decorator for where query parameter

Signature:

function where(modelCtor: typeof Model, name?: string): (target: object, member: string, index: number) => void;

Parameters

Parameter Type Description
modelCtor typeof Model Model class
name string (Optional) Custom name for the parameter, default to where

Returns:

(target: object, member: string, index: number) => void

Example

async count(
  @param.where(modelCtor)) where?: Where<T>,
): Promise<Count> {
  // ...
}