---
source_url: https://www.pubnub.com/docs/general/metadata/filtering
title: App Context Filtering Language
updated_at: 2026-05-21T15:45:27.913Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# App Context Filtering Language

Filter App Context data (users, channels, memberships) using PubNub SDKs, REST API, or BizOps Workspace with powerful operators.

Use the `filter` parameter to return or update data that matches your conditions.

This guide shows which fields you can filter and which operators you can use. For REST, see the [REST API](https://www.pubnub.com/docs/sdks/rest-api). For UI, see [BizOps Workspace](https://www.pubnub.com/docs/bizops-workspace/basics).

## Data fields

You can filter the following fields for users, channels, and memberships. Note: “User” and UUID refer to the same entity in App Context.

### User data fields

:::note Data fields format
Parameter formats can vary across the REST API, SDKs, and BizOps Workspace.
:::

* `id` — Unique user identifier (UUID)
* `name` — User's display name
* `externalId` — An identifier that links the user to an external system
* `profileUrl` — URL to the user's profile picture
* `email` — User's email address
* `status` — Condition the user is in, like `active` (some SDKs)
* `type` — Category used to classify the user, like `SupportAgent` (some SDKs)
* `updated` — Timestamp of the last update to the user's metadata
* `custom` — Any user-specific property (filtering through it is not recommended in SDKs and BizOps Workspace)

### Channel data fields

* `id` — Unique channel identifier
* `name` — Display name of the channel
* `description` — Description of the channel
* `status` — Condition the channel is in, like `archived` (some SDKs)
* `type` — Category used to classify the channel, like `OffTopic` (some SDKs)
* `updated` — Timestamp of the last update to the channel's metadata
* `custom` — Any channel-specific property (filtering through it is not recommended in SDKs and BizOps Workspace)

### Channel memberships and members data fields

Filters differ by API group. Memberships accept `channel.*` fields while members accept `uuid.*` fields.

Common fields are supported by both.

| API group / Endpoint | Filter target allowed | Example |
| --- | --- | --- |
| **Memberships** (`getMemberships`, etc.) | `channel.*` + common | `channel.type == "private"`, `channel.custom.team == "alpha"` |
| **Members** (`getMembers`, etc.) | `uuid.*` + common | `uuid.custom.role == "moderator"`, `uuid.name LIKE "da%"` |

:::warning Rejected filter fields
You can't use `uuid.*` with memberships (or `channel.*` with members).
:::

#### Common fields

* `status` — Condition the membership is in
* `type` — Category used to classify the membership, like `subscription` (only REST API)
* `custom` — Any membership-specific property (not recommended)

#### Memberships filters

For memberships endpoints (e.g., `getMemberships`), filters can target `channel.*` fields plus common fields.

* `channel.id` - Identifier of the channel associated with the membership
* `channel.name` — Name of the channel
* `channel.description` — Channel description
* `channel.status` — Condition the channel is in, like `archived` (some SDKs)
* `channel.type` — Category used to classify the channel, like `OffTopic` (some SDKs)
* `channel.updated` — Timestamp of the last update to the channel's metadata
* `channel.custom` - Any channel-specific property (not recommended in SDKs and [BizOps Workspace](https://www.pubnub.com/docs/bizops-workspace/basics))

#### Memberships filter examples

```bash
// VALID
channel.type == "private"
channel.status == "active" && channel.custom.org == "acme"
type == "member" && channel.custom.team == "alpha"

// INVALID
// memberships only accept channel.* + common fields 
// uuid.* is rejected
uuid.name == "alice"
uuid.custom.role == "moderator"
```

:::warning Unread Counts Context
If you arrived here from unread-count helpers, note that they rely on **Memberships** under the hood, so filter expressions here can **only** use `channel.*` (plus common fields).
Unread counts include **all** messages after the membership's **last read timetoken** (including your own messages). If your UX needs different behavior, ensure you update last read timetoken as appropriate in your app.
:::

#### Members filters

For members endpoints (e.g., `getMembers`), filters can target `uuid.*` fields plus common fields.

* `uuid.id` — The UUID of the channel member
* `uuid.name` — Name of the channel member
* `uuid.externalId` — An identifier that links the channel member to an external system
* `uuid.profileUrl` — URL to the channel member's profile picture
* `uuid.email` — Channel member's email address
* `uuid.status` — Condition the channel member is in, like `active` (some SDKs)
* `uuid.type` — Category used to classify the channel member, like `SupportAgent` (some SDKs)
* `uuid.updated` — Timestamp when the channel member was last updated
* `uuid.custom` - Any channel member-specific property (not recommended in SDKs and [BizOps Workspace](https://www.pubnub.com/docs/bizops-workspace/basics))

#### Members filter examples

```bash
// VALID
uuid.name LIKE "da%"
uuid.custom.role == "moderator" && status == "active"

// INVALID
// members only accept uuid.* + common fields
// channel.* is rejected
channel.type == "private"
channel.custom.team == "alpha"
```

## Filtering operators

Pass a `filter` expression when you retrieve metadata. The language supports comparison operators (`==`, `!=`, `>`, `<`, `>=`, `<=`), logical operators (`&&`, `||`), and SQL-like `LIKE` pattern matching.

* `==` (equal to)
* `!=` (not equal to)
* `<` (less than)
* `>` (greater than)
* `<=` (less than or equal to)
* `>=` (greater than or equal to)
* `&&` (and)
* `||` (or)
* `LIKE` (SQL-like pattern matching, supports `*` as wildcard for string fields)

:::note Filtering large data volumes
For applications with a large number of users, channels, or memberships, use exact ID equality filters (`id == "channel-123"`, `uuid.id == "user-456"`) instead of pattern matching with `LIKE`. In [BizOps Workspace](https://www.pubnub.com/docs/bizops-workspace/basics), avoid the quick search box and use the Filters button with `equals` operators when working with many entities. This approach makes your searches much faster because it uses database indexes rather than scanning all records.
:::

## Query parameters and methods

Filter App Context data in these ways:

* Using the REST API calls to get the data: Get metadata for all users, Get metadata for all channels, Get membership metadata
* Using SDK methods that accept the filter parameter to limit App Context data when getting, setting, or removing it, like getAllUUIDMetadata(), getAllChannelMetadata(), getMemberships(), or setChannelMembers() in the JavaScript SDK. For details, head to the App Context document in a selected SDK documentation set. Filtering through custom propertiesTo avoid performance issues, do not filter App Context data through the custom fields using SDK methods.
* UI filters in BizOps Workspace: Filter users and their related channel memberships, Filter channels and their related user members Filtering through custom propertiesTo avoid performance issues, do not filter App Context data through the custom fields using BizOps Workspace.

:::warning Performance consideration
For applications with a large number of channels or users, always use exact match filtering with `id == "channelname"` or `id == "user-123"` rather than pattern matching with `LIKE` or partial string matches. Exact ID equality queries use database indexes and perform significantly better, especially in high-volume applications.
:::

## Filter expression components

Filter expressions include expressions, data references, literals, and tokens. Use them to build precise conditions.

### Expressions and conditions

These elements form the logical structure of queries.

| Element | Description | Syntax/Example |
| --- | --- | --- |
| Expression | Main building block, evaluates to true or false based on conditions | `email LIKE "*@example.com"` |
| And expression | Combines conditions that must all be true (logical AND) | `name == "Alice" && email LIKE "*@example.com"` |
| Binary condition | Basic unit for simple or negated conditions | `!(name == "Alice")` |
| Relational condition | Compares properties to values | `profileUrl != "http://example.com/default.jpg"` |

### Data references and operators

Use these tools to reference data and apply operators.

| Element | Description | Syntax/Example |
| --- | --- | --- |
| Identifier | Must start with a letter (A-Z, a-z), `$`, or `_`, and allow subsequent characters to include letters, digits (0-9), `$`, or `_`. | `my_user_id`, `$userID`, `_user_912710938aa848eda2c3e0c2b583` |
| Property name | Can be an alternative form of an identifier represented by a string enclosed in square brackets. Using square brackets makes most sense for non-regular (`custom`) fields containing special characters or spaces that are not supported directly with identifiers, but filtering through `custom` fields is not recommended for SDKs and BizOps Workspace. | `["name"] == "John"` (same as identifier `name`, but in brackets) or `custom["employment-status"] == "valid"` (as `custom.employment-status == "test"` would throw an error due to invalid `-` character) |
| Property path | Accesses nested properties using dot notation | `channel.name == "general"` |
| Relational operator | Operators to compare properties and values | `==`, `!=`, `<`, `>`, `<=`, `>=`, `LIKE` |

### Literals and data types

These elements represent specific data values.

| Element | Description | Syntax/Example |
| --- | --- | --- |
| Value | Fixed data values like strings, numbers, booleans, or null | `status == "active"` |
| String | Text values, enclosed in quotes (supports escaped characters) | `"Hello \"World\""` |

### Characters and tokens

Use these symbols to build strings and structure.

| Element | Description | Syntax/Example |
| --- | --- | --- |
| Letter | Any alphabetic character from any language | `a`, `Z`, `é`, `λ` |
| Number | Numeric values, supports integers, decimals, and scientific notation | `3.14159`, `-42`, `6.022e23` |
| Digit | Numbers from 0 to 9 | `0`, `9` |
| Hex digit | Hexadecimal digit used in unicode encoding | `0`, `9`, `A`, `F` |
| Double quote | Used to denote the start and end of strings | `"This is a string"` |
| Unicode character | Any character valid in the Unicode range | Any visible character, emoji, etc. |
| Special character | Characters that perform special functions in strings. For example, if you want to search for parameters that contain an asterisk, you must escape this special character, like `filter: 'name LIKE '*\\**'`. | `\n` (new line), `\t` (tab), `\\` (backslash) |

### Examples

#### Expression

Get all users whose names start with `John`.

##### JavaScript

```javascript
pubnub.objects.getAllUUIDMetadata({
    filter: 'name LIKE "John*"'
})
```

##### Swift

```swift
pubnub.allUUIDMetadata(
    filter: "name LIKE 'John*'",
    completion: { result in
        switch result {
        case .success(let response):
            let uuids = response.uuids
            print("Fetched UUID Metadata: \(uuids)")
        case .failure(let error):
            print("Failed to fetch UUID Metadata: \(error.localizedDescription)")
        }
    }
)
```

##### Kotlin

```kotlin
pubnub.getAllUUIDMetadata(
    filter = "name LIKE 'John*'"
).async { result: Result<PNUUIDMetadataArrayResult> ->
    result.onFailure { exception ->
        println("Error fetching UUID metadata: ${exception.message}")
    }.onSuccess { value: PNUUIDMetadataArrayResult ->
        value.data.forEach { metadata ->
            println("UUID: ${metadata.id}, Name: ${metadata.name}")
        }
    }
 }
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching UUID metadata: {status.error_message}")
    else:
        for uuid_data in response.data:
            print(f"UUID: {uuid_data['id']}, Name: {uuid_data['name']}")

pubnub.get_all_uuid_metadata()
       .filter("name LIKE 'John*'")
       .pn_async(callback)
```

#### And expression

Get metadata of channels that include `general` in names and were updated after January 1st, 2023.

##### JavaScript

```javascript
pubnub.objects.getAllChannelMetadata({
    filter: 'name LIKE "*general*" && updated >= "2023-01-01T00:00:00Z"'
})
```

##### Swift

```swift
pubnub.allChannelMetadata(
  filter: "name LIKE '*general*' && updated >= '2023-01-01T00:00:00Z'",
  completion: { result in
    switch result {
    case .success(let data):
      let channels = data.channels
      print("Filtered Channels: \(channels)")
    case .failure(let error):
      print("Error fetching channel metadata: \(error.localizedDescription)")
    }
  }
)
```

##### Kotlin

```kotlin
pubnub.getAllChannelMetadata(
    filter = "name LIKE '*general*' && updated >= '2023-01-01T00:00:00Z'"
).async { result: Result<PNChannelMetadataArrayResult> ->
    result.onFailure { exception ->
        println("Error fetching channel metadata: ${exception.message}")
    }.onSuccess { value: PNChannelMetadataArrayResult ->
        value.data.forEach { channel ->
            println("Channel ID: ${channel.id}, Name: ${channel.name}")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching channel metadata: {status.error_message}")
    else:
        for channel in response.data:
            print(f"Channel ID: {channel['id']}, Name: {channel['name']}, Updated: {channel['updated']}")

pubnub.get_all_channel_metadata() \
    .filter("name LIKE '*general*' && updated >= '2023-01-01T00:00:00Z'") \
    .pn_async(callback)
```

#### Binary condition

Retrieve all user memberships excluding the channel with ID `Channel-001`.

##### JavaScript

```javascript
pubnub.objects.getMemberships({
    uuid: 'user123',
    filter: '!(channel.id == "Channel-001")'
})
```

##### Swift

```swift
pubnub.fetchMemberships(
    uuid: "user123",
    filter: "!(channel.id == 'Channel-001')",
    completion: { result in
        switch result {
        case .success(let data):
            let memberships = data.memberships
            print("Filtered Memberships: \(memberships)")
        case .failure(let error):
            print("Error fetching memberships: \(error.localizedDescription)")
        }
    }
)
```

##### Kotlin

```kotlin
val userId = "user123"
pubnub.getMemberships(
    uuid = userId,
    filter = "!(channel.id == 'Channel-001')"
).async { result ->
    result.onFailure { exception ->
        println("Error fetching memberships: ${exception.message}")
    }.onSuccess{ value ->
        println("Successfully removed channel members")
        value.data.forEach { membership ->
            println("Channel ID: ${membership.channel?.id}, User ID: $userId")
        }
    }
}
```

##### Python

```python
memberships = pubnub.get_memberships() \
    .uuid("user123") \
    .filter("!(channel.id == 'Channel-001')") \
    .sync()

if memberships.status.is_error():
    print(f"Error fetching memberships: {memberships.status}")
else:
    print(memberships.__dict__)
    for membership in memberships.result.data:
        print(f"Channel ID: {membership['channel']['id']}")
```

#### Relational condition

Find channel members whose last update was before a specific time.

##### JavaScript

```javascript
pubnub.objects.getChannelMembers({
    channel: "specialEvents",
    filter: 'uuid.updated < "2023-01-01T00:00:00Z"'
})
```

##### Swift

```swift
pubnub.fetchMembers(
    channel: "specialEvents",
    filter: "uuid.updated < '2023-01-01T00:00:00Z'",
    completion: { result in
        switch result {
        case .success(let response):
            let memberships = response.memberships
            print("Fetched Memberships: \(memberships)")
        case .failure(let error):
            print("Failed to fetch Memberships: \(error.localizedDescription)")
        }
    }
)
```

##### Kotlin

```kotlin
val channel = "specialEvents"
pubnub.getChannelMembers(
    channel = channel,
    filter = "uuid.updated < '2023-01-01T00:00:00Z'"
).async { result ->
    result.onFailure { exception: PubNubException ->
        println("Error fetching channel members: ${exception.message}")
    }.onSuccess { value: PNMemberArrayResult ->
        value.data.forEach { member ->
            println("Member UUID: ${member.uuid}, Channel: $channel")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching channel members: {status.error_message}")
    else:
        for member in response.data:
            print(f"Member UUID: {member['uuid']}, Channel: {member['channel']}")

pubnub.get_channel_members() \
    .channel("specialEvents") \
    .filter("uuid.updated < '2023-01-01T00:00:00Z'") \
    .pn_async(callback)
```

#### Identifier

Retrieve all users whose name is `John`.

##### JavaScript

```javascript
pubnub.objects.getAllUUIDMetadata({
    filter: 'name == "John"'
})
```

##### Swift

```swift
pubnub.allUUIDMetadata(
    filter: "name == 'John'",
    completion: { result in
        switch result {
        case .success(let response):
            let uuids = response.uuids
            print("Fetched UUID Metadata: \(uuids)")
        case .failure(let error):
            print("Failed to fetch UUID Metadata: \(error.localizedDescription)")
        }
    }
)
```

##### Kotlin

```kotlin
pubnub.getAllUUIDMetadata(
    filter = "name == 'John'"
).async { result ->
    result.onFailure { exception ->
        println("Error fetching UUID metadata: ${exception.message}")
    }.onSuccess { value ->
        value.data.forEach { metadata ->
            println("UUID: ${metadata.id}, Name: ${metadata.name}")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching UUID metadata: {status.error_message}")
    else:
        for uuid_data in response.data:
            print(f"UUID: {uuid_data['id']}, Name: {uuid_data['name']}")

pubnub.get_all_uuid_metadata()
       .filter("name == 'John'")
       .pn_async(callback)
```

#### Property name

Retrieve all channels whose descriptions contain `support`.

##### JavaScript

```javascript
pubnub.objects.getAllChannelMetadata({
    filter: '["description"] LIKE "*support*"'
})
```

##### Swift

```swift
pubnub.allChannelMetadata(
  filter: "['description'] LIKE '*support*'",
  completion: { result in
    switch result {
    case .success(let data):
      let channels = data.channels
      print("Filtered Channels: \(channels)")
    case .failure(let error):
      print("Error fetching channel metadata: \(error.localizedDescription)")
    }
  }
)
```

##### Kotlin

```kotlin
pubnub.getAllChannelMetadata(
    filter = "['description'] LIKE '*support*'"
).async { result ->
    result.onFailure { exception ->
        println("Error fetching channel metadata: ${exception.message}")
    }.onSuccess { value ->
        value.data.forEach { channel ->
            println("Channel ID: ${channel.id}, Name: ${channel.name}")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching channel metadata: {status.error_message}")
    else:
        for channel in response.data:
            print(f"Channel ID: {channel['id']}, Name: {channel['name']}, Updated: {channel['updated']}")

pubnub.get_all_channel_metadata() \
    .filter("['description'] LIKE '*support*'") \
    .pn_async(callback)
```

#### Property path

Retrieve all user memberships where channel ID starts with `user`.

##### JavaScript

```javascript
pubnub.objects.getMemberships({
    uuid: 'user123',
    filter: 'channel.id LIKE "user*"'
})
```

##### Swift

```swift
pubnub.fetchMemberships(
    uuid: "user123",
    filter: "(channel.id LIKE 'user*')",
    completion: { result in
        switch result {
        case .success(let data):
            let memberships = data.memberships
            print("Filtered Memberships: \(memberships)")
        case .failure(let error):
            print("Error fetching memberships: \(error.localizedDescription)")
        }
    }
)
```

##### Kotlin

```kotlin
val userId = "user123"
pubnub.getMemberships(
    uuid = userId,
    filter = "(channel.id LIKE 'user*')"
).async { result ->
    result.onFailure { exception ->
        println("Error fetching memberships: ${exception.message}")
    }.onSuccess{ value ->
        println("Successfully removed channel members")
        value.data.forEach { membership ->
            println("Channel ID: ${membership.channel?.id}, User ID: $userId")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching memberships: {status.error_message}")
    else:
        for membership in response.data:
            print(f"Membership ID: {membership['id']}, Channel ID: {membership['channel']['id']}, User ID: {membership['uuid']}")

pubnub.get_memberships() \
    .uuid("user123") \
    .filter("(channel.id LIKE 'user*')") \
    .pn_async(callback)
```

#### Relational operator

Add to the `advancedChannel` channel all specified users, but return only those users whose IDs are greater than a certain value (`250`).

##### JavaScript

```javascript
pubnub.objects.setChannelMembers({
    channel: "advancedChannel",
    uuids: [
        { id: "201" },
        { id: "300" },
        { id: "450" },
        { id: "789" }
    ],
    filter: 'uuid.id > "250"'
});
```

##### Swift

```swift
pubnub.setMembers(
  channel: "advancedChannel",
  uuids: [
    PubNubMembershipMetadataBase(uuidMetadataId: "201", channelMetadataId: "advancedChannel"),
    PubNubMembershipMetadataBase(uuidMetadataId: "300", channelMetadataId: "advancedChannel"),
    PubNubMembershipMetadataBase(uuidMetadataId: "450", channelMetadataId: "advancedChannel"),
    PubNubMembershipMetadataBase(uuidMetadataId: "789", channelMetadataId: "advancedChannel")
  ],
  filter: "uuid.id > '250'",
  completion: { result in
    switch result {
    case .success(let data):
      let memberships = data.memberships
      print("Updated Memberships: \(memberships)")
    case .failure(let error):
      print("Error setting channel members: \(error.localizedDescription)")
    }
  }
)
```

##### Kotlin

```kotlin
val channel = "advancedChannel"
pubnub.setChannelMembers(
    uuids = listOf(
        PNMember.Partial(uuidId = "201"),
        PNMember.Partial(uuidId = "300"),
        PNMember.Partial(uuidId = "450"),
        PNMember.Partial(uuidId = "789")
    ),
    channel = channel,
    filter = "uuid.id > '250'"
).async { result ->
    result.onFailure { exception ->
        println("Error setting channel members: ${exception.message}")
    }.onSuccess{ value ->
        value.data.forEach { member ->
            println("Member UUID: ${member.uuid}, Channel: $channel")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error setting channel members: {status.error_message}")
    else:
        for member in response.data:
            print(f"Member UUID: {member['uuid']}, Channel: {member['channel']}")

pubnub.set_channel_members() \
    .channel("advancedChannel") \
    .uuids([
        PNUUID(uuid="201"),
        PNUUID(uuid="300"),
        PNUUID(uuid="450"),
        PNUUID(uuid="789")
    ]) \
    .filter("uuid.id > '250'") \
    .pn_async(callback)
```

#### Value

Get all `oldChannel` channel members with the `inactive` status.

##### JavaScript

```javascript
pubnub.objects.getChannelMembers({
    channel: "oldChannel",
    filter: 'uuid.status == "inactive"'
})
```

##### Swift

```swift
pubnub.fetchMembers(
    channel: "oldChannel",
    filter: "uuid.status == 'inactive'",
    completion: { result in
        switch result {
        case .success(let response):
            let memberships = response.memberships
            print("Fetched Memberships: \(memberships)")
        case .failure(let error):
            print("Failed to fetch Memberships: \(error.localizedDescription)")
        }
    }
)
```

##### Kotlin

```kotlin
val channel = "oldChannel"
pubnub.getChannelMembers(
    channel = channel,
    filter = "uuid.status == 'inactive'"
).async { result ->
    result.onFailure { exception: PubNubException ->
        println("Error fetching channel members: ${exception.message}")
    }.onSuccess { value: PNMemberArrayResult ->
        value.data.forEach { member ->
            println("Member UUID: ${member.uuid}, Channel: $channel")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching channel members: {status.error_message}")
    else:
        for member in response.data:
            print(f"Member UUID: {member['uuid']}, Channel: {member['channel']}")

pubnub.get_channel_members() \
    .channel("oldChannel") \
    .filter("uuid.status == 'inactive'") \
    .pn_async(callback)
```

#### String

Get metadata of a channel with a description including escaped characters.

##### JavaScript

```javascript
pubnub.objects.getAllChannelMetadata({
    filter: 'description == "Hello \\"Gossipers\\""'
})
```

##### Swift

```swift
pubnub.allChannelMetadata(
  filter: "description == 'Hello \\'Gossipers\\''",
  completion: { result in
    switch result {
    case .success(let data):
      let channels = data.channels
      print("Filtered Channels: \(channels)")
    case .failure(let error):
      print("Error fetching channel metadata: \(error.localizedDescription)")
    }
  }
)
```

##### Kotlin

```kotlin
pubnub.getAllChannelMetadata(
    filter = "description == 'Hello \\'Gossipers\\''"
).async { result ->
    result.onFailure { exception ->
        println("Error fetching channel metadata: ${exception.message}")
    }.onSuccess { value ->
        value.data.forEach { channel ->
            println("Channel ID: ${channel.id}, Name: ${channel.name}")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching channel metadata: {status.error_message}")
    else:
        for channel in response.data:
            print(f"Channel ID: {channel['id']}, Name: {channel['name']}, Updated: {channel['updated']}")

pubnub.get_all_channel_metadata() \
    .filter("description == 'Hello \\'Gossipers\\''") \
    .pn_async(callback)
```

#### Letter

Get all users whose names start with `J`.

##### JavaScript

```javascript
pubnub.objects.getAllUUIDMetadata({
    filter: 'name LIKE "J*"'
})
```

##### Swift

```swift
pubnub.allUUIDMetadata(
    filter: "name LIKE 'J*'",
    completion: { result in
        switch result {
        case .success(let response):
            let uuids = response.uuids
            print("Fetched UUID Metadata: \(uuids)")
        case .failure(let error):
            print("Failed to fetch UUID Metadata: \(error.localizedDescription)")
        }
    }
)
```

##### Kotlin

```kotlin
pubnub.getAllUUIDMetadata(
    filter = "name LIKE 'J*'"
).async { result ->
    result.onFailure { exception ->
        println("Error fetching UUID metadata: ${exception.message}")
    }.onSuccess { value ->
        value.data.forEach { metadata ->
            println("UUID: ${metadata.id}, Name: ${metadata.name}")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching UUID metadata: {status.error_message}")
    else:
        for uuid_data in response.data:
            print(f"UUID: {uuid_data['id']}, Name: {uuid_data['name']}")

pubnub.get_all_uuid_metadata()
       .filter("name LIKE 'J*'")
       .pn_async(callback)
```

#### Number

Get metadata of channels that were updated after January 1st, 2023.

##### JavaScript

```javascript
pubnub.objects.getAllChannelMetadata({
    filter: 'updated >= "2023-01-01T00:00:00Z"'
})
```

##### Swift

```swift
pubnub.allChannelMetadata(
  filter: "updated >= '2023-01-01T00:00:00Z'",
  completion: { result in
    switch result {
    case .success(let data):
      let channels = data.channels
      print("Filtered Channels: \(channels)")
    case .failure(let error):
      print("Error fetching channel metadata: \(error.localizedDescription)")
    }
  }
)
```

##### Kotlin

```kotlin
pubnub.getAllChannelMetadata(
    filter = "updated >= '2023-01-01T00:00:00Z'"
).async { result ->
    result.onFailure { exception ->
        println("Error fetching channel metadata: ${exception.message}")
    }.onSuccess{ value ->
        value.data.forEach { channel ->
            println("Channel ID: ${channel.id}, Name: ${channel.name}")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching channel metadata: {status.error_message}")
    else:
        for channel in response.data:
            print(f"Channel ID: {channel[' id']}, Name: {channel[' name']}, Updated: {channel[' updated']}")

pubnub.get_all_channel_metadata() \
    .filter("updated >= '2023-01-01T00:00:00Z'") \
    .pn_async(callback)
```

#### Digit

Get all users with IDs that do not contain `8`.

##### JavaScript

```javascript
pubnub.objects.getAllUUIDMetadata({
    filter: '!(id LIKE "*8*")'
})
```

##### Swift

```swift
pubnub.allUUIDMetadata(
    filter: "!(id LIKE '*8*')",
    completion: { result in
        switch result {
        case .success(let response):
            let uuids = response.uuids
            print("Fetched UUID Metadata: \(uuids)")
        case .failure(let error):
            print("Failed to fetch UUID Metadata: \(error.localizedDescription)")
        }
    }
)
```

##### Kotlin

```kotlin
pubnub.getAllUUIDMetadata(
    filter = "!(id LIKE '*8*')"
).async { result ->
    result.onFailure { exception ->
        println("Error fetching UUID metadata: ${exception.message}")
    }.onSuccess { value ->
        value.data.forEach { metadata ->
            println("UUID: ${metadata.id}, Name: ${metadata.name}")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching UUID metadata: {status.error_message}")
    else:
        for uuid_data in response.data:
            print(f"UUID: {uuid_data['id']}, Name: {uuid_data['name']}")

pubnub.get_all_uuid_metadata()
       .filter("!(id LIKE '*8*')")
       .pn_async(callback)
```

#### Hex digit

Retrieve all channels with IDs containing `A3F9`.

##### JavaScript

```javascript
pubnub.objects.getAllChannelMetadata({
    filter: 'id LIKE "*A3F9*"'
})
```

##### Swift

```swift
pubnub.allChannelMetadata(
  filter: "id LIKE '*A3F9*'",
  completion: { result in
    switch result {
    case .success(let data):
      let channels = data.channels
      print("Filtered Channels: \(channels)")
    case .failure(let error):
      print("Error fetching channel metadata: \(error.localizedDescription)")
    }
  }
)
```

##### Kotlin

```kotlin
pubnub.getAllChannelMetadata(
    filter = "id LIKE '*A3F9*'"
).async { result ->
    result.onFailure { exception ->
        println("Error fetching channel metadata: ${exception.message}")
    }.onSuccess { value ->
        value.data.forEach { channel ->
            println("Channel ID: ${channel.id}, Name: ${channel.name}")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching channel metadata: {status.error_message}")
    else:
        for channel in response.data:
            print(f"Channel ID: {channel['id']}, Name: {channel['name']}, Updated: {channel['updated']}")

pubnub.get_all_channel_metadata() \
    .filter("id LIKE '*A3F9*'") \
    .pn_async(callback)
```

#### Double quote

Find all channels whose descriptions contain the word `VIP`.

##### JavaScript

```javascript
pubnub.objects.getAllChannelMetadata({
    filter: "description LIKE \"*VIP*\""
})
```

##### Swift

```swift
pubnub.allChannelMetadata(
  filter: "description LIKE \"*VIP*\"",
  completion: { result in
    switch result {
    case .success(let data):
      let channels = data.channels
      print("Filtered Channels: \(channels)")
    case .failure(let error):
      print("Error fetching channel metadata: \(error.localizedDescription)")
    }
  }
)
```

##### Kotlin

```kotlin
pubnub.getAllChannelMetadata(
  filter = "description LIKE \"*VIP*\""
).async { result ->
  result.onFailure { exception ->
    println("Error fetching channel metadata: ${exception.message}")
  }.onSuccess { value ->
    value.data.forEach { channel ->
      println("Channel ID: ${channel.id}, Name: ${channel.name}")
    }
  }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching channel metadata: {status.error_message}")
    else:
        for channel in response.data:
            print(f"Channel ID: {channel['id']}, Name: {channel['name']}, Updated: {channel['updated']}")

pubnub.get_all_channel_metadata() \
    .filter("description LIKE \"*VIP*\"") \
    .pn_async(callback)
```

#### Unicode character

Retrieve all channel descriptions that contain the `❤️` emoji.

##### JavaScript

```javascript
pubnub.objects.getAllChannelMetadata({
    filter: 'description LIKE "*❤️*"'
})
```

##### Swift

```swift
pubnub.allChannelMetadata(
  filter: "description LIKE '*❤️*'",
  completion: { result in
    switch result {
    case .success(let data):
      let channels = data.channels
      print("Filtered Channels: \(channels)")
    case .failure(let error):
      print("Error fetching channel metadata: \(error.localizedDescription)")
    }
  }
)
```

##### Kotlin

```kotlin
pubnub.getAllChannelMetadata(
  filter = "description LIKE '*❤️*'"
).async { result ->
  result.onFailure { exception ->
    println("Error fetching channel metadata: ${exception.message}")
  }.onSuccess { value ->
    value.data.forEach { channel ->
      println("Channel ID: ${channel.id}, Name: ${channel.name}")
    }
  }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching channel metadata: {status.error_message}")
    else:
        for channel in response.data:
            print(f"Channel ID: {channel['id']}, Name: {channel['name']}, Updated: {channel['updated']}")

pubnub.get_all_channel_metadata() \
    .filter("description LIKE '*❤️*'") \
    .pn_async(callback)
```

#### Special character

Get metadata of a channel with a specific description containing a new line.

##### JavaScript

```javascript
pubnub.objects.getAllChannelMetadata({
    filter: 'description == "Check out our new deals!\\nAvailable for a limited time."'
})
```

##### Swift

```swift
pubnub.allChannelMetadata(
  filter: "description == 'Check out our new deals!\\nAvailable for a limited time.'",
  completion: { result in
    switch result {
    case .success(let data):
      let channels = data.channels
      print("Filtered Channels: \(channels)")
    case .failure(let error):
      print("Error fetching channel metadata: \(error.localizedDescription)")
    }
  }
)
```

##### Kotlin

```kotlin
pubnub.getAllChannelMetadata(
    filter = "description == 'Check out our new deals!\\nAvailable for a limited time.'"
).async { result ->
    result.onFailure { exception ->
        println("Error fetching channel metadata: ${exception.message}")
    }.onSuccess { value ->
        value.data.forEach { channel ->
            println("Channel ID: ${channel.id}, Name: ${channel.name}")
        }
    }
}
```

##### Python

```python
def callback(response, status):
    if status.is_error():
        print(f"Error fetching channel metadata: {status.error_message}")
    else:
        for channel in response.data:
            print(f"Channel ID: {channel['id']}, Name: {channel['name']}, Updated: {channel['updated']}")

pubnub.get_all_channel_metadata() \
    .filter("description == 'Check out our new deals!\\nAvailable for a limited time.'") \
    .pn_async(callback)
```

## Terms in this document

* **PubNub** - PubNub is a real-time messaging platform that provides APIs and SDKs for building scalable applications. It handles the complex infrastructure of real-time communication, including: Message delivery and persistence, Presence detection, Access control, Push notifications, File sharing, Serverless processing with Functions and Events & Actions, Analytics and monitoring with BizOps Workspace, AI-powered insights with Illuminate.
