---
title: "init(query:)"
framework: cloudkit
role: symbol
role_heading: Initializer
path: "cloudkit/ckqueryoperation/init(query:)"
---

# init(query:)

Creates an operation that searches for records in the specified record zone.

## Declaration

```swift
convenience init(query: CKQuery)
```

## Parameters

- `query`: The query for the search.

## Discussion

Discussion You can use the operation that this method returns only once to perform a search, but you can reuse the query that you provide. During execution, the operation performs a new search and returns the first batch of results. If there are more results available, you must create a separate query object using the provided cursor object.

## See Also

### Creating a Query Operation

- [init(cursor:)](cloudkit/ckqueryoperation/init(cursor:).md)
- [init()](cloudkit/ckqueryoperation/init().md)
