nb api resource list

List records for a selected resource. Use --filter, --fields, --sort, --page, and related parameters to control the query.

Usage

nb api resource list --resource <resource> [flags]

Parameters

ParameterTypeDescription
--resourcestringResource name, required
--data-sourcestringData source key, default main
--source-idstringSource record ID for association resources
--filterstringFilter conditions as a JSON object
--fieldsstring[]Fields to query; repeatable or pass a JSON array
--appendsstring[]Association fields to append; repeatable or pass a JSON array
--exceptstring[]Fields to exclude; repeatable or pass a JSON array
--sortstring[]Sort fields, for example -createdAt; repeatable or pass a JSON array
--pageintegerPage number
--page-sizeintegerRecords per page
--paginate / --no-paginatebooleanWhether to paginate

Also supports common connection parameters from nb api resource.

Examples

nb api resource list --resource users
nb api resource list --resource posts.comments --source-id 1 --fields id --fields content
nb api resource list --resource users --filter '{"status":"active"}' --sort=-createdAt