# $field->query()

Uses the field value as Kirby query

****

- Source: <https://github.com/getkirby/kirby/tree/5.5.3/config/methods.php#L528>

****

```php
$field->query(string|null $expect = null): mixed
```

## Parameters

| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| `$expect` | `string` or `null` | `null` | – |

## Return type

`mixed`

This method modifies the existing `$field` object it is applied to and returns it again.


## Examples

Assuming your text field value is `site.find('notes')` this query will return the `notes` page. With the `expect` parameter, you can optionally define the expected return type, in this case a `Kirby\Cms\Page` object.

```php
<?php
dump($page->text()->query('Kirby\Cms\Page'));
```