Skip to main content
Skip to main content

listAndCount - API Key Module Reference

This documentation provides a reference to the listAndCount method. This belongs to the API Key Module.

This method retrieves a paginated list of API keys along with the total count of available API keys satisfying the provided filters.

Example

To retrieve a list of API keys using their IDs:

const [apiKeys, count] =
await apiKeyModuleService.listAndCount({
id: ["apk_123", "apk_321"],
})

By default, only the first 15 records are retrieved. You can control pagination by specifying the skip and take properties of the config parameter:

const [apiKeys, count] =
await apiKeyModuleService.listAndCount(
{
id: ["apk_123", "apk_321"],
},
{
take: 15,
skip: 2,
}
)

Parameters

The filters to apply on the retrieved API keys.
The configurations determining how the api API is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a API key.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<[ApiKeyDTO[], number]>Required
The list of API keys along with their total count.
Was this section helpful?