Query

Route handler parameter decorator. Extracts the query property from the req object and populates the decorated parameter with the value of query. May also apply pipes to the bound query parameter.

See more...


 @Query(property?: string | PipeTransform<any, any> | Type<PipeTransform<any, any>>, ...pipes: (PipeTransform<any, any> | Type<PipeTransform<any, any>>)[])

Parameters

Option Type Description
property string | PipeTransform | Type>

name of single property to extract from the query object


Optional. Default is `undefined`.
pipes (PipeTransform | Type>)[]

one or more pipes to apply to the bound query parameter

Returns

ParameterDecorator

See also

Description

For example:


async find(@Query('user') user: string)