Select Fields
Arguments
- query
An object of class
HALQuery
(typically returned byhal_query()
).- ...
One or more
character
string separated by commas giving the fields to be returned.
Value
An object of class HALQuery
.
Examples
## Select fields
hal_query() |> hal_select("label_s")
#> $q
#> [1] "text:*"
#>
#> $fl
#> [1] "label_s"
#>
#> $wt
#> [1] "json"
#>
#> attr(,"class")
#> [1] "HALQuery"
(q <- hal_query() |> hal_select("halId_s", "uri_s"))
#> $q
#> [1] "text:*"
#>
#> $fl
#> [1] "halId_s,uri_s"
#>
#> $wt
#> [1] "json"
#>
#> attr(,"class")
#> [1] "HALQuery"
## Update query
hal_select(q, "docType_s")
#> $q
#> [1] "text:*"
#>
#> $fl
#> [1] "docType_s"
#>
#> $wt
#> [1] "json"
#>
#> attr(,"class")
#> [1] "HALQuery"