BigQuery: Filter Using Text Values
Introdution
The _like
, _nlike
, _ilike
, _nilike
operators are used for pattern matching on string/text fields.
_like
Fetch a list of articles whose titles contain the word “amet”:
GraphiQL
xxxxxxxxxx
query {
bigquery_articles(
where: {title: {_like: "%amet%"}}
) {
id
title
}
}
Query Variables
Request Headers
x
{
"data": {
"bigquery_articles": [
{
"id": "1",
"title": "sit amet"
},
{
"id": "3",
"title": "amet justo morbi"
},
{
"id": "9",
"title": "sit amet"
}
]
}
}
No Schema Available
Note
_like
is case-sensitive. Use _ilike
for case-insensitive search.
_nlike
Retrieve a list of articles whose titles do not contain the word "Lorem":
GraphiQL
xxxxxxxxxx
query {
bigquery_articles(
where: {title: {_nlike: "%Lorem%"}}
) {
id
title
}
}
Query Variables
Request Headers
1
xxxxxxxxxx
{
"data": {
"bigquery_articles": [
{
"id": "2",
"title": "Dolor sit amet"
},
{
"id": "5",
"title": "Consectetur adipiscing elit"
},
{
"id": "7",
"title": "Aenean nisl libero"
}
]
}
}
No Schema Available
_ilike
Retrieve a list of articles whose titles contain the case-insensitive word "lorem":
GraphiQL
xxxxxxxxxx
query {
bigquery_articles(
where: {title: {_ilike: "%lorem%"}}
) {
id
title
}
}
Query Variables
Request Headers
1
xxxxxxxxxx
{
"data": {
"bigquery_articles": [
{
"id": "1",
"title": "Lorem ipsum dolor"
},
{
"id": "2",
"title": "lorem sit amet"
},
{
"id": "4",
"title": "LOREM IPSUM"
}
]
}
}
No Schema Available
_nilike
Retrieve a list of articles whose titles do not contain the case-insensitive word "ipsum":
GraphiQL
xxxxxxxxxx
query {
bigquery_articles(
where: {title: {_nilike: "%ipsum%"}}
) {
id
title
}
}
Query Variables
Request Headers
1
xxxxxxxxxx
{
"data": {
"bigquery_articles": [
{
"id": "3",
"title": "Dolor sit amet"
},
{
"id": "5",
"title": "Consectetur adipiscing elit"
},
{
"id": "6",
"title": "Aenean nisl libero"
}
]
}
}
No Schema Available