nb api resource get

Get one record from a selected resource. Usually, --filter-by-tk is used to specify the primary key.

Usage

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

Parameters

ParameterTypeDescription
--resourcestringResource name, required
--data-sourcestringData source key, default main
--source-idstringSource record ID for association resources
--filter-by-tkstringPrimary key value; composite or multiple keys can be passed as a JSON array
--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

Also supports common connection parameters from nb api resource.

Examples

nb api resource get --resource users --filter-by-tk 1
nb api resource get --resource posts.comments --source-id 1 --filter-by-tk 2