Skip to content

CLI Filters and Select

Use --where-* flags to filter records, --select to include fields, and --omit to exclude fields.


Where Filters

Filters are built using grouped flags. Each --where-field starts a new filter block.

bash
holysheets read find-many \
  --spreadsheet-id <ID> \
  --sheet <sheet-name> \
  --where-field rating --where-op gte --where-value 4 \
  --where-field name --where-op contains --where-value bar

Multiple filter blocks are combined with AND logic.


Flag Grouping Rules

FlagDescriptionRequired
--where-fieldColumn name (starts a new block)Yes
--where-opComparison operatorYes
--where-valueValue to compare againstYes

Each --where-field starts a new filter block. The following --where-op and --where-value apply to the most recent field.


Supported Operators

OperatorDescriptionValue Type
equalsExact matchstring
notNot equalstring
containsSubstring matchstring
startsWithStarts with prefixstring
endsWithEnds with suffixstring
searchSearch (pattern matching)string
ltLess thannumber
lteLess than or equalnumber
gtGreater thannumber
gteGreater than or equalnumber
inMatches any value in liststring[]
notInMatches none of the values in liststring[]

TIP

For in and notIn, use multiple --where-value flags:

bash
--where-field city --where-op in --where-value "São Paulo" --where-value "Rio"

INFO

Numeric operators (lt, lte, gt, gte) require the value to be a valid number.


Multiple Filters on the Same Field

You can apply multiple operators to the same field:

bash
holysheets read find-many \
  --spreadsheet-id <ID> \
  --sheet <sheet-name> \
  --where-field rating --where-op gte --where-value 3 \
  --where-field rating --where-op lte --where-value 5

This returns records where rating >= 3 AND rating <= 5.


Select

Use --select to return only specific fields. It is repeatable:

bash
holysheets read find-many \
  --spreadsheet-id <ID> \
  --sheet <sheet-name> \
  --select name \
  --select rating

When --select is omitted, all fields are returned.

WARNING

--select is not allowed with read describe.


Omit

Use --omit to exclude specific fields from the output. It is repeatable:

bash
holysheets read find-many \
  --spreadsheet-id <ID> \
  --sheet <sheet-name> \
  --omit instagram \
  --omit endereco

WARNING

--omit cannot be used together with --select in the same command.

WARNING

--omit is not allowed with read describe.

Released under the MIT License.