<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "CloudKitJS",
  "identifier" : "/documentation/CloudKitJS/CloudKit.QueryNotification",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "CloudKit JS"
    ],
    "preciseIdentifier" : "cl/CloudKit.QueryNotification"
  },
  "title" : "CloudKit.QueryNotification"
}
-->

# CloudKit.QueryNotification

A [`CloudKit.QueryNotification`](/documentation/CloudKitJS/CloudKit.QueryNotification) object represents a push notification that was generated by a subscription object. A query notification is triggered by subscriptions where the `subscriptionType` key is `query`. Use a [`CloudKit.QueryNotification`](/documentation/CloudKitJS/CloudKit.QueryNotification) object to get information about the record that changed. To create query subscriptions and handle push notifications, see the [`saveSubscriptions`](/documentation/CloudKitJS/CloudKit.Database/saveSubscriptions) method in [`CloudKit.Database`](/documentation/CloudKitJS/CloudKit.Database).

```
interface CloudKit.QueryNotification
```

## Overview

This class is similar to the <doc://com.apple.documentation/documentation/CloudKit/CKQueryNotification> class in the CloudKit framework.

## Topics

### Getting Record Changes

[`readonly attribute String queryNotificationReason;`](/documentation/CloudKitJS/CloudKit.QueryNotification/queryNotificationReason)

The reason for the query notification.

[`readonly attribute String recordName;`](/documentation/CloudKitJS/CloudKit.QueryNotification/recordName)

The name of the record that was created, deleted, or updated.

[`readonly attribute Object recordFields;`](/documentation/CloudKitJS/CloudKit.QueryNotification/recordFields)

A dictionary representation of the fields that changed in the record.

[`readonly attribute Boolean isPublicDatabase;`](/documentation/CloudKitJS/CloudKit.QueryNotification/isPublicDatabase)

Boolean value indicating whether the notification is from the public database.

### Getting the Notification Type

[`readonly attribute String notificationType;`](/documentation/CloudKitJS/CloudKit.QueryNotification/notificationType)

The type of notification.

[`readonly attribute Boolean isQueryNotification;`](/documentation/CloudKitJS/CloudKit.QueryNotification/isQueryNotification)

Boolean value indicating whether this notification is a [`CloudKit.QueryNotification`](/documentation/CloudKitJS/CloudKit.QueryNotification) object.

### Logging

[`String toString();`](/documentation/CloudKitJS/CloudKit.QueryNotification/toString)

Returns a string representation of the notification.

### Constants

[Reasons for Query Notifications](/documentation/CloudKitJS/reasons-for-query-notifications)

Constants indicating the event that triggered the notification.

## Relationships

### Inherited By

[`CloudKit.Notification`](/documentation/CloudKitJS/CloudKit.Notification)

---

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)