---
title: "perform(_:inZoneWith:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckdatabase/perform(_:inzonewith:)"
---

# perform(_:inZoneWith:)

Searches for records matching a predicate in the specified record zone.

## Declaration

```swift
func perform(_ query: CKQuery, inZoneWith zoneID: CKRecordZone.ID?) async throws -> [CKRecord]
```

## Parameters

- `query`: The query that contains the search parameters. For more information, see doc://com.apple.cloudkit/documentation/CloudKit/CKQuery.
- `zoneID`: The identifier of the record zone to search. If you’re searching a shared database, provide a record zone identifier; otherwise, you can specify nil to search all record zones in the database.

## Discussion

Discussion Returns The records that match the specified query. For information on a more convenient way to search a database, see records(matching:inZoneWith:desiredKeys:resultsLimit:).
