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
{{ message }}
Repository navigation
Commit e13345b
Browse filesBrowse the repository at this point in the historyBrowse files
`{ customer: { country: 'US' } }` beneath a lookup is served in `where`: the
190
+
engine reads the related object as the caller and matches its ids. The limits
191
+
(one level, forward only, `where` only, 1000 ids, the caller's permissions) and
192
+
the two-step route past them: **[filter rules → Relation Filters](./rules/filters.md)**.
192
193
193
194
### Cross-field comparisons
194
195
@@ -328,7 +329,7 @@ that set, never widen it: over the REST/protocol ingress a name outside it is
328
329
Mirror the related record's title into a **stored** field on the queried object
329
330
and search that; the field, the write hooks and the lint wording are
330
331
**objectstack-data → Search Fields (`searchableFields`)**. To *filter* by a
331
-
related record's column, `$in` ids from its own query; to *display* it, `expand`.
332
+
related record's column, `where: { relation: { column: value } }`; to *display* it, `expand`.
332
333
333
334
## Common Patterns
334
335
@@ -337,7 +338,7 @@ related record's column, `$in` ids from its own query; to *display* it, `expand`
337
338
| Scenario | Use |
338
339
|:---------|:----|
339
340
| Load lookup fields for display |`expand`|
340
-
| Filter rows by their lookup target's column |Query the target object, then `{ lookup: { $in: ids } }` — `$contains` per id when `multiple`|
341
+
| Filter rows by their lookup target's column |`{ lookup: { column: value } }` in `where`, up to 1000 related ids; past the cap query the target, then `{ lookup: { $in: ids } }` — `$contains` per id when `multiple`|
341
342
| Filter parent by child conditions | Query the child with `fields: [lookup]`, then `{ id: { $in: those ids } }` on the parent |
342
343
|**Keyword-search by a related record's title**|**Mirror the title into a stored field on this object and search that** — `search` never traverses |
343
344
| Paginate/sort a parent's related records | Query the related object directly |
0 commit comments