address
A postal address, looked up when it is written so that it is stored in its standard form.
At a glance
- Stored as: the value itself, written inline wherever it is used.
- Edited by: JSON Pointer operations.
- Search: full-text (
~*); by similarity (~=).
Writing
Write the address as one line of text: 123 Main St, Springfield, IL 62701. Writing
it looks it up, and the value becomes the address's standard spelling. What the
lookup found (the parts, the coordinates and the time zone) is kept in its
validated metadata.
- The lookup covers addresses in the United States only. Text it cannot find is refused.
- When the lookup's best match is a different address (another street number,
street, city, state or ZIP code), your text is kept as you typed it instead of being
swapped for that address. It is then unverified: it has no coordinates, its
validation_statusisgeocoder_mismatch, and its parts are read from your text. - A JSON object that already holds the lookup's fields (
formatted_address,coordinates,componentsandtimezone) is stored as given, without a lookup. Itsformatted_addressbecomes the value. A JSON object without one of them is refused, naming it. - validate_dtype runs the same lookup and returns the standard spelling, so you can show it to the person before you save. It stores nothing.
To fill an address field as someone types, suggest offers completions once three characters are typed, and resolve turns the chosen suggestion, or free text, into its street line, city, state, ZIP code and country.
Written as
A JSON string whose schema format is address.
Reading
The value reads as the address text: the standard spelling, or your own text when it
is unverified. The parts are not separate values. The street number and name, city,
county, state, ZIP code, country, coordinates and time zone are in the validated
metadata. The time zone is the main one of the address's state, so in a state that
spans two zones it can be the wrong one.
Querying
HQL compares an address as its text. There are no parts to filter on: nothing like
.city or .postal_code follows the field's name. To find a city or a ZIP code,
match it inside the text, for example ilike "%Springfield, IL%".
Every operator is in the HQL reference.
Editing
edit changes the address's JSON: formatted_address,
components, coordinates and timezone. An edit is not looked up again, and the
value is the edited formatted_address. An edit that removes one of these four keys is
refused. If you change a part, such as the city in components, change
formatted_address to match, or the text you read and search keeps the old address.
To correct an address properly, write the new text instead, so that it is looked up.
Metadata
Derived values kept with a stored value:
validated: What the lookup found, kept when the address is written:formatted_address,coordinates(lat,lng),components(whichever ofstreet_number,street_name,city,county,state,postal_codeandcountryare known),timezone(a time zone name such asAmerica/New_York, from the state) andplace_type. When the lookup disagrees with what was typed, the typed text is kept,coordinatesare null andvalidation_statusisgeocoder_mismatch.
Operations
Through the dtypes resource: