---
title: desiredKeys
framework: cloudkit
role: symbol
role_heading: Instance Property
path: cloudkit/ckqueryoperation/desiredkeys-7qrse
---

# desiredKeys

The fields of the records to fetch.

## Declaration

```swift
var desiredKeys: [CKRecord.FieldKey]? { get set }
```

## Discussion

Discussion Use this property to limit the amount of data that CloudKit returns for each record. When CloudKit returns a record, it only includes fields with names that match one of the keys in this property. The property’s default value is nil, which instructs CloudKit to return all of a record’s keys. If you intend to specify a value other than nil, do so before you execute the operation or add the operation to a queue.

## See Also

### Configuring the Query Operation

- [query](cloudkit/ckqueryoperation/query.md)
- [cursor](cloudkit/ckqueryoperation/cursor-swift.property.md)
- [CKQueryOperation.Cursor](cloudkit/ckqueryoperation/cursor-swift.class.md)
- [zoneID](cloudkit/ckqueryoperation/zoneid.md)
- [resultsLimit](cloudkit/ckqueryoperation/resultslimit.md)
- [maximumResults](cloudkit/ckqueryoperation/maximumresults.md)
