How to use the wildcards with ArcQL

In the previous post, we have seen how to search location data.

Now we will check how to use the wildcards to search data using the arcql wildcard query.

Hypi supports the use of two wildcards to search the data; * and ?

    • means matching zero or more characters
  • ? means matching a single character
  • The wildcard may represent any alphabet, number, or symbol.
  • Frame a query like this.
a * 'string_?' OR 123*

We will work with the same schema used earlier.

type arcqlObject {
    str: String
    int: Int
}

Sample Query 1

Below query searches the values in the str field starting with easy

{
  find(type: arcqlObject, arcql: "str * 'easy*'") {
    edges {
      node {
        ... on arcqlObject {
          str
          hypi {
            id
          }
        }
      }
      cursor
    }
  }
}
#result
{
  "data": {
    "find": {
      "edges": [
        {
          "node": {
            "str": "easy to use backend",
            "hypi": {
              "id": "01FJGS5P4ECE8BSG10FVJ1865V"
            }
          },
          "cursor": "01FJGS5P4ECE8BSG10FVJ1865V"
        }
      ]
    }
  }
}

Sample Query 2

Below query searches the four-letter word with hy as starting two letters.

{
  find(type: arcqlObject, arcql: "str * 'hy??'") {
    edges {
      node {
        ... on arcqlObject {
          str
          hypi {
            id
          }
        }
      }
      cursor
    }
  }
}
#result
{
  "data": {
    "find": {
      "edges": [
        {
          "node": {
            "str": "hypi",
            "hypi": {
              "id": "01FJGS5P4C2V0AZ9BGPV6BXGEG"
            }
          },
          "cursor": "01FJGS5P4C2V0AZ9BGPV6BXGEG"
        }
      ]
    }
  }
}

Check the POSTMAN collection for the wildcard query in different programming languages! Click </> and choose the programming language of your choice.

Don’t forget to insert your own Authorization key and Hypi Domain under Headers to test the results!
Run in Postman