Thanks to visit codestin.com
Credit goes to docs.nocobase.com

nb api resource create

Create a record in a selected resource. Pass record data as a JSON object through --values.

Usage

nb api resource create --resource <resource> --values <json> [flags]

Parameters

ParameterTypeDescription
--resourcestringResource name, required
--data-sourcestringData source key, default main
--source-idstringSource record ID for association resources
--valuesstringData for the new record as a JSON object, required
--whiteliststring[]Fields allowed to write; repeatable or pass a JSON array
--blackliststring[]Fields forbidden to write; repeatable or pass a JSON array

Also supports common connection parameters from nb api resource.

Examples

nb api resource create --resource users --values '{"nickname":"Ada"}'
nb api resource create --resource posts.comments --source-id 1 --values '{"content":"Hello"}'