UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

92 lines (49 loc) 1.43 kB
--- lang: en title: 'API docs: openapi-v3.param.where' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/openapi-v3 permalink: /doc/en/lb4/apidocs.openapi-v3.param.where.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/openapi-v3](./openapi-v3.md) &gt; [param](./openapi-v3.param.md) &gt; [where](./openapi-v3.param.where.md) ## param.where() function Sugar decorator for `where` query parameter **Signature:** ```typescript function where(modelCtor: typeof Model, name?: string): (target: object, member: string, index: number) => void; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td markdown="1"> modelCtor </td><td markdown="1"> typeof Model </td><td markdown="1"> Model class </td></tr> <tr><td markdown="1"> name </td><td markdown="1"> string </td><td markdown="1"> _(Optional)_ Custom name for the parameter, default to `where` </td></tr> </tbody></table> **Returns:** (target: object, member: string, index: number) =&gt; void ## Example ```ts async count( @param.where(modelCtor)) where?: Where<T>, ): Promise<Count> { // ... } ```