corsair.telegram.db.<entity>.search({ data, limit?, offset? }) with the filters listed per entity.
New to Corsair? See database operations, data synchronization, and multi-tenancy.
Chats
Path:telegram.db.chats.search
Searchable filters
| Field | Type | Operators |
|---|---|---|
entity_id | string | equals, contains, startsWith, endsWith, in |
id | string | equals, contains, startsWith, endsWith, in |
chat_id | number | equals, gt, gte, lt, lte, in |
title | string | equals, contains, startsWith, endsWith, in |
username | string | equals, contains, startsWith, endsWith, in |
first_name | string | equals, contains, startsWith, endsWith, in |
last_name | string | equals, contains, startsWith, endsWith, in |
is_forum | boolean | equals |
description | string | equals, contains, startsWith, endsWith, in |
invite_link | string | equals, contains, startsWith, endsWith, in |
createdAt | date | equals, before, after, between |
.search() also accepts limit and offset for pagination. .list() is available on the same path without the .search suffix in code — see database operations.
Files
Path:telegram.db.files.search
Searchable filters
| Field | Type | Operators |
|---|---|---|
entity_id | string | equals, contains, startsWith, endsWith, in |
id | string | equals, contains, startsWith, endsWith, in |
file_id | string | equals, contains, startsWith, endsWith, in |
file_unique_id | string | equals, contains, startsWith, endsWith, in |
file_size | number | equals, gt, gte, lt, lte, in |
file_path | string | equals, contains, startsWith, endsWith, in |
createdAt | date | equals, before, after, between |
.search() also accepts limit and offset for pagination. .list() is available on the same path without the .search suffix in code — see database operations.
Messages
Path:telegram.db.messages.search
Searchable filters
| Field | Type | Operators |
|---|---|---|
entity_id | string | equals, contains, startsWith, endsWith, in |
id | string | equals, contains, startsWith, endsWith, in |
message_id | number | equals, gt, gte, lt, lte, in |
chat_id | string | equals, contains, startsWith, endsWith, in |
from_id | string | equals, contains, startsWith, endsWith, in |
authorId | string | equals, contains, startsWith, endsWith, in |
date | number | equals, gt, gte, lt, lte, in |
text | string | equals, contains, startsWith, endsWith, in |
caption | string | equals, contains, startsWith, endsWith, in |
createdAt | date | equals, before, after, between |
edit_date | number | equals, gt, gte, lt, lte, in |
media_group_id | string | equals, contains, startsWith, endsWith, in |
reply_to_message_id | number | equals, gt, gte, lt, lte, in |
forward_from_id | number | equals, gt, gte, lt, lte, in |
forward_from_chat_id | number | equals, gt, gte, lt, lte, in |
forward_from_message_id | number | equals, gt, gte, lt, lte, in |
.search() also accepts limit and offset for pagination. .list() is available on the same path without the .search suffix in code — see database operations.
Polls
Path:telegram.db.polls.search
Searchable filters
| Field | Type | Operators |
|---|---|---|
entity_id | string | equals, contains, startsWith, endsWith, in |
id | string | equals, contains, startsWith, endsWith, in |
poll_id | string | equals, contains, startsWith, endsWith, in |
question | string | equals, contains, startsWith, endsWith, in |
total_voter_count | number | equals, gt, gte, lt, lte, in |
is_closed | boolean | equals |
is_anonymous | boolean | equals |
type | string | equals, contains, startsWith, endsWith, in |
allows_multiple_answers | boolean | equals |
createdAt | date | equals, before, after, between |
.search() also accepts limit and offset for pagination. .list() is available on the same path without the .search suffix in code — see database operations.
Users
Path:telegram.db.users.search
Searchable filters
| Field | Type | Operators |
|---|---|---|
entity_id | string | equals, contains, startsWith, endsWith, in |
id | string | equals, contains, startsWith, endsWith, in |
user_id | number | equals, gt, gte, lt, lte, in |
is_bot | boolean | equals |
first_name | string | equals, contains, startsWith, endsWith, in |
last_name | string | equals, contains, startsWith, endsWith, in |
username | string | equals, contains, startsWith, endsWith, in |
language_code | string | equals, contains, startsWith, endsWith, in |
is_premium | boolean | equals |
createdAt | date | equals, before, after, between |
.search() also accepts limit and offset for pagination. .list() is available on the same path without the .search suffix in code — see database operations.