Page Contents

A fields filter specifies properties (fields) to include or exclude from the results.

REST API

filter[fields][propertyName]=<true|false>&filter[fields][propertyName]=<true|false>...

Note that to include more than one field in REST, use multiple filters.

You can also use stringified JSON format in a REST query.

Node API

{ fields: {propertyName: <true|false>, propertyName: <true|false>, ... } }

Where:

  • propertyName is the name of the property (field) to include or exclude.
  • <true|false> signifies either true or false Boolean literal. Use true to include the property or false to exclude it from results.

By default, queries return all model properties in results. However, if you specify at least one fields filter with a value of true, then by default the query will include only those you specifically include with filters.

Examples

Return only id, make, and model properties:

REST

?filter[fields][id]=true&filter[fields][make]=true&filter[fields][model]=true

Node API

{ fields: {id: true, make: true, model: true} }

Returns:

[{
    "id": "1",
    "make": "Nissan",
    "model": "Titan"
  }, {
    "id": "2",
    "make": "Nissan",
    "model": "Avalon"
  },
  ...
]

Exclude the vin property:

REST

?filter[fields][vin]=false

Node API

{ fields: {vin: false} }