You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`data`|`List[Record]`| The list of record results |
171
+
|`data`|`List[T]`| The list of result items (generic type)|
149
172
|`total`|`int`| Total number of matching records |
150
173
|`count`|`int`| Number of records in current result set |
151
174
|`limit`|`Optional[int]`| Limit that was applied to the search |
152
175
|`skip`|`int`| Number of records that were skipped |
153
176
|`has_more`|`bool`| Whether there are more records available |
154
177
|`search_query`|`SearchQuery`| The search query used to generate result |
155
178
179
+
> **Implementation Notes:**
180
+
>
181
+
> - If `search_query` is not provided during initialization, it defaults to an empty dictionary `{}`
182
+
> - The `skip` property checks if `search_query` is a dictionary and returns the "skip" value or 0
183
+
> - The `has_more` property is calculated as `total > (skip + len(data))`, allowing for efficient pagination
184
+
> - The `__bool__` method returns `True` if the result contains any items (`len(data) > 0`)
185
+
156
186
### Pagination Example
157
187
158
188
```python
@@ -182,6 +212,17 @@ while True:
182
212
current_page +=1
183
213
```
184
214
215
+
### RecordSearchResult Type
216
+
217
+
The SDK provides a specialized type alias for search results containing Record objects:
218
+
219
+
```python
220
+
# Type alias for record search results
221
+
RecordSearchResult = SearchResult[Record]
222
+
```
223
+
224
+
This type is what's returned by methods like `db.records.find()`, providing type safety and specialized handling for Record objects while leveraging all the functionality of the generic SearchResult class.
225
+
185
226
## Improved Record API
186
227
187
228
The Record class has been enhanced with better data access patterns and utility methods.
0 commit comments