<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "CKToolJS",
  "identifier" : "/documentation/CKToolJS/CKDBQuerySort",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "CKTool JS"
    ],
    "preciseIdentifier" : "struct/CKDBQuerySort"
  },
  "title" : "CKDBQuerySort"
}
-->

# CKDBQuerySort

An object that represents a sort descriptor that specifies how to order fetched records.

```
dictionary CKDBQuerySort {
	string? fieldName;
	CKDBQuerySortOrder order;
};
```

## Overview

In JavaScript, this is a plain object with properties as described.

In TypeScript, this type is imported in the following way:

```javascript
import type { CKDBQuerySort } from "@apple/cktool.database";
```

## Topics

### Instance Properties

[`attribute string? fieldName;`](/documentation/CKToolJS/CKDBQuerySort/fieldName)

The name of a field belonging to the record type. Used to sort the fetched records.

[`attribute CKDBQuerySortOrder order;`](/documentation/CKToolJS/CKDBQuerySort/order)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)