[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-tanstack-db-corelive-queries":3,"mdc--ce6l9x-key":32,"related-repo-tanstack-db-corelive-queries":10094,"related-org-tanstack-db-corelive-queries":10181},{"slug":4,"name":5,"fn":6,"description":7,"org":8,"tags":12,"stars":21,"repoUrl":22,"updatedAt":23,"license":24,"forks":25,"topics":26,"repo":27,"sourceUrl":30,"mdContent":31},"db-corelive-queries","db-core\u002Flive-queries","build live queries with TanStack DB","Query builder fluent API: from, where, join, leftJoin, rightJoin, innerJoin, fullJoin, select, fn.select, groupBy, having, orderBy, limit, offset, distinct, findOne. Operators: eq, gt, gte, lt, lte, like, ilike, inArray, isNull, isUndefined, and, or, not. Aggregates: count, sum, avg, min, max. String functions: upper, lower, length, concat. Utility: coalesce, caseWhen. Math: add. $selected namespace. createLiveQueryCollection. Derived collections. Predicate push-down. Incremental view maintenance via differential dataflow (d2ts). Virtual properties ($synced, $origin, $key, $collectionId). Includes subqueries for hierarchical data. toArray and concat(toArray(...)) scalar includes. queryOnce for one-shot queries. createEffect for reactive side effects (onEnter, onUpdate, onExit, onBatch).\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},"tanstack","TanStack","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftanstack.png",[13,17,20],{"name":14,"slug":15,"type":16},"Database","database","tag",{"name":18,"slug":19,"type":16},"SQL","sql",{"name":10,"slug":9,"type":16},3811,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Fdb","2026-07-16T06:04:08.757365",null,245,[],{"repoUrl":22,"stars":21,"forks":25,"topics":28,"description":29},[],"The reactive client store for your API.","https:\u002F\u002Fgithub.com\u002FTanStack\u002Fdb\u002Ftree\u002FHEAD\u002Fpackages\u002Fdb\u002Fskills\u002Fdb-core\u002Flive-queries","---\nname: db-core\u002Flive-queries\ndescription: >\n  Query builder fluent API: from, where, join, leftJoin, rightJoin, innerJoin,\n  fullJoin, select, fn.select, groupBy, having, orderBy, limit, offset, distinct,\n  findOne. Operators: eq, gt, gte, lt, lte, like, ilike, inArray, isNull,\n  isUndefined, and, or, not. Aggregates: count, sum, avg, min, max. String\n  functions: upper, lower, length, concat. Utility: coalesce, caseWhen. Math: add.\n  $selected namespace. createLiveQueryCollection. Derived collections. Predicate push-down.\n  Incremental view maintenance via differential dataflow (d2ts). Virtual\n  properties ($synced, $origin, $key, $collectionId). Includes subqueries\n  for hierarchical data. toArray and concat(toArray(...)) scalar includes.\n  queryOnce for one-shot queries. createEffect for reactive side effects\n  (onEnter, onUpdate, onExit, onBatch).\ntype: sub-skill\nlibrary: db\nlibrary_version: '0.6.0'\nsources:\n  - 'TanStack\u002Fdb:docs\u002Fguides\u002Flive-queries.md'\n  - 'TanStack\u002Fdb:packages\u002Fdb\u002Fsrc\u002Fquery\u002Fbuilder\u002Findex.ts'\n  - 'TanStack\u002Fdb:packages\u002Fdb\u002Fsrc\u002Fquery\u002Fcompiler\u002Findex.ts'\n---\n\n# Live Queries\n\n> This skill builds on db-core.\n\nTanStack DB live queries use a SQL-like fluent query builder to create **reactive derived collections** that automatically update when underlying data changes. The query engine compiles queries into incremental view maintenance (IVM) pipelines using differential dataflow (d2ts), so only deltas are recomputed.\n\nAll operators, string functions, math functions, and aggregates are incrementally maintained. Prefer them over equivalent JS code.\n\n## Setup\n\nMinimal example using the core API (no framework hooks):\n\n```ts\nimport {\n  createCollection,\n  createLiveQueryCollection,\n  liveQueryCollectionOptions,\n  eq,\n} from '@tanstack\u002Fdb'\n\n\u002F\u002F Assume usersCollection is already created via createCollection(...)\n\n\u002F\u002F Option 1: createLiveQueryCollection shorthand\nconst activeUsers = createLiveQueryCollection((q) =>\n  q\n    .from({ user: usersCollection })\n    .where(({ user }) => eq(user.active, true))\n    .select(({ user }) => ({\n      id: user.id,\n      name: user.name,\n      email: user.email,\n    })),\n)\n\n\u002F\u002F Option 2: full options via liveQueryCollectionOptions\nconst activeUsers2 = createCollection(\n  liveQueryCollectionOptions({\n    query: (q) =>\n      q\n        .from({ user: usersCollection })\n        .where(({ user }) => eq(user.active, true))\n        .select(({ user }) => ({\n          id: user.id,\n          name: user.name,\n        })),\n    getKey: (user) => user.id,\n  }),\n)\n\n\u002F\u002F The result is a live collection -- iterate, subscribe, or use as source\nfor (const user of activeUsers) {\n  console.log(user.name)\n}\n```\n\n## Core Patterns\n\n### 1. Filtering with where + operators\n\nChain `.where()` calls (ANDed together) using expression operators. Use `and()`, `or()`, `not()` for complex logic.\n\n```ts\nimport { eq, gt, or, and, not, inArray, like } from '@tanstack\u002Fdb'\n\nconst results = createLiveQueryCollection((q) =>\n  q\n    .from({ user: usersCollection })\n    .where(({ user }) => eq(user.active, true))\n    .where(({ user }) =>\n      and(\n        gt(user.age, 18),\n        or(eq(user.role, 'admin'), eq(user.role, 'moderator')),\n        not(inArray(user.id, bannedIds)),\n      ),\n    ),\n)\n```\n\nBoolean column references work directly:\n\n```ts\n.where(({ user }) => user.active)        \u002F\u002F bare boolean ref\n.where(({ user }) => not(user.suspended)) \u002F\u002F negated boolean ref\n```\n\n### 2. Joining two collections\n\nJoin conditions **must** use `eq()` (equality only -- IVM constraint). Default join type is `left`. Convenience methods: `leftJoin`, `rightJoin`, `innerJoin`, `fullJoin`.\n\n```ts\nimport { eq } from '@tanstack\u002Fdb'\n\nconst userPosts = createLiveQueryCollection((q) =>\n  q\n    .from({ user: usersCollection })\n    .innerJoin({ post: postsCollection }, ({ user, post }) =>\n      eq(user.id, post.userId),\n    )\n    .select(({ user, post }) => ({\n      userName: user.name,\n      postTitle: post.title,\n    })),\n)\n```\n\nMultiple joins:\n\n```ts\nq.from({ user: usersCollection })\n  .join({ post: postsCollection }, ({ user, post }) => eq(user.id, post.userId))\n  .join({ comment: commentsCollection }, ({ post, comment }) =>\n    eq(post.id, comment.postId),\n  )\n```\n\n### 3. Aggregation with groupBy + having\n\nUse `groupBy` to group rows, then aggregate in `select`. Filter groups with `having`. The `$selected` namespace lets `having` and `orderBy` reference fields defined in `select`.\n\n```ts\nimport { count, sum, gt } from '@tanstack\u002Fdb'\n\nconst topCustomers = createLiveQueryCollection((q) =>\n  q\n    .from({ order: ordersCollection })\n    .groupBy(({ order }) => order.customerId)\n    .select(({ order }) => ({\n      customerId: order.customerId,\n      totalSpent: sum(order.amount),\n      orderCount: count(order.id),\n    }))\n    .having(({ $selected }) => gt($selected.totalSpent, 1000))\n    .orderBy(({ $selected }) => $selected.totalSpent, 'desc')\n    .limit(10),\n)\n```\n\nWithout `groupBy`, aggregates in `select` treat the entire collection as one group:\n\n```ts\nconst stats = createLiveQueryCollection((q) =>\n  q.from({ user: usersCollection }).select(({ user }) => ({\n    totalUsers: count(user.id),\n    avgAge: avg(user.age),\n  })),\n)\n```\n\n### 4. Standalone derived collection with createLiveQueryCollection\n\nDerived collections are themselves collections. Use one as a source for another query to cache intermediate results:\n\n```ts\n\u002F\u002F Base derived collection\nconst activeUsers = createLiveQueryCollection((q) =>\n  q.from({ user: usersCollection }).where(({ user }) => eq(user.active, true)),\n)\n\n\u002F\u002F Second query uses the derived collection as its source\nconst activeUserPosts = createLiveQueryCollection((q) =>\n  q\n    .from({ user: activeUsers })\n    .join({ post: postsCollection }, ({ user, post }) =>\n      eq(user.id, post.userId),\n    )\n    .select(({ user, post }) => ({\n      userName: user.name,\n      postTitle: post.title,\n    })),\n)\n```\n\nCreate derived collections once at module scope and reuse them. Do not recreate on every render or navigation.\n\n## Virtual Properties\n\nLive query results include computed, read-only virtual properties on every row:\n\n- `$synced`: `true` when the row is confirmed by sync; `false` when it is still optimistic.\n- `$origin`: `\"local\"` if the last confirmed change came from this client, otherwise `\"remote\"`.\n- `$key`: the row key for the result.\n- `$collectionId`: the source collection ID.\n\nThese props are added automatically and can be used in `where`, `select`, and `orderBy` clauses. Do not persist them back to storage.\n\n## Includes (Subqueries in Select)\n\nEmbed a correlated subquery inside `select()` to produce hierarchical (nested) data. The subquery must contain a `where` with an `eq()` that correlates a parent field with a child field. Three materialization modes are available.\n\n### Collection includes (default)\n\nReturn a child `Collection` on each parent row:\n\n```ts\nimport { eq, createLiveQueryCollection } from '@tanstack\u002Fdb'\n\nconst projectsWithIssues = createLiveQueryCollection((q) =>\n  q.from({ p: projectsCollection }).select(({ p }) => ({\n    id: p.id,\n    name: p.name,\n    issues: q\n      .from({ i: issuesCollection })\n      .where(({ i }) => eq(i.projectId, p.id))\n      .select(({ i }) => ({\n        id: i.id,\n        title: i.title,\n      })),\n  })),\n)\n\n\u002F\u002F Each row's `issues` is a live Collection\nfor (const project of projectsWithIssues) {\n  console.log(project.name, project.issues.toArray)\n}\n```\n\n### Array includes with toArray()\n\nWrap the subquery in `toArray()` to get a plain array of scalar values instead of a Collection:\n\n```ts\nimport { eq, toArray, createLiveQueryCollection } from '@tanstack\u002Fdb'\n\nconst messagesWithParts = createLiveQueryCollection((q) =>\n  q.from({ m: messagesCollection }).select(({ m }) => ({\n    id: m.id,\n    contentParts: toArray(\n      q\n        .from({ c: chunksCollection })\n        .where(({ c }) => eq(c.messageId, m.id))\n        .orderBy(({ c }) => c.timestamp)\n        .select(({ c }) => c.text),\n    ),\n  })),\n)\n\u002F\u002F row.contentParts is string[]\n```\n\n### Concatenated scalar with concat(toArray())\n\nWrap `toArray()` in `concat()` to join the scalar results into a single string:\n\n```ts\nimport { eq, toArray, concat, createLiveQueryCollection } from '@tanstack\u002Fdb'\n\nconst messagesWithContent = createLiveQueryCollection((q) =>\n  q.from({ m: messagesCollection }).select(({ m }) => ({\n    id: m.id,\n    content: concat(\n      toArray(\n        q\n          .from({ c: chunksCollection })\n          .where(({ c }) => eq(c.messageId, m.id))\n          .orderBy(({ c }) => c.timestamp)\n          .select(({ c }) => c.text),\n      ),\n    ),\n  })),\n)\n\u002F\u002F row.content is a single concatenated string\n```\n\n### Includes rules\n\n- The subquery **must** have a `where` clause with an `eq()` correlating a parent alias with a child alias. The library extracts this automatically as the join condition.\n- `toArray()` works with both scalar selects (e.g., `select(({ c }) => c.text)` → `string[]`) and object selects (e.g., `select(({ c }) => ({ id: c.id, title: c.title }))` → `Array\u003C{id, title}>`).\n- `concat(toArray())` requires a **scalar** `select` to concatenate into a string.\n- Collection includes (bare subquery) require an **object** `select`.\n- Includes subqueries are compiled into the same incremental pipeline as the parent query -- they are not separate live queries.\n\n## One-Shot Queries with queryOnce\n\nFor non-reactive, one-time snapshots use `queryOnce`. It creates a live query collection, preloads it, extracts the results, and cleans up automatically.\n\n```ts\nimport { eq, queryOnce } from '@tanstack\u002Fdb'\n\nconst activeUsers = await queryOnce((q) =>\n  q\n    .from({ user: usersCollection })\n    .where(({ user }) => eq(user.active, true))\n    .select(({ user }) => ({ id: user.id, name: user.name })),\n)\n\n\u002F\u002F With findOne — resolves to T | undefined\nconst user = await queryOnce((q) =>\n  q\n    .from({ user: usersCollection })\n    .where(({ user }) => eq(user.id, userId))\n    .findOne(),\n)\n```\n\nUse `queryOnce` for scripts, loaders, data export, tests, or AI\u002FLLM context building. For UI bindings and reactive updates, use live queries instead.\n\n## Reactive Effects (createEffect)\n\nReactive effects respond to query result _changes_ without materializing the full result set. Effects fire callbacks when rows enter, exit, or update within a query result — like a database trigger on an arbitrary live query.\n\n```ts\nimport { createEffect, eq } from '@tanstack\u002Fdb'\n\nconst effect = createEffect({\n  query: (q) =>\n    q\n      .from({ msg: messagesCollection })\n      .where(({ msg }) => eq(msg.role, 'user')),\n  skipInitial: true,\n  onEnter: async (event, ctx) => {\n    await processNewMessage(event.value, { signal: ctx.signal })\n  },\n  onExit: (event) => {\n    console.log('Message left result set:', event.key)\n  },\n  onError: (error, event) => {\n    console.error(`Failed to process ${event.key}:`, error)\n  },\n})\n\n\u002F\u002F Dispose when no longer needed\nawait effect.dispose()\n```\n\n| Use case                        | Approach                                              |\n| ------------------------------- | ----------------------------------------------------- |\n| Display query results in UI     | Live query collection + `useLiveQuery`                |\n| React to changes (side effects) | `createEffect` with `onEnter` \u002F `onUpdate` \u002F `onExit` |\n| Inspect full batch of changes   | `createEffect` with `onBatch`                         |\n\nKey options: `id` (optional), `query`, `skipInitial` (skip existing rows on init), `onEnter`, `onUpdate`, `onExit`, `onBatch`, `onError`, `onSourceError`. The `ctx.signal` aborts when the effect is disposed.\n\n## Common Mistakes\n\n### CRITICAL: Using === instead of eq()\n\nJavaScript `===` in a where callback returns a boolean primitive, not an expression object. Throws `InvalidWhereExpressionError`.\n\n```ts\n\u002F\u002F WRONG\nq.from({ user: usersCollection }).where(({ user }) => user.active === true)\n\n\u002F\u002F CORRECT\nq.from({ user: usersCollection }).where(({ user }) => eq(user.active, true))\n```\n\n### CRITICAL: Filtering in JS instead of query operators\n\nJS `.filter()` \u002F `.map()` on the result array throws away incremental maintenance -- the JS code re-runs from scratch on every change.\n\n```ts\n\u002F\u002F WRONG -- re-runs filter on every change\nconst { data } = useLiveQuery((q) => q.from({ todos: todosCollection }))\nconst active = data.filter((t) => t.completed === false)\n\n\u002F\u002F CORRECT -- incrementally maintained\nconst { data } = useLiveQuery((q) =>\n  q\n    .from({ todos: todosCollection })\n    .where(({ todos }) => eq(todos.completed, false)),\n)\n```\n\n### HIGH: Not using the full operator set\n\nThe library provides string functions (`upper`, `lower`, `length`, `concat`), math (`add`), utility functions (`coalesce`, `caseWhen`), and aggregates (`count`, `sum`, `avg`, `min`, `max`). All are incrementally maintained. Prefer them over JS equivalents.\n\n```ts\n\u002F\u002F WRONG\n.fn.select((row) => ({\n  name: row.user.name.toUpperCase(),\n  total: row.order.price + row.order.tax,\n}))\n\n\u002F\u002F CORRECT\n.select(({ user, order }) => ({\n  name: upper(user.name),\n  total: add(order.price, order.tax),\n  displayName: coalesce(user.displayName, user.name, 'Unknown'),\n}))\n```\n\n### HIGH: Missing conditional expression helpers\n\nUse `coalesce()` for null\u002Fundefined fallbacks and `caseWhen()` for conditional\ncomputed fields. JavaScript operators like `||` or ternaries do not build query\nexpressions inside standard `.select()` callbacks.\n\n```ts\n\u002F\u002F WRONG -- document.title is a query ref, not a runtime string\n.select(({ document }) => ({\n  displayTitle: document.title || 'Untitled document',\n}))\n\n\u002F\u002F CORRECT -- fallback for null\u002Fundefined\n.select(({ document }) => ({\n  displayTitle: coalesce(document.title, 'Untitled document'),\n}))\n\n\u002F\u002F CORRECT -- fallback for null\u002Fundefined and empty string\n.select(({ document }) => ({\n  displayTitle: caseWhen(\n    eq(coalesce(document.title, ''), ''),\n    'Untitled document',\n    document.title,\n  ),\n}))\n```\n\nUse `fn.select()` only when you genuinely need arbitrary JavaScript; it cannot\nbe optimized like expression-based `.select()`.\n\n### HIGH: .distinct() without .select()\n\n`distinct()` deduplicates by the selected columns. Without `select()`, throws `DistinctRequiresSelectError`.\n\n```ts\n\u002F\u002F WRONG\nq.from({ user: usersCollection }).distinct()\n\n\u002F\u002F CORRECT\nq.from({ user: usersCollection })\n  .select(({ user }) => ({ country: user.country }))\n  .distinct()\n```\n\n### HIGH: .having() without .groupBy()\n\n`having` filters aggregated groups. Without `groupBy`, there are no groups. Throws `HavingRequiresGroupByError`.\n\n```ts\n\u002F\u002F WRONG\nq.from({ order: ordersCollection }).having(({ order }) =>\n  gt(count(order.id), 5),\n)\n\n\u002F\u002F CORRECT\nq.from({ order: ordersCollection })\n  .groupBy(({ order }) => order.customerId)\n  .having(({ order }) => gt(count(order.id), 5))\n```\n\n### HIGH: .limit() \u002F .offset() without .orderBy()\n\nWithout deterministic ordering, limit\u002Foffset results are non-deterministic and cannot be incrementally maintained. Throws `LimitOffsetRequireOrderByError`.\n\n```ts\n\u002F\u002F WRONG\nq.from({ user: usersCollection }).limit(10)\n\n\u002F\u002F CORRECT\nq.from({ user: usersCollection })\n  .orderBy(({ user }) => user.name)\n  .limit(10)\n```\n\n### HIGH: Join condition using non-eq() operator\n\nThe differential dataflow join operator only supports equality joins. Using `gt()`, `like()`, etc. throws `JoinConditionMustBeEqualityError`.\n\n```ts\n\u002F\u002F WRONG\nq.from({ user: usersCollection }).join(\n  { post: postsCollection },\n  ({ user, post }) => gt(user.id, post.userId),\n)\n\n\u002F\u002F CORRECT\nq.from({ user: usersCollection }).join(\n  { post: postsCollection },\n  ({ user, post }) => eq(user.id, post.userId),\n)\n```\n\n### MEDIUM: Passing source directly instead of {alias: collection}\n\n`from()` and `join()` require sources wrapped as `{alias: collection}`. Passing the collection directly throws `InvalidSourceTypeError`.\n\n```ts\n\u002F\u002F WRONG\nq.from(usersCollection)\n\n\u002F\u002F CORRECT\nq.from({ users: usersCollection })\n```\n\n## Tension: Query expressiveness vs. IVM constraints\n\nThe query builder looks like SQL but has constraints that SQL does not:\n\n- **Equality joins only** -- `eq()` is the only allowed join condition operator.\n- **orderBy required for limit\u002Foffset** -- non-deterministic pagination cannot be incrementally maintained.\n- **distinct requires select** -- deduplication needs an explicit projection.\n- **fn.select() cannot be used with groupBy()** -- the compiler must statically analyze select to discover aggregate functions.\n\nThese constraints exist because the underlying d2ts differential dataflow engine requires them for correct incremental view maintenance.\n\nSee also: react-db\u002FSKILL.md for React hooks (`useLiveQuery`, `useLiveSuspenseQuery`, `useLiveInfiniteQuery`).\n\n## References\n\n- [Query Operators Reference](.\u002Freferences\u002Foperators.md) -- full signatures and examples for all operators, functions, and aggregates.\n",{"data":33,"body":41},{"name":5,"description":7,"type":34,"library":35,"library_version":36,"sources":37},"sub-skill","db","0.6.0",[38,39,40],"TanStack\u002Fdb:docs\u002Fguides\u002Flive-queries.md","TanStack\u002Fdb:packages\u002Fdb\u002Fsrc\u002Fquery\u002Fbuilder\u002Findex.ts","TanStack\u002Fdb:packages\u002Fdb\u002Fsrc\u002Fquery\u002Fcompiler\u002Findex.ts",{"type":42,"children":43},"root",[44,53,63,76,81,88,93,1068,1074,1081,1117,1619,1624,1733,1739,1795,2168,2173,2428,2434,2491,2999,3018,3233,3239,3244,3737,3742,3748,3753,3832,3857,3863,3890,3896,3909,4519,4525,4538,5018,5024,5044,5549,5555,5671,5677,5690,6190,6201,6207,6220,6863,6973,7046,7052,7058,7078,7303,7309,7329,7695,7701,7794,8208,8214,8250,8672,8690,8696,8721,8932,8938,8962,9266,9272,9284,9485,9491,9518,9845,9851,9884,9976,9982,9987,10037,10042,10067,10073,10088],{"type":45,"tag":46,"props":47,"children":49},"element","h1",{"id":48},"live-queries",[50],{"type":51,"value":52},"text","Live Queries",{"type":45,"tag":54,"props":55,"children":56},"blockquote",{},[57],{"type":45,"tag":58,"props":59,"children":60},"p",{},[61],{"type":51,"value":62},"This skill builds on db-core.",{"type":45,"tag":58,"props":64,"children":65},{},[66,68,74],{"type":51,"value":67},"TanStack DB live queries use a SQL-like fluent query builder to create ",{"type":45,"tag":69,"props":70,"children":71},"strong",{},[72],{"type":51,"value":73},"reactive derived collections",{"type":51,"value":75}," that automatically update when underlying data changes. The query engine compiles queries into incremental view maintenance (IVM) pipelines using differential dataflow (d2ts), so only deltas are recomputed.",{"type":45,"tag":58,"props":77,"children":78},{},[79],{"type":51,"value":80},"All operators, string functions, math functions, and aggregates are incrementally maintained. Prefer them over equivalent JS code.",{"type":45,"tag":82,"props":83,"children":85},"h2",{"id":84},"setup",[86],{"type":51,"value":87},"Setup",{"type":45,"tag":58,"props":89,"children":90},{},[91],{"type":51,"value":92},"Minimal example using the core API (no framework hooks):",{"type":45,"tag":94,"props":95,"children":100},"pre",{"className":96,"code":97,"language":98,"meta":99,"style":99},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import {\n  createCollection,\n  createLiveQueryCollection,\n  liveQueryCollectionOptions,\n  eq,\n} from '@tanstack\u002Fdb'\n\n\u002F\u002F Assume usersCollection is already created via createCollection(...)\n\n\u002F\u002F Option 1: createLiveQueryCollection shorthand\nconst activeUsers = createLiveQueryCollection((q) =>\n  q\n    .from({ user: usersCollection })\n    .where(({ user }) => eq(user.active, true))\n    .select(({ user }) => ({\n      id: user.id,\n      name: user.name,\n      email: user.email,\n    })),\n)\n\n\u002F\u002F Option 2: full options via liveQueryCollectionOptions\nconst activeUsers2 = createCollection(\n  liveQueryCollectionOptions({\n    query: (q) =>\n      q\n        .from({ user: usersCollection })\n        .where(({ user }) => eq(user.active, true))\n        .select(({ user }) => ({\n          id: user.id,\n          name: user.name,\n        })),\n    getKey: (user) => user.id,\n  }),\n)\n\n\u002F\u002F The result is a live collection -- iterate, subscribe, or use as source\nfor (const user of activeUsers) {\n  console.log(user.name)\n}\n","ts","",[101],{"type":45,"tag":102,"props":103,"children":104},"code",{"__ignoreMap":99},[105,123,138,151,164,177,207,217,227,235,244,295,304,352,424,467,497,527,557,575,583,591,600,627,643,672,681,722,782,822,851,880,897,943,960,968,976,985,1021,1059],{"type":45,"tag":106,"props":107,"children":110},"span",{"class":108,"line":109},"line",1,[111,117],{"type":45,"tag":106,"props":112,"children":114},{"style":113},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[115],{"type":51,"value":116},"import",{"type":45,"tag":106,"props":118,"children":120},{"style":119},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[121],{"type":51,"value":122}," {\n",{"type":45,"tag":106,"props":124,"children":126},{"class":108,"line":125},2,[127,133],{"type":45,"tag":106,"props":128,"children":130},{"style":129},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[131],{"type":51,"value":132},"  createCollection",{"type":45,"tag":106,"props":134,"children":135},{"style":119},[136],{"type":51,"value":137},",\n",{"type":45,"tag":106,"props":139,"children":141},{"class":108,"line":140},3,[142,147],{"type":45,"tag":106,"props":143,"children":144},{"style":129},[145],{"type":51,"value":146},"  createLiveQueryCollection",{"type":45,"tag":106,"props":148,"children":149},{"style":119},[150],{"type":51,"value":137},{"type":45,"tag":106,"props":152,"children":154},{"class":108,"line":153},4,[155,160],{"type":45,"tag":106,"props":156,"children":157},{"style":129},[158],{"type":51,"value":159},"  liveQueryCollectionOptions",{"type":45,"tag":106,"props":161,"children":162},{"style":119},[163],{"type":51,"value":137},{"type":45,"tag":106,"props":165,"children":167},{"class":108,"line":166},5,[168,173],{"type":45,"tag":106,"props":169,"children":170},{"style":129},[171],{"type":51,"value":172},"  eq",{"type":45,"tag":106,"props":174,"children":175},{"style":119},[176],{"type":51,"value":137},{"type":45,"tag":106,"props":178,"children":180},{"class":108,"line":179},6,[181,186,191,196,202],{"type":45,"tag":106,"props":182,"children":183},{"style":119},[184],{"type":51,"value":185},"}",{"type":45,"tag":106,"props":187,"children":188},{"style":113},[189],{"type":51,"value":190}," from",{"type":45,"tag":106,"props":192,"children":193},{"style":119},[194],{"type":51,"value":195}," '",{"type":45,"tag":106,"props":197,"children":199},{"style":198},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[200],{"type":51,"value":201},"@tanstack\u002Fdb",{"type":45,"tag":106,"props":203,"children":204},{"style":119},[205],{"type":51,"value":206},"'\n",{"type":45,"tag":106,"props":208,"children":210},{"class":108,"line":209},7,[211],{"type":45,"tag":106,"props":212,"children":214},{"emptyLinePlaceholder":213},true,[215],{"type":51,"value":216},"\n",{"type":45,"tag":106,"props":218,"children":220},{"class":108,"line":219},8,[221],{"type":45,"tag":106,"props":222,"children":224},{"style":223},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[225],{"type":51,"value":226},"\u002F\u002F Assume usersCollection is already created via createCollection(...)\n",{"type":45,"tag":106,"props":228,"children":230},{"class":108,"line":229},9,[231],{"type":45,"tag":106,"props":232,"children":233},{"emptyLinePlaceholder":213},[234],{"type":51,"value":216},{"type":45,"tag":106,"props":236,"children":238},{"class":108,"line":237},10,[239],{"type":45,"tag":106,"props":240,"children":241},{"style":223},[242],{"type":51,"value":243},"\u002F\u002F Option 1: createLiveQueryCollection shorthand\n",{"type":45,"tag":106,"props":245,"children":247},{"class":108,"line":246},11,[248,254,259,264,270,275,279,285,290],{"type":45,"tag":106,"props":249,"children":251},{"style":250},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[252],{"type":51,"value":253},"const",{"type":45,"tag":106,"props":255,"children":256},{"style":129},[257],{"type":51,"value":258}," activeUsers ",{"type":45,"tag":106,"props":260,"children":261},{"style":119},[262],{"type":51,"value":263},"=",{"type":45,"tag":106,"props":265,"children":267},{"style":266},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[268],{"type":51,"value":269}," createLiveQueryCollection",{"type":45,"tag":106,"props":271,"children":272},{"style":129},[273],{"type":51,"value":274},"(",{"type":45,"tag":106,"props":276,"children":277},{"style":119},[278],{"type":51,"value":274},{"type":45,"tag":106,"props":280,"children":282},{"style":281},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[283],{"type":51,"value":284},"q",{"type":45,"tag":106,"props":286,"children":287},{"style":119},[288],{"type":51,"value":289},")",{"type":45,"tag":106,"props":291,"children":292},{"style":250},[293],{"type":51,"value":294}," =>\n",{"type":45,"tag":106,"props":296,"children":298},{"class":108,"line":297},12,[299],{"type":45,"tag":106,"props":300,"children":301},{"style":129},[302],{"type":51,"value":303},"  q\n",{"type":45,"tag":106,"props":305,"children":307},{"class":108,"line":306},13,[308,313,318,322,327,333,338,343,347],{"type":45,"tag":106,"props":309,"children":310},{"style":119},[311],{"type":51,"value":312},"    .",{"type":45,"tag":106,"props":314,"children":315},{"style":266},[316],{"type":51,"value":317},"from",{"type":45,"tag":106,"props":319,"children":320},{"style":129},[321],{"type":51,"value":274},{"type":45,"tag":106,"props":323,"children":324},{"style":119},[325],{"type":51,"value":326},"{",{"type":45,"tag":106,"props":328,"children":330},{"style":329},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[331],{"type":51,"value":332}," user",{"type":45,"tag":106,"props":334,"children":335},{"style":119},[336],{"type":51,"value":337},":",{"type":45,"tag":106,"props":339,"children":340},{"style":129},[341],{"type":51,"value":342}," usersCollection ",{"type":45,"tag":106,"props":344,"children":345},{"style":119},[346],{"type":51,"value":185},{"type":45,"tag":106,"props":348,"children":349},{"style":129},[350],{"type":51,"value":351},")\n",{"type":45,"tag":106,"props":353,"children":355},{"class":108,"line":354},14,[356,360,365,369,374,378,383,388,393,398,403,408,413,419],{"type":45,"tag":106,"props":357,"children":358},{"style":119},[359],{"type":51,"value":312},{"type":45,"tag":106,"props":361,"children":362},{"style":266},[363],{"type":51,"value":364},"where",{"type":45,"tag":106,"props":366,"children":367},{"style":129},[368],{"type":51,"value":274},{"type":45,"tag":106,"props":370,"children":371},{"style":119},[372],{"type":51,"value":373},"({",{"type":45,"tag":106,"props":375,"children":376},{"style":281},[377],{"type":51,"value":332},{"type":45,"tag":106,"props":379,"children":380},{"style":119},[381],{"type":51,"value":382}," })",{"type":45,"tag":106,"props":384,"children":385},{"style":250},[386],{"type":51,"value":387}," =>",{"type":45,"tag":106,"props":389,"children":390},{"style":266},[391],{"type":51,"value":392}," eq",{"type":45,"tag":106,"props":394,"children":395},{"style":129},[396],{"type":51,"value":397},"(user",{"type":45,"tag":106,"props":399,"children":400},{"style":119},[401],{"type":51,"value":402},".",{"type":45,"tag":106,"props":404,"children":405},{"style":129},[406],{"type":51,"value":407},"active",{"type":45,"tag":106,"props":409,"children":410},{"style":119},[411],{"type":51,"value":412},",",{"type":45,"tag":106,"props":414,"children":416},{"style":415},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[417],{"type":51,"value":418}," true",{"type":45,"tag":106,"props":420,"children":421},{"style":129},[422],{"type":51,"value":423},"))\n",{"type":45,"tag":106,"props":425,"children":427},{"class":108,"line":426},15,[428,432,437,441,445,449,453,457,462],{"type":45,"tag":106,"props":429,"children":430},{"style":119},[431],{"type":51,"value":312},{"type":45,"tag":106,"props":433,"children":434},{"style":266},[435],{"type":51,"value":436},"select",{"type":45,"tag":106,"props":438,"children":439},{"style":129},[440],{"type":51,"value":274},{"type":45,"tag":106,"props":442,"children":443},{"style":119},[444],{"type":51,"value":373},{"type":45,"tag":106,"props":446,"children":447},{"style":281},[448],{"type":51,"value":332},{"type":45,"tag":106,"props":450,"children":451},{"style":119},[452],{"type":51,"value":382},{"type":45,"tag":106,"props":454,"children":455},{"style":250},[456],{"type":51,"value":387},{"type":45,"tag":106,"props":458,"children":459},{"style":129},[460],{"type":51,"value":461}," (",{"type":45,"tag":106,"props":463,"children":464},{"style":119},[465],{"type":51,"value":466},"{\n",{"type":45,"tag":106,"props":468,"children":470},{"class":108,"line":469},16,[471,476,480,484,488,493],{"type":45,"tag":106,"props":472,"children":473},{"style":329},[474],{"type":51,"value":475},"      id",{"type":45,"tag":106,"props":477,"children":478},{"style":119},[479],{"type":51,"value":337},{"type":45,"tag":106,"props":481,"children":482},{"style":129},[483],{"type":51,"value":332},{"type":45,"tag":106,"props":485,"children":486},{"style":119},[487],{"type":51,"value":402},{"type":45,"tag":106,"props":489,"children":490},{"style":129},[491],{"type":51,"value":492},"id",{"type":45,"tag":106,"props":494,"children":495},{"style":119},[496],{"type":51,"value":137},{"type":45,"tag":106,"props":498,"children":500},{"class":108,"line":499},17,[501,506,510,514,518,523],{"type":45,"tag":106,"props":502,"children":503},{"style":329},[504],{"type":51,"value":505},"      name",{"type":45,"tag":106,"props":507,"children":508},{"style":119},[509],{"type":51,"value":337},{"type":45,"tag":106,"props":511,"children":512},{"style":129},[513],{"type":51,"value":332},{"type":45,"tag":106,"props":515,"children":516},{"style":119},[517],{"type":51,"value":402},{"type":45,"tag":106,"props":519,"children":520},{"style":129},[521],{"type":51,"value":522},"name",{"type":45,"tag":106,"props":524,"children":525},{"style":119},[526],{"type":51,"value":137},{"type":45,"tag":106,"props":528,"children":530},{"class":108,"line":529},18,[531,536,540,544,548,553],{"type":45,"tag":106,"props":532,"children":533},{"style":329},[534],{"type":51,"value":535},"      email",{"type":45,"tag":106,"props":537,"children":538},{"style":119},[539],{"type":51,"value":337},{"type":45,"tag":106,"props":541,"children":542},{"style":129},[543],{"type":51,"value":332},{"type":45,"tag":106,"props":545,"children":546},{"style":119},[547],{"type":51,"value":402},{"type":45,"tag":106,"props":549,"children":550},{"style":129},[551],{"type":51,"value":552},"email",{"type":45,"tag":106,"props":554,"children":555},{"style":119},[556],{"type":51,"value":137},{"type":45,"tag":106,"props":558,"children":560},{"class":108,"line":559},19,[561,566,571],{"type":45,"tag":106,"props":562,"children":563},{"style":119},[564],{"type":51,"value":565},"    }",{"type":45,"tag":106,"props":567,"children":568},{"style":129},[569],{"type":51,"value":570},"))",{"type":45,"tag":106,"props":572,"children":573},{"style":119},[574],{"type":51,"value":137},{"type":45,"tag":106,"props":576,"children":578},{"class":108,"line":577},20,[579],{"type":45,"tag":106,"props":580,"children":581},{"style":129},[582],{"type":51,"value":351},{"type":45,"tag":106,"props":584,"children":586},{"class":108,"line":585},21,[587],{"type":45,"tag":106,"props":588,"children":589},{"emptyLinePlaceholder":213},[590],{"type":51,"value":216},{"type":45,"tag":106,"props":592,"children":594},{"class":108,"line":593},22,[595],{"type":45,"tag":106,"props":596,"children":597},{"style":223},[598],{"type":51,"value":599},"\u002F\u002F Option 2: full options via liveQueryCollectionOptions\n",{"type":45,"tag":106,"props":601,"children":603},{"class":108,"line":602},23,[604,608,613,617,622],{"type":45,"tag":106,"props":605,"children":606},{"style":250},[607],{"type":51,"value":253},{"type":45,"tag":106,"props":609,"children":610},{"style":129},[611],{"type":51,"value":612}," activeUsers2 ",{"type":45,"tag":106,"props":614,"children":615},{"style":119},[616],{"type":51,"value":263},{"type":45,"tag":106,"props":618,"children":619},{"style":266},[620],{"type":51,"value":621}," createCollection",{"type":45,"tag":106,"props":623,"children":624},{"style":129},[625],{"type":51,"value":626},"(\n",{"type":45,"tag":106,"props":628,"children":630},{"class":108,"line":629},24,[631,635,639],{"type":45,"tag":106,"props":632,"children":633},{"style":266},[634],{"type":51,"value":159},{"type":45,"tag":106,"props":636,"children":637},{"style":129},[638],{"type":51,"value":274},{"type":45,"tag":106,"props":640,"children":641},{"style":119},[642],{"type":51,"value":466},{"type":45,"tag":106,"props":644,"children":646},{"class":108,"line":645},25,[647,652,656,660,664,668],{"type":45,"tag":106,"props":648,"children":649},{"style":266},[650],{"type":51,"value":651},"    query",{"type":45,"tag":106,"props":653,"children":654},{"style":119},[655],{"type":51,"value":337},{"type":45,"tag":106,"props":657,"children":658},{"style":119},[659],{"type":51,"value":461},{"type":45,"tag":106,"props":661,"children":662},{"style":281},[663],{"type":51,"value":284},{"type":45,"tag":106,"props":665,"children":666},{"style":119},[667],{"type":51,"value":289},{"type":45,"tag":106,"props":669,"children":670},{"style":250},[671],{"type":51,"value":294},{"type":45,"tag":106,"props":673,"children":675},{"class":108,"line":674},26,[676],{"type":45,"tag":106,"props":677,"children":678},{"style":129},[679],{"type":51,"value":680},"      q\n",{"type":45,"tag":106,"props":682,"children":684},{"class":108,"line":683},27,[685,690,694,698,702,706,710,714,718],{"type":45,"tag":106,"props":686,"children":687},{"style":119},[688],{"type":51,"value":689},"        .",{"type":45,"tag":106,"props":691,"children":692},{"style":266},[693],{"type":51,"value":317},{"type":45,"tag":106,"props":695,"children":696},{"style":129},[697],{"type":51,"value":274},{"type":45,"tag":106,"props":699,"children":700},{"style":119},[701],{"type":51,"value":326},{"type":45,"tag":106,"props":703,"children":704},{"style":329},[705],{"type":51,"value":332},{"type":45,"tag":106,"props":707,"children":708},{"style":119},[709],{"type":51,"value":337},{"type":45,"tag":106,"props":711,"children":712},{"style":129},[713],{"type":51,"value":342},{"type":45,"tag":106,"props":715,"children":716},{"style":119},[717],{"type":51,"value":185},{"type":45,"tag":106,"props":719,"children":720},{"style":129},[721],{"type":51,"value":351},{"type":45,"tag":106,"props":723,"children":725},{"class":108,"line":724},28,[726,730,734,738,742,746,750,754,758,762,766,770,774,778],{"type":45,"tag":106,"props":727,"children":728},{"style":119},[729],{"type":51,"value":689},{"type":45,"tag":106,"props":731,"children":732},{"style":266},[733],{"type":51,"value":364},{"type":45,"tag":106,"props":735,"children":736},{"style":129},[737],{"type":51,"value":274},{"type":45,"tag":106,"props":739,"children":740},{"style":119},[741],{"type":51,"value":373},{"type":45,"tag":106,"props":743,"children":744},{"style":281},[745],{"type":51,"value":332},{"type":45,"tag":106,"props":747,"children":748},{"style":119},[749],{"type":51,"value":382},{"type":45,"tag":106,"props":751,"children":752},{"style":250},[753],{"type":51,"value":387},{"type":45,"tag":106,"props":755,"children":756},{"style":266},[757],{"type":51,"value":392},{"type":45,"tag":106,"props":759,"children":760},{"style":129},[761],{"type":51,"value":397},{"type":45,"tag":106,"props":763,"children":764},{"style":119},[765],{"type":51,"value":402},{"type":45,"tag":106,"props":767,"children":768},{"style":129},[769],{"type":51,"value":407},{"type":45,"tag":106,"props":771,"children":772},{"style":119},[773],{"type":51,"value":412},{"type":45,"tag":106,"props":775,"children":776},{"style":415},[777],{"type":51,"value":418},{"type":45,"tag":106,"props":779,"children":780},{"style":129},[781],{"type":51,"value":423},{"type":45,"tag":106,"props":783,"children":785},{"class":108,"line":784},29,[786,790,794,798,802,806,810,814,818],{"type":45,"tag":106,"props":787,"children":788},{"style":119},[789],{"type":51,"value":689},{"type":45,"tag":106,"props":791,"children":792},{"style":266},[793],{"type":51,"value":436},{"type":45,"tag":106,"props":795,"children":796},{"style":129},[797],{"type":51,"value":274},{"type":45,"tag":106,"props":799,"children":800},{"style":119},[801],{"type":51,"value":373},{"type":45,"tag":106,"props":803,"children":804},{"style":281},[805],{"type":51,"value":332},{"type":45,"tag":106,"props":807,"children":808},{"style":119},[809],{"type":51,"value":382},{"type":45,"tag":106,"props":811,"children":812},{"style":250},[813],{"type":51,"value":387},{"type":45,"tag":106,"props":815,"children":816},{"style":129},[817],{"type":51,"value":461},{"type":45,"tag":106,"props":819,"children":820},{"style":119},[821],{"type":51,"value":466},{"type":45,"tag":106,"props":823,"children":825},{"class":108,"line":824},30,[826,831,835,839,843,847],{"type":45,"tag":106,"props":827,"children":828},{"style":329},[829],{"type":51,"value":830},"          id",{"type":45,"tag":106,"props":832,"children":833},{"style":119},[834],{"type":51,"value":337},{"type":45,"tag":106,"props":836,"children":837},{"style":129},[838],{"type":51,"value":332},{"type":45,"tag":106,"props":840,"children":841},{"style":119},[842],{"type":51,"value":402},{"type":45,"tag":106,"props":844,"children":845},{"style":129},[846],{"type":51,"value":492},{"type":45,"tag":106,"props":848,"children":849},{"style":119},[850],{"type":51,"value":137},{"type":45,"tag":106,"props":852,"children":854},{"class":108,"line":853},31,[855,860,864,868,872,876],{"type":45,"tag":106,"props":856,"children":857},{"style":329},[858],{"type":51,"value":859},"          name",{"type":45,"tag":106,"props":861,"children":862},{"style":119},[863],{"type":51,"value":337},{"type":45,"tag":106,"props":865,"children":866},{"style":129},[867],{"type":51,"value":332},{"type":45,"tag":106,"props":869,"children":870},{"style":119},[871],{"type":51,"value":402},{"type":45,"tag":106,"props":873,"children":874},{"style":129},[875],{"type":51,"value":522},{"type":45,"tag":106,"props":877,"children":878},{"style":119},[879],{"type":51,"value":137},{"type":45,"tag":106,"props":881,"children":883},{"class":108,"line":882},32,[884,889,893],{"type":45,"tag":106,"props":885,"children":886},{"style":119},[887],{"type":51,"value":888},"        }",{"type":45,"tag":106,"props":890,"children":891},{"style":129},[892],{"type":51,"value":570},{"type":45,"tag":106,"props":894,"children":895},{"style":119},[896],{"type":51,"value":137},{"type":45,"tag":106,"props":898,"children":900},{"class":108,"line":899},33,[901,906,910,914,919,923,927,931,935,939],{"type":45,"tag":106,"props":902,"children":903},{"style":266},[904],{"type":51,"value":905},"    getKey",{"type":45,"tag":106,"props":907,"children":908},{"style":119},[909],{"type":51,"value":337},{"type":45,"tag":106,"props":911,"children":912},{"style":119},[913],{"type":51,"value":461},{"type":45,"tag":106,"props":915,"children":916},{"style":281},[917],{"type":51,"value":918},"user",{"type":45,"tag":106,"props":920,"children":921},{"style":119},[922],{"type":51,"value":289},{"type":45,"tag":106,"props":924,"children":925},{"style":250},[926],{"type":51,"value":387},{"type":45,"tag":106,"props":928,"children":929},{"style":129},[930],{"type":51,"value":332},{"type":45,"tag":106,"props":932,"children":933},{"style":119},[934],{"type":51,"value":402},{"type":45,"tag":106,"props":936,"children":937},{"style":129},[938],{"type":51,"value":492},{"type":45,"tag":106,"props":940,"children":941},{"style":119},[942],{"type":51,"value":137},{"type":45,"tag":106,"props":944,"children":946},{"class":108,"line":945},34,[947,952,956],{"type":45,"tag":106,"props":948,"children":949},{"style":119},[950],{"type":51,"value":951},"  }",{"type":45,"tag":106,"props":953,"children":954},{"style":129},[955],{"type":51,"value":289},{"type":45,"tag":106,"props":957,"children":958},{"style":119},[959],{"type":51,"value":137},{"type":45,"tag":106,"props":961,"children":963},{"class":108,"line":962},35,[964],{"type":45,"tag":106,"props":965,"children":966},{"style":129},[967],{"type":51,"value":351},{"type":45,"tag":106,"props":969,"children":971},{"class":108,"line":970},36,[972],{"type":45,"tag":106,"props":973,"children":974},{"emptyLinePlaceholder":213},[975],{"type":51,"value":216},{"type":45,"tag":106,"props":977,"children":979},{"class":108,"line":978},37,[980],{"type":45,"tag":106,"props":981,"children":982},{"style":223},[983],{"type":51,"value":984},"\u002F\u002F The result is a live collection -- iterate, subscribe, or use as source\n",{"type":45,"tag":106,"props":986,"children":988},{"class":108,"line":987},38,[989,994,998,1002,1007,1012,1017],{"type":45,"tag":106,"props":990,"children":991},{"style":113},[992],{"type":51,"value":993},"for",{"type":45,"tag":106,"props":995,"children":996},{"style":129},[997],{"type":51,"value":461},{"type":45,"tag":106,"props":999,"children":1000},{"style":250},[1001],{"type":51,"value":253},{"type":45,"tag":106,"props":1003,"children":1004},{"style":129},[1005],{"type":51,"value":1006}," user ",{"type":45,"tag":106,"props":1008,"children":1009},{"style":119},[1010],{"type":51,"value":1011},"of",{"type":45,"tag":106,"props":1013,"children":1014},{"style":129},[1015],{"type":51,"value":1016}," activeUsers) ",{"type":45,"tag":106,"props":1018,"children":1019},{"style":119},[1020],{"type":51,"value":466},{"type":45,"tag":106,"props":1022,"children":1024},{"class":108,"line":1023},39,[1025,1030,1034,1039,1043,1047,1051,1055],{"type":45,"tag":106,"props":1026,"children":1027},{"style":129},[1028],{"type":51,"value":1029},"  console",{"type":45,"tag":106,"props":1031,"children":1032},{"style":119},[1033],{"type":51,"value":402},{"type":45,"tag":106,"props":1035,"children":1036},{"style":266},[1037],{"type":51,"value":1038},"log",{"type":45,"tag":106,"props":1040,"children":1041},{"style":329},[1042],{"type":51,"value":274},{"type":45,"tag":106,"props":1044,"children":1045},{"style":129},[1046],{"type":51,"value":918},{"type":45,"tag":106,"props":1048,"children":1049},{"style":119},[1050],{"type":51,"value":402},{"type":45,"tag":106,"props":1052,"children":1053},{"style":129},[1054],{"type":51,"value":522},{"type":45,"tag":106,"props":1056,"children":1057},{"style":329},[1058],{"type":51,"value":351},{"type":45,"tag":106,"props":1060,"children":1062},{"class":108,"line":1061},40,[1063],{"type":45,"tag":106,"props":1064,"children":1065},{"style":119},[1066],{"type":51,"value":1067},"}\n",{"type":45,"tag":82,"props":1069,"children":1071},{"id":1070},"core-patterns",[1072],{"type":51,"value":1073},"Core Patterns",{"type":45,"tag":1075,"props":1076,"children":1078},"h3",{"id":1077},"_1-filtering-with-where-operators",[1079],{"type":51,"value":1080},"1. Filtering with where + operators",{"type":45,"tag":58,"props":1082,"children":1083},{},[1084,1086,1092,1094,1100,1102,1108,1109,1115],{"type":51,"value":1085},"Chain ",{"type":45,"tag":102,"props":1087,"children":1089},{"className":1088},[],[1090],{"type":51,"value":1091},".where()",{"type":51,"value":1093}," calls (ANDed together) using expression operators. Use ",{"type":45,"tag":102,"props":1095,"children":1097},{"className":1096},[],[1098],{"type":51,"value":1099},"and()",{"type":51,"value":1101},", ",{"type":45,"tag":102,"props":1103,"children":1105},{"className":1104},[],[1106],{"type":51,"value":1107},"or()",{"type":51,"value":1101},{"type":45,"tag":102,"props":1110,"children":1112},{"className":1111},[],[1113],{"type":51,"value":1114},"not()",{"type":51,"value":1116}," for complex logic.",{"type":45,"tag":94,"props":1118,"children":1120},{"className":96,"code":1119,"language":98,"meta":99,"style":99},"import { eq, gt, or, and, not, inArray, like } from '@tanstack\u002Fdb'\n\nconst results = createLiveQueryCollection((q) =>\n  q\n    .from({ user: usersCollection })\n    .where(({ user }) => eq(user.active, true))\n    .where(({ user }) =>\n      and(\n        gt(user.age, 18),\n        or(eq(user.role, 'admin'), eq(user.role, 'moderator')),\n        not(inArray(user.id, bannedIds)),\n      ),\n    ),\n)\n",[1121],{"type":45,"tag":102,"props":1122,"children":1123},{"__ignoreMap":99},[1124,1215,1222,1262,1269,1308,1367,1398,1410,1449,1546,1588,1600,1612],{"type":45,"tag":106,"props":1125,"children":1126},{"class":108,"line":109},[1127,1131,1136,1140,1144,1149,1153,1158,1162,1167,1171,1176,1180,1185,1189,1194,1199,1203,1207,1211],{"type":45,"tag":106,"props":1128,"children":1129},{"style":113},[1130],{"type":51,"value":116},{"type":45,"tag":106,"props":1132,"children":1133},{"style":119},[1134],{"type":51,"value":1135}," {",{"type":45,"tag":106,"props":1137,"children":1138},{"style":129},[1139],{"type":51,"value":392},{"type":45,"tag":106,"props":1141,"children":1142},{"style":119},[1143],{"type":51,"value":412},{"type":45,"tag":106,"props":1145,"children":1146},{"style":129},[1147],{"type":51,"value":1148}," gt",{"type":45,"tag":106,"props":1150,"children":1151},{"style":119},[1152],{"type":51,"value":412},{"type":45,"tag":106,"props":1154,"children":1155},{"style":129},[1156],{"type":51,"value":1157}," or",{"type":45,"tag":106,"props":1159,"children":1160},{"style":119},[1161],{"type":51,"value":412},{"type":45,"tag":106,"props":1163,"children":1164},{"style":129},[1165],{"type":51,"value":1166}," and",{"type":45,"tag":106,"props":1168,"children":1169},{"style":119},[1170],{"type":51,"value":412},{"type":45,"tag":106,"props":1172,"children":1173},{"style":129},[1174],{"type":51,"value":1175}," not",{"type":45,"tag":106,"props":1177,"children":1178},{"style":119},[1179],{"type":51,"value":412},{"type":45,"tag":106,"props":1181,"children":1182},{"style":129},[1183],{"type":51,"value":1184}," inArray",{"type":45,"tag":106,"props":1186,"children":1187},{"style":119},[1188],{"type":51,"value":412},{"type":45,"tag":106,"props":1190,"children":1191},{"style":129},[1192],{"type":51,"value":1193}," like",{"type":45,"tag":106,"props":1195,"children":1196},{"style":119},[1197],{"type":51,"value":1198}," }",{"type":45,"tag":106,"props":1200,"children":1201},{"style":113},[1202],{"type":51,"value":190},{"type":45,"tag":106,"props":1204,"children":1205},{"style":119},[1206],{"type":51,"value":195},{"type":45,"tag":106,"props":1208,"children":1209},{"style":198},[1210],{"type":51,"value":201},{"type":45,"tag":106,"props":1212,"children":1213},{"style":119},[1214],{"type":51,"value":206},{"type":45,"tag":106,"props":1216,"children":1217},{"class":108,"line":125},[1218],{"type":45,"tag":106,"props":1219,"children":1220},{"emptyLinePlaceholder":213},[1221],{"type":51,"value":216},{"type":45,"tag":106,"props":1223,"children":1224},{"class":108,"line":140},[1225,1229,1234,1238,1242,1246,1250,1254,1258],{"type":45,"tag":106,"props":1226,"children":1227},{"style":250},[1228],{"type":51,"value":253},{"type":45,"tag":106,"props":1230,"children":1231},{"style":129},[1232],{"type":51,"value":1233}," results ",{"type":45,"tag":106,"props":1235,"children":1236},{"style":119},[1237],{"type":51,"value":263},{"type":45,"tag":106,"props":1239,"children":1240},{"style":266},[1241],{"type":51,"value":269},{"type":45,"tag":106,"props":1243,"children":1244},{"style":129},[1245],{"type":51,"value":274},{"type":45,"tag":106,"props":1247,"children":1248},{"style":119},[1249],{"type":51,"value":274},{"type":45,"tag":106,"props":1251,"children":1252},{"style":281},[1253],{"type":51,"value":284},{"type":45,"tag":106,"props":1255,"children":1256},{"style":119},[1257],{"type":51,"value":289},{"type":45,"tag":106,"props":1259,"children":1260},{"style":250},[1261],{"type":51,"value":294},{"type":45,"tag":106,"props":1263,"children":1264},{"class":108,"line":153},[1265],{"type":45,"tag":106,"props":1266,"children":1267},{"style":129},[1268],{"type":51,"value":303},{"type":45,"tag":106,"props":1270,"children":1271},{"class":108,"line":166},[1272,1276,1280,1284,1288,1292,1296,1300,1304],{"type":45,"tag":106,"props":1273,"children":1274},{"style":119},[1275],{"type":51,"value":312},{"type":45,"tag":106,"props":1277,"children":1278},{"style":266},[1279],{"type":51,"value":317},{"type":45,"tag":106,"props":1281,"children":1282},{"style":129},[1283],{"type":51,"value":274},{"type":45,"tag":106,"props":1285,"children":1286},{"style":119},[1287],{"type":51,"value":326},{"type":45,"tag":106,"props":1289,"children":1290},{"style":329},[1291],{"type":51,"value":332},{"type":45,"tag":106,"props":1293,"children":1294},{"style":119},[1295],{"type":51,"value":337},{"type":45,"tag":106,"props":1297,"children":1298},{"style":129},[1299],{"type":51,"value":342},{"type":45,"tag":106,"props":1301,"children":1302},{"style":119},[1303],{"type":51,"value":185},{"type":45,"tag":106,"props":1305,"children":1306},{"style":129},[1307],{"type":51,"value":351},{"type":45,"tag":106,"props":1309,"children":1310},{"class":108,"line":179},[1311,1315,1319,1323,1327,1331,1335,1339,1343,1347,1351,1355,1359,1363],{"type":45,"tag":106,"props":1312,"children":1313},{"style":119},[1314],{"type":51,"value":312},{"type":45,"tag":106,"props":1316,"children":1317},{"style":266},[1318],{"type":51,"value":364},{"type":45,"tag":106,"props":1320,"children":1321},{"style":129},[1322],{"type":51,"value":274},{"type":45,"tag":106,"props":1324,"children":1325},{"style":119},[1326],{"type":51,"value":373},{"type":45,"tag":106,"props":1328,"children":1329},{"style":281},[1330],{"type":51,"value":332},{"type":45,"tag":106,"props":1332,"children":1333},{"style":119},[1334],{"type":51,"value":382},{"type":45,"tag":106,"props":1336,"children":1337},{"style":250},[1338],{"type":51,"value":387},{"type":45,"tag":106,"props":1340,"children":1341},{"style":266},[1342],{"type":51,"value":392},{"type":45,"tag":106,"props":1344,"children":1345},{"style":129},[1346],{"type":51,"value":397},{"type":45,"tag":106,"props":1348,"children":1349},{"style":119},[1350],{"type":51,"value":402},{"type":45,"tag":106,"props":1352,"children":1353},{"style":129},[1354],{"type":51,"value":407},{"type":45,"tag":106,"props":1356,"children":1357},{"style":119},[1358],{"type":51,"value":412},{"type":45,"tag":106,"props":1360,"children":1361},{"style":415},[1362],{"type":51,"value":418},{"type":45,"tag":106,"props":1364,"children":1365},{"style":129},[1366],{"type":51,"value":423},{"type":45,"tag":106,"props":1368,"children":1369},{"class":108,"line":209},[1370,1374,1378,1382,1386,1390,1394],{"type":45,"tag":106,"props":1371,"children":1372},{"style":119},[1373],{"type":51,"value":312},{"type":45,"tag":106,"props":1375,"children":1376},{"style":266},[1377],{"type":51,"value":364},{"type":45,"tag":106,"props":1379,"children":1380},{"style":129},[1381],{"type":51,"value":274},{"type":45,"tag":106,"props":1383,"children":1384},{"style":119},[1385],{"type":51,"value":373},{"type":45,"tag":106,"props":1387,"children":1388},{"style":281},[1389],{"type":51,"value":332},{"type":45,"tag":106,"props":1391,"children":1392},{"style":119},[1393],{"type":51,"value":382},{"type":45,"tag":106,"props":1395,"children":1396},{"style":250},[1397],{"type":51,"value":294},{"type":45,"tag":106,"props":1399,"children":1400},{"class":108,"line":219},[1401,1406],{"type":45,"tag":106,"props":1402,"children":1403},{"style":266},[1404],{"type":51,"value":1405},"      and",{"type":45,"tag":106,"props":1407,"children":1408},{"style":129},[1409],{"type":51,"value":626},{"type":45,"tag":106,"props":1411,"children":1412},{"class":108,"line":229},[1413,1418,1422,1426,1431,1435,1441,1445],{"type":45,"tag":106,"props":1414,"children":1415},{"style":266},[1416],{"type":51,"value":1417},"        gt",{"type":45,"tag":106,"props":1419,"children":1420},{"style":129},[1421],{"type":51,"value":397},{"type":45,"tag":106,"props":1423,"children":1424},{"style":119},[1425],{"type":51,"value":402},{"type":45,"tag":106,"props":1427,"children":1428},{"style":129},[1429],{"type":51,"value":1430},"age",{"type":45,"tag":106,"props":1432,"children":1433},{"style":119},[1434],{"type":51,"value":412},{"type":45,"tag":106,"props":1436,"children":1438},{"style":1437},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1439],{"type":51,"value":1440}," 18",{"type":45,"tag":106,"props":1442,"children":1443},{"style":129},[1444],{"type":51,"value":289},{"type":45,"tag":106,"props":1446,"children":1447},{"style":119},[1448],{"type":51,"value":137},{"type":45,"tag":106,"props":1450,"children":1451},{"class":108,"line":237},[1452,1457,1461,1466,1470,1474,1479,1483,1487,1492,1497,1501,1505,1509,1513,1517,1521,1525,1529,1534,1538,1542],{"type":45,"tag":106,"props":1453,"children":1454},{"style":266},[1455],{"type":51,"value":1456},"        or",{"type":45,"tag":106,"props":1458,"children":1459},{"style":129},[1460],{"type":51,"value":274},{"type":45,"tag":106,"props":1462,"children":1463},{"style":266},[1464],{"type":51,"value":1465},"eq",{"type":45,"tag":106,"props":1467,"children":1468},{"style":129},[1469],{"type":51,"value":397},{"type":45,"tag":106,"props":1471,"children":1472},{"style":119},[1473],{"type":51,"value":402},{"type":45,"tag":106,"props":1475,"children":1476},{"style":129},[1477],{"type":51,"value":1478},"role",{"type":45,"tag":106,"props":1480,"children":1481},{"style":119},[1482],{"type":51,"value":412},{"type":45,"tag":106,"props":1484,"children":1485},{"style":119},[1486],{"type":51,"value":195},{"type":45,"tag":106,"props":1488,"children":1489},{"style":198},[1490],{"type":51,"value":1491},"admin",{"type":45,"tag":106,"props":1493,"children":1494},{"style":119},[1495],{"type":51,"value":1496},"'",{"type":45,"tag":106,"props":1498,"children":1499},{"style":129},[1500],{"type":51,"value":289},{"type":45,"tag":106,"props":1502,"children":1503},{"style":119},[1504],{"type":51,"value":412},{"type":45,"tag":106,"props":1506,"children":1507},{"style":266},[1508],{"type":51,"value":392},{"type":45,"tag":106,"props":1510,"children":1511},{"style":129},[1512],{"type":51,"value":397},{"type":45,"tag":106,"props":1514,"children":1515},{"style":119},[1516],{"type":51,"value":402},{"type":45,"tag":106,"props":1518,"children":1519},{"style":129},[1520],{"type":51,"value":1478},{"type":45,"tag":106,"props":1522,"children":1523},{"style":119},[1524],{"type":51,"value":412},{"type":45,"tag":106,"props":1526,"children":1527},{"style":119},[1528],{"type":51,"value":195},{"type":45,"tag":106,"props":1530,"children":1531},{"style":198},[1532],{"type":51,"value":1533},"moderator",{"type":45,"tag":106,"props":1535,"children":1536},{"style":119},[1537],{"type":51,"value":1496},{"type":45,"tag":106,"props":1539,"children":1540},{"style":129},[1541],{"type":51,"value":570},{"type":45,"tag":106,"props":1543,"children":1544},{"style":119},[1545],{"type":51,"value":137},{"type":45,"tag":106,"props":1547,"children":1548},{"class":108,"line":246},[1549,1554,1558,1563,1567,1571,1575,1579,1584],{"type":45,"tag":106,"props":1550,"children":1551},{"style":266},[1552],{"type":51,"value":1553},"        not",{"type":45,"tag":106,"props":1555,"children":1556},{"style":129},[1557],{"type":51,"value":274},{"type":45,"tag":106,"props":1559,"children":1560},{"style":266},[1561],{"type":51,"value":1562},"inArray",{"type":45,"tag":106,"props":1564,"children":1565},{"style":129},[1566],{"type":51,"value":397},{"type":45,"tag":106,"props":1568,"children":1569},{"style":119},[1570],{"type":51,"value":402},{"type":45,"tag":106,"props":1572,"children":1573},{"style":129},[1574],{"type":51,"value":492},{"type":45,"tag":106,"props":1576,"children":1577},{"style":119},[1578],{"type":51,"value":412},{"type":45,"tag":106,"props":1580,"children":1581},{"style":129},[1582],{"type":51,"value":1583}," bannedIds))",{"type":45,"tag":106,"props":1585,"children":1586},{"style":119},[1587],{"type":51,"value":137},{"type":45,"tag":106,"props":1589,"children":1590},{"class":108,"line":297},[1591,1596],{"type":45,"tag":106,"props":1592,"children":1593},{"style":129},[1594],{"type":51,"value":1595},"      )",{"type":45,"tag":106,"props":1597,"children":1598},{"style":119},[1599],{"type":51,"value":137},{"type":45,"tag":106,"props":1601,"children":1602},{"class":108,"line":306},[1603,1608],{"type":45,"tag":106,"props":1604,"children":1605},{"style":129},[1606],{"type":51,"value":1607},"    )",{"type":45,"tag":106,"props":1609,"children":1610},{"style":119},[1611],{"type":51,"value":137},{"type":45,"tag":106,"props":1613,"children":1614},{"class":108,"line":354},[1615],{"type":45,"tag":106,"props":1616,"children":1617},{"style":129},[1618],{"type":51,"value":351},{"type":45,"tag":58,"props":1620,"children":1621},{},[1622],{"type":51,"value":1623},"Boolean column references work directly:",{"type":45,"tag":94,"props":1625,"children":1627},{"className":96,"code":1626,"language":98,"meta":99,"style":99},".where(({ user }) => user.active)        \u002F\u002F bare boolean ref\n.where(({ user }) => not(user.suspended)) \u002F\u002F negated boolean ref\n",[1628],{"type":45,"tag":102,"props":1629,"children":1630},{"__ignoreMap":99},[1631,1680],{"type":45,"tag":106,"props":1632,"children":1633},{"class":108,"line":109},[1634,1638,1642,1646,1650,1654,1658,1662,1666,1670,1675],{"type":45,"tag":106,"props":1635,"children":1636},{"style":119},[1637],{"type":51,"value":402},{"type":45,"tag":106,"props":1639,"children":1640},{"style":266},[1641],{"type":51,"value":364},{"type":45,"tag":106,"props":1643,"children":1644},{"style":129},[1645],{"type":51,"value":274},{"type":45,"tag":106,"props":1647,"children":1648},{"style":119},[1649],{"type":51,"value":373},{"type":45,"tag":106,"props":1651,"children":1652},{"style":281},[1653],{"type":51,"value":332},{"type":45,"tag":106,"props":1655,"children":1656},{"style":119},[1657],{"type":51,"value":382},{"type":45,"tag":106,"props":1659,"children":1660},{"style":250},[1661],{"type":51,"value":387},{"type":45,"tag":106,"props":1663,"children":1664},{"style":129},[1665],{"type":51,"value":332},{"type":45,"tag":106,"props":1667,"children":1668},{"style":119},[1669],{"type":51,"value":402},{"type":45,"tag":106,"props":1671,"children":1672},{"style":129},[1673],{"type":51,"value":1674},"active)        ",{"type":45,"tag":106,"props":1676,"children":1677},{"style":223},[1678],{"type":51,"value":1679},"\u002F\u002F bare boolean ref\n",{"type":45,"tag":106,"props":1681,"children":1682},{"class":108,"line":125},[1683,1687,1691,1695,1699,1703,1707,1711,1715,1719,1723,1728],{"type":45,"tag":106,"props":1684,"children":1685},{"style":119},[1686],{"type":51,"value":402},{"type":45,"tag":106,"props":1688,"children":1689},{"style":266},[1690],{"type":51,"value":364},{"type":45,"tag":106,"props":1692,"children":1693},{"style":129},[1694],{"type":51,"value":274},{"type":45,"tag":106,"props":1696,"children":1697},{"style":119},[1698],{"type":51,"value":373},{"type":45,"tag":106,"props":1700,"children":1701},{"style":281},[1702],{"type":51,"value":332},{"type":45,"tag":106,"props":1704,"children":1705},{"style":119},[1706],{"type":51,"value":382},{"type":45,"tag":106,"props":1708,"children":1709},{"style":250},[1710],{"type":51,"value":387},{"type":45,"tag":106,"props":1712,"children":1713},{"style":266},[1714],{"type":51,"value":1175},{"type":45,"tag":106,"props":1716,"children":1717},{"style":129},[1718],{"type":51,"value":397},{"type":45,"tag":106,"props":1720,"children":1721},{"style":119},[1722],{"type":51,"value":402},{"type":45,"tag":106,"props":1724,"children":1725},{"style":129},[1726],{"type":51,"value":1727},"suspended)) ",{"type":45,"tag":106,"props":1729,"children":1730},{"style":223},[1731],{"type":51,"value":1732},"\u002F\u002F negated boolean ref\n",{"type":45,"tag":1075,"props":1734,"children":1736},{"id":1735},"_2-joining-two-collections",[1737],{"type":51,"value":1738},"2. Joining two collections",{"type":45,"tag":58,"props":1740,"children":1741},{},[1742,1744,1749,1751,1757,1759,1765,1767,1773,1774,1780,1781,1787,1788,1794],{"type":51,"value":1743},"Join conditions ",{"type":45,"tag":69,"props":1745,"children":1746},{},[1747],{"type":51,"value":1748},"must",{"type":51,"value":1750}," use ",{"type":45,"tag":102,"props":1752,"children":1754},{"className":1753},[],[1755],{"type":51,"value":1756},"eq()",{"type":51,"value":1758}," (equality only -- IVM constraint). Default join type is ",{"type":45,"tag":102,"props":1760,"children":1762},{"className":1761},[],[1763],{"type":51,"value":1764},"left",{"type":51,"value":1766},". Convenience methods: ",{"type":45,"tag":102,"props":1768,"children":1770},{"className":1769},[],[1771],{"type":51,"value":1772},"leftJoin",{"type":51,"value":1101},{"type":45,"tag":102,"props":1775,"children":1777},{"className":1776},[],[1778],{"type":51,"value":1779},"rightJoin",{"type":51,"value":1101},{"type":45,"tag":102,"props":1782,"children":1784},{"className":1783},[],[1785],{"type":51,"value":1786},"innerJoin",{"type":51,"value":1101},{"type":45,"tag":102,"props":1789,"children":1791},{"className":1790},[],[1792],{"type":51,"value":1793},"fullJoin",{"type":51,"value":402},{"type":45,"tag":94,"props":1796,"children":1798},{"className":96,"code":1797,"language":98,"meta":99,"style":99},"import { eq } from '@tanstack\u002Fdb'\n\nconst userPosts = createLiveQueryCollection((q) =>\n  q\n    .from({ user: usersCollection })\n    .innerJoin({ post: postsCollection }, ({ user, post }) =>\n      eq(user.id, post.userId),\n    )\n    .select(({ user, post }) => ({\n      userName: user.name,\n      postTitle: post.title,\n    })),\n)\n",[1799],{"type":45,"tag":102,"props":1800,"children":1801},{"__ignoreMap":99},[1802,1837,1844,1884,1891,1930,1993,2034,2042,2089,2117,2146,2161],{"type":45,"tag":106,"props":1803,"children":1804},{"class":108,"line":109},[1805,1809,1813,1817,1821,1825,1829,1833],{"type":45,"tag":106,"props":1806,"children":1807},{"style":113},[1808],{"type":51,"value":116},{"type":45,"tag":106,"props":1810,"children":1811},{"style":119},[1812],{"type":51,"value":1135},{"type":45,"tag":106,"props":1814,"children":1815},{"style":129},[1816],{"type":51,"value":392},{"type":45,"tag":106,"props":1818,"children":1819},{"style":119},[1820],{"type":51,"value":1198},{"type":45,"tag":106,"props":1822,"children":1823},{"style":113},[1824],{"type":51,"value":190},{"type":45,"tag":106,"props":1826,"children":1827},{"style":119},[1828],{"type":51,"value":195},{"type":45,"tag":106,"props":1830,"children":1831},{"style":198},[1832],{"type":51,"value":201},{"type":45,"tag":106,"props":1834,"children":1835},{"style":119},[1836],{"type":51,"value":206},{"type":45,"tag":106,"props":1838,"children":1839},{"class":108,"line":125},[1840],{"type":45,"tag":106,"props":1841,"children":1842},{"emptyLinePlaceholder":213},[1843],{"type":51,"value":216},{"type":45,"tag":106,"props":1845,"children":1846},{"class":108,"line":140},[1847,1851,1856,1860,1864,1868,1872,1876,1880],{"type":45,"tag":106,"props":1848,"children":1849},{"style":250},[1850],{"type":51,"value":253},{"type":45,"tag":106,"props":1852,"children":1853},{"style":129},[1854],{"type":51,"value":1855}," userPosts ",{"type":45,"tag":106,"props":1857,"children":1858},{"style":119},[1859],{"type":51,"value":263},{"type":45,"tag":106,"props":1861,"children":1862},{"style":266},[1863],{"type":51,"value":269},{"type":45,"tag":106,"props":1865,"children":1866},{"style":129},[1867],{"type":51,"value":274},{"type":45,"tag":106,"props":1869,"children":1870},{"style":119},[1871],{"type":51,"value":274},{"type":45,"tag":106,"props":1873,"children":1874},{"style":281},[1875],{"type":51,"value":284},{"type":45,"tag":106,"props":1877,"children":1878},{"style":119},[1879],{"type":51,"value":289},{"type":45,"tag":106,"props":1881,"children":1882},{"style":250},[1883],{"type":51,"value":294},{"type":45,"tag":106,"props":1885,"children":1886},{"class":108,"line":153},[1887],{"type":45,"tag":106,"props":1888,"children":1889},{"style":129},[1890],{"type":51,"value":303},{"type":45,"tag":106,"props":1892,"children":1893},{"class":108,"line":166},[1894,1898,1902,1906,1910,1914,1918,1922,1926],{"type":45,"tag":106,"props":1895,"children":1896},{"style":119},[1897],{"type":51,"value":312},{"type":45,"tag":106,"props":1899,"children":1900},{"style":266},[1901],{"type":51,"value":317},{"type":45,"tag":106,"props":1903,"children":1904},{"style":129},[1905],{"type":51,"value":274},{"type":45,"tag":106,"props":1907,"children":1908},{"style":119},[1909],{"type":51,"value":326},{"type":45,"tag":106,"props":1911,"children":1912},{"style":329},[1913],{"type":51,"value":332},{"type":45,"tag":106,"props":1915,"children":1916},{"style":119},[1917],{"type":51,"value":337},{"type":45,"tag":106,"props":1919,"children":1920},{"style":129},[1921],{"type":51,"value":342},{"type":45,"tag":106,"props":1923,"children":1924},{"style":119},[1925],{"type":51,"value":185},{"type":45,"tag":106,"props":1927,"children":1928},{"style":129},[1929],{"type":51,"value":351},{"type":45,"tag":106,"props":1931,"children":1932},{"class":108,"line":179},[1933,1937,1941,1945,1949,1954,1958,1963,1968,1973,1977,1981,1985,1989],{"type":45,"tag":106,"props":1934,"children":1935},{"style":119},[1936],{"type":51,"value":312},{"type":45,"tag":106,"props":1938,"children":1939},{"style":266},[1940],{"type":51,"value":1786},{"type":45,"tag":106,"props":1942,"children":1943},{"style":129},[1944],{"type":51,"value":274},{"type":45,"tag":106,"props":1946,"children":1947},{"style":119},[1948],{"type":51,"value":326},{"type":45,"tag":106,"props":1950,"children":1951},{"style":329},[1952],{"type":51,"value":1953}," post",{"type":45,"tag":106,"props":1955,"children":1956},{"style":119},[1957],{"type":51,"value":337},{"type":45,"tag":106,"props":1959,"children":1960},{"style":129},[1961],{"type":51,"value":1962}," postsCollection ",{"type":45,"tag":106,"props":1964,"children":1965},{"style":119},[1966],{"type":51,"value":1967},"},",{"type":45,"tag":106,"props":1969,"children":1970},{"style":119},[1971],{"type":51,"value":1972}," ({",{"type":45,"tag":106,"props":1974,"children":1975},{"style":281},[1976],{"type":51,"value":332},{"type":45,"tag":106,"props":1978,"children":1979},{"style":119},[1980],{"type":51,"value":412},{"type":45,"tag":106,"props":1982,"children":1983},{"style":281},[1984],{"type":51,"value":1953},{"type":45,"tag":106,"props":1986,"children":1987},{"style":119},[1988],{"type":51,"value":382},{"type":45,"tag":106,"props":1990,"children":1991},{"style":250},[1992],{"type":51,"value":294},{"type":45,"tag":106,"props":1994,"children":1995},{"class":108,"line":209},[1996,2001,2005,2009,2013,2017,2021,2025,2030],{"type":45,"tag":106,"props":1997,"children":1998},{"style":266},[1999],{"type":51,"value":2000},"      eq",{"type":45,"tag":106,"props":2002,"children":2003},{"style":129},[2004],{"type":51,"value":397},{"type":45,"tag":106,"props":2006,"children":2007},{"style":119},[2008],{"type":51,"value":402},{"type":45,"tag":106,"props":2010,"children":2011},{"style":129},[2012],{"type":51,"value":492},{"type":45,"tag":106,"props":2014,"children":2015},{"style":119},[2016],{"type":51,"value":412},{"type":45,"tag":106,"props":2018,"children":2019},{"style":129},[2020],{"type":51,"value":1953},{"type":45,"tag":106,"props":2022,"children":2023},{"style":119},[2024],{"type":51,"value":402},{"type":45,"tag":106,"props":2026,"children":2027},{"style":129},[2028],{"type":51,"value":2029},"userId)",{"type":45,"tag":106,"props":2031,"children":2032},{"style":119},[2033],{"type":51,"value":137},{"type":45,"tag":106,"props":2035,"children":2036},{"class":108,"line":219},[2037],{"type":45,"tag":106,"props":2038,"children":2039},{"style":129},[2040],{"type":51,"value":2041},"    )\n",{"type":45,"tag":106,"props":2043,"children":2044},{"class":108,"line":229},[2045,2049,2053,2057,2061,2065,2069,2073,2077,2081,2085],{"type":45,"tag":106,"props":2046,"children":2047},{"style":119},[2048],{"type":51,"value":312},{"type":45,"tag":106,"props":2050,"children":2051},{"style":266},[2052],{"type":51,"value":436},{"type":45,"tag":106,"props":2054,"children":2055},{"style":129},[2056],{"type":51,"value":274},{"type":45,"tag":106,"props":2058,"children":2059},{"style":119},[2060],{"type":51,"value":373},{"type":45,"tag":106,"props":2062,"children":2063},{"style":281},[2064],{"type":51,"value":332},{"type":45,"tag":106,"props":2066,"children":2067},{"style":119},[2068],{"type":51,"value":412},{"type":45,"tag":106,"props":2070,"children":2071},{"style":281},[2072],{"type":51,"value":1953},{"type":45,"tag":106,"props":2074,"children":2075},{"style":119},[2076],{"type":51,"value":382},{"type":45,"tag":106,"props":2078,"children":2079},{"style":250},[2080],{"type":51,"value":387},{"type":45,"tag":106,"props":2082,"children":2083},{"style":129},[2084],{"type":51,"value":461},{"type":45,"tag":106,"props":2086,"children":2087},{"style":119},[2088],{"type":51,"value":466},{"type":45,"tag":106,"props":2090,"children":2091},{"class":108,"line":237},[2092,2097,2101,2105,2109,2113],{"type":45,"tag":106,"props":2093,"children":2094},{"style":329},[2095],{"type":51,"value":2096},"      userName",{"type":45,"tag":106,"props":2098,"children":2099},{"style":119},[2100],{"type":51,"value":337},{"type":45,"tag":106,"props":2102,"children":2103},{"style":129},[2104],{"type":51,"value":332},{"type":45,"tag":106,"props":2106,"children":2107},{"style":119},[2108],{"type":51,"value":402},{"type":45,"tag":106,"props":2110,"children":2111},{"style":129},[2112],{"type":51,"value":522},{"type":45,"tag":106,"props":2114,"children":2115},{"style":119},[2116],{"type":51,"value":137},{"type":45,"tag":106,"props":2118,"children":2119},{"class":108,"line":246},[2120,2125,2129,2133,2137,2142],{"type":45,"tag":106,"props":2121,"children":2122},{"style":329},[2123],{"type":51,"value":2124},"      postTitle",{"type":45,"tag":106,"props":2126,"children":2127},{"style":119},[2128],{"type":51,"value":337},{"type":45,"tag":106,"props":2130,"children":2131},{"style":129},[2132],{"type":51,"value":1953},{"type":45,"tag":106,"props":2134,"children":2135},{"style":119},[2136],{"type":51,"value":402},{"type":45,"tag":106,"props":2138,"children":2139},{"style":129},[2140],{"type":51,"value":2141},"title",{"type":45,"tag":106,"props":2143,"children":2144},{"style":119},[2145],{"type":51,"value":137},{"type":45,"tag":106,"props":2147,"children":2148},{"class":108,"line":297},[2149,2153,2157],{"type":45,"tag":106,"props":2150,"children":2151},{"style":119},[2152],{"type":51,"value":565},{"type":45,"tag":106,"props":2154,"children":2155},{"style":129},[2156],{"type":51,"value":570},{"type":45,"tag":106,"props":2158,"children":2159},{"style":119},[2160],{"type":51,"value":137},{"type":45,"tag":106,"props":2162,"children":2163},{"class":108,"line":306},[2164],{"type":45,"tag":106,"props":2165,"children":2166},{"style":129},[2167],{"type":51,"value":351},{"type":45,"tag":58,"props":2169,"children":2170},{},[2171],{"type":51,"value":2172},"Multiple joins:",{"type":45,"tag":94,"props":2174,"children":2176},{"className":96,"code":2175,"language":98,"meta":99,"style":99},"q.from({ user: usersCollection })\n  .join({ post: postsCollection }, ({ user, post }) => eq(user.id, post.userId))\n  .join({ comment: commentsCollection }, ({ post, comment }) =>\n    eq(post.id, comment.postId),\n  )\n",[2177],{"type":45,"tag":102,"props":2178,"children":2179},{"__ignoreMap":99},[2180,2223,2317,2378,2420],{"type":45,"tag":106,"props":2181,"children":2182},{"class":108,"line":109},[2183,2187,2191,2195,2199,2203,2207,2211,2215,2219],{"type":45,"tag":106,"props":2184,"children":2185},{"style":129},[2186],{"type":51,"value":284},{"type":45,"tag":106,"props":2188,"children":2189},{"style":119},[2190],{"type":51,"value":402},{"type":45,"tag":106,"props":2192,"children":2193},{"style":266},[2194],{"type":51,"value":317},{"type":45,"tag":106,"props":2196,"children":2197},{"style":129},[2198],{"type":51,"value":274},{"type":45,"tag":106,"props":2200,"children":2201},{"style":119},[2202],{"type":51,"value":326},{"type":45,"tag":106,"props":2204,"children":2205},{"style":329},[2206],{"type":51,"value":332},{"type":45,"tag":106,"props":2208,"children":2209},{"style":119},[2210],{"type":51,"value":337},{"type":45,"tag":106,"props":2212,"children":2213},{"style":129},[2214],{"type":51,"value":342},{"type":45,"tag":106,"props":2216,"children":2217},{"style":119},[2218],{"type":51,"value":185},{"type":45,"tag":106,"props":2220,"children":2221},{"style":129},[2222],{"type":51,"value":351},{"type":45,"tag":106,"props":2224,"children":2225},{"class":108,"line":125},[2226,2231,2236,2240,2244,2248,2252,2256,2260,2264,2268,2272,2276,2280,2284,2288,2292,2296,2300,2304,2308,2312],{"type":45,"tag":106,"props":2227,"children":2228},{"style":119},[2229],{"type":51,"value":2230},"  .",{"type":45,"tag":106,"props":2232,"children":2233},{"style":266},[2234],{"type":51,"value":2235},"join",{"type":45,"tag":106,"props":2237,"children":2238},{"style":129},[2239],{"type":51,"value":274},{"type":45,"tag":106,"props":2241,"children":2242},{"style":119},[2243],{"type":51,"value":326},{"type":45,"tag":106,"props":2245,"children":2246},{"style":329},[2247],{"type":51,"value":1953},{"type":45,"tag":106,"props":2249,"children":2250},{"style":119},[2251],{"type":51,"value":337},{"type":45,"tag":106,"props":2253,"children":2254},{"style":129},[2255],{"type":51,"value":1962},{"type":45,"tag":106,"props":2257,"children":2258},{"style":119},[2259],{"type":51,"value":1967},{"type":45,"tag":106,"props":2261,"children":2262},{"style":119},[2263],{"type":51,"value":1972},{"type":45,"tag":106,"props":2265,"children":2266},{"style":281},[2267],{"type":51,"value":332},{"type":45,"tag":106,"props":2269,"children":2270},{"style":119},[2271],{"type":51,"value":412},{"type":45,"tag":106,"props":2273,"children":2274},{"style":281},[2275],{"type":51,"value":1953},{"type":45,"tag":106,"props":2277,"children":2278},{"style":119},[2279],{"type":51,"value":382},{"type":45,"tag":106,"props":2281,"children":2282},{"style":250},[2283],{"type":51,"value":387},{"type":45,"tag":106,"props":2285,"children":2286},{"style":266},[2287],{"type":51,"value":392},{"type":45,"tag":106,"props":2289,"children":2290},{"style":129},[2291],{"type":51,"value":397},{"type":45,"tag":106,"props":2293,"children":2294},{"style":119},[2295],{"type":51,"value":402},{"type":45,"tag":106,"props":2297,"children":2298},{"style":129},[2299],{"type":51,"value":492},{"type":45,"tag":106,"props":2301,"children":2302},{"style":119},[2303],{"type":51,"value":412},{"type":45,"tag":106,"props":2305,"children":2306},{"style":129},[2307],{"type":51,"value":1953},{"type":45,"tag":106,"props":2309,"children":2310},{"style":119},[2311],{"type":51,"value":402},{"type":45,"tag":106,"props":2313,"children":2314},{"style":129},[2315],{"type":51,"value":2316},"userId))\n",{"type":45,"tag":106,"props":2318,"children":2319},{"class":108,"line":140},[2320,2324,2328,2332,2336,2341,2345,2350,2354,2358,2362,2366,2370,2374],{"type":45,"tag":106,"props":2321,"children":2322},{"style":119},[2323],{"type":51,"value":2230},{"type":45,"tag":106,"props":2325,"children":2326},{"style":266},[2327],{"type":51,"value":2235},{"type":45,"tag":106,"props":2329,"children":2330},{"style":129},[2331],{"type":51,"value":274},{"type":45,"tag":106,"props":2333,"children":2334},{"style":119},[2335],{"type":51,"value":326},{"type":45,"tag":106,"props":2337,"children":2338},{"style":329},[2339],{"type":51,"value":2340}," comment",{"type":45,"tag":106,"props":2342,"children":2343},{"style":119},[2344],{"type":51,"value":337},{"type":45,"tag":106,"props":2346,"children":2347},{"style":129},[2348],{"type":51,"value":2349}," commentsCollection ",{"type":45,"tag":106,"props":2351,"children":2352},{"style":119},[2353],{"type":51,"value":1967},{"type":45,"tag":106,"props":2355,"children":2356},{"style":119},[2357],{"type":51,"value":1972},{"type":45,"tag":106,"props":2359,"children":2360},{"style":281},[2361],{"type":51,"value":1953},{"type":45,"tag":106,"props":2363,"children":2364},{"style":119},[2365],{"type":51,"value":412},{"type":45,"tag":106,"props":2367,"children":2368},{"style":281},[2369],{"type":51,"value":2340},{"type":45,"tag":106,"props":2371,"children":2372},{"style":119},[2373],{"type":51,"value":382},{"type":45,"tag":106,"props":2375,"children":2376},{"style":250},[2377],{"type":51,"value":294},{"type":45,"tag":106,"props":2379,"children":2380},{"class":108,"line":153},[2381,2386,2391,2395,2399,2403,2407,2411,2416],{"type":45,"tag":106,"props":2382,"children":2383},{"style":266},[2384],{"type":51,"value":2385},"    eq",{"type":45,"tag":106,"props":2387,"children":2388},{"style":129},[2389],{"type":51,"value":2390},"(post",{"type":45,"tag":106,"props":2392,"children":2393},{"style":119},[2394],{"type":51,"value":402},{"type":45,"tag":106,"props":2396,"children":2397},{"style":129},[2398],{"type":51,"value":492},{"type":45,"tag":106,"props":2400,"children":2401},{"style":119},[2402],{"type":51,"value":412},{"type":45,"tag":106,"props":2404,"children":2405},{"style":129},[2406],{"type":51,"value":2340},{"type":45,"tag":106,"props":2408,"children":2409},{"style":119},[2410],{"type":51,"value":402},{"type":45,"tag":106,"props":2412,"children":2413},{"style":129},[2414],{"type":51,"value":2415},"postId)",{"type":45,"tag":106,"props":2417,"children":2418},{"style":119},[2419],{"type":51,"value":137},{"type":45,"tag":106,"props":2421,"children":2422},{"class":108,"line":166},[2423],{"type":45,"tag":106,"props":2424,"children":2425},{"style":129},[2426],{"type":51,"value":2427},"  )\n",{"type":45,"tag":1075,"props":2429,"children":2431},{"id":2430},"_3-aggregation-with-groupby-having",[2432],{"type":51,"value":2433},"3. Aggregation with groupBy + having",{"type":45,"tag":58,"props":2435,"children":2436},{},[2437,2439,2445,2447,2452,2454,2460,2462,2468,2470,2475,2477,2483,2485,2490],{"type":51,"value":2438},"Use ",{"type":45,"tag":102,"props":2440,"children":2442},{"className":2441},[],[2443],{"type":51,"value":2444},"groupBy",{"type":51,"value":2446}," to group rows, then aggregate in ",{"type":45,"tag":102,"props":2448,"children":2450},{"className":2449},[],[2451],{"type":51,"value":436},{"type":51,"value":2453},". Filter groups with ",{"type":45,"tag":102,"props":2455,"children":2457},{"className":2456},[],[2458],{"type":51,"value":2459},"having",{"type":51,"value":2461},". The ",{"type":45,"tag":102,"props":2463,"children":2465},{"className":2464},[],[2466],{"type":51,"value":2467},"$selected",{"type":51,"value":2469}," namespace lets ",{"type":45,"tag":102,"props":2471,"children":2473},{"className":2472},[],[2474],{"type":51,"value":2459},{"type":51,"value":2476}," and ",{"type":45,"tag":102,"props":2478,"children":2480},{"className":2479},[],[2481],{"type":51,"value":2482},"orderBy",{"type":51,"value":2484}," reference fields defined in ",{"type":45,"tag":102,"props":2486,"children":2488},{"className":2487},[],[2489],{"type":51,"value":436},{"type":51,"value":402},{"type":45,"tag":94,"props":2492,"children":2494},{"className":96,"code":2493,"language":98,"meta":99,"style":99},"import { count, sum, gt } from '@tanstack\u002Fdb'\n\nconst topCustomers = createLiveQueryCollection((q) =>\n  q\n    .from({ order: ordersCollection })\n    .groupBy(({ order }) => order.customerId)\n    .select(({ order }) => ({\n      customerId: order.customerId,\n      totalSpent: sum(order.amount),\n      orderCount: count(order.id),\n    }))\n    .having(({ $selected }) => gt($selected.totalSpent, 1000))\n    .orderBy(({ $selected }) => $selected.totalSpent, 'desc')\n    .limit(10),\n)\n",[2495],{"type":45,"tag":102,"props":2496,"children":2497},{"__ignoreMap":99},[2498,2551,2558,2598,2605,2646,2690,2729,2758,2792,2825,2836,2899,2963,2992],{"type":45,"tag":106,"props":2499,"children":2500},{"class":108,"line":109},[2501,2505,2509,2514,2518,2523,2527,2531,2535,2539,2543,2547],{"type":45,"tag":106,"props":2502,"children":2503},{"style":113},[2504],{"type":51,"value":116},{"type":45,"tag":106,"props":2506,"children":2507},{"style":119},[2508],{"type":51,"value":1135},{"type":45,"tag":106,"props":2510,"children":2511},{"style":129},[2512],{"type":51,"value":2513}," count",{"type":45,"tag":106,"props":2515,"children":2516},{"style":119},[2517],{"type":51,"value":412},{"type":45,"tag":106,"props":2519,"children":2520},{"style":129},[2521],{"type":51,"value":2522}," sum",{"type":45,"tag":106,"props":2524,"children":2525},{"style":119},[2526],{"type":51,"value":412},{"type":45,"tag":106,"props":2528,"children":2529},{"style":129},[2530],{"type":51,"value":1148},{"type":45,"tag":106,"props":2532,"children":2533},{"style":119},[2534],{"type":51,"value":1198},{"type":45,"tag":106,"props":2536,"children":2537},{"style":113},[2538],{"type":51,"value":190},{"type":45,"tag":106,"props":2540,"children":2541},{"style":119},[2542],{"type":51,"value":195},{"type":45,"tag":106,"props":2544,"children":2545},{"style":198},[2546],{"type":51,"value":201},{"type":45,"tag":106,"props":2548,"children":2549},{"style":119},[2550],{"type":51,"value":206},{"type":45,"tag":106,"props":2552,"children":2553},{"class":108,"line":125},[2554],{"type":45,"tag":106,"props":2555,"children":2556},{"emptyLinePlaceholder":213},[2557],{"type":51,"value":216},{"type":45,"tag":106,"props":2559,"children":2560},{"class":108,"line":140},[2561,2565,2570,2574,2578,2582,2586,2590,2594],{"type":45,"tag":106,"props":2562,"children":2563},{"style":250},[2564],{"type":51,"value":253},{"type":45,"tag":106,"props":2566,"children":2567},{"style":129},[2568],{"type":51,"value":2569}," topCustomers ",{"type":45,"tag":106,"props":2571,"children":2572},{"style":119},[2573],{"type":51,"value":263},{"type":45,"tag":106,"props":2575,"children":2576},{"style":266},[2577],{"type":51,"value":269},{"type":45,"tag":106,"props":2579,"children":2580},{"style":129},[2581],{"type":51,"value":274},{"type":45,"tag":106,"props":2583,"children":2584},{"style":119},[2585],{"type":51,"value":274},{"type":45,"tag":106,"props":2587,"children":2588},{"style":281},[2589],{"type":51,"value":284},{"type":45,"tag":106,"props":2591,"children":2592},{"style":119},[2593],{"type":51,"value":289},{"type":45,"tag":106,"props":2595,"children":2596},{"style":250},[2597],{"type":51,"value":294},{"type":45,"tag":106,"props":2599,"children":2600},{"class":108,"line":153},[2601],{"type":45,"tag":106,"props":2602,"children":2603},{"style":129},[2604],{"type":51,"value":303},{"type":45,"tag":106,"props":2606,"children":2607},{"class":108,"line":166},[2608,2612,2616,2620,2624,2629,2633,2638,2642],{"type":45,"tag":106,"props":2609,"children":2610},{"style":119},[2611],{"type":51,"value":312},{"type":45,"tag":106,"props":2613,"children":2614},{"style":266},[2615],{"type":51,"value":317},{"type":45,"tag":106,"props":2617,"children":2618},{"style":129},[2619],{"type":51,"value":274},{"type":45,"tag":106,"props":2621,"children":2622},{"style":119},[2623],{"type":51,"value":326},{"type":45,"tag":106,"props":2625,"children":2626},{"style":329},[2627],{"type":51,"value":2628}," order",{"type":45,"tag":106,"props":2630,"children":2631},{"style":119},[2632],{"type":51,"value":337},{"type":45,"tag":106,"props":2634,"children":2635},{"style":129},[2636],{"type":51,"value":2637}," ordersCollection ",{"type":45,"tag":106,"props":2639,"children":2640},{"style":119},[2641],{"type":51,"value":185},{"type":45,"tag":106,"props":2643,"children":2644},{"style":129},[2645],{"type":51,"value":351},{"type":45,"tag":106,"props":2647,"children":2648},{"class":108,"line":179},[2649,2653,2657,2661,2665,2669,2673,2677,2681,2685],{"type":45,"tag":106,"props":2650,"children":2651},{"style":119},[2652],{"type":51,"value":312},{"type":45,"tag":106,"props":2654,"children":2655},{"style":266},[2656],{"type":51,"value":2444},{"type":45,"tag":106,"props":2658,"children":2659},{"style":129},[2660],{"type":51,"value":274},{"type":45,"tag":106,"props":2662,"children":2663},{"style":119},[2664],{"type":51,"value":373},{"type":45,"tag":106,"props":2666,"children":2667},{"style":281},[2668],{"type":51,"value":2628},{"type":45,"tag":106,"props":2670,"children":2671},{"style":119},[2672],{"type":51,"value":382},{"type":45,"tag":106,"props":2674,"children":2675},{"style":250},[2676],{"type":51,"value":387},{"type":45,"tag":106,"props":2678,"children":2679},{"style":129},[2680],{"type":51,"value":2628},{"type":45,"tag":106,"props":2682,"children":2683},{"style":119},[2684],{"type":51,"value":402},{"type":45,"tag":106,"props":2686,"children":2687},{"style":129},[2688],{"type":51,"value":2689},"customerId)\n",{"type":45,"tag":106,"props":2691,"children":2692},{"class":108,"line":209},[2693,2697,2701,2705,2709,2713,2717,2721,2725],{"type":45,"tag":106,"props":2694,"children":2695},{"style":119},[2696],{"type":51,"value":312},{"type":45,"tag":106,"props":2698,"children":2699},{"style":266},[2700],{"type":51,"value":436},{"type":45,"tag":106,"props":2702,"children":2703},{"style":129},[2704],{"type":51,"value":274},{"type":45,"tag":106,"props":2706,"children":2707},{"style":119},[2708],{"type":51,"value":373},{"type":45,"tag":106,"props":2710,"children":2711},{"style":281},[2712],{"type":51,"value":2628},{"type":45,"tag":106,"props":2714,"children":2715},{"style":119},[2716],{"type":51,"value":382},{"type":45,"tag":106,"props":2718,"children":2719},{"style":250},[2720],{"type":51,"value":387},{"type":45,"tag":106,"props":2722,"children":2723},{"style":129},[2724],{"type":51,"value":461},{"type":45,"tag":106,"props":2726,"children":2727},{"style":119},[2728],{"type":51,"value":466},{"type":45,"tag":106,"props":2730,"children":2731},{"class":108,"line":219},[2732,2737,2741,2745,2749,2754],{"type":45,"tag":106,"props":2733,"children":2734},{"style":329},[2735],{"type":51,"value":2736},"      customerId",{"type":45,"tag":106,"props":2738,"children":2739},{"style":119},[2740],{"type":51,"value":337},{"type":45,"tag":106,"props":2742,"children":2743},{"style":129},[2744],{"type":51,"value":2628},{"type":45,"tag":106,"props":2746,"children":2747},{"style":119},[2748],{"type":51,"value":402},{"type":45,"tag":106,"props":2750,"children":2751},{"style":129},[2752],{"type":51,"value":2753},"customerId",{"type":45,"tag":106,"props":2755,"children":2756},{"style":119},[2757],{"type":51,"value":137},{"type":45,"tag":106,"props":2759,"children":2760},{"class":108,"line":229},[2761,2766,2770,2774,2779,2783,2788],{"type":45,"tag":106,"props":2762,"children":2763},{"style":329},[2764],{"type":51,"value":2765},"      totalSpent",{"type":45,"tag":106,"props":2767,"children":2768},{"style":119},[2769],{"type":51,"value":337},{"type":45,"tag":106,"props":2771,"children":2772},{"style":266},[2773],{"type":51,"value":2522},{"type":45,"tag":106,"props":2775,"children":2776},{"style":129},[2777],{"type":51,"value":2778},"(order",{"type":45,"tag":106,"props":2780,"children":2781},{"style":119},[2782],{"type":51,"value":402},{"type":45,"tag":106,"props":2784,"children":2785},{"style":129},[2786],{"type":51,"value":2787},"amount)",{"type":45,"tag":106,"props":2789,"children":2790},{"style":119},[2791],{"type":51,"value":137},{"type":45,"tag":106,"props":2793,"children":2794},{"class":108,"line":237},[2795,2800,2804,2808,2812,2816,2821],{"type":45,"tag":106,"props":2796,"children":2797},{"style":329},[2798],{"type":51,"value":2799},"      orderCount",{"type":45,"tag":106,"props":2801,"children":2802},{"style":119},[2803],{"type":51,"value":337},{"type":45,"tag":106,"props":2805,"children":2806},{"style":266},[2807],{"type":51,"value":2513},{"type":45,"tag":106,"props":2809,"children":2810},{"style":129},[2811],{"type":51,"value":2778},{"type":45,"tag":106,"props":2813,"children":2814},{"style":119},[2815],{"type":51,"value":402},{"type":45,"tag":106,"props":2817,"children":2818},{"style":129},[2819],{"type":51,"value":2820},"id)",{"type":45,"tag":106,"props":2822,"children":2823},{"style":119},[2824],{"type":51,"value":137},{"type":45,"tag":106,"props":2826,"children":2827},{"class":108,"line":246},[2828,2832],{"type":45,"tag":106,"props":2829,"children":2830},{"style":119},[2831],{"type":51,"value":565},{"type":45,"tag":106,"props":2833,"children":2834},{"style":129},[2835],{"type":51,"value":423},{"type":45,"tag":106,"props":2837,"children":2838},{"class":108,"line":297},[2839,2843,2847,2851,2855,2860,2864,2868,2872,2877,2881,2886,2890,2895],{"type":45,"tag":106,"props":2840,"children":2841},{"style":119},[2842],{"type":51,"value":312},{"type":45,"tag":106,"props":2844,"children":2845},{"style":266},[2846],{"type":51,"value":2459},{"type":45,"tag":106,"props":2848,"children":2849},{"style":129},[2850],{"type":51,"value":274},{"type":45,"tag":106,"props":2852,"children":2853},{"style":119},[2854],{"type":51,"value":373},{"type":45,"tag":106,"props":2856,"children":2857},{"style":281},[2858],{"type":51,"value":2859}," $selected",{"type":45,"tag":106,"props":2861,"children":2862},{"style":119},[2863],{"type":51,"value":382},{"type":45,"tag":106,"props":2865,"children":2866},{"style":250},[2867],{"type":51,"value":387},{"type":45,"tag":106,"props":2869,"children":2870},{"style":266},[2871],{"type":51,"value":1148},{"type":45,"tag":106,"props":2873,"children":2874},{"style":129},[2875],{"type":51,"value":2876},"($selected",{"type":45,"tag":106,"props":2878,"children":2879},{"style":119},[2880],{"type":51,"value":402},{"type":45,"tag":106,"props":2882,"children":2883},{"style":129},[2884],{"type":51,"value":2885},"totalSpent",{"type":45,"tag":106,"props":2887,"children":2888},{"style":119},[2889],{"type":51,"value":412},{"type":45,"tag":106,"props":2891,"children":2892},{"style":1437},[2893],{"type":51,"value":2894}," 1000",{"type":45,"tag":106,"props":2896,"children":2897},{"style":129},[2898],{"type":51,"value":423},{"type":45,"tag":106,"props":2900,"children":2901},{"class":108,"line":306},[2902,2906,2910,2914,2918,2922,2926,2930,2934,2938,2942,2946,2950,2955,2959],{"type":45,"tag":106,"props":2903,"children":2904},{"style":119},[2905],{"type":51,"value":312},{"type":45,"tag":106,"props":2907,"children":2908},{"style":266},[2909],{"type":51,"value":2482},{"type":45,"tag":106,"props":2911,"children":2912},{"style":129},[2913],{"type":51,"value":274},{"type":45,"tag":106,"props":2915,"children":2916},{"style":119},[2917],{"type":51,"value":373},{"type":45,"tag":106,"props":2919,"children":2920},{"style":281},[2921],{"type":51,"value":2859},{"type":45,"tag":106,"props":2923,"children":2924},{"style":119},[2925],{"type":51,"value":382},{"type":45,"tag":106,"props":2927,"children":2928},{"style":250},[2929],{"type":51,"value":387},{"type":45,"tag":106,"props":2931,"children":2932},{"style":129},[2933],{"type":51,"value":2859},{"type":45,"tag":106,"props":2935,"children":2936},{"style":119},[2937],{"type":51,"value":402},{"type":45,"tag":106,"props":2939,"children":2940},{"style":129},[2941],{"type":51,"value":2885},{"type":45,"tag":106,"props":2943,"children":2944},{"style":119},[2945],{"type":51,"value":412},{"type":45,"tag":106,"props":2947,"children":2948},{"style":119},[2949],{"type":51,"value":195},{"type":45,"tag":106,"props":2951,"children":2952},{"style":198},[2953],{"type":51,"value":2954},"desc",{"type":45,"tag":106,"props":2956,"children":2957},{"style":119},[2958],{"type":51,"value":1496},{"type":45,"tag":106,"props":2960,"children":2961},{"style":129},[2962],{"type":51,"value":351},{"type":45,"tag":106,"props":2964,"children":2965},{"class":108,"line":354},[2966,2970,2975,2979,2984,2988],{"type":45,"tag":106,"props":2967,"children":2968},{"style":119},[2969],{"type":51,"value":312},{"type":45,"tag":106,"props":2971,"children":2972},{"style":266},[2973],{"type":51,"value":2974},"limit",{"type":45,"tag":106,"props":2976,"children":2977},{"style":129},[2978],{"type":51,"value":274},{"type":45,"tag":106,"props":2980,"children":2981},{"style":1437},[2982],{"type":51,"value":2983},"10",{"type":45,"tag":106,"props":2985,"children":2986},{"style":129},[2987],{"type":51,"value":289},{"type":45,"tag":106,"props":2989,"children":2990},{"style":119},[2991],{"type":51,"value":137},{"type":45,"tag":106,"props":2993,"children":2994},{"class":108,"line":426},[2995],{"type":45,"tag":106,"props":2996,"children":2997},{"style":129},[2998],{"type":51,"value":351},{"type":45,"tag":58,"props":3000,"children":3001},{},[3002,3004,3009,3011,3016],{"type":51,"value":3003},"Without ",{"type":45,"tag":102,"props":3005,"children":3007},{"className":3006},[],[3008],{"type":51,"value":2444},{"type":51,"value":3010},", aggregates in ",{"type":45,"tag":102,"props":3012,"children":3014},{"className":3013},[],[3015],{"type":51,"value":436},{"type":51,"value":3017}," treat the entire collection as one group:",{"type":45,"tag":94,"props":3019,"children":3021},{"className":96,"code":3020,"language":98,"meta":99,"style":99},"const stats = createLiveQueryCollection((q) =>\n  q.from({ user: usersCollection }).select(({ user }) => ({\n    totalUsers: count(user.id),\n    avgAge: avg(user.age),\n  })),\n)\n",[3022],{"type":45,"tag":102,"props":3023,"children":3024},{"__ignoreMap":99},[3025,3065,3145,3177,3211,3226],{"type":45,"tag":106,"props":3026,"children":3027},{"class":108,"line":109},[3028,3032,3037,3041,3045,3049,3053,3057,3061],{"type":45,"tag":106,"props":3029,"children":3030},{"style":250},[3031],{"type":51,"value":253},{"type":45,"tag":106,"props":3033,"children":3034},{"style":129},[3035],{"type":51,"value":3036}," stats ",{"type":45,"tag":106,"props":3038,"children":3039},{"style":119},[3040],{"type":51,"value":263},{"type":45,"tag":106,"props":3042,"children":3043},{"style":266},[3044],{"type":51,"value":269},{"type":45,"tag":106,"props":3046,"children":3047},{"style":129},[3048],{"type":51,"value":274},{"type":45,"tag":106,"props":3050,"children":3051},{"style":119},[3052],{"type":51,"value":274},{"type":45,"tag":106,"props":3054,"children":3055},{"style":281},[3056],{"type":51,"value":284},{"type":45,"tag":106,"props":3058,"children":3059},{"style":119},[3060],{"type":51,"value":289},{"type":45,"tag":106,"props":3062,"children":3063},{"style":250},[3064],{"type":51,"value":294},{"type":45,"tag":106,"props":3066,"children":3067},{"class":108,"line":125},[3068,3073,3077,3081,3085,3089,3093,3097,3101,3105,3109,3113,3117,3121,3125,3129,3133,3137,3141],{"type":45,"tag":106,"props":3069,"children":3070},{"style":129},[3071],{"type":51,"value":3072},"  q",{"type":45,"tag":106,"props":3074,"children":3075},{"style":119},[3076],{"type":51,"value":402},{"type":45,"tag":106,"props":3078,"children":3079},{"style":266},[3080],{"type":51,"value":317},{"type":45,"tag":106,"props":3082,"children":3083},{"style":129},[3084],{"type":51,"value":274},{"type":45,"tag":106,"props":3086,"children":3087},{"style":119},[3088],{"type":51,"value":326},{"type":45,"tag":106,"props":3090,"children":3091},{"style":329},[3092],{"type":51,"value":332},{"type":45,"tag":106,"props":3094,"children":3095},{"style":119},[3096],{"type":51,"value":337},{"type":45,"tag":106,"props":3098,"children":3099},{"style":129},[3100],{"type":51,"value":342},{"type":45,"tag":106,"props":3102,"children":3103},{"style":119},[3104],{"type":51,"value":185},{"type":45,"tag":106,"props":3106,"children":3107},{"style":129},[3108],{"type":51,"value":289},{"type":45,"tag":106,"props":3110,"children":3111},{"style":119},[3112],{"type":51,"value":402},{"type":45,"tag":106,"props":3114,"children":3115},{"style":266},[3116],{"type":51,"value":436},{"type":45,"tag":106,"props":3118,"children":3119},{"style":129},[3120],{"type":51,"value":274},{"type":45,"tag":106,"props":3122,"children":3123},{"style":119},[3124],{"type":51,"value":373},{"type":45,"tag":106,"props":3126,"children":3127},{"style":281},[3128],{"type":51,"value":332},{"type":45,"tag":106,"props":3130,"children":3131},{"style":119},[3132],{"type":51,"value":382},{"type":45,"tag":106,"props":3134,"children":3135},{"style":250},[3136],{"type":51,"value":387},{"type":45,"tag":106,"props":3138,"children":3139},{"style":129},[3140],{"type":51,"value":461},{"type":45,"tag":106,"props":3142,"children":3143},{"style":119},[3144],{"type":51,"value":466},{"type":45,"tag":106,"props":3146,"children":3147},{"class":108,"line":140},[3148,3153,3157,3161,3165,3169,3173],{"type":45,"tag":106,"props":3149,"children":3150},{"style":329},[3151],{"type":51,"value":3152},"    totalUsers",{"type":45,"tag":106,"props":3154,"children":3155},{"style":119},[3156],{"type":51,"value":337},{"type":45,"tag":106,"props":3158,"children":3159},{"style":266},[3160],{"type":51,"value":2513},{"type":45,"tag":106,"props":3162,"children":3163},{"style":129},[3164],{"type":51,"value":397},{"type":45,"tag":106,"props":3166,"children":3167},{"style":119},[3168],{"type":51,"value":402},{"type":45,"tag":106,"props":3170,"children":3171},{"style":129},[3172],{"type":51,"value":2820},{"type":45,"tag":106,"props":3174,"children":3175},{"style":119},[3176],{"type":51,"value":137},{"type":45,"tag":106,"props":3178,"children":3179},{"class":108,"line":153},[3180,3185,3189,3194,3198,3202,3207],{"type":45,"tag":106,"props":3181,"children":3182},{"style":329},[3183],{"type":51,"value":3184},"    avgAge",{"type":45,"tag":106,"props":3186,"children":3187},{"style":119},[3188],{"type":51,"value":337},{"type":45,"tag":106,"props":3190,"children":3191},{"style":266},[3192],{"type":51,"value":3193}," avg",{"type":45,"tag":106,"props":3195,"children":3196},{"style":129},[3197],{"type":51,"value":397},{"type":45,"tag":106,"props":3199,"children":3200},{"style":119},[3201],{"type":51,"value":402},{"type":45,"tag":106,"props":3203,"children":3204},{"style":129},[3205],{"type":51,"value":3206},"age)",{"type":45,"tag":106,"props":3208,"children":3209},{"style":119},[3210],{"type":51,"value":137},{"type":45,"tag":106,"props":3212,"children":3213},{"class":108,"line":166},[3214,3218,3222],{"type":45,"tag":106,"props":3215,"children":3216},{"style":119},[3217],{"type":51,"value":951},{"type":45,"tag":106,"props":3219,"children":3220},{"style":129},[3221],{"type":51,"value":570},{"type":45,"tag":106,"props":3223,"children":3224},{"style":119},[3225],{"type":51,"value":137},{"type":45,"tag":106,"props":3227,"children":3228},{"class":108,"line":179},[3229],{"type":45,"tag":106,"props":3230,"children":3231},{"style":129},[3232],{"type":51,"value":351},{"type":45,"tag":1075,"props":3234,"children":3236},{"id":3235},"_4-standalone-derived-collection-with-createlivequerycollection",[3237],{"type":51,"value":3238},"4. Standalone derived collection with createLiveQueryCollection",{"type":45,"tag":58,"props":3240,"children":3241},{},[3242],{"type":51,"value":3243},"Derived collections are themselves collections. Use one as a source for another query to cache intermediate results:",{"type":45,"tag":94,"props":3245,"children":3247},{"className":96,"code":3246,"language":98,"meta":99,"style":99},"\u002F\u002F Base derived collection\nconst activeUsers = createLiveQueryCollection((q) =>\n  q.from({ user: usersCollection }).where(({ user }) => eq(user.active, true)),\n)\n\n\u002F\u002F Second query uses the derived collection as its source\nconst activeUserPosts = createLiveQueryCollection((q) =>\n  q\n    .from({ user: activeUsers })\n    .join({ post: postsCollection }, ({ user, post }) =>\n      eq(user.id, post.userId),\n    )\n    .select(({ user, post }) => ({\n      userName: user.name,\n      postTitle: post.title,\n    })),\n)\n",[3248],{"type":45,"tag":102,"props":3249,"children":3250},{"__ignoreMap":99},[3251,3259,3298,3401,3408,3415,3423,3463,3470,3509,3568,3607,3614,3661,3688,3715,3730],{"type":45,"tag":106,"props":3252,"children":3253},{"class":108,"line":109},[3254],{"type":45,"tag":106,"props":3255,"children":3256},{"style":223},[3257],{"type":51,"value":3258},"\u002F\u002F Base derived collection\n",{"type":45,"tag":106,"props":3260,"children":3261},{"class":108,"line":125},[3262,3266,3270,3274,3278,3282,3286,3290,3294],{"type":45,"tag":106,"props":3263,"children":3264},{"style":250},[3265],{"type":51,"value":253},{"type":45,"tag":106,"props":3267,"children":3268},{"style":129},[3269],{"type":51,"value":258},{"type":45,"tag":106,"props":3271,"children":3272},{"style":119},[3273],{"type":51,"value":263},{"type":45,"tag":106,"props":3275,"children":3276},{"style":266},[3277],{"type":51,"value":269},{"type":45,"tag":106,"props":3279,"children":3280},{"style":129},[3281],{"type":51,"value":274},{"type":45,"tag":106,"props":3283,"children":3284},{"style":119},[3285],{"type":51,"value":274},{"type":45,"tag":106,"props":3287,"children":3288},{"style":281},[3289],{"type":51,"value":284},{"type":45,"tag":106,"props":3291,"children":3292},{"style":119},[3293],{"type":51,"value":289},{"type":45,"tag":106,"props":3295,"children":3296},{"style":250},[3297],{"type":51,"value":294},{"type":45,"tag":106,"props":3299,"children":3300},{"class":108,"line":140},[3301,3305,3309,3313,3317,3321,3325,3329,3333,3337,3341,3345,3349,3353,3357,3361,3365,3369,3373,3377,3381,3385,3389,3393,3397],{"type":45,"tag":106,"props":3302,"children":3303},{"style":129},[3304],{"type":51,"value":3072},{"type":45,"tag":106,"props":3306,"children":3307},{"style":119},[3308],{"type":51,"value":402},{"type":45,"tag":106,"props":3310,"children":3311},{"style":266},[3312],{"type":51,"value":317},{"type":45,"tag":106,"props":3314,"children":3315},{"style":129},[3316],{"type":51,"value":274},{"type":45,"tag":106,"props":3318,"children":3319},{"style":119},[3320],{"type":51,"value":326},{"type":45,"tag":106,"props":3322,"children":3323},{"style":329},[3324],{"type":51,"value":332},{"type":45,"tag":106,"props":3326,"children":3327},{"style":119},[3328],{"type":51,"value":337},{"type":45,"tag":106,"props":3330,"children":3331},{"style":129},[3332],{"type":51,"value":342},{"type":45,"tag":106,"props":3334,"children":3335},{"style":119},[3336],{"type":51,"value":185},{"type":45,"tag":106,"props":3338,"children":3339},{"style":129},[3340],{"type":51,"value":289},{"type":45,"tag":106,"props":3342,"children":3343},{"style":119},[3344],{"type":51,"value":402},{"type":45,"tag":106,"props":3346,"children":3347},{"style":266},[3348],{"type":51,"value":364},{"type":45,"tag":106,"props":3350,"children":3351},{"style":129},[3352],{"type":51,"value":274},{"type":45,"tag":106,"props":3354,"children":3355},{"style":119},[3356],{"type":51,"value":373},{"type":45,"tag":106,"props":3358,"children":3359},{"style":281},[3360],{"type":51,"value":332},{"type":45,"tag":106,"props":3362,"children":3363},{"style":119},[3364],{"type":51,"value":382},{"type":45,"tag":106,"props":3366,"children":3367},{"style":250},[3368],{"type":51,"value":387},{"type":45,"tag":106,"props":3370,"children":3371},{"style":266},[3372],{"type":51,"value":392},{"type":45,"tag":106,"props":3374,"children":3375},{"style":129},[3376],{"type":51,"value":397},{"type":45,"tag":106,"props":3378,"children":3379},{"style":119},[3380],{"type":51,"value":402},{"type":45,"tag":106,"props":3382,"children":3383},{"style":129},[3384],{"type":51,"value":407},{"type":45,"tag":106,"props":3386,"children":3387},{"style":119},[3388],{"type":51,"value":412},{"type":45,"tag":106,"props":3390,"children":3391},{"style":415},[3392],{"type":51,"value":418},{"type":45,"tag":106,"props":3394,"children":3395},{"style":129},[3396],{"type":51,"value":570},{"type":45,"tag":106,"props":3398,"children":3399},{"style":119},[3400],{"type":51,"value":137},{"type":45,"tag":106,"props":3402,"children":3403},{"class":108,"line":153},[3404],{"type":45,"tag":106,"props":3405,"children":3406},{"style":129},[3407],{"type":51,"value":351},{"type":45,"tag":106,"props":3409,"children":3410},{"class":108,"line":166},[3411],{"type":45,"tag":106,"props":3412,"children":3413},{"emptyLinePlaceholder":213},[3414],{"type":51,"value":216},{"type":45,"tag":106,"props":3416,"children":3417},{"class":108,"line":179},[3418],{"type":45,"tag":106,"props":3419,"children":3420},{"style":223},[3421],{"type":51,"value":3422},"\u002F\u002F Second query uses the derived collection as its source\n",{"type":45,"tag":106,"props":3424,"children":3425},{"class":108,"line":209},[3426,3430,3435,3439,3443,3447,3451,3455,3459],{"type":45,"tag":106,"props":3427,"children":3428},{"style":250},[3429],{"type":51,"value":253},{"type":45,"tag":106,"props":3431,"children":3432},{"style":129},[3433],{"type":51,"value":3434}," activeUserPosts ",{"type":45,"tag":106,"props":3436,"children":3437},{"style":119},[3438],{"type":51,"value":263},{"type":45,"tag":106,"props":3440,"children":3441},{"style":266},[3442],{"type":51,"value":269},{"type":45,"tag":106,"props":3444,"children":3445},{"style":129},[3446],{"type":51,"value":274},{"type":45,"tag":106,"props":3448,"children":3449},{"style":119},[3450],{"type":51,"value":274},{"type":45,"tag":106,"props":3452,"children":3453},{"style":281},[3454],{"type":51,"value":284},{"type":45,"tag":106,"props":3456,"children":3457},{"style":119},[3458],{"type":51,"value":289},{"type":45,"tag":106,"props":3460,"children":3461},{"style":250},[3462],{"type":51,"value":294},{"type":45,"tag":106,"props":3464,"children":3465},{"class":108,"line":219},[3466],{"type":45,"tag":106,"props":3467,"children":3468},{"style":129},[3469],{"type":51,"value":303},{"type":45,"tag":106,"props":3471,"children":3472},{"class":108,"line":229},[3473,3477,3481,3485,3489,3493,3497,3501,3505],{"type":45,"tag":106,"props":3474,"children":3475},{"style":119},[3476],{"type":51,"value":312},{"type":45,"tag":106,"props":3478,"children":3479},{"style":266},[3480],{"type":51,"value":317},{"type":45,"tag":106,"props":3482,"children":3483},{"style":129},[3484],{"type":51,"value":274},{"type":45,"tag":106,"props":3486,"children":3487},{"style":119},[3488],{"type":51,"value":326},{"type":45,"tag":106,"props":3490,"children":3491},{"style":329},[3492],{"type":51,"value":332},{"type":45,"tag":106,"props":3494,"children":3495},{"style":119},[3496],{"type":51,"value":337},{"type":45,"tag":106,"props":3498,"children":3499},{"style":129},[3500],{"type":51,"value":258},{"type":45,"tag":106,"props":3502,"children":3503},{"style":119},[3504],{"type":51,"value":185},{"type":45,"tag":106,"props":3506,"children":3507},{"style":129},[3508],{"type":51,"value":351},{"type":45,"tag":106,"props":3510,"children":3511},{"class":108,"line":237},[3512,3516,3520,3524,3528,3532,3536,3540,3544,3548,3552,3556,3560,3564],{"type":45,"tag":106,"props":3513,"children":3514},{"style":119},[3515],{"type":51,"value":312},{"type":45,"tag":106,"props":3517,"children":3518},{"style":266},[3519],{"type":51,"value":2235},{"type":45,"tag":106,"props":3521,"children":3522},{"style":129},[3523],{"type":51,"value":274},{"type":45,"tag":106,"props":3525,"children":3526},{"style":119},[3527],{"type":51,"value":326},{"type":45,"tag":106,"props":3529,"children":3530},{"style":329},[3531],{"type":51,"value":1953},{"type":45,"tag":106,"props":3533,"children":3534},{"style":119},[3535],{"type":51,"value":337},{"type":45,"tag":106,"props":3537,"children":3538},{"style":129},[3539],{"type":51,"value":1962},{"type":45,"tag":106,"props":3541,"children":3542},{"style":119},[3543],{"type":51,"value":1967},{"type":45,"tag":106,"props":3545,"children":3546},{"style":119},[3547],{"type":51,"value":1972},{"type":45,"tag":106,"props":3549,"children":3550},{"style":281},[3551],{"type":51,"value":332},{"type":45,"tag":106,"props":3553,"children":3554},{"style":119},[3555],{"type":51,"value":412},{"type":45,"tag":106,"props":3557,"children":3558},{"style":281},[3559],{"type":51,"value":1953},{"type":45,"tag":106,"props":3561,"children":3562},{"style":119},[3563],{"type":51,"value":382},{"type":45,"tag":106,"props":3565,"children":3566},{"style":250},[3567],{"type":51,"value":294},{"type":45,"tag":106,"props":3569,"children":3570},{"class":108,"line":246},[3571,3575,3579,3583,3587,3591,3595,3599,3603],{"type":45,"tag":106,"props":3572,"children":3573},{"style":266},[3574],{"type":51,"value":2000},{"type":45,"tag":106,"props":3576,"children":3577},{"style":129},[3578],{"type":51,"value":397},{"type":45,"tag":106,"props":3580,"children":3581},{"style":119},[3582],{"type":51,"value":402},{"type":45,"tag":106,"props":3584,"children":3585},{"style":129},[3586],{"type":51,"value":492},{"type":45,"tag":106,"props":3588,"children":3589},{"style":119},[3590],{"type":51,"value":412},{"type":45,"tag":106,"props":3592,"children":3593},{"style":129},[3594],{"type":51,"value":1953},{"type":45,"tag":106,"props":3596,"children":3597},{"style":119},[3598],{"type":51,"value":402},{"type":45,"tag":106,"props":3600,"children":3601},{"style":129},[3602],{"type":51,"value":2029},{"type":45,"tag":106,"props":3604,"children":3605},{"style":119},[3606],{"type":51,"value":137},{"type":45,"tag":106,"props":3608,"children":3609},{"class":108,"line":297},[3610],{"type":45,"tag":106,"props":3611,"children":3612},{"style":129},[3613],{"type":51,"value":2041},{"type":45,"tag":106,"props":3615,"children":3616},{"class":108,"line":306},[3617,3621,3625,3629,3633,3637,3641,3645,3649,3653,3657],{"type":45,"tag":106,"props":3618,"children":3619},{"style":119},[3620],{"type":51,"value":312},{"type":45,"tag":106,"props":3622,"children":3623},{"style":266},[3624],{"type":51,"value":436},{"type":45,"tag":106,"props":3626,"children":3627},{"style":129},[3628],{"type":51,"value":274},{"type":45,"tag":106,"props":3630,"children":3631},{"style":119},[3632],{"type":51,"value":373},{"type":45,"tag":106,"props":3634,"children":3635},{"style":281},[3636],{"type":51,"value":332},{"type":45,"tag":106,"props":3638,"children":3639},{"style":119},[3640],{"type":51,"value":412},{"type":45,"tag":106,"props":3642,"children":3643},{"style":281},[3644],{"type":51,"value":1953},{"type":45,"tag":106,"props":3646,"children":3647},{"style":119},[3648],{"type":51,"value":382},{"type":45,"tag":106,"props":3650,"children":3651},{"style":250},[3652],{"type":51,"value":387},{"type":45,"tag":106,"props":3654,"children":3655},{"style":129},[3656],{"type":51,"value":461},{"type":45,"tag":106,"props":3658,"children":3659},{"style":119},[3660],{"type":51,"value":466},{"type":45,"tag":106,"props":3662,"children":3663},{"class":108,"line":354},[3664,3668,3672,3676,3680,3684],{"type":45,"tag":106,"props":3665,"children":3666},{"style":329},[3667],{"type":51,"value":2096},{"type":45,"tag":106,"props":3669,"children":3670},{"style":119},[3671],{"type":51,"value":337},{"type":45,"tag":106,"props":3673,"children":3674},{"style":129},[3675],{"type":51,"value":332},{"type":45,"tag":106,"props":3677,"children":3678},{"style":119},[3679],{"type":51,"value":402},{"type":45,"tag":106,"props":3681,"children":3682},{"style":129},[3683],{"type":51,"value":522},{"type":45,"tag":106,"props":3685,"children":3686},{"style":119},[3687],{"type":51,"value":137},{"type":45,"tag":106,"props":3689,"children":3690},{"class":108,"line":426},[3691,3695,3699,3703,3707,3711],{"type":45,"tag":106,"props":3692,"children":3693},{"style":329},[3694],{"type":51,"value":2124},{"type":45,"tag":106,"props":3696,"children":3697},{"style":119},[3698],{"type":51,"value":337},{"type":45,"tag":106,"props":3700,"children":3701},{"style":129},[3702],{"type":51,"value":1953},{"type":45,"tag":106,"props":3704,"children":3705},{"style":119},[3706],{"type":51,"value":402},{"type":45,"tag":106,"props":3708,"children":3709},{"style":129},[3710],{"type":51,"value":2141},{"type":45,"tag":106,"props":3712,"children":3713},{"style":119},[3714],{"type":51,"value":137},{"type":45,"tag":106,"props":3716,"children":3717},{"class":108,"line":469},[3718,3722,3726],{"type":45,"tag":106,"props":3719,"children":3720},{"style":119},[3721],{"type":51,"value":565},{"type":45,"tag":106,"props":3723,"children":3724},{"style":129},[3725],{"type":51,"value":570},{"type":45,"tag":106,"props":3727,"children":3728},{"style":119},[3729],{"type":51,"value":137},{"type":45,"tag":106,"props":3731,"children":3732},{"class":108,"line":499},[3733],{"type":45,"tag":106,"props":3734,"children":3735},{"style":129},[3736],{"type":51,"value":351},{"type":45,"tag":58,"props":3738,"children":3739},{},[3740],{"type":51,"value":3741},"Create derived collections once at module scope and reuse them. Do not recreate on every render or navigation.",{"type":45,"tag":82,"props":3743,"children":3745},{"id":3744},"virtual-properties",[3746],{"type":51,"value":3747},"Virtual Properties",{"type":45,"tag":58,"props":3749,"children":3750},{},[3751],{"type":51,"value":3752},"Live query results include computed, read-only virtual properties on every row:",{"type":45,"tag":3754,"props":3755,"children":3756},"ul",{},[3757,3785,3810,3821],{"type":45,"tag":3758,"props":3759,"children":3760},"li",{},[3761,3767,3769,3775,3777,3783],{"type":45,"tag":102,"props":3762,"children":3764},{"className":3763},[],[3765],{"type":51,"value":3766},"$synced",{"type":51,"value":3768},": ",{"type":45,"tag":102,"props":3770,"children":3772},{"className":3771},[],[3773],{"type":51,"value":3774},"true",{"type":51,"value":3776}," when the row is confirmed by sync; ",{"type":45,"tag":102,"props":3778,"children":3780},{"className":3779},[],[3781],{"type":51,"value":3782},"false",{"type":51,"value":3784}," when it is still optimistic.",{"type":45,"tag":3758,"props":3786,"children":3787},{},[3788,3794,3795,3801,3803,3809],{"type":45,"tag":102,"props":3789,"children":3791},{"className":3790},[],[3792],{"type":51,"value":3793},"$origin",{"type":51,"value":3768},{"type":45,"tag":102,"props":3796,"children":3798},{"className":3797},[],[3799],{"type":51,"value":3800},"\"local\"",{"type":51,"value":3802}," if the last confirmed change came from this client, otherwise ",{"type":45,"tag":102,"props":3804,"children":3806},{"className":3805},[],[3807],{"type":51,"value":3808},"\"remote\"",{"type":51,"value":402},{"type":45,"tag":3758,"props":3811,"children":3812},{},[3813,3819],{"type":45,"tag":102,"props":3814,"children":3816},{"className":3815},[],[3817],{"type":51,"value":3818},"$key",{"type":51,"value":3820},": the row key for the result.",{"type":45,"tag":3758,"props":3822,"children":3823},{},[3824,3830],{"type":45,"tag":102,"props":3825,"children":3827},{"className":3826},[],[3828],{"type":51,"value":3829},"$collectionId",{"type":51,"value":3831},": the source collection ID.",{"type":45,"tag":58,"props":3833,"children":3834},{},[3835,3837,3842,3843,3848,3850,3855],{"type":51,"value":3836},"These props are added automatically and can be used in ",{"type":45,"tag":102,"props":3838,"children":3840},{"className":3839},[],[3841],{"type":51,"value":364},{"type":51,"value":1101},{"type":45,"tag":102,"props":3844,"children":3846},{"className":3845},[],[3847],{"type":51,"value":436},{"type":51,"value":3849},", and ",{"type":45,"tag":102,"props":3851,"children":3853},{"className":3852},[],[3854],{"type":51,"value":2482},{"type":51,"value":3856}," clauses. Do not persist them back to storage.",{"type":45,"tag":82,"props":3858,"children":3860},{"id":3859},"includes-subqueries-in-select",[3861],{"type":51,"value":3862},"Includes (Subqueries in Select)",{"type":45,"tag":58,"props":3864,"children":3865},{},[3866,3868,3874,3876,3881,3883,3888],{"type":51,"value":3867},"Embed a correlated subquery inside ",{"type":45,"tag":102,"props":3869,"children":3871},{"className":3870},[],[3872],{"type":51,"value":3873},"select()",{"type":51,"value":3875}," to produce hierarchical (nested) data. The subquery must contain a ",{"type":45,"tag":102,"props":3877,"children":3879},{"className":3878},[],[3880],{"type":51,"value":364},{"type":51,"value":3882}," with an ",{"type":45,"tag":102,"props":3884,"children":3886},{"className":3885},[],[3887],{"type":51,"value":1756},{"type":51,"value":3889}," that correlates a parent field with a child field. Three materialization modes are available.",{"type":45,"tag":1075,"props":3891,"children":3893},{"id":3892},"collection-includes-default",[3894],{"type":51,"value":3895},"Collection includes (default)",{"type":45,"tag":58,"props":3897,"children":3898},{},[3899,3901,3907],{"type":51,"value":3900},"Return a child ",{"type":45,"tag":102,"props":3902,"children":3904},{"className":3903},[],[3905],{"type":51,"value":3906},"Collection",{"type":51,"value":3908}," on each parent row:",{"type":45,"tag":94,"props":3910,"children":3912},{"className":96,"code":3911,"language":98,"meta":99,"style":99},"import { eq, createLiveQueryCollection } from '@tanstack\u002Fdb'\n\nconst projectsWithIssues = createLiveQueryCollection((q) =>\n  q.from({ p: projectsCollection }).select(({ p }) => ({\n    id: p.id,\n    name: p.name,\n    issues: q\n      .from({ i: issuesCollection })\n      .where(({ i }) => eq(i.projectId, p.id))\n      .select(({ i }) => ({\n        id: i.id,\n        title: i.title,\n      })),\n  })),\n)\n\n\u002F\u002F Each row's `issues` is a live Collection\nfor (const project of projectsWithIssues) {\n  console.log(project.name, project.issues.toArray)\n}\n",[3913],{"type":45,"tag":102,"props":3914,"children":3915},{"__ignoreMap":99},[3916,3959,3966,4006,4087,4115,4143,4160,4202,4268,4307,4335,4363,4379,4394,4401,4408,4416,4449,4512],{"type":45,"tag":106,"props":3917,"children":3918},{"class":108,"line":109},[3919,3923,3927,3931,3935,3939,3943,3947,3951,3955],{"type":45,"tag":106,"props":3920,"children":3921},{"style":113},[3922],{"type":51,"value":116},{"type":45,"tag":106,"props":3924,"children":3925},{"style":119},[3926],{"type":51,"value":1135},{"type":45,"tag":106,"props":3928,"children":3929},{"style":129},[3930],{"type":51,"value":392},{"type":45,"tag":106,"props":3932,"children":3933},{"style":119},[3934],{"type":51,"value":412},{"type":45,"tag":106,"props":3936,"children":3937},{"style":129},[3938],{"type":51,"value":269},{"type":45,"tag":106,"props":3940,"children":3941},{"style":119},[3942],{"type":51,"value":1198},{"type":45,"tag":106,"props":3944,"children":3945},{"style":113},[3946],{"type":51,"value":190},{"type":45,"tag":106,"props":3948,"children":3949},{"style":119},[3950],{"type":51,"value":195},{"type":45,"tag":106,"props":3952,"children":3953},{"style":198},[3954],{"type":51,"value":201},{"type":45,"tag":106,"props":3956,"children":3957},{"style":119},[3958],{"type":51,"value":206},{"type":45,"tag":106,"props":3960,"children":3961},{"class":108,"line":125},[3962],{"type":45,"tag":106,"props":3963,"children":3964},{"emptyLinePlaceholder":213},[3965],{"type":51,"value":216},{"type":45,"tag":106,"props":3967,"children":3968},{"class":108,"line":140},[3969,3973,3978,3982,3986,3990,3994,3998,4002],{"type":45,"tag":106,"props":3970,"children":3971},{"style":250},[3972],{"type":51,"value":253},{"type":45,"tag":106,"props":3974,"children":3975},{"style":129},[3976],{"type":51,"value":3977}," projectsWithIssues ",{"type":45,"tag":106,"props":3979,"children":3980},{"style":119},[3981],{"type":51,"value":263},{"type":45,"tag":106,"props":3983,"children":3984},{"style":266},[3985],{"type":51,"value":269},{"type":45,"tag":106,"props":3987,"children":3988},{"style":129},[3989],{"type":51,"value":274},{"type":45,"tag":106,"props":3991,"children":3992},{"style":119},[3993],{"type":51,"value":274},{"type":45,"tag":106,"props":3995,"children":3996},{"style":281},[3997],{"type":51,"value":284},{"type":45,"tag":106,"props":3999,"children":4000},{"style":119},[4001],{"type":51,"value":289},{"type":45,"tag":106,"props":4003,"children":4004},{"style":250},[4005],{"type":51,"value":294},{"type":45,"tag":106,"props":4007,"children":4008},{"class":108,"line":153},[4009,4013,4017,4021,4025,4029,4034,4038,4043,4047,4051,4055,4059,4063,4067,4071,4075,4079,4083],{"type":45,"tag":106,"props":4010,"children":4011},{"style":129},[4012],{"type":51,"value":3072},{"type":45,"tag":106,"props":4014,"children":4015},{"style":119},[4016],{"type":51,"value":402},{"type":45,"tag":106,"props":4018,"children":4019},{"style":266},[4020],{"type":51,"value":317},{"type":45,"tag":106,"props":4022,"children":4023},{"style":129},[4024],{"type":51,"value":274},{"type":45,"tag":106,"props":4026,"children":4027},{"style":119},[4028],{"type":51,"value":326},{"type":45,"tag":106,"props":4030,"children":4031},{"style":329},[4032],{"type":51,"value":4033}," p",{"type":45,"tag":106,"props":4035,"children":4036},{"style":119},[4037],{"type":51,"value":337},{"type":45,"tag":106,"props":4039,"children":4040},{"style":129},[4041],{"type":51,"value":4042}," projectsCollection ",{"type":45,"tag":106,"props":4044,"children":4045},{"style":119},[4046],{"type":51,"value":185},{"type":45,"tag":106,"props":4048,"children":4049},{"style":129},[4050],{"type":51,"value":289},{"type":45,"tag":106,"props":4052,"children":4053},{"style":119},[4054],{"type":51,"value":402},{"type":45,"tag":106,"props":4056,"children":4057},{"style":266},[4058],{"type":51,"value":436},{"type":45,"tag":106,"props":4060,"children":4061},{"style":129},[4062],{"type":51,"value":274},{"type":45,"tag":106,"props":4064,"children":4065},{"style":119},[4066],{"type":51,"value":373},{"type":45,"tag":106,"props":4068,"children":4069},{"style":281},[4070],{"type":51,"value":4033},{"type":45,"tag":106,"props":4072,"children":4073},{"style":119},[4074],{"type":51,"value":382},{"type":45,"tag":106,"props":4076,"children":4077},{"style":250},[4078],{"type":51,"value":387},{"type":45,"tag":106,"props":4080,"children":4081},{"style":129},[4082],{"type":51,"value":461},{"type":45,"tag":106,"props":4084,"children":4085},{"style":119},[4086],{"type":51,"value":466},{"type":45,"tag":106,"props":4088,"children":4089},{"class":108,"line":166},[4090,4095,4099,4103,4107,4111],{"type":45,"tag":106,"props":4091,"children":4092},{"style":329},[4093],{"type":51,"value":4094},"    id",{"type":45,"tag":106,"props":4096,"children":4097},{"style":119},[4098],{"type":51,"value":337},{"type":45,"tag":106,"props":4100,"children":4101},{"style":129},[4102],{"type":51,"value":4033},{"type":45,"tag":106,"props":4104,"children":4105},{"style":119},[4106],{"type":51,"value":402},{"type":45,"tag":106,"props":4108,"children":4109},{"style":129},[4110],{"type":51,"value":492},{"type":45,"tag":106,"props":4112,"children":4113},{"style":119},[4114],{"type":51,"value":137},{"type":45,"tag":106,"props":4116,"children":4117},{"class":108,"line":179},[4118,4123,4127,4131,4135,4139],{"type":45,"tag":106,"props":4119,"children":4120},{"style":329},[4121],{"type":51,"value":4122},"    name",{"type":45,"tag":106,"props":4124,"children":4125},{"style":119},[4126],{"type":51,"value":337},{"type":45,"tag":106,"props":4128,"children":4129},{"style":129},[4130],{"type":51,"value":4033},{"type":45,"tag":106,"props":4132,"children":4133},{"style":119},[4134],{"type":51,"value":402},{"type":45,"tag":106,"props":4136,"children":4137},{"style":129},[4138],{"type":51,"value":522},{"type":45,"tag":106,"props":4140,"children":4141},{"style":119},[4142],{"type":51,"value":137},{"type":45,"tag":106,"props":4144,"children":4145},{"class":108,"line":209},[4146,4151,4155],{"type":45,"tag":106,"props":4147,"children":4148},{"style":329},[4149],{"type":51,"value":4150},"    issues",{"type":45,"tag":106,"props":4152,"children":4153},{"style":119},[4154],{"type":51,"value":337},{"type":45,"tag":106,"props":4156,"children":4157},{"style":129},[4158],{"type":51,"value":4159}," q\n",{"type":45,"tag":106,"props":4161,"children":4162},{"class":108,"line":219},[4163,4168,4172,4176,4180,4185,4189,4194,4198],{"type":45,"tag":106,"props":4164,"children":4165},{"style":119},[4166],{"type":51,"value":4167},"      .",{"type":45,"tag":106,"props":4169,"children":4170},{"style":266},[4171],{"type":51,"value":317},{"type":45,"tag":106,"props":4173,"children":4174},{"style":129},[4175],{"type":51,"value":274},{"type":45,"tag":106,"props":4177,"children":4178},{"style":119},[4179],{"type":51,"value":326},{"type":45,"tag":106,"props":4181,"children":4182},{"style":329},[4183],{"type":51,"value":4184}," i",{"type":45,"tag":106,"props":4186,"children":4187},{"style":119},[4188],{"type":51,"value":337},{"type":45,"tag":106,"props":4190,"children":4191},{"style":129},[4192],{"type":51,"value":4193}," issuesCollection ",{"type":45,"tag":106,"props":4195,"children":4196},{"style":119},[4197],{"type":51,"value":185},{"type":45,"tag":106,"props":4199,"children":4200},{"style":129},[4201],{"type":51,"value":351},{"type":45,"tag":106,"props":4203,"children":4204},{"class":108,"line":229},[4205,4209,4213,4217,4221,4225,4229,4233,4237,4242,4246,4251,4255,4259,4263],{"type":45,"tag":106,"props":4206,"children":4207},{"style":119},[4208],{"type":51,"value":4167},{"type":45,"tag":106,"props":4210,"children":4211},{"style":266},[4212],{"type":51,"value":364},{"type":45,"tag":106,"props":4214,"children":4215},{"style":129},[4216],{"type":51,"value":274},{"type":45,"tag":106,"props":4218,"children":4219},{"style":119},[4220],{"type":51,"value":373},{"type":45,"tag":106,"props":4222,"children":4223},{"style":281},[4224],{"type":51,"value":4184},{"type":45,"tag":106,"props":4226,"children":4227},{"style":119},[4228],{"type":51,"value":382},{"type":45,"tag":106,"props":4230,"children":4231},{"style":250},[4232],{"type":51,"value":387},{"type":45,"tag":106,"props":4234,"children":4235},{"style":266},[4236],{"type":51,"value":392},{"type":45,"tag":106,"props":4238,"children":4239},{"style":129},[4240],{"type":51,"value":4241},"(i",{"type":45,"tag":106,"props":4243,"children":4244},{"style":119},[4245],{"type":51,"value":402},{"type":45,"tag":106,"props":4247,"children":4248},{"style":129},[4249],{"type":51,"value":4250},"projectId",{"type":45,"tag":106,"props":4252,"children":4253},{"style":119},[4254],{"type":51,"value":412},{"type":45,"tag":106,"props":4256,"children":4257},{"style":129},[4258],{"type":51,"value":4033},{"type":45,"tag":106,"props":4260,"children":4261},{"style":119},[4262],{"type":51,"value":402},{"type":45,"tag":106,"props":4264,"children":4265},{"style":129},[4266],{"type":51,"value":4267},"id))\n",{"type":45,"tag":106,"props":4269,"children":4270},{"class":108,"line":237},[4271,4275,4279,4283,4287,4291,4295,4299,4303],{"type":45,"tag":106,"props":4272,"children":4273},{"style":119},[4274],{"type":51,"value":4167},{"type":45,"tag":106,"props":4276,"children":4277},{"style":266},[4278],{"type":51,"value":436},{"type":45,"tag":106,"props":4280,"children":4281},{"style":129},[4282],{"type":51,"value":274},{"type":45,"tag":106,"props":4284,"children":4285},{"style":119},[4286],{"type":51,"value":373},{"type":45,"tag":106,"props":4288,"children":4289},{"style":281},[4290],{"type":51,"value":4184},{"type":45,"tag":106,"props":4292,"children":4293},{"style":119},[4294],{"type":51,"value":382},{"type":45,"tag":106,"props":4296,"children":4297},{"style":250},[4298],{"type":51,"value":387},{"type":45,"tag":106,"props":4300,"children":4301},{"style":129},[4302],{"type":51,"value":461},{"type":45,"tag":106,"props":4304,"children":4305},{"style":119},[4306],{"type":51,"value":466},{"type":45,"tag":106,"props":4308,"children":4309},{"class":108,"line":246},[4310,4315,4319,4323,4327,4331],{"type":45,"tag":106,"props":4311,"children":4312},{"style":329},[4313],{"type":51,"value":4314},"        id",{"type":45,"tag":106,"props":4316,"children":4317},{"style":119},[4318],{"type":51,"value":337},{"type":45,"tag":106,"props":4320,"children":4321},{"style":129},[4322],{"type":51,"value":4184},{"type":45,"tag":106,"props":4324,"children":4325},{"style":119},[4326],{"type":51,"value":402},{"type":45,"tag":106,"props":4328,"children":4329},{"style":129},[4330],{"type":51,"value":492},{"type":45,"tag":106,"props":4332,"children":4333},{"style":119},[4334],{"type":51,"value":137},{"type":45,"tag":106,"props":4336,"children":4337},{"class":108,"line":297},[4338,4343,4347,4351,4355,4359],{"type":45,"tag":106,"props":4339,"children":4340},{"style":329},[4341],{"type":51,"value":4342},"        title",{"type":45,"tag":106,"props":4344,"children":4345},{"style":119},[4346],{"type":51,"value":337},{"type":45,"tag":106,"props":4348,"children":4349},{"style":129},[4350],{"type":51,"value":4184},{"type":45,"tag":106,"props":4352,"children":4353},{"style":119},[4354],{"type":51,"value":402},{"type":45,"tag":106,"props":4356,"children":4357},{"style":129},[4358],{"type":51,"value":2141},{"type":45,"tag":106,"props":4360,"children":4361},{"style":119},[4362],{"type":51,"value":137},{"type":45,"tag":106,"props":4364,"children":4365},{"class":108,"line":306},[4366,4371,4375],{"type":45,"tag":106,"props":4367,"children":4368},{"style":119},[4369],{"type":51,"value":4370},"      }",{"type":45,"tag":106,"props":4372,"children":4373},{"style":129},[4374],{"type":51,"value":570},{"type":45,"tag":106,"props":4376,"children":4377},{"style":119},[4378],{"type":51,"value":137},{"type":45,"tag":106,"props":4380,"children":4381},{"class":108,"line":354},[4382,4386,4390],{"type":45,"tag":106,"props":4383,"children":4384},{"style":119},[4385],{"type":51,"value":951},{"type":45,"tag":106,"props":4387,"children":4388},{"style":129},[4389],{"type":51,"value":570},{"type":45,"tag":106,"props":4391,"children":4392},{"style":119},[4393],{"type":51,"value":137},{"type":45,"tag":106,"props":4395,"children":4396},{"class":108,"line":426},[4397],{"type":45,"tag":106,"props":4398,"children":4399},{"style":129},[4400],{"type":51,"value":351},{"type":45,"tag":106,"props":4402,"children":4403},{"class":108,"line":469},[4404],{"type":45,"tag":106,"props":4405,"children":4406},{"emptyLinePlaceholder":213},[4407],{"type":51,"value":216},{"type":45,"tag":106,"props":4409,"children":4410},{"class":108,"line":499},[4411],{"type":45,"tag":106,"props":4412,"children":4413},{"style":223},[4414],{"type":51,"value":4415},"\u002F\u002F Each row's `issues` is a live Collection\n",{"type":45,"tag":106,"props":4417,"children":4418},{"class":108,"line":529},[4419,4423,4427,4431,4436,4440,4445],{"type":45,"tag":106,"props":4420,"children":4421},{"style":113},[4422],{"type":51,"value":993},{"type":45,"tag":106,"props":4424,"children":4425},{"style":129},[4426],{"type":51,"value":461},{"type":45,"tag":106,"props":4428,"children":4429},{"style":250},[4430],{"type":51,"value":253},{"type":45,"tag":106,"props":4432,"children":4433},{"style":129},[4434],{"type":51,"value":4435}," project ",{"type":45,"tag":106,"props":4437,"children":4438},{"style":119},[4439],{"type":51,"value":1011},{"type":45,"tag":106,"props":4441,"children":4442},{"style":129},[4443],{"type":51,"value":4444}," projectsWithIssues) ",{"type":45,"tag":106,"props":4446,"children":4447},{"style":119},[4448],{"type":51,"value":466},{"type":45,"tag":106,"props":4450,"children":4451},{"class":108,"line":559},[4452,4456,4460,4464,4468,4473,4477,4481,4485,4490,4494,4499,4503,4508],{"type":45,"tag":106,"props":4453,"children":4454},{"style":129},[4455],{"type":51,"value":1029},{"type":45,"tag":106,"props":4457,"children":4458},{"style":119},[4459],{"type":51,"value":402},{"type":45,"tag":106,"props":4461,"children":4462},{"style":266},[4463],{"type":51,"value":1038},{"type":45,"tag":106,"props":4465,"children":4466},{"style":329},[4467],{"type":51,"value":274},{"type":45,"tag":106,"props":4469,"children":4470},{"style":129},[4471],{"type":51,"value":4472},"project",{"type":45,"tag":106,"props":4474,"children":4475},{"style":119},[4476],{"type":51,"value":402},{"type":45,"tag":106,"props":4478,"children":4479},{"style":129},[4480],{"type":51,"value":522},{"type":45,"tag":106,"props":4482,"children":4483},{"style":119},[4484],{"type":51,"value":412},{"type":45,"tag":106,"props":4486,"children":4487},{"style":129},[4488],{"type":51,"value":4489}," project",{"type":45,"tag":106,"props":4491,"children":4492},{"style":119},[4493],{"type":51,"value":402},{"type":45,"tag":106,"props":4495,"children":4496},{"style":129},[4497],{"type":51,"value":4498},"issues",{"type":45,"tag":106,"props":4500,"children":4501},{"style":119},[4502],{"type":51,"value":402},{"type":45,"tag":106,"props":4504,"children":4505},{"style":129},[4506],{"type":51,"value":4507},"toArray",{"type":45,"tag":106,"props":4509,"children":4510},{"style":329},[4511],{"type":51,"value":351},{"type":45,"tag":106,"props":4513,"children":4514},{"class":108,"line":577},[4515],{"type":45,"tag":106,"props":4516,"children":4517},{"style":119},[4518],{"type":51,"value":1067},{"type":45,"tag":1075,"props":4520,"children":4522},{"id":4521},"array-includes-with-toarray",[4523],{"type":51,"value":4524},"Array includes with toArray()",{"type":45,"tag":58,"props":4526,"children":4527},{},[4528,4530,4536],{"type":51,"value":4529},"Wrap the subquery in ",{"type":45,"tag":102,"props":4531,"children":4533},{"className":4532},[],[4534],{"type":51,"value":4535},"toArray()",{"type":51,"value":4537}," to get a plain array of scalar values instead of a Collection:",{"type":45,"tag":94,"props":4539,"children":4541},{"className":96,"code":4540,"language":98,"meta":99,"style":99},"import { eq, toArray, createLiveQueryCollection } from '@tanstack\u002Fdb'\n\nconst messagesWithParts = createLiveQueryCollection((q) =>\n  q.from({ m: messagesCollection }).select(({ m }) => ({\n    id: m.id,\n    contentParts: toArray(\n      q\n        .from({ c: chunksCollection })\n        .where(({ c }) => eq(c.messageId, m.id))\n        .orderBy(({ c }) => c.timestamp)\n        .select(({ c }) => c.text),\n    ),\n  })),\n)\n\u002F\u002F row.contentParts is string[]\n",[4542],{"type":45,"tag":102,"props":4543,"children":4544},{"__ignoreMap":99},[4545,4597,4604,4644,4725,4752,4772,4779,4820,4885,4929,4977,4988,5003,5010],{"type":45,"tag":106,"props":4546,"children":4547},{"class":108,"line":109},[4548,4552,4556,4560,4564,4569,4573,4577,4581,4585,4589,4593],{"type":45,"tag":106,"props":4549,"children":4550},{"style":113},[4551],{"type":51,"value":116},{"type":45,"tag":106,"props":4553,"children":4554},{"style":119},[4555],{"type":51,"value":1135},{"type":45,"tag":106,"props":4557,"children":4558},{"style":129},[4559],{"type":51,"value":392},{"type":45,"tag":106,"props":4561,"children":4562},{"style":119},[4563],{"type":51,"value":412},{"type":45,"tag":106,"props":4565,"children":4566},{"style":129},[4567],{"type":51,"value":4568}," toArray",{"type":45,"tag":106,"props":4570,"children":4571},{"style":119},[4572],{"type":51,"value":412},{"type":45,"tag":106,"props":4574,"children":4575},{"style":129},[4576],{"type":51,"value":269},{"type":45,"tag":106,"props":4578,"children":4579},{"style":119},[4580],{"type":51,"value":1198},{"type":45,"tag":106,"props":4582,"children":4583},{"style":113},[4584],{"type":51,"value":190},{"type":45,"tag":106,"props":4586,"children":4587},{"style":119},[4588],{"type":51,"value":195},{"type":45,"tag":106,"props":4590,"children":4591},{"style":198},[4592],{"type":51,"value":201},{"type":45,"tag":106,"props":4594,"children":4595},{"style":119},[4596],{"type":51,"value":206},{"type":45,"tag":106,"props":4598,"children":4599},{"class":108,"line":125},[4600],{"type":45,"tag":106,"props":4601,"children":4602},{"emptyLinePlaceholder":213},[4603],{"type":51,"value":216},{"type":45,"tag":106,"props":4605,"children":4606},{"class":108,"line":140},[4607,4611,4616,4620,4624,4628,4632,4636,4640],{"type":45,"tag":106,"props":4608,"children":4609},{"style":250},[4610],{"type":51,"value":253},{"type":45,"tag":106,"props":4612,"children":4613},{"style":129},[4614],{"type":51,"value":4615}," messagesWithParts ",{"type":45,"tag":106,"props":4617,"children":4618},{"style":119},[4619],{"type":51,"value":263},{"type":45,"tag":106,"props":4621,"children":4622},{"style":266},[4623],{"type":51,"value":269},{"type":45,"tag":106,"props":4625,"children":4626},{"style":129},[4627],{"type":51,"value":274},{"type":45,"tag":106,"props":4629,"children":4630},{"style":119},[4631],{"type":51,"value":274},{"type":45,"tag":106,"props":4633,"children":4634},{"style":281},[4635],{"type":51,"value":284},{"type":45,"tag":106,"props":4637,"children":4638},{"style":119},[4639],{"type":51,"value":289},{"type":45,"tag":106,"props":4641,"children":4642},{"style":250},[4643],{"type":51,"value":294},{"type":45,"tag":106,"props":4645,"children":4646},{"class":108,"line":153},[4647,4651,4655,4659,4663,4667,4672,4676,4681,4685,4689,4693,4697,4701,4705,4709,4713,4717,4721],{"type":45,"tag":106,"props":4648,"children":4649},{"style":129},[4650],{"type":51,"value":3072},{"type":45,"tag":106,"props":4652,"children":4653},{"style":119},[4654],{"type":51,"value":402},{"type":45,"tag":106,"props":4656,"children":4657},{"style":266},[4658],{"type":51,"value":317},{"type":45,"tag":106,"props":4660,"children":4661},{"style":129},[4662],{"type":51,"value":274},{"type":45,"tag":106,"props":4664,"children":4665},{"style":119},[4666],{"type":51,"value":326},{"type":45,"tag":106,"props":4668,"children":4669},{"style":329},[4670],{"type":51,"value":4671}," m",{"type":45,"tag":106,"props":4673,"children":4674},{"style":119},[4675],{"type":51,"value":337},{"type":45,"tag":106,"props":4677,"children":4678},{"style":129},[4679],{"type":51,"value":4680}," messagesCollection ",{"type":45,"tag":106,"props":4682,"children":4683},{"style":119},[4684],{"type":51,"value":185},{"type":45,"tag":106,"props":4686,"children":4687},{"style":129},[4688],{"type":51,"value":289},{"type":45,"tag":106,"props":4690,"children":4691},{"style":119},[4692],{"type":51,"value":402},{"type":45,"tag":106,"props":4694,"children":4695},{"style":266},[4696],{"type":51,"value":436},{"type":45,"tag":106,"props":4698,"children":4699},{"style":129},[4700],{"type":51,"value":274},{"type":45,"tag":106,"props":4702,"children":4703},{"style":119},[4704],{"type":51,"value":373},{"type":45,"tag":106,"props":4706,"children":4707},{"style":281},[4708],{"type":51,"value":4671},{"type":45,"tag":106,"props":4710,"children":4711},{"style":119},[4712],{"type":51,"value":382},{"type":45,"tag":106,"props":4714,"children":4715},{"style":250},[4716],{"type":51,"value":387},{"type":45,"tag":106,"props":4718,"children":4719},{"style":129},[4720],{"type":51,"value":461},{"type":45,"tag":106,"props":4722,"children":4723},{"style":119},[4724],{"type":51,"value":466},{"type":45,"tag":106,"props":4726,"children":4727},{"class":108,"line":166},[4728,4732,4736,4740,4744,4748],{"type":45,"tag":106,"props":4729,"children":4730},{"style":329},[4731],{"type":51,"value":4094},{"type":45,"tag":106,"props":4733,"children":4734},{"style":119},[4735],{"type":51,"value":337},{"type":45,"tag":106,"props":4737,"children":4738},{"style":129},[4739],{"type":51,"value":4671},{"type":45,"tag":106,"props":4741,"children":4742},{"style":119},[4743],{"type":51,"value":402},{"type":45,"tag":106,"props":4745,"children":4746},{"style":129},[4747],{"type":51,"value":492},{"type":45,"tag":106,"props":4749,"children":4750},{"style":119},[4751],{"type":51,"value":137},{"type":45,"tag":106,"props":4753,"children":4754},{"class":108,"line":179},[4755,4760,4764,4768],{"type":45,"tag":106,"props":4756,"children":4757},{"style":329},[4758],{"type":51,"value":4759},"    contentParts",{"type":45,"tag":106,"props":4761,"children":4762},{"style":119},[4763],{"type":51,"value":337},{"type":45,"tag":106,"props":4765,"children":4766},{"style":266},[4767],{"type":51,"value":4568},{"type":45,"tag":106,"props":4769,"children":4770},{"style":129},[4771],{"type":51,"value":626},{"type":45,"tag":106,"props":4773,"children":4774},{"class":108,"line":209},[4775],{"type":45,"tag":106,"props":4776,"children":4777},{"style":129},[4778],{"type":51,"value":680},{"type":45,"tag":106,"props":4780,"children":4781},{"class":108,"line":219},[4782,4786,4790,4794,4798,4803,4807,4812,4816],{"type":45,"tag":106,"props":4783,"children":4784},{"style":119},[4785],{"type":51,"value":689},{"type":45,"tag":106,"props":4787,"children":4788},{"style":266},[4789],{"type":51,"value":317},{"type":45,"tag":106,"props":4791,"children":4792},{"style":129},[4793],{"type":51,"value":274},{"type":45,"tag":106,"props":4795,"children":4796},{"style":119},[4797],{"type":51,"value":326},{"type":45,"tag":106,"props":4799,"children":4800},{"style":329},[4801],{"type":51,"value":4802}," c",{"type":45,"tag":106,"props":4804,"children":4805},{"style":119},[4806],{"type":51,"value":337},{"type":45,"tag":106,"props":4808,"children":4809},{"style":129},[4810],{"type":51,"value":4811}," chunksCollection ",{"type":45,"tag":106,"props":4813,"children":4814},{"style":119},[4815],{"type":51,"value":185},{"type":45,"tag":106,"props":4817,"children":4818},{"style":129},[4819],{"type":51,"value":351},{"type":45,"tag":106,"props":4821,"children":4822},{"class":108,"line":229},[4823,4827,4831,4835,4839,4843,4847,4851,4855,4860,4864,4869,4873,4877,4881],{"type":45,"tag":106,"props":4824,"children":4825},{"style":119},[4826],{"type":51,"value":689},{"type":45,"tag":106,"props":4828,"children":4829},{"style":266},[4830],{"type":51,"value":364},{"type":45,"tag":106,"props":4832,"children":4833},{"style":129},[4834],{"type":51,"value":274},{"type":45,"tag":106,"props":4836,"children":4837},{"style":119},[4838],{"type":51,"value":373},{"type":45,"tag":106,"props":4840,"children":4841},{"style":281},[4842],{"type":51,"value":4802},{"type":45,"tag":106,"props":4844,"children":4845},{"style":119},[4846],{"type":51,"value":382},{"type":45,"tag":106,"props":4848,"children":4849},{"style":250},[4850],{"type":51,"value":387},{"type":45,"tag":106,"props":4852,"children":4853},{"style":266},[4854],{"type":51,"value":392},{"type":45,"tag":106,"props":4856,"children":4857},{"style":129},[4858],{"type":51,"value":4859},"(c",{"type":45,"tag":106,"props":4861,"children":4862},{"style":119},[4863],{"type":51,"value":402},{"type":45,"tag":106,"props":4865,"children":4866},{"style":129},[4867],{"type":51,"value":4868},"messageId",{"type":45,"tag":106,"props":4870,"children":4871},{"style":119},[4872],{"type":51,"value":412},{"type":45,"tag":106,"props":4874,"children":4875},{"style":129},[4876],{"type":51,"value":4671},{"type":45,"tag":106,"props":4878,"children":4879},{"style":119},[4880],{"type":51,"value":402},{"type":45,"tag":106,"props":4882,"children":4883},{"style":129},[4884],{"type":51,"value":4267},{"type":45,"tag":106,"props":4886,"children":4887},{"class":108,"line":237},[4888,4892,4896,4900,4904,4908,4912,4916,4920,4924],{"type":45,"tag":106,"props":4889,"children":4890},{"style":119},[4891],{"type":51,"value":689},{"type":45,"tag":106,"props":4893,"children":4894},{"style":266},[4895],{"type":51,"value":2482},{"type":45,"tag":106,"props":4897,"children":4898},{"style":129},[4899],{"type":51,"value":274},{"type":45,"tag":106,"props":4901,"children":4902},{"style":119},[4903],{"type":51,"value":373},{"type":45,"tag":106,"props":4905,"children":4906},{"style":281},[4907],{"type":51,"value":4802},{"type":45,"tag":106,"props":4909,"children":4910},{"style":119},[4911],{"type":51,"value":382},{"type":45,"tag":106,"props":4913,"children":4914},{"style":250},[4915],{"type":51,"value":387},{"type":45,"tag":106,"props":4917,"children":4918},{"style":129},[4919],{"type":51,"value":4802},{"type":45,"tag":106,"props":4921,"children":4922},{"style":119},[4923],{"type":51,"value":402},{"type":45,"tag":106,"props":4925,"children":4926},{"style":129},[4927],{"type":51,"value":4928},"timestamp)\n",{"type":45,"tag":106,"props":4930,"children":4931},{"class":108,"line":246},[4932,4936,4940,4944,4948,4952,4956,4960,4964,4968,4973],{"type":45,"tag":106,"props":4933,"children":4934},{"style":119},[4935],{"type":51,"value":689},{"type":45,"tag":106,"props":4937,"children":4938},{"style":266},[4939],{"type":51,"value":436},{"type":45,"tag":106,"props":4941,"children":4942},{"style":129},[4943],{"type":51,"value":274},{"type":45,"tag":106,"props":4945,"children":4946},{"style":119},[4947],{"type":51,"value":373},{"type":45,"tag":106,"props":4949,"children":4950},{"style":281},[4951],{"type":51,"value":4802},{"type":45,"tag":106,"props":4953,"children":4954},{"style":119},[4955],{"type":51,"value":382},{"type":45,"tag":106,"props":4957,"children":4958},{"style":250},[4959],{"type":51,"value":387},{"type":45,"tag":106,"props":4961,"children":4962},{"style":129},[4963],{"type":51,"value":4802},{"type":45,"tag":106,"props":4965,"children":4966},{"style":119},[4967],{"type":51,"value":402},{"type":45,"tag":106,"props":4969,"children":4970},{"style":129},[4971],{"type":51,"value":4972},"text)",{"type":45,"tag":106,"props":4974,"children":4975},{"style":119},[4976],{"type":51,"value":137},{"type":45,"tag":106,"props":4978,"children":4979},{"class":108,"line":297},[4980,4984],{"type":45,"tag":106,"props":4981,"children":4982},{"style":129},[4983],{"type":51,"value":1607},{"type":45,"tag":106,"props":4985,"children":4986},{"style":119},[4987],{"type":51,"value":137},{"type":45,"tag":106,"props":4989,"children":4990},{"class":108,"line":306},[4991,4995,4999],{"type":45,"tag":106,"props":4992,"children":4993},{"style":119},[4994],{"type":51,"value":951},{"type":45,"tag":106,"props":4996,"children":4997},{"style":129},[4998],{"type":51,"value":570},{"type":45,"tag":106,"props":5000,"children":5001},{"style":119},[5002],{"type":51,"value":137},{"type":45,"tag":106,"props":5004,"children":5005},{"class":108,"line":354},[5006],{"type":45,"tag":106,"props":5007,"children":5008},{"style":129},[5009],{"type":51,"value":351},{"type":45,"tag":106,"props":5011,"children":5012},{"class":108,"line":426},[5013],{"type":45,"tag":106,"props":5014,"children":5015},{"style":223},[5016],{"type":51,"value":5017},"\u002F\u002F row.contentParts is string[]\n",{"type":45,"tag":1075,"props":5019,"children":5021},{"id":5020},"concatenated-scalar-with-concattoarray",[5022],{"type":51,"value":5023},"Concatenated scalar with concat(toArray())",{"type":45,"tag":58,"props":5025,"children":5026},{},[5027,5029,5034,5036,5042],{"type":51,"value":5028},"Wrap ",{"type":45,"tag":102,"props":5030,"children":5032},{"className":5031},[],[5033],{"type":51,"value":4535},{"type":51,"value":5035}," in ",{"type":45,"tag":102,"props":5037,"children":5039},{"className":5038},[],[5040],{"type":51,"value":5041},"concat()",{"type":51,"value":5043}," to join the scalar results into a single string:",{"type":45,"tag":94,"props":5045,"children":5047},{"className":96,"code":5046,"language":98,"meta":99,"style":99},"import { eq, toArray, concat, createLiveQueryCollection } from '@tanstack\u002Fdb'\n\nconst messagesWithContent = createLiveQueryCollection((q) =>\n  q.from({ m: messagesCollection }).select(({ m }) => ({\n    id: m.id,\n    content: concat(\n      toArray(\n        q\n          .from({ c: chunksCollection })\n          .where(({ c }) => eq(c.messageId, m.id))\n          .orderBy(({ c }) => c.timestamp)\n          .select(({ c }) => c.text),\n      ),\n    ),\n  })),\n)\n\u002F\u002F row.content is a single concatenated string\n",[5048],{"type":45,"tag":102,"props":5049,"children":5050},{"__ignoreMap":99},[5051,5111,5118,5158,5237,5264,5284,5296,5304,5344,5407,5450,5497,5508,5519,5534,5541],{"type":45,"tag":106,"props":5052,"children":5053},{"class":108,"line":109},[5054,5058,5062,5066,5070,5074,5078,5083,5087,5091,5095,5099,5103,5107],{"type":45,"tag":106,"props":5055,"children":5056},{"style":113},[5057],{"type":51,"value":116},{"type":45,"tag":106,"props":5059,"children":5060},{"style":119},[5061],{"type":51,"value":1135},{"type":45,"tag":106,"props":5063,"children":5064},{"style":129},[5065],{"type":51,"value":392},{"type":45,"tag":106,"props":5067,"children":5068},{"style":119},[5069],{"type":51,"value":412},{"type":45,"tag":106,"props":5071,"children":5072},{"style":129},[5073],{"type":51,"value":4568},{"type":45,"tag":106,"props":5075,"children":5076},{"style":119},[5077],{"type":51,"value":412},{"type":45,"tag":106,"props":5079,"children":5080},{"style":129},[5081],{"type":51,"value":5082}," concat",{"type":45,"tag":106,"props":5084,"children":5085},{"style":119},[5086],{"type":51,"value":412},{"type":45,"tag":106,"props":5088,"children":5089},{"style":129},[5090],{"type":51,"value":269},{"type":45,"tag":106,"props":5092,"children":5093},{"style":119},[5094],{"type":51,"value":1198},{"type":45,"tag":106,"props":5096,"children":5097},{"style":113},[5098],{"type":51,"value":190},{"type":45,"tag":106,"props":5100,"children":5101},{"style":119},[5102],{"type":51,"value":195},{"type":45,"tag":106,"props":5104,"children":5105},{"style":198},[5106],{"type":51,"value":201},{"type":45,"tag":106,"props":5108,"children":5109},{"style":119},[5110],{"type":51,"value":206},{"type":45,"tag":106,"props":5112,"children":5113},{"class":108,"line":125},[5114],{"type":45,"tag":106,"props":5115,"children":5116},{"emptyLinePlaceholder":213},[5117],{"type":51,"value":216},{"type":45,"tag":106,"props":5119,"children":5120},{"class":108,"line":140},[5121,5125,5130,5134,5138,5142,5146,5150,5154],{"type":45,"tag":106,"props":5122,"children":5123},{"style":250},[5124],{"type":51,"value":253},{"type":45,"tag":106,"props":5126,"children":5127},{"style":129},[5128],{"type":51,"value":5129}," messagesWithContent ",{"type":45,"tag":106,"props":5131,"children":5132},{"style":119},[5133],{"type":51,"value":263},{"type":45,"tag":106,"props":5135,"children":5136},{"style":266},[5137],{"type":51,"value":269},{"type":45,"tag":106,"props":5139,"children":5140},{"style":129},[5141],{"type":51,"value":274},{"type":45,"tag":106,"props":5143,"children":5144},{"style":119},[5145],{"type":51,"value":274},{"type":45,"tag":106,"props":5147,"children":5148},{"style":281},[5149],{"type":51,"value":284},{"type":45,"tag":106,"props":5151,"children":5152},{"style":119},[5153],{"type":51,"value":289},{"type":45,"tag":106,"props":5155,"children":5156},{"style":250},[5157],{"type":51,"value":294},{"type":45,"tag":106,"props":5159,"children":5160},{"class":108,"line":153},[5161,5165,5169,5173,5177,5181,5185,5189,5193,5197,5201,5205,5209,5213,5217,5221,5225,5229,5233],{"type":45,"tag":106,"props":5162,"children":5163},{"style":129},[5164],{"type":51,"value":3072},{"type":45,"tag":106,"props":5166,"children":5167},{"style":119},[5168],{"type":51,"value":402},{"type":45,"tag":106,"props":5170,"children":5171},{"style":266},[5172],{"type":51,"value":317},{"type":45,"tag":106,"props":5174,"children":5175},{"style":129},[5176],{"type":51,"value":274},{"type":45,"tag":106,"props":5178,"children":5179},{"style":119},[5180],{"type":51,"value":326},{"type":45,"tag":106,"props":5182,"children":5183},{"style":329},[5184],{"type":51,"value":4671},{"type":45,"tag":106,"props":5186,"children":5187},{"style":119},[5188],{"type":51,"value":337},{"type":45,"tag":106,"props":5190,"children":5191},{"style":129},[5192],{"type":51,"value":4680},{"type":45,"tag":106,"props":5194,"children":5195},{"style":119},[5196],{"type":51,"value":185},{"type":45,"tag":106,"props":5198,"children":5199},{"style":129},[5200],{"type":51,"value":289},{"type":45,"tag":106,"props":5202,"children":5203},{"style":119},[5204],{"type":51,"value":402},{"type":45,"tag":106,"props":5206,"children":5207},{"style":266},[5208],{"type":51,"value":436},{"type":45,"tag":106,"props":5210,"children":5211},{"style":129},[5212],{"type":51,"value":274},{"type":45,"tag":106,"props":5214,"children":5215},{"style":119},[5216],{"type":51,"value":373},{"type":45,"tag":106,"props":5218,"children":5219},{"style":281},[5220],{"type":51,"value":4671},{"type":45,"tag":106,"props":5222,"children":5223},{"style":119},[5224],{"type":51,"value":382},{"type":45,"tag":106,"props":5226,"children":5227},{"style":250},[5228],{"type":51,"value":387},{"type":45,"tag":106,"props":5230,"children":5231},{"style":129},[5232],{"type":51,"value":461},{"type":45,"tag":106,"props":5234,"children":5235},{"style":119},[5236],{"type":51,"value":466},{"type":45,"tag":106,"props":5238,"children":5239},{"class":108,"line":166},[5240,5244,5248,5252,5256,5260],{"type":45,"tag":106,"props":5241,"children":5242},{"style":329},[5243],{"type":51,"value":4094},{"type":45,"tag":106,"props":5245,"children":5246},{"style":119},[5247],{"type":51,"value":337},{"type":45,"tag":106,"props":5249,"children":5250},{"style":129},[5251],{"type":51,"value":4671},{"type":45,"tag":106,"props":5253,"children":5254},{"style":119},[5255],{"type":51,"value":402},{"type":45,"tag":106,"props":5257,"children":5258},{"style":129},[5259],{"type":51,"value":492},{"type":45,"tag":106,"props":5261,"children":5262},{"style":119},[5263],{"type":51,"value":137},{"type":45,"tag":106,"props":5265,"children":5266},{"class":108,"line":179},[5267,5272,5276,5280],{"type":45,"tag":106,"props":5268,"children":5269},{"style":329},[5270],{"type":51,"value":5271},"    content",{"type":45,"tag":106,"props":5273,"children":5274},{"style":119},[5275],{"type":51,"value":337},{"type":45,"tag":106,"props":5277,"children":5278},{"style":266},[5279],{"type":51,"value":5082},{"type":45,"tag":106,"props":5281,"children":5282},{"style":129},[5283],{"type":51,"value":626},{"type":45,"tag":106,"props":5285,"children":5286},{"class":108,"line":209},[5287,5292],{"type":45,"tag":106,"props":5288,"children":5289},{"style":266},[5290],{"type":51,"value":5291},"      toArray",{"type":45,"tag":106,"props":5293,"children":5294},{"style":129},[5295],{"type":51,"value":626},{"type":45,"tag":106,"props":5297,"children":5298},{"class":108,"line":219},[5299],{"type":45,"tag":106,"props":5300,"children":5301},{"style":129},[5302],{"type":51,"value":5303},"        q\n",{"type":45,"tag":106,"props":5305,"children":5306},{"class":108,"line":229},[5307,5312,5316,5320,5324,5328,5332,5336,5340],{"type":45,"tag":106,"props":5308,"children":5309},{"style":119},[5310],{"type":51,"value":5311},"          .",{"type":45,"tag":106,"props":5313,"children":5314},{"style":266},[5315],{"type":51,"value":317},{"type":45,"tag":106,"props":5317,"children":5318},{"style":129},[5319],{"type":51,"value":274},{"type":45,"tag":106,"props":5321,"children":5322},{"style":119},[5323],{"type":51,"value":326},{"type":45,"tag":106,"props":5325,"children":5326},{"style":329},[5327],{"type":51,"value":4802},{"type":45,"tag":106,"props":5329,"children":5330},{"style":119},[5331],{"type":51,"value":337},{"type":45,"tag":106,"props":5333,"children":5334},{"style":129},[5335],{"type":51,"value":4811},{"type":45,"tag":106,"props":5337,"children":5338},{"style":119},[5339],{"type":51,"value":185},{"type":45,"tag":106,"props":5341,"children":5342},{"style":129},[5343],{"type":51,"value":351},{"type":45,"tag":106,"props":5345,"children":5346},{"class":108,"line":237},[5347,5351,5355,5359,5363,5367,5371,5375,5379,5383,5387,5391,5395,5399,5403],{"type":45,"tag":106,"props":5348,"children":5349},{"style":119},[5350],{"type":51,"value":5311},{"type":45,"tag":106,"props":5352,"children":5353},{"style":266},[5354],{"type":51,"value":364},{"type":45,"tag":106,"props":5356,"children":5357},{"style":129},[5358],{"type":51,"value":274},{"type":45,"tag":106,"props":5360,"children":5361},{"style":119},[5362],{"type":51,"value":373},{"type":45,"tag":106,"props":5364,"children":5365},{"style":281},[5366],{"type":51,"value":4802},{"type":45,"tag":106,"props":5368,"children":5369},{"style":119},[5370],{"type":51,"value":382},{"type":45,"tag":106,"props":5372,"children":5373},{"style":250},[5374],{"type":51,"value":387},{"type":45,"tag":106,"props":5376,"children":5377},{"style":266},[5378],{"type":51,"value":392},{"type":45,"tag":106,"props":5380,"children":5381},{"style":129},[5382],{"type":51,"value":4859},{"type":45,"tag":106,"props":5384,"children":5385},{"style":119},[5386],{"type":51,"value":402},{"type":45,"tag":106,"props":5388,"children":5389},{"style":129},[5390],{"type":51,"value":4868},{"type":45,"tag":106,"props":5392,"children":5393},{"style":119},[5394],{"type":51,"value":412},{"type":45,"tag":106,"props":5396,"children":5397},{"style":129},[5398],{"type":51,"value":4671},{"type":45,"tag":106,"props":5400,"children":5401},{"style":119},[5402],{"type":51,"value":402},{"type":45,"tag":106,"props":5404,"children":5405},{"style":129},[5406],{"type":51,"value":4267},{"type":45,"tag":106,"props":5408,"children":5409},{"class":108,"line":246},[5410,5414,5418,5422,5426,5430,5434,5438,5442,5446],{"type":45,"tag":106,"props":5411,"children":5412},{"style":119},[5413],{"type":51,"value":5311},{"type":45,"tag":106,"props":5415,"children":5416},{"style":266},[5417],{"type":51,"value":2482},{"type":45,"tag":106,"props":5419,"children":5420},{"style":129},[5421],{"type":51,"value":274},{"type":45,"tag":106,"props":5423,"children":5424},{"style":119},[5425],{"type":51,"value":373},{"type":45,"tag":106,"props":5427,"children":5428},{"style":281},[5429],{"type":51,"value":4802},{"type":45,"tag":106,"props":5431,"children":5432},{"style":119},[5433],{"type":51,"value":382},{"type":45,"tag":106,"props":5435,"children":5436},{"style":250},[5437],{"type":51,"value":387},{"type":45,"tag":106,"props":5439,"children":5440},{"style":129},[5441],{"type":51,"value":4802},{"type":45,"tag":106,"props":5443,"children":5444},{"style":119},[5445],{"type":51,"value":402},{"type":45,"tag":106,"props":5447,"children":5448},{"style":129},[5449],{"type":51,"value":4928},{"type":45,"tag":106,"props":5451,"children":5452},{"class":108,"line":297},[5453,5457,5461,5465,5469,5473,5477,5481,5485,5489,5493],{"type":45,"tag":106,"props":5454,"children":5455},{"style":119},[5456],{"type":51,"value":5311},{"type":45,"tag":106,"props":5458,"children":5459},{"style":266},[5460],{"type":51,"value":436},{"type":45,"tag":106,"props":5462,"children":5463},{"style":129},[5464],{"type":51,"value":274},{"type":45,"tag":106,"props":5466,"children":5467},{"style":119},[5468],{"type":51,"value":373},{"type":45,"tag":106,"props":5470,"children":5471},{"style":281},[5472],{"type":51,"value":4802},{"type":45,"tag":106,"props":5474,"children":5475},{"style":119},[5476],{"type":51,"value":382},{"type":45,"tag":106,"props":5478,"children":5479},{"style":250},[5480],{"type":51,"value":387},{"type":45,"tag":106,"props":5482,"children":5483},{"style":129},[5484],{"type":51,"value":4802},{"type":45,"tag":106,"props":5486,"children":5487},{"style":119},[5488],{"type":51,"value":402},{"type":45,"tag":106,"props":5490,"children":5491},{"style":129},[5492],{"type":51,"value":4972},{"type":45,"tag":106,"props":5494,"children":5495},{"style":119},[5496],{"type":51,"value":137},{"type":45,"tag":106,"props":5498,"children":5499},{"class":108,"line":306},[5500,5504],{"type":45,"tag":106,"props":5501,"children":5502},{"style":129},[5503],{"type":51,"value":1595},{"type":45,"tag":106,"props":5505,"children":5506},{"style":119},[5507],{"type":51,"value":137},{"type":45,"tag":106,"props":5509,"children":5510},{"class":108,"line":354},[5511,5515],{"type":45,"tag":106,"props":5512,"children":5513},{"style":129},[5514],{"type":51,"value":1607},{"type":45,"tag":106,"props":5516,"children":5517},{"style":119},[5518],{"type":51,"value":137},{"type":45,"tag":106,"props":5520,"children":5521},{"class":108,"line":426},[5522,5526,5530],{"type":45,"tag":106,"props":5523,"children":5524},{"style":119},[5525],{"type":51,"value":951},{"type":45,"tag":106,"props":5527,"children":5528},{"style":129},[5529],{"type":51,"value":570},{"type":45,"tag":106,"props":5531,"children":5532},{"style":119},[5533],{"type":51,"value":137},{"type":45,"tag":106,"props":5535,"children":5536},{"class":108,"line":469},[5537],{"type":45,"tag":106,"props":5538,"children":5539},{"style":129},[5540],{"type":51,"value":351},{"type":45,"tag":106,"props":5542,"children":5543},{"class":108,"line":499},[5544],{"type":45,"tag":106,"props":5545,"children":5546},{"style":223},[5547],{"type":51,"value":5548},"\u002F\u002F row.content is a single concatenated string\n",{"type":45,"tag":1075,"props":5550,"children":5552},{"id":5551},"includes-rules",[5553],{"type":51,"value":5554},"Includes rules",{"type":45,"tag":3754,"props":5556,"children":5557},{},[5558,5583,5624,5649,5666],{"type":45,"tag":3758,"props":5559,"children":5560},{},[5561,5563,5567,5569,5574,5576,5581],{"type":51,"value":5562},"The subquery ",{"type":45,"tag":69,"props":5564,"children":5565},{},[5566],{"type":51,"value":1748},{"type":51,"value":5568}," have a ",{"type":45,"tag":102,"props":5570,"children":5572},{"className":5571},[],[5573],{"type":51,"value":364},{"type":51,"value":5575}," clause with an ",{"type":45,"tag":102,"props":5577,"children":5579},{"className":5578},[],[5580],{"type":51,"value":1756},{"type":51,"value":5582}," correlating a parent alias with a child alias. The library extracts this automatically as the join condition.",{"type":45,"tag":3758,"props":5584,"children":5585},{},[5586,5591,5593,5599,5601,5607,5609,5615,5616,5622],{"type":45,"tag":102,"props":5587,"children":5589},{"className":5588},[],[5590],{"type":51,"value":4535},{"type":51,"value":5592}," works with both scalar selects (e.g., ",{"type":45,"tag":102,"props":5594,"children":5596},{"className":5595},[],[5597],{"type":51,"value":5598},"select(({ c }) => c.text)",{"type":51,"value":5600}," → ",{"type":45,"tag":102,"props":5602,"children":5604},{"className":5603},[],[5605],{"type":51,"value":5606},"string[]",{"type":51,"value":5608},") and object selects (e.g., ",{"type":45,"tag":102,"props":5610,"children":5612},{"className":5611},[],[5613],{"type":51,"value":5614},"select(({ c }) => ({ id: c.id, title: c.title }))",{"type":51,"value":5600},{"type":45,"tag":102,"props":5617,"children":5619},{"className":5618},[],[5620],{"type":51,"value":5621},"Array\u003C{id, title}>",{"type":51,"value":5623},").",{"type":45,"tag":3758,"props":5625,"children":5626},{},[5627,5633,5635,5640,5642,5647],{"type":45,"tag":102,"props":5628,"children":5630},{"className":5629},[],[5631],{"type":51,"value":5632},"concat(toArray())",{"type":51,"value":5634}," requires a ",{"type":45,"tag":69,"props":5636,"children":5637},{},[5638],{"type":51,"value":5639},"scalar",{"type":51,"value":5641}," ",{"type":45,"tag":102,"props":5643,"children":5645},{"className":5644},[],[5646],{"type":51,"value":436},{"type":51,"value":5648}," to concatenate into a string.",{"type":45,"tag":3758,"props":5650,"children":5651},{},[5652,5654,5659,5660,5665],{"type":51,"value":5653},"Collection includes (bare subquery) require an ",{"type":45,"tag":69,"props":5655,"children":5656},{},[5657],{"type":51,"value":5658},"object",{"type":51,"value":5641},{"type":45,"tag":102,"props":5661,"children":5663},{"className":5662},[],[5664],{"type":51,"value":436},{"type":51,"value":402},{"type":45,"tag":3758,"props":5667,"children":5668},{},[5669],{"type":51,"value":5670},"Includes subqueries are compiled into the same incremental pipeline as the parent query -- they are not separate live queries.",{"type":45,"tag":82,"props":5672,"children":5674},{"id":5673},"one-shot-queries-with-queryonce",[5675],{"type":51,"value":5676},"One-Shot Queries with queryOnce",{"type":45,"tag":58,"props":5678,"children":5679},{},[5680,5682,5688],{"type":51,"value":5681},"For non-reactive, one-time snapshots use ",{"type":45,"tag":102,"props":5683,"children":5685},{"className":5684},[],[5686],{"type":51,"value":5687},"queryOnce",{"type":51,"value":5689},". It creates a live query collection, preloads it, extracts the results, and cleans up automatically.",{"type":45,"tag":94,"props":5691,"children":5693},{"className":96,"code":5692,"language":98,"meta":99,"style":99},"import { eq, queryOnce } from '@tanstack\u002Fdb'\n\nconst activeUsers = await queryOnce((q) =>\n  q\n    .from({ user: usersCollection })\n    .where(({ user }) => eq(user.active, true))\n    .select(({ user }) => ({ id: user.id, name: user.name })),\n)\n\n\u002F\u002F With findOne — resolves to T | undefined\nconst user = await queryOnce((q) =>\n  q\n    .from({ user: usersCollection })\n    .where(({ user }) => eq(user.id, userId))\n    .findOne(),\n)\n",[5694],{"type":45,"tag":102,"props":5695,"children":5696},{"__ignoreMap":99},[5697,5741,5748,5792,5799,5838,5897,5995,6002,6009,6017,6060,6067,6106,6162,6183],{"type":45,"tag":106,"props":5698,"children":5699},{"class":108,"line":109},[5700,5704,5708,5712,5716,5721,5725,5729,5733,5737],{"type":45,"tag":106,"props":5701,"children":5702},{"style":113},[5703],{"type":51,"value":116},{"type":45,"tag":106,"props":5705,"children":5706},{"style":119},[5707],{"type":51,"value":1135},{"type":45,"tag":106,"props":5709,"children":5710},{"style":129},[5711],{"type":51,"value":392},{"type":45,"tag":106,"props":5713,"children":5714},{"style":119},[5715],{"type":51,"value":412},{"type":45,"tag":106,"props":5717,"children":5718},{"style":129},[5719],{"type":51,"value":5720}," queryOnce",{"type":45,"tag":106,"props":5722,"children":5723},{"style":119},[5724],{"type":51,"value":1198},{"type":45,"tag":106,"props":5726,"children":5727},{"style":113},[5728],{"type":51,"value":190},{"type":45,"tag":106,"props":5730,"children":5731},{"style":119},[5732],{"type":51,"value":195},{"type":45,"tag":106,"props":5734,"children":5735},{"style":198},[5736],{"type":51,"value":201},{"type":45,"tag":106,"props":5738,"children":5739},{"style":119},[5740],{"type":51,"value":206},{"type":45,"tag":106,"props":5742,"children":5743},{"class":108,"line":125},[5744],{"type":45,"tag":106,"props":5745,"children":5746},{"emptyLinePlaceholder":213},[5747],{"type":51,"value":216},{"type":45,"tag":106,"props":5749,"children":5750},{"class":108,"line":140},[5751,5755,5759,5763,5768,5772,5776,5780,5784,5788],{"type":45,"tag":106,"props":5752,"children":5753},{"style":250},[5754],{"type":51,"value":253},{"type":45,"tag":106,"props":5756,"children":5757},{"style":129},[5758],{"type":51,"value":258},{"type":45,"tag":106,"props":5760,"children":5761},{"style":119},[5762],{"type":51,"value":263},{"type":45,"tag":106,"props":5764,"children":5765},{"style":113},[5766],{"type":51,"value":5767}," await",{"type":45,"tag":106,"props":5769,"children":5770},{"style":266},[5771],{"type":51,"value":5720},{"type":45,"tag":106,"props":5773,"children":5774},{"style":129},[5775],{"type":51,"value":274},{"type":45,"tag":106,"props":5777,"children":5778},{"style":119},[5779],{"type":51,"value":274},{"type":45,"tag":106,"props":5781,"children":5782},{"style":281},[5783],{"type":51,"value":284},{"type":45,"tag":106,"props":5785,"children":5786},{"style":119},[5787],{"type":51,"value":289},{"type":45,"tag":106,"props":5789,"children":5790},{"style":250},[5791],{"type":51,"value":294},{"type":45,"tag":106,"props":5793,"children":5794},{"class":108,"line":153},[5795],{"type":45,"tag":106,"props":5796,"children":5797},{"style":129},[5798],{"type":51,"value":303},{"type":45,"tag":106,"props":5800,"children":5801},{"class":108,"line":166},[5802,5806,5810,5814,5818,5822,5826,5830,5834],{"type":45,"tag":106,"props":5803,"children":5804},{"style":119},[5805],{"type":51,"value":312},{"type":45,"tag":106,"props":5807,"children":5808},{"style":266},[5809],{"type":51,"value":317},{"type":45,"tag":106,"props":5811,"children":5812},{"style":129},[5813],{"type":51,"value":274},{"type":45,"tag":106,"props":5815,"children":5816},{"style":119},[5817],{"type":51,"value":326},{"type":45,"tag":106,"props":5819,"children":5820},{"style":329},[5821],{"type":51,"value":332},{"type":45,"tag":106,"props":5823,"children":5824},{"style":119},[5825],{"type":51,"value":337},{"type":45,"tag":106,"props":5827,"children":5828},{"style":129},[5829],{"type":51,"value":342},{"type":45,"tag":106,"props":5831,"children":5832},{"style":119},[5833],{"type":51,"value":185},{"type":45,"tag":106,"props":5835,"children":5836},{"style":129},[5837],{"type":51,"value":351},{"type":45,"tag":106,"props":5839,"children":5840},{"class":108,"line":179},[5841,5845,5849,5853,5857,5861,5865,5869,5873,5877,5881,5885,5889,5893],{"type":45,"tag":106,"props":5842,"children":5843},{"style":119},[5844],{"type":51,"value":312},{"type":45,"tag":106,"props":5846,"children":5847},{"style":266},[5848],{"type":51,"value":364},{"type":45,"tag":106,"props":5850,"children":5851},{"style":129},[5852],{"type":51,"value":274},{"type":45,"tag":106,"props":5854,"children":5855},{"style":119},[5856],{"type":51,"value":373},{"type":45,"tag":106,"props":5858,"children":5859},{"style":281},[5860],{"type":51,"value":332},{"type":45,"tag":106,"props":5862,"children":5863},{"style":119},[5864],{"type":51,"value":382},{"type":45,"tag":106,"props":5866,"children":5867},{"style":250},[5868],{"type":51,"value":387},{"type":45,"tag":106,"props":5870,"children":5871},{"style":266},[5872],{"type":51,"value":392},{"type":45,"tag":106,"props":5874,"children":5875},{"style":129},[5876],{"type":51,"value":397},{"type":45,"tag":106,"props":5878,"children":5879},{"style":119},[5880],{"type":51,"value":402},{"type":45,"tag":106,"props":5882,"children":5883},{"style":129},[5884],{"type":51,"value":407},{"type":45,"tag":106,"props":5886,"children":5887},{"style":119},[5888],{"type":51,"value":412},{"type":45,"tag":106,"props":5890,"children":5891},{"style":415},[5892],{"type":51,"value":418},{"type":45,"tag":106,"props":5894,"children":5895},{"style":129},[5896],{"type":51,"value":423},{"type":45,"tag":106,"props":5898,"children":5899},{"class":108,"line":209},[5900,5904,5908,5912,5916,5920,5924,5928,5932,5936,5941,5945,5949,5953,5957,5961,5966,5970,5974,5978,5983,5987,5991],{"type":45,"tag":106,"props":5901,"children":5902},{"style":119},[5903],{"type":51,"value":312},{"type":45,"tag":106,"props":5905,"children":5906},{"style":266},[5907],{"type":51,"value":436},{"type":45,"tag":106,"props":5909,"children":5910},{"style":129},[5911],{"type":51,"value":274},{"type":45,"tag":106,"props":5913,"children":5914},{"style":119},[5915],{"type":51,"value":373},{"type":45,"tag":106,"props":5917,"children":5918},{"style":281},[5919],{"type":51,"value":332},{"type":45,"tag":106,"props":5921,"children":5922},{"style":119},[5923],{"type":51,"value":382},{"type":45,"tag":106,"props":5925,"children":5926},{"style":250},[5927],{"type":51,"value":387},{"type":45,"tag":106,"props":5929,"children":5930},{"style":129},[5931],{"type":51,"value":461},{"type":45,"tag":106,"props":5933,"children":5934},{"style":119},[5935],{"type":51,"value":326},{"type":45,"tag":106,"props":5937,"children":5938},{"style":329},[5939],{"type":51,"value":5940}," id",{"type":45,"tag":106,"props":5942,"children":5943},{"style":119},[5944],{"type":51,"value":337},{"type":45,"tag":106,"props":5946,"children":5947},{"style":129},[5948],{"type":51,"value":332},{"type":45,"tag":106,"props":5950,"children":5951},{"style":119},[5952],{"type":51,"value":402},{"type":45,"tag":106,"props":5954,"children":5955},{"style":129},[5956],{"type":51,"value":492},{"type":45,"tag":106,"props":5958,"children":5959},{"style":119},[5960],{"type":51,"value":412},{"type":45,"tag":106,"props":5962,"children":5963},{"style":329},[5964],{"type":51,"value":5965}," name",{"type":45,"tag":106,"props":5967,"children":5968},{"style":119},[5969],{"type":51,"value":337},{"type":45,"tag":106,"props":5971,"children":5972},{"style":129},[5973],{"type":51,"value":332},{"type":45,"tag":106,"props":5975,"children":5976},{"style":119},[5977],{"type":51,"value":402},{"type":45,"tag":106,"props":5979,"children":5980},{"style":129},[5981],{"type":51,"value":5982},"name ",{"type":45,"tag":106,"props":5984,"children":5985},{"style":119},[5986],{"type":51,"value":185},{"type":45,"tag":106,"props":5988,"children":5989},{"style":129},[5990],{"type":51,"value":570},{"type":45,"tag":106,"props":5992,"children":5993},{"style":119},[5994],{"type":51,"value":137},{"type":45,"tag":106,"props":5996,"children":5997},{"class":108,"line":219},[5998],{"type":45,"tag":106,"props":5999,"children":6000},{"style":129},[6001],{"type":51,"value":351},{"type":45,"tag":106,"props":6003,"children":6004},{"class":108,"line":229},[6005],{"type":45,"tag":106,"props":6006,"children":6007},{"emptyLinePlaceholder":213},[6008],{"type":51,"value":216},{"type":45,"tag":106,"props":6010,"children":6011},{"class":108,"line":237},[6012],{"type":45,"tag":106,"props":6013,"children":6014},{"style":223},[6015],{"type":51,"value":6016},"\u002F\u002F With findOne — resolves to T | undefined\n",{"type":45,"tag":106,"props":6018,"children":6019},{"class":108,"line":246},[6020,6024,6028,6032,6036,6040,6044,6048,6052,6056],{"type":45,"tag":106,"props":6021,"children":6022},{"style":250},[6023],{"type":51,"value":253},{"type":45,"tag":106,"props":6025,"children":6026},{"style":129},[6027],{"type":51,"value":1006},{"type":45,"tag":106,"props":6029,"children":6030},{"style":119},[6031],{"type":51,"value":263},{"type":45,"tag":106,"props":6033,"children":6034},{"style":113},[6035],{"type":51,"value":5767},{"type":45,"tag":106,"props":6037,"children":6038},{"style":266},[6039],{"type":51,"value":5720},{"type":45,"tag":106,"props":6041,"children":6042},{"style":129},[6043],{"type":51,"value":274},{"type":45,"tag":106,"props":6045,"children":6046},{"style":119},[6047],{"type":51,"value":274},{"type":45,"tag":106,"props":6049,"children":6050},{"style":281},[6051],{"type":51,"value":284},{"type":45,"tag":106,"props":6053,"children":6054},{"style":119},[6055],{"type":51,"value":289},{"type":45,"tag":106,"props":6057,"children":6058},{"style":250},[6059],{"type":51,"value":294},{"type":45,"tag":106,"props":6061,"children":6062},{"class":108,"line":297},[6063],{"type":45,"tag":106,"props":6064,"children":6065},{"style":129},[6066],{"type":51,"value":303},{"type":45,"tag":106,"props":6068,"children":6069},{"class":108,"line":306},[6070,6074,6078,6082,6086,6090,6094,6098,6102],{"type":45,"tag":106,"props":6071,"children":6072},{"style":119},[6073],{"type":51,"value":312},{"type":45,"tag":106,"props":6075,"children":6076},{"style":266},[6077],{"type":51,"value":317},{"type":45,"tag":106,"props":6079,"children":6080},{"style":129},[6081],{"type":51,"value":274},{"type":45,"tag":106,"props":6083,"children":6084},{"style":119},[6085],{"type":51,"value":326},{"type":45,"tag":106,"props":6087,"children":6088},{"style":329},[6089],{"type":51,"value":332},{"type":45,"tag":106,"props":6091,"children":6092},{"style":119},[6093],{"type":51,"value":337},{"type":45,"tag":106,"props":6095,"children":6096},{"style":129},[6097],{"type":51,"value":342},{"type":45,"tag":106,"props":6099,"children":6100},{"style":119},[6101],{"type":51,"value":185},{"type":45,"tag":106,"props":6103,"children":6104},{"style":129},[6105],{"type":51,"value":351},{"type":45,"tag":106,"props":6107,"children":6108},{"class":108,"line":354},[6109,6113,6117,6121,6125,6129,6133,6137,6141,6145,6149,6153,6157],{"type":45,"tag":106,"props":6110,"children":6111},{"style":119},[6112],{"type":51,"value":312},{"type":45,"tag":106,"props":6114,"children":6115},{"style":266},[6116],{"type":51,"value":364},{"type":45,"tag":106,"props":6118,"children":6119},{"style":129},[6120],{"type":51,"value":274},{"type":45,"tag":106,"props":6122,"children":6123},{"style":119},[6124],{"type":51,"value":373},{"type":45,"tag":106,"props":6126,"children":6127},{"style":281},[6128],{"type":51,"value":332},{"type":45,"tag":106,"props":6130,"children":6131},{"style":119},[6132],{"type":51,"value":382},{"type":45,"tag":106,"props":6134,"children":6135},{"style":250},[6136],{"type":51,"value":387},{"type":45,"tag":106,"props":6138,"children":6139},{"style":266},[6140],{"type":51,"value":392},{"type":45,"tag":106,"props":6142,"children":6143},{"style":129},[6144],{"type":51,"value":397},{"type":45,"tag":106,"props":6146,"children":6147},{"style":119},[6148],{"type":51,"value":402},{"type":45,"tag":106,"props":6150,"children":6151},{"style":129},[6152],{"type":51,"value":492},{"type":45,"tag":106,"props":6154,"children":6155},{"style":119},[6156],{"type":51,"value":412},{"type":45,"tag":106,"props":6158,"children":6159},{"style":129},[6160],{"type":51,"value":6161}," userId))\n",{"type":45,"tag":106,"props":6163,"children":6164},{"class":108,"line":426},[6165,6169,6174,6179],{"type":45,"tag":106,"props":6166,"children":6167},{"style":119},[6168],{"type":51,"value":312},{"type":45,"tag":106,"props":6170,"children":6171},{"style":266},[6172],{"type":51,"value":6173},"findOne",{"type":45,"tag":106,"props":6175,"children":6176},{"style":129},[6177],{"type":51,"value":6178},"()",{"type":45,"tag":106,"props":6180,"children":6181},{"style":119},[6182],{"type":51,"value":137},{"type":45,"tag":106,"props":6184,"children":6185},{"class":108,"line":469},[6186],{"type":45,"tag":106,"props":6187,"children":6188},{"style":129},[6189],{"type":51,"value":351},{"type":45,"tag":58,"props":6191,"children":6192},{},[6193,6194,6199],{"type":51,"value":2438},{"type":45,"tag":102,"props":6195,"children":6197},{"className":6196},[],[6198],{"type":51,"value":5687},{"type":51,"value":6200}," for scripts, loaders, data export, tests, or AI\u002FLLM context building. For UI bindings and reactive updates, use live queries instead.",{"type":45,"tag":82,"props":6202,"children":6204},{"id":6203},"reactive-effects-createeffect",[6205],{"type":51,"value":6206},"Reactive Effects (createEffect)",{"type":45,"tag":58,"props":6208,"children":6209},{},[6210,6212,6218],{"type":51,"value":6211},"Reactive effects respond to query result ",{"type":45,"tag":6213,"props":6214,"children":6215},"em",{},[6216],{"type":51,"value":6217},"changes",{"type":51,"value":6219}," without materializing the full result set. Effects fire callbacks when rows enter, exit, or update within a query result — like a database trigger on an arbitrary live query.",{"type":45,"tag":94,"props":6221,"children":6223},{"className":96,"code":6222,"language":98,"meta":99,"style":99},"import { createEffect, eq } from '@tanstack\u002Fdb'\n\nconst effect = createEffect({\n  query: (q) =>\n    q\n      .from({ msg: messagesCollection })\n      .where(({ msg }) => eq(msg.role, 'user')),\n  skipInitial: true,\n  onEnter: async (event, ctx) => {\n    await processNewMessage(event.value, { signal: ctx.signal })\n  },\n  onExit: (event) => {\n    console.log('Message left result set:', event.key)\n  },\n  onError: (error, event) => {\n    console.error(`Failed to process ${event.key}:`, error)\n  },\n})\n\n\u002F\u002F Dispose when no longer needed\nawait effect.dispose()\n",[6224],{"type":45,"tag":102,"props":6225,"children":6226},{"__ignoreMap":99},[6227,6271,6278,6306,6334,6342,6382,6454,6474,6521,6589,6597,6629,6684,6691,6732,6803,6810,6821,6828,6836],{"type":45,"tag":106,"props":6228,"children":6229},{"class":108,"line":109},[6230,6234,6238,6243,6247,6251,6255,6259,6263,6267],{"type":45,"tag":106,"props":6231,"children":6232},{"style":113},[6233],{"type":51,"value":116},{"type":45,"tag":106,"props":6235,"children":6236},{"style":119},[6237],{"type":51,"value":1135},{"type":45,"tag":106,"props":6239,"children":6240},{"style":129},[6241],{"type":51,"value":6242}," createEffect",{"type":45,"tag":106,"props":6244,"children":6245},{"style":119},[6246],{"type":51,"value":412},{"type":45,"tag":106,"props":6248,"children":6249},{"style":129},[6250],{"type":51,"value":392},{"type":45,"tag":106,"props":6252,"children":6253},{"style":119},[6254],{"type":51,"value":1198},{"type":45,"tag":106,"props":6256,"children":6257},{"style":113},[6258],{"type":51,"value":190},{"type":45,"tag":106,"props":6260,"children":6261},{"style":119},[6262],{"type":51,"value":195},{"type":45,"tag":106,"props":6264,"children":6265},{"style":198},[6266],{"type":51,"value":201},{"type":45,"tag":106,"props":6268,"children":6269},{"style":119},[6270],{"type":51,"value":206},{"type":45,"tag":106,"props":6272,"children":6273},{"class":108,"line":125},[6274],{"type":45,"tag":106,"props":6275,"children":6276},{"emptyLinePlaceholder":213},[6277],{"type":51,"value":216},{"type":45,"tag":106,"props":6279,"children":6280},{"class":108,"line":140},[6281,6285,6290,6294,6298,6302],{"type":45,"tag":106,"props":6282,"children":6283},{"style":250},[6284],{"type":51,"value":253},{"type":45,"tag":106,"props":6286,"children":6287},{"style":129},[6288],{"type":51,"value":6289}," effect ",{"type":45,"tag":106,"props":6291,"children":6292},{"style":119},[6293],{"type":51,"value":263},{"type":45,"tag":106,"props":6295,"children":6296},{"style":266},[6297],{"type":51,"value":6242},{"type":45,"tag":106,"props":6299,"children":6300},{"style":129},[6301],{"type":51,"value":274},{"type":45,"tag":106,"props":6303,"children":6304},{"style":119},[6305],{"type":51,"value":466},{"type":45,"tag":106,"props":6307,"children":6308},{"class":108,"line":153},[6309,6314,6318,6322,6326,6330],{"type":45,"tag":106,"props":6310,"children":6311},{"style":266},[6312],{"type":51,"value":6313},"  query",{"type":45,"tag":106,"props":6315,"children":6316},{"style":119},[6317],{"type":51,"value":337},{"type":45,"tag":106,"props":6319,"children":6320},{"style":119},[6321],{"type":51,"value":461},{"type":45,"tag":106,"props":6323,"children":6324},{"style":281},[6325],{"type":51,"value":284},{"type":45,"tag":106,"props":6327,"children":6328},{"style":119},[6329],{"type":51,"value":289},{"type":45,"tag":106,"props":6331,"children":6332},{"style":250},[6333],{"type":51,"value":294},{"type":45,"tag":106,"props":6335,"children":6336},{"class":108,"line":166},[6337],{"type":45,"tag":106,"props":6338,"children":6339},{"style":129},[6340],{"type":51,"value":6341},"    q\n",{"type":45,"tag":106,"props":6343,"children":6344},{"class":108,"line":179},[6345,6349,6353,6357,6361,6366,6370,6374,6378],{"type":45,"tag":106,"props":6346,"children":6347},{"style":119},[6348],{"type":51,"value":4167},{"type":45,"tag":106,"props":6350,"children":6351},{"style":266},[6352],{"type":51,"value":317},{"type":45,"tag":106,"props":6354,"children":6355},{"style":129},[6356],{"type":51,"value":274},{"type":45,"tag":106,"props":6358,"children":6359},{"style":119},[6360],{"type":51,"value":326},{"type":45,"tag":106,"props":6362,"children":6363},{"style":329},[6364],{"type":51,"value":6365}," msg",{"type":45,"tag":106,"props":6367,"children":6368},{"style":119},[6369],{"type":51,"value":337},{"type":45,"tag":106,"props":6371,"children":6372},{"style":129},[6373],{"type":51,"value":4680},{"type":45,"tag":106,"props":6375,"children":6376},{"style":119},[6377],{"type":51,"value":185},{"type":45,"tag":106,"props":6379,"children":6380},{"style":129},[6381],{"type":51,"value":351},{"type":45,"tag":106,"props":6383,"children":6384},{"class":108,"line":209},[6385,6389,6393,6397,6401,6405,6409,6413,6417,6422,6426,6430,6434,6438,6442,6446,6450],{"type":45,"tag":106,"props":6386,"children":6387},{"style":119},[6388],{"type":51,"value":4167},{"type":45,"tag":106,"props":6390,"children":6391},{"style":266},[6392],{"type":51,"value":364},{"type":45,"tag":106,"props":6394,"children":6395},{"style":129},[6396],{"type":51,"value":274},{"type":45,"tag":106,"props":6398,"children":6399},{"style":119},[6400],{"type":51,"value":373},{"type":45,"tag":106,"props":6402,"children":6403},{"style":281},[6404],{"type":51,"value":6365},{"type":45,"tag":106,"props":6406,"children":6407},{"style":119},[6408],{"type":51,"value":382},{"type":45,"tag":106,"props":6410,"children":6411},{"style":250},[6412],{"type":51,"value":387},{"type":45,"tag":106,"props":6414,"children":6415},{"style":266},[6416],{"type":51,"value":392},{"type":45,"tag":106,"props":6418,"children":6419},{"style":129},[6420],{"type":51,"value":6421},"(msg",{"type":45,"tag":106,"props":6423,"children":6424},{"style":119},[6425],{"type":51,"value":402},{"type":45,"tag":106,"props":6427,"children":6428},{"style":129},[6429],{"type":51,"value":1478},{"type":45,"tag":106,"props":6431,"children":6432},{"style":119},[6433],{"type":51,"value":412},{"type":45,"tag":106,"props":6435,"children":6436},{"style":119},[6437],{"type":51,"value":195},{"type":45,"tag":106,"props":6439,"children":6440},{"style":198},[6441],{"type":51,"value":918},{"type":45,"tag":106,"props":6443,"children":6444},{"style":119},[6445],{"type":51,"value":1496},{"type":45,"tag":106,"props":6447,"children":6448},{"style":129},[6449],{"type":51,"value":570},{"type":45,"tag":106,"props":6451,"children":6452},{"style":119},[6453],{"type":51,"value":137},{"type":45,"tag":106,"props":6455,"children":6456},{"class":108,"line":219},[6457,6462,6466,6470],{"type":45,"tag":106,"props":6458,"children":6459},{"style":329},[6460],{"type":51,"value":6461},"  skipInitial",{"type":45,"tag":106,"props":6463,"children":6464},{"style":119},[6465],{"type":51,"value":337},{"type":45,"tag":106,"props":6467,"children":6468},{"style":415},[6469],{"type":51,"value":418},{"type":45,"tag":106,"props":6471,"children":6472},{"style":119},[6473],{"type":51,"value":137},{"type":45,"tag":106,"props":6475,"children":6476},{"class":108,"line":229},[6477,6482,6486,6491,6495,6500,6504,6509,6513,6517],{"type":45,"tag":106,"props":6478,"children":6479},{"style":266},[6480],{"type":51,"value":6481},"  onEnter",{"type":45,"tag":106,"props":6483,"children":6484},{"style":119},[6485],{"type":51,"value":337},{"type":45,"tag":106,"props":6487,"children":6488},{"style":250},[6489],{"type":51,"value":6490}," async",{"type":45,"tag":106,"props":6492,"children":6493},{"style":119},[6494],{"type":51,"value":461},{"type":45,"tag":106,"props":6496,"children":6497},{"style":281},[6498],{"type":51,"value":6499},"event",{"type":45,"tag":106,"props":6501,"children":6502},{"style":119},[6503],{"type":51,"value":412},{"type":45,"tag":106,"props":6505,"children":6506},{"style":281},[6507],{"type":51,"value":6508}," ctx",{"type":45,"tag":106,"props":6510,"children":6511},{"style":119},[6512],{"type":51,"value":289},{"type":45,"tag":106,"props":6514,"children":6515},{"style":250},[6516],{"type":51,"value":387},{"type":45,"tag":106,"props":6518,"children":6519},{"style":119},[6520],{"type":51,"value":122},{"type":45,"tag":106,"props":6522,"children":6523},{"class":108,"line":237},[6524,6529,6534,6538,6542,6546,6551,6555,6559,6564,6568,6572,6576,6581,6585],{"type":45,"tag":106,"props":6525,"children":6526},{"style":113},[6527],{"type":51,"value":6528},"    await",{"type":45,"tag":106,"props":6530,"children":6531},{"style":266},[6532],{"type":51,"value":6533}," processNewMessage",{"type":45,"tag":106,"props":6535,"children":6536},{"style":329},[6537],{"type":51,"value":274},{"type":45,"tag":106,"props":6539,"children":6540},{"style":129},[6541],{"type":51,"value":6499},{"type":45,"tag":106,"props":6543,"children":6544},{"style":119},[6545],{"type":51,"value":402},{"type":45,"tag":106,"props":6547,"children":6548},{"style":129},[6549],{"type":51,"value":6550},"value",{"type":45,"tag":106,"props":6552,"children":6553},{"style":119},[6554],{"type":51,"value":412},{"type":45,"tag":106,"props":6556,"children":6557},{"style":119},[6558],{"type":51,"value":1135},{"type":45,"tag":106,"props":6560,"children":6561},{"style":329},[6562],{"type":51,"value":6563}," signal",{"type":45,"tag":106,"props":6565,"children":6566},{"style":119},[6567],{"type":51,"value":337},{"type":45,"tag":106,"props":6569,"children":6570},{"style":129},[6571],{"type":51,"value":6508},{"type":45,"tag":106,"props":6573,"children":6574},{"style":119},[6575],{"type":51,"value":402},{"type":45,"tag":106,"props":6577,"children":6578},{"style":129},[6579],{"type":51,"value":6580},"signal",{"type":45,"tag":106,"props":6582,"children":6583},{"style":119},[6584],{"type":51,"value":1198},{"type":45,"tag":106,"props":6586,"children":6587},{"style":329},[6588],{"type":51,"value":351},{"type":45,"tag":106,"props":6590,"children":6591},{"class":108,"line":246},[6592],{"type":45,"tag":106,"props":6593,"children":6594},{"style":119},[6595],{"type":51,"value":6596},"  },\n",{"type":45,"tag":106,"props":6598,"children":6599},{"class":108,"line":297},[6600,6605,6609,6613,6617,6621,6625],{"type":45,"tag":106,"props":6601,"children":6602},{"style":266},[6603],{"type":51,"value":6604},"  onExit",{"type":45,"tag":106,"props":6606,"children":6607},{"style":119},[6608],{"type":51,"value":337},{"type":45,"tag":106,"props":6610,"children":6611},{"style":119},[6612],{"type":51,"value":461},{"type":45,"tag":106,"props":6614,"children":6615},{"style":281},[6616],{"type":51,"value":6499},{"type":45,"tag":106,"props":6618,"children":6619},{"style":119},[6620],{"type":51,"value":289},{"type":45,"tag":106,"props":6622,"children":6623},{"style":250},[6624],{"type":51,"value":387},{"type":45,"tag":106,"props":6626,"children":6627},{"style":119},[6628],{"type":51,"value":122},{"type":45,"tag":106,"props":6630,"children":6631},{"class":108,"line":306},[6632,6637,6641,6645,6649,6653,6658,6662,6666,6671,6675,6680],{"type":45,"tag":106,"props":6633,"children":6634},{"style":129},[6635],{"type":51,"value":6636},"    console",{"type":45,"tag":106,"props":6638,"children":6639},{"style":119},[6640],{"type":51,"value":402},{"type":45,"tag":106,"props":6642,"children":6643},{"style":266},[6644],{"type":51,"value":1038},{"type":45,"tag":106,"props":6646,"children":6647},{"style":329},[6648],{"type":51,"value":274},{"type":45,"tag":106,"props":6650,"children":6651},{"style":119},[6652],{"type":51,"value":1496},{"type":45,"tag":106,"props":6654,"children":6655},{"style":198},[6656],{"type":51,"value":6657},"Message left result set:",{"type":45,"tag":106,"props":6659,"children":6660},{"style":119},[6661],{"type":51,"value":1496},{"type":45,"tag":106,"props":6663,"children":6664},{"style":119},[6665],{"type":51,"value":412},{"type":45,"tag":106,"props":6667,"children":6668},{"style":129},[6669],{"type":51,"value":6670}," event",{"type":45,"tag":106,"props":6672,"children":6673},{"style":119},[6674],{"type":51,"value":402},{"type":45,"tag":106,"props":6676,"children":6677},{"style":129},[6678],{"type":51,"value":6679},"key",{"type":45,"tag":106,"props":6681,"children":6682},{"style":329},[6683],{"type":51,"value":351},{"type":45,"tag":106,"props":6685,"children":6686},{"class":108,"line":354},[6687],{"type":45,"tag":106,"props":6688,"children":6689},{"style":119},[6690],{"type":51,"value":6596},{"type":45,"tag":106,"props":6692,"children":6693},{"class":108,"line":426},[6694,6699,6703,6707,6712,6716,6720,6724,6728],{"type":45,"tag":106,"props":6695,"children":6696},{"style":266},[6697],{"type":51,"value":6698},"  onError",{"type":45,"tag":106,"props":6700,"children":6701},{"style":119},[6702],{"type":51,"value":337},{"type":45,"tag":106,"props":6704,"children":6705},{"style":119},[6706],{"type":51,"value":461},{"type":45,"tag":106,"props":6708,"children":6709},{"style":281},[6710],{"type":51,"value":6711},"error",{"type":45,"tag":106,"props":6713,"children":6714},{"style":119},[6715],{"type":51,"value":412},{"type":45,"tag":106,"props":6717,"children":6718},{"style":281},[6719],{"type":51,"value":6670},{"type":45,"tag":106,"props":6721,"children":6722},{"style":119},[6723],{"type":51,"value":289},{"type":45,"tag":106,"props":6725,"children":6726},{"style":250},[6727],{"type":51,"value":387},{"type":45,"tag":106,"props":6729,"children":6730},{"style":119},[6731],{"type":51,"value":122},{"type":45,"tag":106,"props":6733,"children":6734},{"class":108,"line":469},[6735,6739,6743,6747,6751,6756,6761,6766,6770,6774,6778,6782,6786,6790,6794,6799],{"type":45,"tag":106,"props":6736,"children":6737},{"style":129},[6738],{"type":51,"value":6636},{"type":45,"tag":106,"props":6740,"children":6741},{"style":119},[6742],{"type":51,"value":402},{"type":45,"tag":106,"props":6744,"children":6745},{"style":266},[6746],{"type":51,"value":6711},{"type":45,"tag":106,"props":6748,"children":6749},{"style":329},[6750],{"type":51,"value":274},{"type":45,"tag":106,"props":6752,"children":6753},{"style":119},[6754],{"type":51,"value":6755},"`",{"type":45,"tag":106,"props":6757,"children":6758},{"style":198},[6759],{"type":51,"value":6760},"Failed to process ",{"type":45,"tag":106,"props":6762,"children":6763},{"style":119},[6764],{"type":51,"value":6765},"${",{"type":45,"tag":106,"props":6767,"children":6768},{"style":129},[6769],{"type":51,"value":6499},{"type":45,"tag":106,"props":6771,"children":6772},{"style":119},[6773],{"type":51,"value":402},{"type":45,"tag":106,"props":6775,"children":6776},{"style":129},[6777],{"type":51,"value":6679},{"type":45,"tag":106,"props":6779,"children":6780},{"style":119},[6781],{"type":51,"value":185},{"type":45,"tag":106,"props":6783,"children":6784},{"style":198},[6785],{"type":51,"value":337},{"type":45,"tag":106,"props":6787,"children":6788},{"style":119},[6789],{"type":51,"value":6755},{"type":45,"tag":106,"props":6791,"children":6792},{"style":119},[6793],{"type":51,"value":412},{"type":45,"tag":106,"props":6795,"children":6796},{"style":129},[6797],{"type":51,"value":6798}," error",{"type":45,"tag":106,"props":6800,"children":6801},{"style":329},[6802],{"type":51,"value":351},{"type":45,"tag":106,"props":6804,"children":6805},{"class":108,"line":499},[6806],{"type":45,"tag":106,"props":6807,"children":6808},{"style":119},[6809],{"type":51,"value":6596},{"type":45,"tag":106,"props":6811,"children":6812},{"class":108,"line":529},[6813,6817],{"type":45,"tag":106,"props":6814,"children":6815},{"style":119},[6816],{"type":51,"value":185},{"type":45,"tag":106,"props":6818,"children":6819},{"style":129},[6820],{"type":51,"value":351},{"type":45,"tag":106,"props":6822,"children":6823},{"class":108,"line":559},[6824],{"type":45,"tag":106,"props":6825,"children":6826},{"emptyLinePlaceholder":213},[6827],{"type":51,"value":216},{"type":45,"tag":106,"props":6829,"children":6830},{"class":108,"line":577},[6831],{"type":45,"tag":106,"props":6832,"children":6833},{"style":223},[6834],{"type":51,"value":6835},"\u002F\u002F Dispose when no longer needed\n",{"type":45,"tag":106,"props":6837,"children":6838},{"class":108,"line":585},[6839,6844,6849,6853,6858],{"type":45,"tag":106,"props":6840,"children":6841},{"style":113},[6842],{"type":51,"value":6843},"await",{"type":45,"tag":106,"props":6845,"children":6846},{"style":129},[6847],{"type":51,"value":6848}," effect",{"type":45,"tag":106,"props":6850,"children":6851},{"style":119},[6852],{"type":51,"value":402},{"type":45,"tag":106,"props":6854,"children":6855},{"style":266},[6856],{"type":51,"value":6857},"dispose",{"type":45,"tag":106,"props":6859,"children":6860},{"style":129},[6861],{"type":51,"value":6862},"()\n",{"type":45,"tag":6864,"props":6865,"children":6866},"table",{},[6867,6886],{"type":45,"tag":6868,"props":6869,"children":6870},"thead",{},[6871],{"type":45,"tag":6872,"props":6873,"children":6874},"tr",{},[6875,6881],{"type":45,"tag":6876,"props":6877,"children":6878},"th",{},[6879],{"type":51,"value":6880},"Use case",{"type":45,"tag":6876,"props":6882,"children":6883},{},[6884],{"type":51,"value":6885},"Approach",{"type":45,"tag":6887,"props":6888,"children":6889},"tbody",{},[6890,6910,6950],{"type":45,"tag":6872,"props":6891,"children":6892},{},[6893,6899],{"type":45,"tag":6894,"props":6895,"children":6896},"td",{},[6897],{"type":51,"value":6898},"Display query results in UI",{"type":45,"tag":6894,"props":6900,"children":6901},{},[6902,6904],{"type":51,"value":6903},"Live query collection + ",{"type":45,"tag":102,"props":6905,"children":6907},{"className":6906},[],[6908],{"type":51,"value":6909},"useLiveQuery",{"type":45,"tag":6872,"props":6911,"children":6912},{},[6913,6918],{"type":45,"tag":6894,"props":6914,"children":6915},{},[6916],{"type":51,"value":6917},"React to changes (side effects)",{"type":45,"tag":6894,"props":6919,"children":6920},{},[6921,6927,6929,6935,6937,6943,6944],{"type":45,"tag":102,"props":6922,"children":6924},{"className":6923},[],[6925],{"type":51,"value":6926},"createEffect",{"type":51,"value":6928}," with ",{"type":45,"tag":102,"props":6930,"children":6932},{"className":6931},[],[6933],{"type":51,"value":6934},"onEnter",{"type":51,"value":6936}," \u002F ",{"type":45,"tag":102,"props":6938,"children":6940},{"className":6939},[],[6941],{"type":51,"value":6942},"onUpdate",{"type":51,"value":6936},{"type":45,"tag":102,"props":6945,"children":6947},{"className":6946},[],[6948],{"type":51,"value":6949},"onExit",{"type":45,"tag":6872,"props":6951,"children":6952},{},[6953,6958],{"type":45,"tag":6894,"props":6954,"children":6955},{},[6956],{"type":51,"value":6957},"Inspect full batch of changes",{"type":45,"tag":6894,"props":6959,"children":6960},{},[6961,6966,6967],{"type":45,"tag":102,"props":6962,"children":6964},{"className":6963},[],[6965],{"type":51,"value":6926},{"type":51,"value":6928},{"type":45,"tag":102,"props":6968,"children":6970},{"className":6969},[],[6971],{"type":51,"value":6972},"onBatch",{"type":45,"tag":58,"props":6974,"children":6975},{},[6976,6978,6983,6985,6991,6992,6998,7000,7005,7006,7011,7012,7017,7018,7023,7024,7030,7031,7037,7038,7044],{"type":51,"value":6977},"Key options: ",{"type":45,"tag":102,"props":6979,"children":6981},{"className":6980},[],[6982],{"type":51,"value":492},{"type":51,"value":6984}," (optional), ",{"type":45,"tag":102,"props":6986,"children":6988},{"className":6987},[],[6989],{"type":51,"value":6990},"query",{"type":51,"value":1101},{"type":45,"tag":102,"props":6993,"children":6995},{"className":6994},[],[6996],{"type":51,"value":6997},"skipInitial",{"type":51,"value":6999}," (skip existing rows on init), ",{"type":45,"tag":102,"props":7001,"children":7003},{"className":7002},[],[7004],{"type":51,"value":6934},{"type":51,"value":1101},{"type":45,"tag":102,"props":7007,"children":7009},{"className":7008},[],[7010],{"type":51,"value":6942},{"type":51,"value":1101},{"type":45,"tag":102,"props":7013,"children":7015},{"className":7014},[],[7016],{"type":51,"value":6949},{"type":51,"value":1101},{"type":45,"tag":102,"props":7019,"children":7021},{"className":7020},[],[7022],{"type":51,"value":6972},{"type":51,"value":1101},{"type":45,"tag":102,"props":7025,"children":7027},{"className":7026},[],[7028],{"type":51,"value":7029},"onError",{"type":51,"value":1101},{"type":45,"tag":102,"props":7032,"children":7034},{"className":7033},[],[7035],{"type":51,"value":7036},"onSourceError",{"type":51,"value":2461},{"type":45,"tag":102,"props":7039,"children":7041},{"className":7040},[],[7042],{"type":51,"value":7043},"ctx.signal",{"type":51,"value":7045}," aborts when the effect is disposed.",{"type":45,"tag":82,"props":7047,"children":7049},{"id":7048},"common-mistakes",[7050],{"type":51,"value":7051},"Common Mistakes",{"type":45,"tag":1075,"props":7053,"children":7055},{"id":7054},"critical-using-instead-of-eq",[7056],{"type":51,"value":7057},"CRITICAL: Using === instead of eq()",{"type":45,"tag":58,"props":7059,"children":7060},{},[7061,7063,7069,7071,7077],{"type":51,"value":7062},"JavaScript ",{"type":45,"tag":102,"props":7064,"children":7066},{"className":7065},[],[7067],{"type":51,"value":7068},"===",{"type":51,"value":7070}," in a where callback returns a boolean primitive, not an expression object. Throws ",{"type":45,"tag":102,"props":7072,"children":7074},{"className":7073},[],[7075],{"type":51,"value":7076},"InvalidWhereExpressionError",{"type":51,"value":402},{"type":45,"tag":94,"props":7079,"children":7081},{"className":96,"code":7080,"language":98,"meta":99,"style":99},"\u002F\u002F WRONG\nq.from({ user: usersCollection }).where(({ user }) => user.active === true)\n\n\u002F\u002F CORRECT\nq.from({ user: usersCollection }).where(({ user }) => eq(user.active, true))\n",[7082],{"type":45,"tag":102,"props":7083,"children":7084},{"__ignoreMap":99},[7085,7093,7189,7196,7204],{"type":45,"tag":106,"props":7086,"children":7087},{"class":108,"line":109},[7088],{"type":45,"tag":106,"props":7089,"children":7090},{"style":223},[7091],{"type":51,"value":7092},"\u002F\u002F WRONG\n",{"type":45,"tag":106,"props":7094,"children":7095},{"class":108,"line":125},[7096,7100,7104,7108,7112,7116,7120,7124,7128,7132,7136,7140,7144,7148,7152,7156,7160,7164,7168,7172,7177,7181,7185],{"type":45,"tag":106,"props":7097,"children":7098},{"style":129},[7099],{"type":51,"value":284},{"type":45,"tag":106,"props":7101,"children":7102},{"style":119},[7103],{"type":51,"value":402},{"type":45,"tag":106,"props":7105,"children":7106},{"style":266},[7107],{"type":51,"value":317},{"type":45,"tag":106,"props":7109,"children":7110},{"style":129},[7111],{"type":51,"value":274},{"type":45,"tag":106,"props":7113,"children":7114},{"style":119},[7115],{"type":51,"value":326},{"type":45,"tag":106,"props":7117,"children":7118},{"style":329},[7119],{"type":51,"value":332},{"type":45,"tag":106,"props":7121,"children":7122},{"style":119},[7123],{"type":51,"value":337},{"type":45,"tag":106,"props":7125,"children":7126},{"style":129},[7127],{"type":51,"value":342},{"type":45,"tag":106,"props":7129,"children":7130},{"style":119},[7131],{"type":51,"value":185},{"type":45,"tag":106,"props":7133,"children":7134},{"style":129},[7135],{"type":51,"value":289},{"type":45,"tag":106,"props":7137,"children":7138},{"style":119},[7139],{"type":51,"value":402},{"type":45,"tag":106,"props":7141,"children":7142},{"style":266},[7143],{"type":51,"value":364},{"type":45,"tag":106,"props":7145,"children":7146},{"style":129},[7147],{"type":51,"value":274},{"type":45,"tag":106,"props":7149,"children":7150},{"style":119},[7151],{"type":51,"value":373},{"type":45,"tag":106,"props":7153,"children":7154},{"style":281},[7155],{"type":51,"value":332},{"type":45,"tag":106,"props":7157,"children":7158},{"style":119},[7159],{"type":51,"value":382},{"type":45,"tag":106,"props":7161,"children":7162},{"style":250},[7163],{"type":51,"value":387},{"type":45,"tag":106,"props":7165,"children":7166},{"style":129},[7167],{"type":51,"value":332},{"type":45,"tag":106,"props":7169,"children":7170},{"style":119},[7171],{"type":51,"value":402},{"type":45,"tag":106,"props":7173,"children":7174},{"style":129},[7175],{"type":51,"value":7176},"active ",{"type":45,"tag":106,"props":7178,"children":7179},{"style":119},[7180],{"type":51,"value":7068},{"type":45,"tag":106,"props":7182,"children":7183},{"style":415},[7184],{"type":51,"value":418},{"type":45,"tag":106,"props":7186,"children":7187},{"style":129},[7188],{"type":51,"value":351},{"type":45,"tag":106,"props":7190,"children":7191},{"class":108,"line":140},[7192],{"type":45,"tag":106,"props":7193,"children":7194},{"emptyLinePlaceholder":213},[7195],{"type":51,"value":216},{"type":45,"tag":106,"props":7197,"children":7198},{"class":108,"line":153},[7199],{"type":45,"tag":106,"props":7200,"children":7201},{"style":223},[7202],{"type":51,"value":7203},"\u002F\u002F CORRECT\n",{"type":45,"tag":106,"props":7205,"children":7206},{"class":108,"line":166},[7207,7211,7215,7219,7223,7227,7231,7235,7239,7243,7247,7251,7255,7259,7263,7267,7271,7275,7279,7283,7287,7291,7295,7299],{"type":45,"tag":106,"props":7208,"children":7209},{"style":129},[7210],{"type":51,"value":284},{"type":45,"tag":106,"props":7212,"children":7213},{"style":119},[7214],{"type":51,"value":402},{"type":45,"tag":106,"props":7216,"children":7217},{"style":266},[7218],{"type":51,"value":317},{"type":45,"tag":106,"props":7220,"children":7221},{"style":129},[7222],{"type":51,"value":274},{"type":45,"tag":106,"props":7224,"children":7225},{"style":119},[7226],{"type":51,"value":326},{"type":45,"tag":106,"props":7228,"children":7229},{"style":329},[7230],{"type":51,"value":332},{"type":45,"tag":106,"props":7232,"children":7233},{"style":119},[7234],{"type":51,"value":337},{"type":45,"tag":106,"props":7236,"children":7237},{"style":129},[7238],{"type":51,"value":342},{"type":45,"tag":106,"props":7240,"children":7241},{"style":119},[7242],{"type":51,"value":185},{"type":45,"tag":106,"props":7244,"children":7245},{"style":129},[7246],{"type":51,"value":289},{"type":45,"tag":106,"props":7248,"children":7249},{"style":119},[7250],{"type":51,"value":402},{"type":45,"tag":106,"props":7252,"children":7253},{"style":266},[7254],{"type":51,"value":364},{"type":45,"tag":106,"props":7256,"children":7257},{"style":129},[7258],{"type":51,"value":274},{"type":45,"tag":106,"props":7260,"children":7261},{"style":119},[7262],{"type":51,"value":373},{"type":45,"tag":106,"props":7264,"children":7265},{"style":281},[7266],{"type":51,"value":332},{"type":45,"tag":106,"props":7268,"children":7269},{"style":119},[7270],{"type":51,"value":382},{"type":45,"tag":106,"props":7272,"children":7273},{"style":250},[7274],{"type":51,"value":387},{"type":45,"tag":106,"props":7276,"children":7277},{"style":266},[7278],{"type":51,"value":392},{"type":45,"tag":106,"props":7280,"children":7281},{"style":129},[7282],{"type":51,"value":397},{"type":45,"tag":106,"props":7284,"children":7285},{"style":119},[7286],{"type":51,"value":402},{"type":45,"tag":106,"props":7288,"children":7289},{"style":129},[7290],{"type":51,"value":407},{"type":45,"tag":106,"props":7292,"children":7293},{"style":119},[7294],{"type":51,"value":412},{"type":45,"tag":106,"props":7296,"children":7297},{"style":415},[7298],{"type":51,"value":418},{"type":45,"tag":106,"props":7300,"children":7301},{"style":129},[7302],{"type":51,"value":423},{"type":45,"tag":1075,"props":7304,"children":7306},{"id":7305},"critical-filtering-in-js-instead-of-query-operators",[7307],{"type":51,"value":7308},"CRITICAL: Filtering in JS instead of query operators",{"type":45,"tag":58,"props":7310,"children":7311},{},[7312,7314,7320,7321,7327],{"type":51,"value":7313},"JS ",{"type":45,"tag":102,"props":7315,"children":7317},{"className":7316},[],[7318],{"type":51,"value":7319},".filter()",{"type":51,"value":6936},{"type":45,"tag":102,"props":7322,"children":7324},{"className":7323},[],[7325],{"type":51,"value":7326},".map()",{"type":51,"value":7328}," on the result array throws away incremental maintenance -- the JS code re-runs from scratch on every change.",{"type":45,"tag":94,"props":7330,"children":7332},{"className":96,"code":7331,"language":98,"meta":99,"style":99},"\u002F\u002F WRONG -- re-runs filter on every change\nconst { data } = useLiveQuery((q) => q.from({ todos: todosCollection }))\nconst active = data.filter((t) => t.completed === false)\n\n\u002F\u002F CORRECT -- incrementally maintained\nconst { data } = useLiveQuery((q) =>\n  q\n    .from({ todos: todosCollection })\n    .where(({ todos }) => eq(todos.completed, false)),\n)\n",[7333],{"type":45,"tag":102,"props":7334,"children":7335},{"__ignoreMap":99},[7336,7344,7437,7515,7522,7530,7577,7584,7623,7688],{"type":45,"tag":106,"props":7337,"children":7338},{"class":108,"line":109},[7339],{"type":45,"tag":106,"props":7340,"children":7341},{"style":223},[7342],{"type":51,"value":7343},"\u002F\u002F WRONG -- re-runs filter on every change\n",{"type":45,"tag":106,"props":7345,"children":7346},{"class":108,"line":125},[7347,7351,7355,7360,7364,7369,7374,7378,7382,7386,7390,7394,7399,7403,7407,7411,7415,7420,7424,7429,7433],{"type":45,"tag":106,"props":7348,"children":7349},{"style":250},[7350],{"type":51,"value":253},{"type":45,"tag":106,"props":7352,"children":7353},{"style":119},[7354],{"type":51,"value":1135},{"type":45,"tag":106,"props":7356,"children":7357},{"style":129},[7358],{"type":51,"value":7359}," data ",{"type":45,"tag":106,"props":7361,"children":7362},{"style":119},[7363],{"type":51,"value":185},{"type":45,"tag":106,"props":7365,"children":7366},{"style":119},[7367],{"type":51,"value":7368}," =",{"type":45,"tag":106,"props":7370,"children":7371},{"style":266},[7372],{"type":51,"value":7373}," useLiveQuery",{"type":45,"tag":106,"props":7375,"children":7376},{"style":129},[7377],{"type":51,"value":274},{"type":45,"tag":106,"props":7379,"children":7380},{"style":119},[7381],{"type":51,"value":274},{"type":45,"tag":106,"props":7383,"children":7384},{"style":281},[7385],{"type":51,"value":284},{"type":45,"tag":106,"props":7387,"children":7388},{"style":119},[7389],{"type":51,"value":289},{"type":45,"tag":106,"props":7391,"children":7392},{"style":250},[7393],{"type":51,"value":387},{"type":45,"tag":106,"props":7395,"children":7396},{"style":129},[7397],{"type":51,"value":7398}," q",{"type":45,"tag":106,"props":7400,"children":7401},{"style":119},[7402],{"type":51,"value":402},{"type":45,"tag":106,"props":7404,"children":7405},{"style":266},[7406],{"type":51,"value":317},{"type":45,"tag":106,"props":7408,"children":7409},{"style":129},[7410],{"type":51,"value":274},{"type":45,"tag":106,"props":7412,"children":7413},{"style":119},[7414],{"type":51,"value":326},{"type":45,"tag":106,"props":7416,"children":7417},{"style":329},[7418],{"type":51,"value":7419}," todos",{"type":45,"tag":106,"props":7421,"children":7422},{"style":119},[7423],{"type":51,"value":337},{"type":45,"tag":106,"props":7425,"children":7426},{"style":129},[7427],{"type":51,"value":7428}," todosCollection ",{"type":45,"tag":106,"props":7430,"children":7431},{"style":119},[7432],{"type":51,"value":185},{"type":45,"tag":106,"props":7434,"children":7435},{"style":129},[7436],{"type":51,"value":423},{"type":45,"tag":106,"props":7438,"children":7439},{"class":108,"line":140},[7440,7444,7449,7453,7458,7462,7467,7471,7475,7480,7484,7488,7493,7497,7502,7506,7511],{"type":45,"tag":106,"props":7441,"children":7442},{"style":250},[7443],{"type":51,"value":253},{"type":45,"tag":106,"props":7445,"children":7446},{"style":129},[7447],{"type":51,"value":7448}," active ",{"type":45,"tag":106,"props":7450,"children":7451},{"style":119},[7452],{"type":51,"value":263},{"type":45,"tag":106,"props":7454,"children":7455},{"style":129},[7456],{"type":51,"value":7457}," data",{"type":45,"tag":106,"props":7459,"children":7460},{"style":119},[7461],{"type":51,"value":402},{"type":45,"tag":106,"props":7463,"children":7464},{"style":266},[7465],{"type":51,"value":7466},"filter",{"type":45,"tag":106,"props":7468,"children":7469},{"style":129},[7470],{"type":51,"value":274},{"type":45,"tag":106,"props":7472,"children":7473},{"style":119},[7474],{"type":51,"value":274},{"type":45,"tag":106,"props":7476,"children":7477},{"style":281},[7478],{"type":51,"value":7479},"t",{"type":45,"tag":106,"props":7481,"children":7482},{"style":119},[7483],{"type":51,"value":289},{"type":45,"tag":106,"props":7485,"children":7486},{"style":250},[7487],{"type":51,"value":387},{"type":45,"tag":106,"props":7489,"children":7490},{"style":129},[7491],{"type":51,"value":7492}," t",{"type":45,"tag":106,"props":7494,"children":7495},{"style":119},[7496],{"type":51,"value":402},{"type":45,"tag":106,"props":7498,"children":7499},{"style":129},[7500],{"type":51,"value":7501},"completed ",{"type":45,"tag":106,"props":7503,"children":7504},{"style":119},[7505],{"type":51,"value":7068},{"type":45,"tag":106,"props":7507,"children":7508},{"style":415},[7509],{"type":51,"value":7510}," false",{"type":45,"tag":106,"props":7512,"children":7513},{"style":129},[7514],{"type":51,"value":351},{"type":45,"tag":106,"props":7516,"children":7517},{"class":108,"line":153},[7518],{"type":45,"tag":106,"props":7519,"children":7520},{"emptyLinePlaceholder":213},[7521],{"type":51,"value":216},{"type":45,"tag":106,"props":7523,"children":7524},{"class":108,"line":166},[7525],{"type":45,"tag":106,"props":7526,"children":7527},{"style":223},[7528],{"type":51,"value":7529},"\u002F\u002F CORRECT -- incrementally maintained\n",{"type":45,"tag":106,"props":7531,"children":7532},{"class":108,"line":179},[7533,7537,7541,7545,7549,7553,7557,7561,7565,7569,7573],{"type":45,"tag":106,"props":7534,"children":7535},{"style":250},[7536],{"type":51,"value":253},{"type":45,"tag":106,"props":7538,"children":7539},{"style":119},[7540],{"type":51,"value":1135},{"type":45,"tag":106,"props":7542,"children":7543},{"style":129},[7544],{"type":51,"value":7359},{"type":45,"tag":106,"props":7546,"children":7547},{"style":119},[7548],{"type":51,"value":185},{"type":45,"tag":106,"props":7550,"children":7551},{"style":119},[7552],{"type":51,"value":7368},{"type":45,"tag":106,"props":7554,"children":7555},{"style":266},[7556],{"type":51,"value":7373},{"type":45,"tag":106,"props":7558,"children":7559},{"style":129},[7560],{"type":51,"value":274},{"type":45,"tag":106,"props":7562,"children":7563},{"style":119},[7564],{"type":51,"value":274},{"type":45,"tag":106,"props":7566,"children":7567},{"style":281},[7568],{"type":51,"value":284},{"type":45,"tag":106,"props":7570,"children":7571},{"style":119},[7572],{"type":51,"value":289},{"type":45,"tag":106,"props":7574,"children":7575},{"style":250},[7576],{"type":51,"value":294},{"type":45,"tag":106,"props":7578,"children":7579},{"class":108,"line":209},[7580],{"type":45,"tag":106,"props":7581,"children":7582},{"style":129},[7583],{"type":51,"value":303},{"type":45,"tag":106,"props":7585,"children":7586},{"class":108,"line":219},[7587,7591,7595,7599,7603,7607,7611,7615,7619],{"type":45,"tag":106,"props":7588,"children":7589},{"style":119},[7590],{"type":51,"value":312},{"type":45,"tag":106,"props":7592,"children":7593},{"style":266},[7594],{"type":51,"value":317},{"type":45,"tag":106,"props":7596,"children":7597},{"style":129},[7598],{"type":51,"value":274},{"type":45,"tag":106,"props":7600,"children":7601},{"style":119},[7602],{"type":51,"value":326},{"type":45,"tag":106,"props":7604,"children":7605},{"style":329},[7606],{"type":51,"value":7419},{"type":45,"tag":106,"props":7608,"children":7609},{"style":119},[7610],{"type":51,"value":337},{"type":45,"tag":106,"props":7612,"children":7613},{"style":129},[7614],{"type":51,"value":7428},{"type":45,"tag":106,"props":7616,"children":7617},{"style":119},[7618],{"type":51,"value":185},{"type":45,"tag":106,"props":7620,"children":7621},{"style":129},[7622],{"type":51,"value":351},{"type":45,"tag":106,"props":7624,"children":7625},{"class":108,"line":229},[7626,7630,7634,7638,7642,7646,7650,7654,7658,7663,7667,7672,7676,7680,7684],{"type":45,"tag":106,"props":7627,"children":7628},{"style":119},[7629],{"type":51,"value":312},{"type":45,"tag":106,"props":7631,"children":7632},{"style":266},[7633],{"type":51,"value":364},{"type":45,"tag":106,"props":7635,"children":7636},{"style":129},[7637],{"type":51,"value":274},{"type":45,"tag":106,"props":7639,"children":7640},{"style":119},[7641],{"type":51,"value":373},{"type":45,"tag":106,"props":7643,"children":7644},{"style":281},[7645],{"type":51,"value":7419},{"type":45,"tag":106,"props":7647,"children":7648},{"style":119},[7649],{"type":51,"value":382},{"type":45,"tag":106,"props":7651,"children":7652},{"style":250},[7653],{"type":51,"value":387},{"type":45,"tag":106,"props":7655,"children":7656},{"style":266},[7657],{"type":51,"value":392},{"type":45,"tag":106,"props":7659,"children":7660},{"style":129},[7661],{"type":51,"value":7662},"(todos",{"type":45,"tag":106,"props":7664,"children":7665},{"style":119},[7666],{"type":51,"value":402},{"type":45,"tag":106,"props":7668,"children":7669},{"style":129},[7670],{"type":51,"value":7671},"completed",{"type":45,"tag":106,"props":7673,"children":7674},{"style":119},[7675],{"type":51,"value":412},{"type":45,"tag":106,"props":7677,"children":7678},{"style":415},[7679],{"type":51,"value":7510},{"type":45,"tag":106,"props":7681,"children":7682},{"style":129},[7683],{"type":51,"value":570},{"type":45,"tag":106,"props":7685,"children":7686},{"style":119},[7687],{"type":51,"value":137},{"type":45,"tag":106,"props":7689,"children":7690},{"class":108,"line":237},[7691],{"type":45,"tag":106,"props":7692,"children":7693},{"style":129},[7694],{"type":51,"value":351},{"type":45,"tag":1075,"props":7696,"children":7698},{"id":7697},"high-not-using-the-full-operator-set",[7699],{"type":51,"value":7700},"HIGH: Not using the full operator set",{"type":45,"tag":58,"props":7702,"children":7703},{},[7704,7706,7712,7713,7719,7720,7726,7727,7733,7735,7741,7743,7749,7750,7756,7758,7764,7765,7771,7772,7778,7779,7785,7786,7792],{"type":51,"value":7705},"The library provides string functions (",{"type":45,"tag":102,"props":7707,"children":7709},{"className":7708},[],[7710],{"type":51,"value":7711},"upper",{"type":51,"value":1101},{"type":45,"tag":102,"props":7714,"children":7716},{"className":7715},[],[7717],{"type":51,"value":7718},"lower",{"type":51,"value":1101},{"type":45,"tag":102,"props":7721,"children":7723},{"className":7722},[],[7724],{"type":51,"value":7725},"length",{"type":51,"value":1101},{"type":45,"tag":102,"props":7728,"children":7730},{"className":7729},[],[7731],{"type":51,"value":7732},"concat",{"type":51,"value":7734},"), math (",{"type":45,"tag":102,"props":7736,"children":7738},{"className":7737},[],[7739],{"type":51,"value":7740},"add",{"type":51,"value":7742},"), utility functions (",{"type":45,"tag":102,"props":7744,"children":7746},{"className":7745},[],[7747],{"type":51,"value":7748},"coalesce",{"type":51,"value":1101},{"type":45,"tag":102,"props":7751,"children":7753},{"className":7752},[],[7754],{"type":51,"value":7755},"caseWhen",{"type":51,"value":7757},"), and aggregates (",{"type":45,"tag":102,"props":7759,"children":7761},{"className":7760},[],[7762],{"type":51,"value":7763},"count",{"type":51,"value":1101},{"type":45,"tag":102,"props":7766,"children":7768},{"className":7767},[],[7769],{"type":51,"value":7770},"sum",{"type":51,"value":1101},{"type":45,"tag":102,"props":7773,"children":7775},{"className":7774},[],[7776],{"type":51,"value":7777},"avg",{"type":51,"value":1101},{"type":45,"tag":102,"props":7780,"children":7782},{"className":7781},[],[7783],{"type":51,"value":7784},"min",{"type":51,"value":1101},{"type":45,"tag":102,"props":7787,"children":7789},{"className":7788},[],[7790],{"type":51,"value":7791},"max",{"type":51,"value":7793},"). All are incrementally maintained. Prefer them over JS equivalents.",{"type":45,"tag":94,"props":7795,"children":7797},{"className":96,"code":7796,"language":98,"meta":99,"style":99},"\u002F\u002F WRONG\n.fn.select((row) => ({\n  name: row.user.name.toUpperCase(),\n  total: row.order.price + row.order.tax,\n}))\n\n\u002F\u002F CORRECT\n.select(({ user, order }) => ({\n  name: upper(user.name),\n  total: add(order.price, order.tax),\n  displayName: coalesce(user.displayName, user.name, 'Unknown'),\n}))\n",[7798],{"type":45,"tag":102,"props":7799,"children":7800},{"__ignoreMap":99},[7801,7808,7857,7907,7971,7982,7989,7996,8043,8076,8126,8197],{"type":45,"tag":106,"props":7802,"children":7803},{"class":108,"line":109},[7804],{"type":45,"tag":106,"props":7805,"children":7806},{"style":223},[7807],{"type":51,"value":7092},{"type":45,"tag":106,"props":7809,"children":7810},{"class":108,"line":125},[7811,7815,7820,7824,7828,7832,7836,7841,7845,7849,7853],{"type":45,"tag":106,"props":7812,"children":7813},{"style":119},[7814],{"type":51,"value":402},{"type":45,"tag":106,"props":7816,"children":7817},{"style":129},[7818],{"type":51,"value":7819},"fn",{"type":45,"tag":106,"props":7821,"children":7822},{"style":119},[7823],{"type":51,"value":402},{"type":45,"tag":106,"props":7825,"children":7826},{"style":266},[7827],{"type":51,"value":436},{"type":45,"tag":106,"props":7829,"children":7830},{"style":129},[7831],{"type":51,"value":274},{"type":45,"tag":106,"props":7833,"children":7834},{"style":119},[7835],{"type":51,"value":274},{"type":45,"tag":106,"props":7837,"children":7838},{"style":281},[7839],{"type":51,"value":7840},"row",{"type":45,"tag":106,"props":7842,"children":7843},{"style":119},[7844],{"type":51,"value":289},{"type":45,"tag":106,"props":7846,"children":7847},{"style":250},[7848],{"type":51,"value":387},{"type":45,"tag":106,"props":7850,"children":7851},{"style":129},[7852],{"type":51,"value":461},{"type":45,"tag":106,"props":7854,"children":7855},{"style":119},[7856],{"type":51,"value":466},{"type":45,"tag":106,"props":7858,"children":7859},{"class":108,"line":140},[7860,7865,7869,7874,7878,7882,7886,7890,7894,7899,7903],{"type":45,"tag":106,"props":7861,"children":7862},{"style":329},[7863],{"type":51,"value":7864},"  name",{"type":45,"tag":106,"props":7866,"children":7867},{"style":119},[7868],{"type":51,"value":337},{"type":45,"tag":106,"props":7870,"children":7871},{"style":129},[7872],{"type":51,"value":7873}," row",{"type":45,"tag":106,"props":7875,"children":7876},{"style":119},[7877],{"type":51,"value":402},{"type":45,"tag":106,"props":7879,"children":7880},{"style":129},[7881],{"type":51,"value":918},{"type":45,"tag":106,"props":7883,"children":7884},{"style":119},[7885],{"type":51,"value":402},{"type":45,"tag":106,"props":7887,"children":7888},{"style":129},[7889],{"type":51,"value":522},{"type":45,"tag":106,"props":7891,"children":7892},{"style":119},[7893],{"type":51,"value":402},{"type":45,"tag":106,"props":7895,"children":7896},{"style":266},[7897],{"type":51,"value":7898},"toUpperCase",{"type":45,"tag":106,"props":7900,"children":7901},{"style":129},[7902],{"type":51,"value":6178},{"type":45,"tag":106,"props":7904,"children":7905},{"style":119},[7906],{"type":51,"value":137},{"type":45,"tag":106,"props":7908,"children":7909},{"class":108,"line":153},[7910,7915,7919,7923,7927,7932,7936,7941,7946,7950,7954,7958,7962,7967],{"type":45,"tag":106,"props":7911,"children":7912},{"style":329},[7913],{"type":51,"value":7914},"  total",{"type":45,"tag":106,"props":7916,"children":7917},{"style":119},[7918],{"type":51,"value":337},{"type":45,"tag":106,"props":7920,"children":7921},{"style":129},[7922],{"type":51,"value":7873},{"type":45,"tag":106,"props":7924,"children":7925},{"style":119},[7926],{"type":51,"value":402},{"type":45,"tag":106,"props":7928,"children":7929},{"style":129},[7930],{"type":51,"value":7931},"order",{"type":45,"tag":106,"props":7933,"children":7934},{"style":119},[7935],{"type":51,"value":402},{"type":45,"tag":106,"props":7937,"children":7938},{"style":129},[7939],{"type":51,"value":7940},"price ",{"type":45,"tag":106,"props":7942,"children":7943},{"style":119},[7944],{"type":51,"value":7945},"+",{"type":45,"tag":106,"props":7947,"children":7948},{"style":129},[7949],{"type":51,"value":7873},{"type":45,"tag":106,"props":7951,"children":7952},{"style":119},[7953],{"type":51,"value":402},{"type":45,"tag":106,"props":7955,"children":7956},{"style":129},[7957],{"type":51,"value":7931},{"type":45,"tag":106,"props":7959,"children":7960},{"style":119},[7961],{"type":51,"value":402},{"type":45,"tag":106,"props":7963,"children":7964},{"style":129},[7965],{"type":51,"value":7966},"tax",{"type":45,"tag":106,"props":7968,"children":7969},{"style":119},[7970],{"type":51,"value":137},{"type":45,"tag":106,"props":7972,"children":7973},{"class":108,"line":166},[7974,7978],{"type":45,"tag":106,"props":7975,"children":7976},{"style":119},[7977],{"type":51,"value":185},{"type":45,"tag":106,"props":7979,"children":7980},{"style":129},[7981],{"type":51,"value":423},{"type":45,"tag":106,"props":7983,"children":7984},{"class":108,"line":179},[7985],{"type":45,"tag":106,"props":7986,"children":7987},{"emptyLinePlaceholder":213},[7988],{"type":51,"value":216},{"type":45,"tag":106,"props":7990,"children":7991},{"class":108,"line":209},[7992],{"type":45,"tag":106,"props":7993,"children":7994},{"style":223},[7995],{"type":51,"value":7203},{"type":45,"tag":106,"props":7997,"children":7998},{"class":108,"line":219},[7999,8003,8007,8011,8015,8019,8023,8027,8031,8035,8039],{"type":45,"tag":106,"props":8000,"children":8001},{"style":119},[8002],{"type":51,"value":402},{"type":45,"tag":106,"props":8004,"children":8005},{"style":266},[8006],{"type":51,"value":436},{"type":45,"tag":106,"props":8008,"children":8009},{"style":129},[8010],{"type":51,"value":274},{"type":45,"tag":106,"props":8012,"children":8013},{"style":119},[8014],{"type":51,"value":373},{"type":45,"tag":106,"props":8016,"children":8017},{"style":281},[8018],{"type":51,"value":332},{"type":45,"tag":106,"props":8020,"children":8021},{"style":119},[8022],{"type":51,"value":412},{"type":45,"tag":106,"props":8024,"children":8025},{"style":281},[8026],{"type":51,"value":2628},{"type":45,"tag":106,"props":8028,"children":8029},{"style":119},[8030],{"type":51,"value":382},{"type":45,"tag":106,"props":8032,"children":8033},{"style":250},[8034],{"type":51,"value":387},{"type":45,"tag":106,"props":8036,"children":8037},{"style":129},[8038],{"type":51,"value":461},{"type":45,"tag":106,"props":8040,"children":8041},{"style":119},[8042],{"type":51,"value":466},{"type":45,"tag":106,"props":8044,"children":8045},{"class":108,"line":229},[8046,8050,8054,8059,8063,8067,8072],{"type":45,"tag":106,"props":8047,"children":8048},{"style":329},[8049],{"type":51,"value":7864},{"type":45,"tag":106,"props":8051,"children":8052},{"style":119},[8053],{"type":51,"value":337},{"type":45,"tag":106,"props":8055,"children":8056},{"style":266},[8057],{"type":51,"value":8058}," upper",{"type":45,"tag":106,"props":8060,"children":8061},{"style":129},[8062],{"type":51,"value":397},{"type":45,"tag":106,"props":8064,"children":8065},{"style":119},[8066],{"type":51,"value":402},{"type":45,"tag":106,"props":8068,"children":8069},{"style":129},[8070],{"type":51,"value":8071},"name)",{"type":45,"tag":106,"props":8073,"children":8074},{"style":119},[8075],{"type":51,"value":137},{"type":45,"tag":106,"props":8077,"children":8078},{"class":108,"line":237},[8079,8083,8087,8092,8096,8100,8105,8109,8113,8117,8122],{"type":45,"tag":106,"props":8080,"children":8081},{"style":329},[8082],{"type":51,"value":7914},{"type":45,"tag":106,"props":8084,"children":8085},{"style":119},[8086],{"type":51,"value":337},{"type":45,"tag":106,"props":8088,"children":8089},{"style":266},[8090],{"type":51,"value":8091}," add",{"type":45,"tag":106,"props":8093,"children":8094},{"style":129},[8095],{"type":51,"value":2778},{"type":45,"tag":106,"props":8097,"children":8098},{"style":119},[8099],{"type":51,"value":402},{"type":45,"tag":106,"props":8101,"children":8102},{"style":129},[8103],{"type":51,"value":8104},"price",{"type":45,"tag":106,"props":8106,"children":8107},{"style":119},[8108],{"type":51,"value":412},{"type":45,"tag":106,"props":8110,"children":8111},{"style":129},[8112],{"type":51,"value":2628},{"type":45,"tag":106,"props":8114,"children":8115},{"style":119},[8116],{"type":51,"value":402},{"type":45,"tag":106,"props":8118,"children":8119},{"style":129},[8120],{"type":51,"value":8121},"tax)",{"type":45,"tag":106,"props":8123,"children":8124},{"style":119},[8125],{"type":51,"value":137},{"type":45,"tag":106,"props":8127,"children":8128},{"class":108,"line":246},[8129,8134,8138,8143,8147,8151,8156,8160,8164,8168,8172,8176,8180,8185,8189,8193],{"type":45,"tag":106,"props":8130,"children":8131},{"style":329},[8132],{"type":51,"value":8133},"  displayName",{"type":45,"tag":106,"props":8135,"children":8136},{"style":119},[8137],{"type":51,"value":337},{"type":45,"tag":106,"props":8139,"children":8140},{"style":266},[8141],{"type":51,"value":8142}," coalesce",{"type":45,"tag":106,"props":8144,"children":8145},{"style":129},[8146],{"type":51,"value":397},{"type":45,"tag":106,"props":8148,"children":8149},{"style":119},[8150],{"type":51,"value":402},{"type":45,"tag":106,"props":8152,"children":8153},{"style":129},[8154],{"type":51,"value":8155},"displayName",{"type":45,"tag":106,"props":8157,"children":8158},{"style":119},[8159],{"type":51,"value":412},{"type":45,"tag":106,"props":8161,"children":8162},{"style":129},[8163],{"type":51,"value":332},{"type":45,"tag":106,"props":8165,"children":8166},{"style":119},[8167],{"type":51,"value":402},{"type":45,"tag":106,"props":8169,"children":8170},{"style":129},[8171],{"type":51,"value":522},{"type":45,"tag":106,"props":8173,"children":8174},{"style":119},[8175],{"type":51,"value":412},{"type":45,"tag":106,"props":8177,"children":8178},{"style":119},[8179],{"type":51,"value":195},{"type":45,"tag":106,"props":8181,"children":8182},{"style":198},[8183],{"type":51,"value":8184},"Unknown",{"type":45,"tag":106,"props":8186,"children":8187},{"style":119},[8188],{"type":51,"value":1496},{"type":45,"tag":106,"props":8190,"children":8191},{"style":129},[8192],{"type":51,"value":289},{"type":45,"tag":106,"props":8194,"children":8195},{"style":119},[8196],{"type":51,"value":137},{"type":45,"tag":106,"props":8198,"children":8199},{"class":108,"line":297},[8200,8204],{"type":45,"tag":106,"props":8201,"children":8202},{"style":119},[8203],{"type":51,"value":185},{"type":45,"tag":106,"props":8205,"children":8206},{"style":129},[8207],{"type":51,"value":423},{"type":45,"tag":1075,"props":8209,"children":8211},{"id":8210},"high-missing-conditional-expression-helpers",[8212],{"type":51,"value":8213},"HIGH: Missing conditional expression helpers",{"type":45,"tag":58,"props":8215,"children":8216},{},[8217,8218,8224,8226,8232,8234,8240,8242,8248],{"type":51,"value":2438},{"type":45,"tag":102,"props":8219,"children":8221},{"className":8220},[],[8222],{"type":51,"value":8223},"coalesce()",{"type":51,"value":8225}," for null\u002Fundefined fallbacks and ",{"type":45,"tag":102,"props":8227,"children":8229},{"className":8228},[],[8230],{"type":51,"value":8231},"caseWhen()",{"type":51,"value":8233}," for conditional\ncomputed fields. JavaScript operators like ",{"type":45,"tag":102,"props":8235,"children":8237},{"className":8236},[],[8238],{"type":51,"value":8239},"||",{"type":51,"value":8241}," or ternaries do not build query\nexpressions inside standard ",{"type":45,"tag":102,"props":8243,"children":8245},{"className":8244},[],[8246],{"type":51,"value":8247},".select()",{"type":51,"value":8249}," callbacks.",{"type":45,"tag":94,"props":8251,"children":8253},{"className":96,"code":8252,"language":98,"meta":99,"style":99},"\u002F\u002F WRONG -- document.title is a query ref, not a runtime string\n.select(({ document }) => ({\n  displayTitle: document.title || 'Untitled document',\n}))\n\n\u002F\u002F CORRECT -- fallback for null\u002Fundefined\n.select(({ document }) => ({\n  displayTitle: coalesce(document.title, 'Untitled document'),\n}))\n\n\u002F\u002F CORRECT -- fallback for null\u002Fundefined and empty string\n.select(({ document }) => ({\n  displayTitle: caseWhen(\n    eq(coalesce(document.title, ''), ''),\n    'Untitled document',\n    document.title,\n  ),\n}))\n",[8254],{"type":45,"tag":102,"props":8255,"children":8256},{"__ignoreMap":99},[8257,8265,8305,8351,8362,8369,8377,8416,8468,8479,8486,8494,8533,8553,8609,8629,8649,8661],{"type":45,"tag":106,"props":8258,"children":8259},{"class":108,"line":109},[8260],{"type":45,"tag":106,"props":8261,"children":8262},{"style":223},[8263],{"type":51,"value":8264},"\u002F\u002F WRONG -- document.title is a query ref, not a runtime string\n",{"type":45,"tag":106,"props":8266,"children":8267},{"class":108,"line":125},[8268,8272,8276,8280,8284,8289,8293,8297,8301],{"type":45,"tag":106,"props":8269,"children":8270},{"style":119},[8271],{"type":51,"value":402},{"type":45,"tag":106,"props":8273,"children":8274},{"style":266},[8275],{"type":51,"value":436},{"type":45,"tag":106,"props":8277,"children":8278},{"style":129},[8279],{"type":51,"value":274},{"type":45,"tag":106,"props":8281,"children":8282},{"style":119},[8283],{"type":51,"value":373},{"type":45,"tag":106,"props":8285,"children":8286},{"style":281},[8287],{"type":51,"value":8288}," document",{"type":45,"tag":106,"props":8290,"children":8291},{"style":119},[8292],{"type":51,"value":382},{"type":45,"tag":106,"props":8294,"children":8295},{"style":250},[8296],{"type":51,"value":387},{"type":45,"tag":106,"props":8298,"children":8299},{"style":129},[8300],{"type":51,"value":461},{"type":45,"tag":106,"props":8302,"children":8303},{"style":119},[8304],{"type":51,"value":466},{"type":45,"tag":106,"props":8306,"children":8307},{"class":108,"line":140},[8308,8313,8317,8321,8325,8330,8334,8338,8343,8347],{"type":45,"tag":106,"props":8309,"children":8310},{"style":329},[8311],{"type":51,"value":8312},"  displayTitle",{"type":45,"tag":106,"props":8314,"children":8315},{"style":119},[8316],{"type":51,"value":337},{"type":45,"tag":106,"props":8318,"children":8319},{"style":129},[8320],{"type":51,"value":8288},{"type":45,"tag":106,"props":8322,"children":8323},{"style":119},[8324],{"type":51,"value":402},{"type":45,"tag":106,"props":8326,"children":8327},{"style":129},[8328],{"type":51,"value":8329},"title ",{"type":45,"tag":106,"props":8331,"children":8332},{"style":119},[8333],{"type":51,"value":8239},{"type":45,"tag":106,"props":8335,"children":8336},{"style":119},[8337],{"type":51,"value":195},{"type":45,"tag":106,"props":8339,"children":8340},{"style":198},[8341],{"type":51,"value":8342},"Untitled document",{"type":45,"tag":106,"props":8344,"children":8345},{"style":119},[8346],{"type":51,"value":1496},{"type":45,"tag":106,"props":8348,"children":8349},{"style":119},[8350],{"type":51,"value":137},{"type":45,"tag":106,"props":8352,"children":8353},{"class":108,"line":153},[8354,8358],{"type":45,"tag":106,"props":8355,"children":8356},{"style":119},[8357],{"type":51,"value":185},{"type":45,"tag":106,"props":8359,"children":8360},{"style":129},[8361],{"type":51,"value":423},{"type":45,"tag":106,"props":8363,"children":8364},{"class":108,"line":166},[8365],{"type":45,"tag":106,"props":8366,"children":8367},{"emptyLinePlaceholder":213},[8368],{"type":51,"value":216},{"type":45,"tag":106,"props":8370,"children":8371},{"class":108,"line":179},[8372],{"type":45,"tag":106,"props":8373,"children":8374},{"style":223},[8375],{"type":51,"value":8376},"\u002F\u002F CORRECT -- fallback for null\u002Fundefined\n",{"type":45,"tag":106,"props":8378,"children":8379},{"class":108,"line":209},[8380,8384,8388,8392,8396,8400,8404,8408,8412],{"type":45,"tag":106,"props":8381,"children":8382},{"style":119},[8383],{"type":51,"value":402},{"type":45,"tag":106,"props":8385,"children":8386},{"style":266},[8387],{"type":51,"value":436},{"type":45,"tag":106,"props":8389,"children":8390},{"style":129},[8391],{"type":51,"value":274},{"type":45,"tag":106,"props":8393,"children":8394},{"style":119},[8395],{"type":51,"value":373},{"type":45,"tag":106,"props":8397,"children":8398},{"style":281},[8399],{"type":51,"value":8288},{"type":45,"tag":106,"props":8401,"children":8402},{"style":119},[8403],{"type":51,"value":382},{"type":45,"tag":106,"props":8405,"children":8406},{"style":250},[8407],{"type":51,"value":387},{"type":45,"tag":106,"props":8409,"children":8410},{"style":129},[8411],{"type":51,"value":461},{"type":45,"tag":106,"props":8413,"children":8414},{"style":119},[8415],{"type":51,"value":466},{"type":45,"tag":106,"props":8417,"children":8418},{"class":108,"line":219},[8419,8423,8427,8431,8436,8440,8444,8448,8452,8456,8460,8464],{"type":45,"tag":106,"props":8420,"children":8421},{"style":329},[8422],{"type":51,"value":8312},{"type":45,"tag":106,"props":8424,"children":8425},{"style":119},[8426],{"type":51,"value":337},{"type":45,"tag":106,"props":8428,"children":8429},{"style":266},[8430],{"type":51,"value":8142},{"type":45,"tag":106,"props":8432,"children":8433},{"style":129},[8434],{"type":51,"value":8435},"(document",{"type":45,"tag":106,"props":8437,"children":8438},{"style":119},[8439],{"type":51,"value":402},{"type":45,"tag":106,"props":8441,"children":8442},{"style":129},[8443],{"type":51,"value":2141},{"type":45,"tag":106,"props":8445,"children":8446},{"style":119},[8447],{"type":51,"value":412},{"type":45,"tag":106,"props":8449,"children":8450},{"style":119},[8451],{"type":51,"value":195},{"type":45,"tag":106,"props":8453,"children":8454},{"style":198},[8455],{"type":51,"value":8342},{"type":45,"tag":106,"props":8457,"children":8458},{"style":119},[8459],{"type":51,"value":1496},{"type":45,"tag":106,"props":8461,"children":8462},{"style":129},[8463],{"type":51,"value":289},{"type":45,"tag":106,"props":8465,"children":8466},{"style":119},[8467],{"type":51,"value":137},{"type":45,"tag":106,"props":8469,"children":8470},{"class":108,"line":229},[8471,8475],{"type":45,"tag":106,"props":8472,"children":8473},{"style":119},[8474],{"type":51,"value":185},{"type":45,"tag":106,"props":8476,"children":8477},{"style":129},[8478],{"type":51,"value":423},{"type":45,"tag":106,"props":8480,"children":8481},{"class":108,"line":237},[8482],{"type":45,"tag":106,"props":8483,"children":8484},{"emptyLinePlaceholder":213},[8485],{"type":51,"value":216},{"type":45,"tag":106,"props":8487,"children":8488},{"class":108,"line":246},[8489],{"type":45,"tag":106,"props":8490,"children":8491},{"style":223},[8492],{"type":51,"value":8493},"\u002F\u002F CORRECT -- fallback for null\u002Fundefined and empty string\n",{"type":45,"tag":106,"props":8495,"children":8496},{"class":108,"line":297},[8497,8501,8505,8509,8513,8517,8521,8525,8529],{"type":45,"tag":106,"props":8498,"children":8499},{"style":119},[8500],{"type":51,"value":402},{"type":45,"tag":106,"props":8502,"children":8503},{"style":266},[8504],{"type":51,"value":436},{"type":45,"tag":106,"props":8506,"children":8507},{"style":129},[8508],{"type":51,"value":274},{"type":45,"tag":106,"props":8510,"children":8511},{"style":119},[8512],{"type":51,"value":373},{"type":45,"tag":106,"props":8514,"children":8515},{"style":281},[8516],{"type":51,"value":8288},{"type":45,"tag":106,"props":8518,"children":8519},{"style":119},[8520],{"type":51,"value":382},{"type":45,"tag":106,"props":8522,"children":8523},{"style":250},[8524],{"type":51,"value":387},{"type":45,"tag":106,"props":8526,"children":8527},{"style":129},[8528],{"type":51,"value":461},{"type":45,"tag":106,"props":8530,"children":8531},{"style":119},[8532],{"type":51,"value":466},{"type":45,"tag":106,"props":8534,"children":8535},{"class":108,"line":306},[8536,8540,8544,8549],{"type":45,"tag":106,"props":8537,"children":8538},{"style":329},[8539],{"type":51,"value":8312},{"type":45,"tag":106,"props":8541,"children":8542},{"style":119},[8543],{"type":51,"value":337},{"type":45,"tag":106,"props":8545,"children":8546},{"style":266},[8547],{"type":51,"value":8548}," caseWhen",{"type":45,"tag":106,"props":8550,"children":8551},{"style":129},[8552],{"type":51,"value":626},{"type":45,"tag":106,"props":8554,"children":8555},{"class":108,"line":354},[8556,8560,8564,8568,8572,8576,8580,8584,8589,8593,8597,8601,8605],{"type":45,"tag":106,"props":8557,"children":8558},{"style":266},[8559],{"type":51,"value":2385},{"type":45,"tag":106,"props":8561,"children":8562},{"style":129},[8563],{"type":51,"value":274},{"type":45,"tag":106,"props":8565,"children":8566},{"style":266},[8567],{"type":51,"value":7748},{"type":45,"tag":106,"props":8569,"children":8570},{"style":129},[8571],{"type":51,"value":8435},{"type":45,"tag":106,"props":8573,"children":8574},{"style":119},[8575],{"type":51,"value":402},{"type":45,"tag":106,"props":8577,"children":8578},{"style":129},[8579],{"type":51,"value":2141},{"type":45,"tag":106,"props":8581,"children":8582},{"style":119},[8583],{"type":51,"value":412},{"type":45,"tag":106,"props":8585,"children":8586},{"style":119},[8587],{"type":51,"value":8588}," ''",{"type":45,"tag":106,"props":8590,"children":8591},{"style":129},[8592],{"type":51,"value":289},{"type":45,"tag":106,"props":8594,"children":8595},{"style":119},[8596],{"type":51,"value":412},{"type":45,"tag":106,"props":8598,"children":8599},{"style":119},[8600],{"type":51,"value":8588},{"type":45,"tag":106,"props":8602,"children":8603},{"style":129},[8604],{"type":51,"value":289},{"type":45,"tag":106,"props":8606,"children":8607},{"style":119},[8608],{"type":51,"value":137},{"type":45,"tag":106,"props":8610,"children":8611},{"class":108,"line":426},[8612,8617,8621,8625],{"type":45,"tag":106,"props":8613,"children":8614},{"style":119},[8615],{"type":51,"value":8616},"    '",{"type":45,"tag":106,"props":8618,"children":8619},{"style":198},[8620],{"type":51,"value":8342},{"type":45,"tag":106,"props":8622,"children":8623},{"style":119},[8624],{"type":51,"value":1496},{"type":45,"tag":106,"props":8626,"children":8627},{"style":119},[8628],{"type":51,"value":137},{"type":45,"tag":106,"props":8630,"children":8631},{"class":108,"line":469},[8632,8637,8641,8645],{"type":45,"tag":106,"props":8633,"children":8634},{"style":129},[8635],{"type":51,"value":8636},"    document",{"type":45,"tag":106,"props":8638,"children":8639},{"style":119},[8640],{"type":51,"value":402},{"type":45,"tag":106,"props":8642,"children":8643},{"style":129},[8644],{"type":51,"value":2141},{"type":45,"tag":106,"props":8646,"children":8647},{"style":119},[8648],{"type":51,"value":137},{"type":45,"tag":106,"props":8650,"children":8651},{"class":108,"line":499},[8652,8657],{"type":45,"tag":106,"props":8653,"children":8654},{"style":129},[8655],{"type":51,"value":8656},"  )",{"type":45,"tag":106,"props":8658,"children":8659},{"style":119},[8660],{"type":51,"value":137},{"type":45,"tag":106,"props":8662,"children":8663},{"class":108,"line":529},[8664,8668],{"type":45,"tag":106,"props":8665,"children":8666},{"style":119},[8667],{"type":51,"value":185},{"type":45,"tag":106,"props":8669,"children":8670},{"style":129},[8671],{"type":51,"value":423},{"type":45,"tag":58,"props":8673,"children":8674},{},[8675,8676,8682,8684,8689],{"type":51,"value":2438},{"type":45,"tag":102,"props":8677,"children":8679},{"className":8678},[],[8680],{"type":51,"value":8681},"fn.select()",{"type":51,"value":8683}," only when you genuinely need arbitrary JavaScript; it cannot\nbe optimized like expression-based ",{"type":45,"tag":102,"props":8685,"children":8687},{"className":8686},[],[8688],{"type":51,"value":8247},{"type":51,"value":402},{"type":45,"tag":1075,"props":8691,"children":8693},{"id":8692},"high-distinct-without-select",[8694],{"type":51,"value":8695},"HIGH: .distinct() without .select()",{"type":45,"tag":58,"props":8697,"children":8698},{},[8699,8705,8707,8712,8714,8720],{"type":45,"tag":102,"props":8700,"children":8702},{"className":8701},[],[8703],{"type":51,"value":8704},"distinct()",{"type":51,"value":8706}," deduplicates by the selected columns. Without ",{"type":45,"tag":102,"props":8708,"children":8710},{"className":8709},[],[8711],{"type":51,"value":3873},{"type":51,"value":8713},", throws ",{"type":45,"tag":102,"props":8715,"children":8717},{"className":8716},[],[8718],{"type":51,"value":8719},"DistinctRequiresSelectError",{"type":51,"value":402},{"type":45,"tag":94,"props":8722,"children":8724},{"className":96,"code":8723,"language":98,"meta":99,"style":99},"\u002F\u002F WRONG\nq.from({ user: usersCollection }).distinct()\n\n\u002F\u002F CORRECT\nq.from({ user: usersCollection })\n  .select(({ user }) => ({ country: user.country }))\n  .distinct()\n",[8725],{"type":45,"tag":102,"props":8726,"children":8727},{"__ignoreMap":99},[8728,8735,8791,8798,8805,8848,8917],{"type":45,"tag":106,"props":8729,"children":8730},{"class":108,"line":109},[8731],{"type":45,"tag":106,"props":8732,"children":8733},{"style":223},[8734],{"type":51,"value":7092},{"type":45,"tag":106,"props":8736,"children":8737},{"class":108,"line":125},[8738,8742,8746,8750,8754,8758,8762,8766,8770,8774,8778,8782,8787],{"type":45,"tag":106,"props":8739,"children":8740},{"style":129},[8741],{"type":51,"value":284},{"type":45,"tag":106,"props":8743,"children":8744},{"style":119},[8745],{"type":51,"value":402},{"type":45,"tag":106,"props":8747,"children":8748},{"style":266},[8749],{"type":51,"value":317},{"type":45,"tag":106,"props":8751,"children":8752},{"style":129},[8753],{"type":51,"value":274},{"type":45,"tag":106,"props":8755,"children":8756},{"style":119},[8757],{"type":51,"value":326},{"type":45,"tag":106,"props":8759,"children":8760},{"style":329},[8761],{"type":51,"value":332},{"type":45,"tag":106,"props":8763,"children":8764},{"style":119},[8765],{"type":51,"value":337},{"type":45,"tag":106,"props":8767,"children":8768},{"style":129},[8769],{"type":51,"value":342},{"type":45,"tag":106,"props":8771,"children":8772},{"style":119},[8773],{"type":51,"value":185},{"type":45,"tag":106,"props":8775,"children":8776},{"style":129},[8777],{"type":51,"value":289},{"type":45,"tag":106,"props":8779,"children":8780},{"style":119},[8781],{"type":51,"value":402},{"type":45,"tag":106,"props":8783,"children":8784},{"style":266},[8785],{"type":51,"value":8786},"distinct",{"type":45,"tag":106,"props":8788,"children":8789},{"style":129},[8790],{"type":51,"value":6862},{"type":45,"tag":106,"props":8792,"children":8793},{"class":108,"line":140},[8794],{"type":45,"tag":106,"props":8795,"children":8796},{"emptyLinePlaceholder":213},[8797],{"type":51,"value":216},{"type":45,"tag":106,"props":8799,"children":8800},{"class":108,"line":153},[8801],{"type":45,"tag":106,"props":8802,"children":8803},{"style":223},[8804],{"type":51,"value":7203},{"type":45,"tag":106,"props":8806,"children":8807},{"class":108,"line":166},[8808,8812,8816,8820,8824,8828,8832,8836,8840,8844],{"type":45,"tag":106,"props":8809,"children":8810},{"style":129},[8811],{"type":51,"value":284},{"type":45,"tag":106,"props":8813,"children":8814},{"style":119},[8815],{"type":51,"value":402},{"type":45,"tag":106,"props":8817,"children":8818},{"style":266},[8819],{"type":51,"value":317},{"type":45,"tag":106,"props":8821,"children":8822},{"style":129},[8823],{"type":51,"value":274},{"type":45,"tag":106,"props":8825,"children":8826},{"style":119},[8827],{"type":51,"value":326},{"type":45,"tag":106,"props":8829,"children":8830},{"style":329},[8831],{"type":51,"value":332},{"type":45,"tag":106,"props":8833,"children":8834},{"style":119},[8835],{"type":51,"value":337},{"type":45,"tag":106,"props":8837,"children":8838},{"style":129},[8839],{"type":51,"value":342},{"type":45,"tag":106,"props":8841,"children":8842},{"style":119},[8843],{"type":51,"value":185},{"type":45,"tag":106,"props":8845,"children":8846},{"style":129},[8847],{"type":51,"value":351},{"type":45,"tag":106,"props":8849,"children":8850},{"class":108,"line":179},[8851,8855,8859,8863,8867,8871,8875,8879,8883,8887,8892,8896,8900,8904,8909,8913],{"type":45,"tag":106,"props":8852,"children":8853},{"style":119},[8854],{"type":51,"value":2230},{"type":45,"tag":106,"props":8856,"children":8857},{"style":266},[8858],{"type":51,"value":436},{"type":45,"tag":106,"props":8860,"children":8861},{"style":129},[8862],{"type":51,"value":274},{"type":45,"tag":106,"props":8864,"children":8865},{"style":119},[8866],{"type":51,"value":373},{"type":45,"tag":106,"props":8868,"children":8869},{"style":281},[8870],{"type":51,"value":332},{"type":45,"tag":106,"props":8872,"children":8873},{"style":119},[8874],{"type":51,"value":382},{"type":45,"tag":106,"props":8876,"children":8877},{"style":250},[8878],{"type":51,"value":387},{"type":45,"tag":106,"props":8880,"children":8881},{"style":129},[8882],{"type":51,"value":461},{"type":45,"tag":106,"props":8884,"children":8885},{"style":119},[8886],{"type":51,"value":326},{"type":45,"tag":106,"props":8888,"children":8889},{"style":329},[8890],{"type":51,"value":8891}," country",{"type":45,"tag":106,"props":8893,"children":8894},{"style":119},[8895],{"type":51,"value":337},{"type":45,"tag":106,"props":8897,"children":8898},{"style":129},[8899],{"type":51,"value":332},{"type":45,"tag":106,"props":8901,"children":8902},{"style":119},[8903],{"type":51,"value":402},{"type":45,"tag":106,"props":8905,"children":8906},{"style":129},[8907],{"type":51,"value":8908},"country ",{"type":45,"tag":106,"props":8910,"children":8911},{"style":119},[8912],{"type":51,"value":185},{"type":45,"tag":106,"props":8914,"children":8915},{"style":129},[8916],{"type":51,"value":423},{"type":45,"tag":106,"props":8918,"children":8919},{"class":108,"line":209},[8920,8924,8928],{"type":45,"tag":106,"props":8921,"children":8922},{"style":119},[8923],{"type":51,"value":2230},{"type":45,"tag":106,"props":8925,"children":8926},{"style":266},[8927],{"type":51,"value":8786},{"type":45,"tag":106,"props":8929,"children":8930},{"style":129},[8931],{"type":51,"value":6862},{"type":45,"tag":1075,"props":8933,"children":8935},{"id":8934},"high-having-without-groupby",[8936],{"type":51,"value":8937},"HIGH: .having() without .groupBy()",{"type":45,"tag":58,"props":8939,"children":8940},{},[8941,8946,8948,8953,8955,8961],{"type":45,"tag":102,"props":8942,"children":8944},{"className":8943},[],[8945],{"type":51,"value":2459},{"type":51,"value":8947}," filters aggregated groups. Without ",{"type":45,"tag":102,"props":8949,"children":8951},{"className":8950},[],[8952],{"type":51,"value":2444},{"type":51,"value":8954},", there are no groups. Throws ",{"type":45,"tag":102,"props":8956,"children":8958},{"className":8957},[],[8959],{"type":51,"value":8960},"HavingRequiresGroupByError",{"type":51,"value":402},{"type":45,"tag":94,"props":8963,"children":8965},{"className":96,"code":8964,"language":98,"meta":99,"style":99},"\u002F\u002F WRONG\nq.from({ order: ordersCollection }).having(({ order }) =>\n  gt(count(order.id), 5),\n)\n\n\u002F\u002F CORRECT\nq.from({ order: ordersCollection })\n  .groupBy(({ order }) => order.customerId)\n  .having(({ order }) => gt(count(order.id), 5))\n",[8966],{"type":45,"tag":102,"props":8967,"children":8968},{"__ignoreMap":99},[8969,8976,9047,9092,9099,9106,9113,9156,9199],{"type":45,"tag":106,"props":8970,"children":8971},{"class":108,"line":109},[8972],{"type":45,"tag":106,"props":8973,"children":8974},{"style":223},[8975],{"type":51,"value":7092},{"type":45,"tag":106,"props":8977,"children":8978},{"class":108,"line":125},[8979,8983,8987,8991,8995,8999,9003,9007,9011,9015,9019,9023,9027,9031,9035,9039,9043],{"type":45,"tag":106,"props":8980,"children":8981},{"style":129},[8982],{"type":51,"value":284},{"type":45,"tag":106,"props":8984,"children":8985},{"style":119},[8986],{"type":51,"value":402},{"type":45,"tag":106,"props":8988,"children":8989},{"style":266},[8990],{"type":51,"value":317},{"type":45,"tag":106,"props":8992,"children":8993},{"style":129},[8994],{"type":51,"value":274},{"type":45,"tag":106,"props":8996,"children":8997},{"style":119},[8998],{"type":51,"value":326},{"type":45,"tag":106,"props":9000,"children":9001},{"style":329},[9002],{"type":51,"value":2628},{"type":45,"tag":106,"props":9004,"children":9005},{"style":119},[9006],{"type":51,"value":337},{"type":45,"tag":106,"props":9008,"children":9009},{"style":129},[9010],{"type":51,"value":2637},{"type":45,"tag":106,"props":9012,"children":9013},{"style":119},[9014],{"type":51,"value":185},{"type":45,"tag":106,"props":9016,"children":9017},{"style":129},[9018],{"type":51,"value":289},{"type":45,"tag":106,"props":9020,"children":9021},{"style":119},[9022],{"type":51,"value":402},{"type":45,"tag":106,"props":9024,"children":9025},{"style":266},[9026],{"type":51,"value":2459},{"type":45,"tag":106,"props":9028,"children":9029},{"style":129},[9030],{"type":51,"value":274},{"type":45,"tag":106,"props":9032,"children":9033},{"style":119},[9034],{"type":51,"value":373},{"type":45,"tag":106,"props":9036,"children":9037},{"style":281},[9038],{"type":51,"value":2628},{"type":45,"tag":106,"props":9040,"children":9041},{"style":119},[9042],{"type":51,"value":382},{"type":45,"tag":106,"props":9044,"children":9045},{"style":250},[9046],{"type":51,"value":294},{"type":45,"tag":106,"props":9048,"children":9049},{"class":108,"line":140},[9050,9055,9059,9063,9067,9071,9075,9079,9084,9088],{"type":45,"tag":106,"props":9051,"children":9052},{"style":266},[9053],{"type":51,"value":9054},"  gt",{"type":45,"tag":106,"props":9056,"children":9057},{"style":129},[9058],{"type":51,"value":274},{"type":45,"tag":106,"props":9060,"children":9061},{"style":266},[9062],{"type":51,"value":7763},{"type":45,"tag":106,"props":9064,"children":9065},{"style":129},[9066],{"type":51,"value":2778},{"type":45,"tag":106,"props":9068,"children":9069},{"style":119},[9070],{"type":51,"value":402},{"type":45,"tag":106,"props":9072,"children":9073},{"style":129},[9074],{"type":51,"value":2820},{"type":45,"tag":106,"props":9076,"children":9077},{"style":119},[9078],{"type":51,"value":412},{"type":45,"tag":106,"props":9080,"children":9081},{"style":1437},[9082],{"type":51,"value":9083}," 5",{"type":45,"tag":106,"props":9085,"children":9086},{"style":129},[9087],{"type":51,"value":289},{"type":45,"tag":106,"props":9089,"children":9090},{"style":119},[9091],{"type":51,"value":137},{"type":45,"tag":106,"props":9093,"children":9094},{"class":108,"line":153},[9095],{"type":45,"tag":106,"props":9096,"children":9097},{"style":129},[9098],{"type":51,"value":351},{"type":45,"tag":106,"props":9100,"children":9101},{"class":108,"line":166},[9102],{"type":45,"tag":106,"props":9103,"children":9104},{"emptyLinePlaceholder":213},[9105],{"type":51,"value":216},{"type":45,"tag":106,"props":9107,"children":9108},{"class":108,"line":179},[9109],{"type":45,"tag":106,"props":9110,"children":9111},{"style":223},[9112],{"type":51,"value":7203},{"type":45,"tag":106,"props":9114,"children":9115},{"class":108,"line":209},[9116,9120,9124,9128,9132,9136,9140,9144,9148,9152],{"type":45,"tag":106,"props":9117,"children":9118},{"style":129},[9119],{"type":51,"value":284},{"type":45,"tag":106,"props":9121,"children":9122},{"style":119},[9123],{"type":51,"value":402},{"type":45,"tag":106,"props":9125,"children":9126},{"style":266},[9127],{"type":51,"value":317},{"type":45,"tag":106,"props":9129,"children":9130},{"style":129},[9131],{"type":51,"value":274},{"type":45,"tag":106,"props":9133,"children":9134},{"style":119},[9135],{"type":51,"value":326},{"type":45,"tag":106,"props":9137,"children":9138},{"style":329},[9139],{"type":51,"value":2628},{"type":45,"tag":106,"props":9141,"children":9142},{"style":119},[9143],{"type":51,"value":337},{"type":45,"tag":106,"props":9145,"children":9146},{"style":129},[9147],{"type":51,"value":2637},{"type":45,"tag":106,"props":9149,"children":9150},{"style":119},[9151],{"type":51,"value":185},{"type":45,"tag":106,"props":9153,"children":9154},{"style":129},[9155],{"type":51,"value":351},{"type":45,"tag":106,"props":9157,"children":9158},{"class":108,"line":219},[9159,9163,9167,9171,9175,9179,9183,9187,9191,9195],{"type":45,"tag":106,"props":9160,"children":9161},{"style":119},[9162],{"type":51,"value":2230},{"type":45,"tag":106,"props":9164,"children":9165},{"style":266},[9166],{"type":51,"value":2444},{"type":45,"tag":106,"props":9168,"children":9169},{"style":129},[9170],{"type":51,"value":274},{"type":45,"tag":106,"props":9172,"children":9173},{"style":119},[9174],{"type":51,"value":373},{"type":45,"tag":106,"props":9176,"children":9177},{"style":281},[9178],{"type":51,"value":2628},{"type":45,"tag":106,"props":9180,"children":9181},{"style":119},[9182],{"type":51,"value":382},{"type":45,"tag":106,"props":9184,"children":9185},{"style":250},[9186],{"type":51,"value":387},{"type":45,"tag":106,"props":9188,"children":9189},{"style":129},[9190],{"type":51,"value":2628},{"type":45,"tag":106,"props":9192,"children":9193},{"style":119},[9194],{"type":51,"value":402},{"type":45,"tag":106,"props":9196,"children":9197},{"style":129},[9198],{"type":51,"value":2689},{"type":45,"tag":106,"props":9200,"children":9201},{"class":108,"line":229},[9202,9206,9210,9214,9218,9222,9226,9230,9234,9238,9242,9246,9250,9254,9258,9262],{"type":45,"tag":106,"props":9203,"children":9204},{"style":119},[9205],{"type":51,"value":2230},{"type":45,"tag":106,"props":9207,"children":9208},{"style":266},[9209],{"type":51,"value":2459},{"type":45,"tag":106,"props":9211,"children":9212},{"style":129},[9213],{"type":51,"value":274},{"type":45,"tag":106,"props":9215,"children":9216},{"style":119},[9217],{"type":51,"value":373},{"type":45,"tag":106,"props":9219,"children":9220},{"style":281},[9221],{"type":51,"value":2628},{"type":45,"tag":106,"props":9223,"children":9224},{"style":119},[9225],{"type":51,"value":382},{"type":45,"tag":106,"props":9227,"children":9228},{"style":250},[9229],{"type":51,"value":387},{"type":45,"tag":106,"props":9231,"children":9232},{"style":266},[9233],{"type":51,"value":1148},{"type":45,"tag":106,"props":9235,"children":9236},{"style":129},[9237],{"type":51,"value":274},{"type":45,"tag":106,"props":9239,"children":9240},{"style":266},[9241],{"type":51,"value":7763},{"type":45,"tag":106,"props":9243,"children":9244},{"style":129},[9245],{"type":51,"value":2778},{"type":45,"tag":106,"props":9247,"children":9248},{"style":119},[9249],{"type":51,"value":402},{"type":45,"tag":106,"props":9251,"children":9252},{"style":129},[9253],{"type":51,"value":2820},{"type":45,"tag":106,"props":9255,"children":9256},{"style":119},[9257],{"type":51,"value":412},{"type":45,"tag":106,"props":9259,"children":9260},{"style":1437},[9261],{"type":51,"value":9083},{"type":45,"tag":106,"props":9263,"children":9264},{"style":129},[9265],{"type":51,"value":423},{"type":45,"tag":1075,"props":9267,"children":9269},{"id":9268},"high-limit-offset-without-orderby",[9270],{"type":51,"value":9271},"HIGH: .limit() \u002F .offset() without .orderBy()",{"type":45,"tag":58,"props":9273,"children":9274},{},[9275,9277,9283],{"type":51,"value":9276},"Without deterministic ordering, limit\u002Foffset results are non-deterministic and cannot be incrementally maintained. Throws ",{"type":45,"tag":102,"props":9278,"children":9280},{"className":9279},[],[9281],{"type":51,"value":9282},"LimitOffsetRequireOrderByError",{"type":51,"value":402},{"type":45,"tag":94,"props":9285,"children":9287},{"className":96,"code":9286,"language":98,"meta":99,"style":99},"\u002F\u002F WRONG\nq.from({ user: usersCollection }).limit(10)\n\n\u002F\u002F CORRECT\nq.from({ user: usersCollection })\n  .orderBy(({ user }) => user.name)\n  .limit(10)\n",[9288],{"type":45,"tag":102,"props":9289,"children":9290},{"__ignoreMap":99},[9291,9298,9361,9368,9375,9418,9462],{"type":45,"tag":106,"props":9292,"children":9293},{"class":108,"line":109},[9294],{"type":45,"tag":106,"props":9295,"children":9296},{"style":223},[9297],{"type":51,"value":7092},{"type":45,"tag":106,"props":9299,"children":9300},{"class":108,"line":125},[9301,9305,9309,9313,9317,9321,9325,9329,9333,9337,9341,9345,9349,9353,9357],{"type":45,"tag":106,"props":9302,"children":9303},{"style":129},[9304],{"type":51,"value":284},{"type":45,"tag":106,"props":9306,"children":9307},{"style":119},[9308],{"type":51,"value":402},{"type":45,"tag":106,"props":9310,"children":9311},{"style":266},[9312],{"type":51,"value":317},{"type":45,"tag":106,"props":9314,"children":9315},{"style":129},[9316],{"type":51,"value":274},{"type":45,"tag":106,"props":9318,"children":9319},{"style":119},[9320],{"type":51,"value":326},{"type":45,"tag":106,"props":9322,"children":9323},{"style":329},[9324],{"type":51,"value":332},{"type":45,"tag":106,"props":9326,"children":9327},{"style":119},[9328],{"type":51,"value":337},{"type":45,"tag":106,"props":9330,"children":9331},{"style":129},[9332],{"type":51,"value":342},{"type":45,"tag":106,"props":9334,"children":9335},{"style":119},[9336],{"type":51,"value":185},{"type":45,"tag":106,"props":9338,"children":9339},{"style":129},[9340],{"type":51,"value":289},{"type":45,"tag":106,"props":9342,"children":9343},{"style":119},[9344],{"type":51,"value":402},{"type":45,"tag":106,"props":9346,"children":9347},{"style":266},[9348],{"type":51,"value":2974},{"type":45,"tag":106,"props":9350,"children":9351},{"style":129},[9352],{"type":51,"value":274},{"type":45,"tag":106,"props":9354,"children":9355},{"style":1437},[9356],{"type":51,"value":2983},{"type":45,"tag":106,"props":9358,"children":9359},{"style":129},[9360],{"type":51,"value":351},{"type":45,"tag":106,"props":9362,"children":9363},{"class":108,"line":140},[9364],{"type":45,"tag":106,"props":9365,"children":9366},{"emptyLinePlaceholder":213},[9367],{"type":51,"value":216},{"type":45,"tag":106,"props":9369,"children":9370},{"class":108,"line":153},[9371],{"type":45,"tag":106,"props":9372,"children":9373},{"style":223},[9374],{"type":51,"value":7203},{"type":45,"tag":106,"props":9376,"children":9377},{"class":108,"line":166},[9378,9382,9386,9390,9394,9398,9402,9406,9410,9414],{"type":45,"tag":106,"props":9379,"children":9380},{"style":129},[9381],{"type":51,"value":284},{"type":45,"tag":106,"props":9383,"children":9384},{"style":119},[9385],{"type":51,"value":402},{"type":45,"tag":106,"props":9387,"children":9388},{"style":266},[9389],{"type":51,"value":317},{"type":45,"tag":106,"props":9391,"children":9392},{"style":129},[9393],{"type":51,"value":274},{"type":45,"tag":106,"props":9395,"children":9396},{"style":119},[9397],{"type":51,"value":326},{"type":45,"tag":106,"props":9399,"children":9400},{"style":329},[9401],{"type":51,"value":332},{"type":45,"tag":106,"props":9403,"children":9404},{"style":119},[9405],{"type":51,"value":337},{"type":45,"tag":106,"props":9407,"children":9408},{"style":129},[9409],{"type":51,"value":342},{"type":45,"tag":106,"props":9411,"children":9412},{"style":119},[9413],{"type":51,"value":185},{"type":45,"tag":106,"props":9415,"children":9416},{"style":129},[9417],{"type":51,"value":351},{"type":45,"tag":106,"props":9419,"children":9420},{"class":108,"line":179},[9421,9425,9429,9433,9437,9441,9445,9449,9453,9457],{"type":45,"tag":106,"props":9422,"children":9423},{"style":119},[9424],{"type":51,"value":2230},{"type":45,"tag":106,"props":9426,"children":9427},{"style":266},[9428],{"type":51,"value":2482},{"type":45,"tag":106,"props":9430,"children":9431},{"style":129},[9432],{"type":51,"value":274},{"type":45,"tag":106,"props":9434,"children":9435},{"style":119},[9436],{"type":51,"value":373},{"type":45,"tag":106,"props":9438,"children":9439},{"style":281},[9440],{"type":51,"value":332},{"type":45,"tag":106,"props":9442,"children":9443},{"style":119},[9444],{"type":51,"value":382},{"type":45,"tag":106,"props":9446,"children":9447},{"style":250},[9448],{"type":51,"value":387},{"type":45,"tag":106,"props":9450,"children":9451},{"style":129},[9452],{"type":51,"value":332},{"type":45,"tag":106,"props":9454,"children":9455},{"style":119},[9456],{"type":51,"value":402},{"type":45,"tag":106,"props":9458,"children":9459},{"style":129},[9460],{"type":51,"value":9461},"name)\n",{"type":45,"tag":106,"props":9463,"children":9464},{"class":108,"line":209},[9465,9469,9473,9477,9481],{"type":45,"tag":106,"props":9466,"children":9467},{"style":119},[9468],{"type":51,"value":2230},{"type":45,"tag":106,"props":9470,"children":9471},{"style":266},[9472],{"type":51,"value":2974},{"type":45,"tag":106,"props":9474,"children":9475},{"style":129},[9476],{"type":51,"value":274},{"type":45,"tag":106,"props":9478,"children":9479},{"style":1437},[9480],{"type":51,"value":2983},{"type":45,"tag":106,"props":9482,"children":9483},{"style":129},[9484],{"type":51,"value":351},{"type":45,"tag":1075,"props":9486,"children":9488},{"id":9487},"high-join-condition-using-non-eq-operator",[9489],{"type":51,"value":9490},"HIGH: Join condition using non-eq() operator",{"type":45,"tag":58,"props":9492,"children":9493},{},[9494,9496,9502,9503,9509,9511,9517],{"type":51,"value":9495},"The differential dataflow join operator only supports equality joins. Using ",{"type":45,"tag":102,"props":9497,"children":9499},{"className":9498},[],[9500],{"type":51,"value":9501},"gt()",{"type":51,"value":1101},{"type":45,"tag":102,"props":9504,"children":9506},{"className":9505},[],[9507],{"type":51,"value":9508},"like()",{"type":51,"value":9510},", etc. throws ",{"type":45,"tag":102,"props":9512,"children":9514},{"className":9513},[],[9515],{"type":51,"value":9516},"JoinConditionMustBeEqualityError",{"type":51,"value":402},{"type":45,"tag":94,"props":9519,"children":9521},{"className":96,"code":9520,"language":98,"meta":99,"style":99},"\u002F\u002F WRONG\nq.from({ user: usersCollection }).join(\n  { post: postsCollection },\n  ({ user, post }) => gt(user.id, post.userId),\n)\n\n\u002F\u002F CORRECT\nq.from({ user: usersCollection }).join(\n  { post: postsCollection },\n  ({ user, post }) => eq(user.id, post.userId),\n)\n",[9522],{"type":45,"tag":102,"props":9523,"children":9524},{"__ignoreMap":99},[9525,9532,9587,9612,9676,9683,9690,9697,9752,9775,9838],{"type":45,"tag":106,"props":9526,"children":9527},{"class":108,"line":109},[9528],{"type":45,"tag":106,"props":9529,"children":9530},{"style":223},[9531],{"type":51,"value":7092},{"type":45,"tag":106,"props":9533,"children":9534},{"class":108,"line":125},[9535,9539,9543,9547,9551,9555,9559,9563,9567,9571,9575,9579,9583],{"type":45,"tag":106,"props":9536,"children":9537},{"style":129},[9538],{"type":51,"value":284},{"type":45,"tag":106,"props":9540,"children":9541},{"style":119},[9542],{"type":51,"value":402},{"type":45,"tag":106,"props":9544,"children":9545},{"style":266},[9546],{"type":51,"value":317},{"type":45,"tag":106,"props":9548,"children":9549},{"style":129},[9550],{"type":51,"value":274},{"type":45,"tag":106,"props":9552,"children":9553},{"style":119},[9554],{"type":51,"value":326},{"type":45,"tag":106,"props":9556,"children":9557},{"style":329},[9558],{"type":51,"value":332},{"type":45,"tag":106,"props":9560,"children":9561},{"style":119},[9562],{"type":51,"value":337},{"type":45,"tag":106,"props":9564,"children":9565},{"style":129},[9566],{"type":51,"value":342},{"type":45,"tag":106,"props":9568,"children":9569},{"style":119},[9570],{"type":51,"value":185},{"type":45,"tag":106,"props":9572,"children":9573},{"style":129},[9574],{"type":51,"value":289},{"type":45,"tag":106,"props":9576,"children":9577},{"style":119},[9578],{"type":51,"value":402},{"type":45,"tag":106,"props":9580,"children":9581},{"style":266},[9582],{"type":51,"value":2235},{"type":45,"tag":106,"props":9584,"children":9585},{"style":129},[9586],{"type":51,"value":626},{"type":45,"tag":106,"props":9588,"children":9589},{"class":108,"line":140},[9590,9595,9599,9603,9607],{"type":45,"tag":106,"props":9591,"children":9592},{"style":119},[9593],{"type":51,"value":9594},"  {",{"type":45,"tag":106,"props":9596,"children":9597},{"style":329},[9598],{"type":51,"value":1953},{"type":45,"tag":106,"props":9600,"children":9601},{"style":119},[9602],{"type":51,"value":337},{"type":45,"tag":106,"props":9604,"children":9605},{"style":129},[9606],{"type":51,"value":1962},{"type":45,"tag":106,"props":9608,"children":9609},{"style":119},[9610],{"type":51,"value":9611},"},\n",{"type":45,"tag":106,"props":9613,"children":9614},{"class":108,"line":153},[9615,9620,9624,9628,9632,9636,9640,9644,9648,9652,9656,9660,9664,9668,9672],{"type":45,"tag":106,"props":9616,"children":9617},{"style":119},[9618],{"type":51,"value":9619},"  ({",{"type":45,"tag":106,"props":9621,"children":9622},{"style":281},[9623],{"type":51,"value":332},{"type":45,"tag":106,"props":9625,"children":9626},{"style":119},[9627],{"type":51,"value":412},{"type":45,"tag":106,"props":9629,"children":9630},{"style":281},[9631],{"type":51,"value":1953},{"type":45,"tag":106,"props":9633,"children":9634},{"style":119},[9635],{"type":51,"value":382},{"type":45,"tag":106,"props":9637,"children":9638},{"style":250},[9639],{"type":51,"value":387},{"type":45,"tag":106,"props":9641,"children":9642},{"style":266},[9643],{"type":51,"value":1148},{"type":45,"tag":106,"props":9645,"children":9646},{"style":129},[9647],{"type":51,"value":397},{"type":45,"tag":106,"props":9649,"children":9650},{"style":119},[9651],{"type":51,"value":402},{"type":45,"tag":106,"props":9653,"children":9654},{"style":129},[9655],{"type":51,"value":492},{"type":45,"tag":106,"props":9657,"children":9658},{"style":119},[9659],{"type":51,"value":412},{"type":45,"tag":106,"props":9661,"children":9662},{"style":129},[9663],{"type":51,"value":1953},{"type":45,"tag":106,"props":9665,"children":9666},{"style":119},[9667],{"type":51,"value":402},{"type":45,"tag":106,"props":9669,"children":9670},{"style":129},[9671],{"type":51,"value":2029},{"type":45,"tag":106,"props":9673,"children":9674},{"style":119},[9675],{"type":51,"value":137},{"type":45,"tag":106,"props":9677,"children":9678},{"class":108,"line":166},[9679],{"type":45,"tag":106,"props":9680,"children":9681},{"style":129},[9682],{"type":51,"value":351},{"type":45,"tag":106,"props":9684,"children":9685},{"class":108,"line":179},[9686],{"type":45,"tag":106,"props":9687,"children":9688},{"emptyLinePlaceholder":213},[9689],{"type":51,"value":216},{"type":45,"tag":106,"props":9691,"children":9692},{"class":108,"line":209},[9693],{"type":45,"tag":106,"props":9694,"children":9695},{"style":223},[9696],{"type":51,"value":7203},{"type":45,"tag":106,"props":9698,"children":9699},{"class":108,"line":219},[9700,9704,9708,9712,9716,9720,9724,9728,9732,9736,9740,9744,9748],{"type":45,"tag":106,"props":9701,"children":9702},{"style":129},[9703],{"type":51,"value":284},{"type":45,"tag":106,"props":9705,"children":9706},{"style":119},[9707],{"type":51,"value":402},{"type":45,"tag":106,"props":9709,"children":9710},{"style":266},[9711],{"type":51,"value":317},{"type":45,"tag":106,"props":9713,"children":9714},{"style":129},[9715],{"type":51,"value":274},{"type":45,"tag":106,"props":9717,"children":9718},{"style":119},[9719],{"type":51,"value":326},{"type":45,"tag":106,"props":9721,"children":9722},{"style":329},[9723],{"type":51,"value":332},{"type":45,"tag":106,"props":9725,"children":9726},{"style":119},[9727],{"type":51,"value":337},{"type":45,"tag":106,"props":9729,"children":9730},{"style":129},[9731],{"type":51,"value":342},{"type":45,"tag":106,"props":9733,"children":9734},{"style":119},[9735],{"type":51,"value":185},{"type":45,"tag":106,"props":9737,"children":9738},{"style":129},[9739],{"type":51,"value":289},{"type":45,"tag":106,"props":9741,"children":9742},{"style":119},[9743],{"type":51,"value":402},{"type":45,"tag":106,"props":9745,"children":9746},{"style":266},[9747],{"type":51,"value":2235},{"type":45,"tag":106,"props":9749,"children":9750},{"style":129},[9751],{"type":51,"value":626},{"type":45,"tag":106,"props":9753,"children":9754},{"class":108,"line":229},[9755,9759,9763,9767,9771],{"type":45,"tag":106,"props":9756,"children":9757},{"style":119},[9758],{"type":51,"value":9594},{"type":45,"tag":106,"props":9760,"children":9761},{"style":329},[9762],{"type":51,"value":1953},{"type":45,"tag":106,"props":9764,"children":9765},{"style":119},[9766],{"type":51,"value":337},{"type":45,"tag":106,"props":9768,"children":9769},{"style":129},[9770],{"type":51,"value":1962},{"type":45,"tag":106,"props":9772,"children":9773},{"style":119},[9774],{"type":51,"value":9611},{"type":45,"tag":106,"props":9776,"children":9777},{"class":108,"line":237},[9778,9782,9786,9790,9794,9798,9802,9806,9810,9814,9818,9822,9826,9830,9834],{"type":45,"tag":106,"props":9779,"children":9780},{"style":119},[9781],{"type":51,"value":9619},{"type":45,"tag":106,"props":9783,"children":9784},{"style":281},[9785],{"type":51,"value":332},{"type":45,"tag":106,"props":9787,"children":9788},{"style":119},[9789],{"type":51,"value":412},{"type":45,"tag":106,"props":9791,"children":9792},{"style":281},[9793],{"type":51,"value":1953},{"type":45,"tag":106,"props":9795,"children":9796},{"style":119},[9797],{"type":51,"value":382},{"type":45,"tag":106,"props":9799,"children":9800},{"style":250},[9801],{"type":51,"value":387},{"type":45,"tag":106,"props":9803,"children":9804},{"style":266},[9805],{"type":51,"value":392},{"type":45,"tag":106,"props":9807,"children":9808},{"style":129},[9809],{"type":51,"value":397},{"type":45,"tag":106,"props":9811,"children":9812},{"style":119},[9813],{"type":51,"value":402},{"type":45,"tag":106,"props":9815,"children":9816},{"style":129},[9817],{"type":51,"value":492},{"type":45,"tag":106,"props":9819,"children":9820},{"style":119},[9821],{"type":51,"value":412},{"type":45,"tag":106,"props":9823,"children":9824},{"style":129},[9825],{"type":51,"value":1953},{"type":45,"tag":106,"props":9827,"children":9828},{"style":119},[9829],{"type":51,"value":402},{"type":45,"tag":106,"props":9831,"children":9832},{"style":129},[9833],{"type":51,"value":2029},{"type":45,"tag":106,"props":9835,"children":9836},{"style":119},[9837],{"type":51,"value":137},{"type":45,"tag":106,"props":9839,"children":9840},{"class":108,"line":246},[9841],{"type":45,"tag":106,"props":9842,"children":9843},{"style":129},[9844],{"type":51,"value":351},{"type":45,"tag":1075,"props":9846,"children":9848},{"id":9847},"medium-passing-source-directly-instead-of-alias-collection",[9849],{"type":51,"value":9850},"MEDIUM: Passing source directly instead of {alias: collection}",{"type":45,"tag":58,"props":9852,"children":9853},{},[9854,9860,9861,9867,9869,9875,9877,9883],{"type":45,"tag":102,"props":9855,"children":9857},{"className":9856},[],[9858],{"type":51,"value":9859},"from()",{"type":51,"value":2476},{"type":45,"tag":102,"props":9862,"children":9864},{"className":9863},[],[9865],{"type":51,"value":9866},"join()",{"type":51,"value":9868}," require sources wrapped as ",{"type":45,"tag":102,"props":9870,"children":9872},{"className":9871},[],[9873],{"type":51,"value":9874},"{alias: collection}",{"type":51,"value":9876},". Passing the collection directly throws ",{"type":45,"tag":102,"props":9878,"children":9880},{"className":9879},[],[9881],{"type":51,"value":9882},"InvalidSourceTypeError",{"type":51,"value":402},{"type":45,"tag":94,"props":9885,"children":9887},{"className":96,"code":9886,"language":98,"meta":99,"style":99},"\u002F\u002F WRONG\nq.from(usersCollection)\n\n\u002F\u002F CORRECT\nq.from({ users: usersCollection })\n",[9888],{"type":45,"tag":102,"props":9889,"children":9890},{"__ignoreMap":99},[9891,9898,9918,9925,9932],{"type":45,"tag":106,"props":9892,"children":9893},{"class":108,"line":109},[9894],{"type":45,"tag":106,"props":9895,"children":9896},{"style":223},[9897],{"type":51,"value":7092},{"type":45,"tag":106,"props":9899,"children":9900},{"class":108,"line":125},[9901,9905,9909,9913],{"type":45,"tag":106,"props":9902,"children":9903},{"style":129},[9904],{"type":51,"value":284},{"type":45,"tag":106,"props":9906,"children":9907},{"style":119},[9908],{"type":51,"value":402},{"type":45,"tag":106,"props":9910,"children":9911},{"style":266},[9912],{"type":51,"value":317},{"type":45,"tag":106,"props":9914,"children":9915},{"style":129},[9916],{"type":51,"value":9917},"(usersCollection)\n",{"type":45,"tag":106,"props":9919,"children":9920},{"class":108,"line":140},[9921],{"type":45,"tag":106,"props":9922,"children":9923},{"emptyLinePlaceholder":213},[9924],{"type":51,"value":216},{"type":45,"tag":106,"props":9926,"children":9927},{"class":108,"line":153},[9928],{"type":45,"tag":106,"props":9929,"children":9930},{"style":223},[9931],{"type":51,"value":7203},{"type":45,"tag":106,"props":9933,"children":9934},{"class":108,"line":166},[9935,9939,9943,9947,9951,9955,9960,9964,9968,9972],{"type":45,"tag":106,"props":9936,"children":9937},{"style":129},[9938],{"type":51,"value":284},{"type":45,"tag":106,"props":9940,"children":9941},{"style":119},[9942],{"type":51,"value":402},{"type":45,"tag":106,"props":9944,"children":9945},{"style":266},[9946],{"type":51,"value":317},{"type":45,"tag":106,"props":9948,"children":9949},{"style":129},[9950],{"type":51,"value":274},{"type":45,"tag":106,"props":9952,"children":9953},{"style":119},[9954],{"type":51,"value":326},{"type":45,"tag":106,"props":9956,"children":9957},{"style":329},[9958],{"type":51,"value":9959}," users",{"type":45,"tag":106,"props":9961,"children":9962},{"style":119},[9963],{"type":51,"value":337},{"type":45,"tag":106,"props":9965,"children":9966},{"style":129},[9967],{"type":51,"value":342},{"type":45,"tag":106,"props":9969,"children":9970},{"style":119},[9971],{"type":51,"value":185},{"type":45,"tag":106,"props":9973,"children":9974},{"style":129},[9975],{"type":51,"value":351},{"type":45,"tag":82,"props":9977,"children":9979},{"id":9978},"tension-query-expressiveness-vs-ivm-constraints",[9980],{"type":51,"value":9981},"Tension: Query expressiveness vs. IVM constraints",{"type":45,"tag":58,"props":9983,"children":9984},{},[9985],{"type":51,"value":9986},"The query builder looks like SQL but has constraints that SQL does not:",{"type":45,"tag":3754,"props":9988,"children":9989},{},[9990,10007,10017,10027],{"type":45,"tag":3758,"props":9991,"children":9992},{},[9993,9998,10000,10005],{"type":45,"tag":69,"props":9994,"children":9995},{},[9996],{"type":51,"value":9997},"Equality joins only",{"type":51,"value":9999}," -- ",{"type":45,"tag":102,"props":10001,"children":10003},{"className":10002},[],[10004],{"type":51,"value":1756},{"type":51,"value":10006}," is the only allowed join condition operator.",{"type":45,"tag":3758,"props":10008,"children":10009},{},[10010,10015],{"type":45,"tag":69,"props":10011,"children":10012},{},[10013],{"type":51,"value":10014},"orderBy required for limit\u002Foffset",{"type":51,"value":10016}," -- non-deterministic pagination cannot be incrementally maintained.",{"type":45,"tag":3758,"props":10018,"children":10019},{},[10020,10025],{"type":45,"tag":69,"props":10021,"children":10022},{},[10023],{"type":51,"value":10024},"distinct requires select",{"type":51,"value":10026}," -- deduplication needs an explicit projection.",{"type":45,"tag":3758,"props":10028,"children":10029},{},[10030,10035],{"type":45,"tag":69,"props":10031,"children":10032},{},[10033],{"type":51,"value":10034},"fn.select() cannot be used with groupBy()",{"type":51,"value":10036}," -- the compiler must statically analyze select to discover aggregate functions.",{"type":45,"tag":58,"props":10038,"children":10039},{},[10040],{"type":51,"value":10041},"These constraints exist because the underlying d2ts differential dataflow engine requires them for correct incremental view maintenance.",{"type":45,"tag":58,"props":10043,"children":10044},{},[10045,10047,10052,10053,10059,10060,10066],{"type":51,"value":10046},"See also: react-db\u002FSKILL.md for React hooks (",{"type":45,"tag":102,"props":10048,"children":10050},{"className":10049},[],[10051],{"type":51,"value":6909},{"type":51,"value":1101},{"type":45,"tag":102,"props":10054,"children":10056},{"className":10055},[],[10057],{"type":51,"value":10058},"useLiveSuspenseQuery",{"type":51,"value":1101},{"type":45,"tag":102,"props":10061,"children":10063},{"className":10062},[],[10064],{"type":51,"value":10065},"useLiveInfiniteQuery",{"type":51,"value":5623},{"type":45,"tag":82,"props":10068,"children":10070},{"id":10069},"references",[10071],{"type":51,"value":10072},"References",{"type":45,"tag":3754,"props":10074,"children":10075},{},[10076],{"type":45,"tag":3758,"props":10077,"children":10078},{},[10079,10086],{"type":45,"tag":10080,"props":10081,"children":10083},"a",{"href":10082},".\u002Freferences\u002Foperators.md",[10084],{"type":51,"value":10085},"Query Operators Reference",{"type":51,"value":10087}," -- full signatures and examples for all operators, functions, and aggregates.",{"type":45,"tag":10089,"props":10090,"children":10091},"style",{},[10092],{"type":51,"value":10093},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":10095,"total":306},[10096,10110,10122,10133,10146,10152,10165],{"slug":10097,"name":10097,"fn":10098,"description":10099,"org":10100,"tags":10101,"stars":21,"repoUrl":22,"updatedAt":10109},"angular-db","integrate TanStack DB with Angular","Angular bindings for TanStack DB. injectLiveQuery inject function with Angular signals (Signal\u003CT>) for all return values. Reactive params pattern ({ params: () => T, query: ({ params, q }) => QueryBuilder }) for dynamic queries. Must be called in injection context. Angular 17+ control flow (@if, @for) and signal inputs supported. Import from @tanstack\u002Fangular-db (re-exports all of @tanstack\u002Fdb).\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10102,10105,10106],{"name":10103,"slug":10104,"type":16},"Angular","angular",{"name":14,"slug":15,"type":16},{"name":10107,"slug":10108,"type":16},"TypeScript","typescript","2026-07-16T06:01:16.345046",{"slug":10111,"name":10111,"fn":10112,"description":10113,"org":10114,"tags":10115,"stars":21,"repoUrl":22,"updatedAt":10121},"db-core","manage database collections with TanStack DB","TanStack DB core concepts: createCollection with queryCollectionOptions, electricCollectionOptions, powerSyncCollectionOptions, rxdbCollectionOptions, trailbaseCollectionOptions, localOnlyCollectionOptions. Live queries via query builder (from, where, join, select, groupBy, orderBy, limit). Optimistic mutations with draft proxy (collection.insert, collection.update, collection.delete). createOptimisticAction, createTransaction, createPacedMutations. Entry point for all TanStack DB skills.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10116,10119,10120],{"name":10117,"slug":10118,"type":16},"Data Modeling","data-modeling",{"name":14,"slug":15,"type":16},{"name":10,"slug":9,"type":16},"2026-07-17T06:06:40.214285",{"slug":10123,"name":10124,"fn":10125,"description":10126,"org":10127,"tags":10128,"stars":21,"repoUrl":22,"updatedAt":10132},"db-corecollection-setup","db-core\u002Fcollection-setup","set up typed collections in TanStack DB","Creating typed collections with createCollection. Adapter selection: queryCollectionOptions (REST\u002FTanStack Query), electricCollectionOptions (ElectricSQL real-time sync), powerSyncCollectionOptions (PowerSync SQLite), rxdbCollectionOptions (RxDB), trailbaseCollectionOptions (TrailBase), localOnlyCollectionOptions, localStorageCollectionOptions. CollectionConfig options: getKey, schema, sync, gcTime, autoIndex (default off), defaultIndexType, syncMode (eager\u002Fon-demand, plus progressive for Electric). StandardSchema validation with Zod\u002FValibot\u002FArkType. Collection lifecycle (idle\u002Floading\u002Fready\u002Ferror). Adapter-specific sync patterns including Electric txid tracking, Query direct writes, and PowerSync query-driven sync with onLoad\u002FonLoadSubset hooks.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10129,10130,10131],{"name":10117,"slug":10118,"type":16},{"name":14,"slug":15,"type":16},{"name":10,"slug":9,"type":16},"2026-07-26T05:48:58.321777",{"slug":10134,"name":10135,"fn":10136,"description":10137,"org":10138,"tags":10139,"stars":21,"repoUrl":22,"updatedAt":10145},"db-corecustom-adapter","db-core\u002Fcustom-adapter","build custom TanStack collection adapters","Building custom collection adapters for new backends. SyncConfig interface: sync function receiving begin, write, commit, markReady, truncate, metadata primitives. ChangeMessage format (insert, update, delete). loadSubset for on-demand sync. LoadSubsetOptions (where, orderBy, limit, cursor). Expression parsing: parseWhereExpression, parseOrderByExpression, extractSimpleComparisons, parseLoadSubsetOptions. Collection options creator pattern. rowUpdateMode (partial vs full). Subscription lifecycle and cleanup functions. Persisted sync metadata API (metadata.row and metadata.collection) for storing per-row and per-collection adapter state.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10140,10141,10144],{"name":14,"slug":15,"type":16},{"name":10142,"slug":10143,"type":16},"Engineering","engineering",{"name":10,"slug":9,"type":16},"2026-07-16T06:04:06.862485",{"slug":4,"name":5,"fn":6,"description":7,"org":10147,"tags":10148,"stars":21,"repoUrl":22,"updatedAt":23},{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10149,10150,10151],{"name":14,"slug":15,"type":16},{"name":18,"slug":19,"type":16},{"name":10,"slug":9,"type":16},{"slug":10153,"name":10154,"fn":10155,"description":10156,"org":10157,"tags":10158,"stars":21,"repoUrl":22,"updatedAt":10164},"db-coremutations-optimistic","db-core\u002Fmutations-optimistic","manage optimistic mutations in TanStack DB","collection.insert, collection.update (Immer-style draft proxy), collection.delete. createOptimisticAction (onMutate + mutationFn). createPacedMutations with debounceStrategy, throttleStrategy, queueStrategy. createTransaction, getActiveTransaction, ambient transaction context. Transaction lifecycle (pending\u002Fpersisting\u002Fcompleted\u002Ffailed). Mutation merging. onInsert\u002FonUpdate\u002FonDelete handlers. PendingMutation type. Transaction.isPersisted.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10159,10160,10163],{"name":14,"slug":15,"type":16},{"name":10161,"slug":10162,"type":16},"Frontend","frontend",{"name":10,"slug":9,"type":16},"2026-07-26T05:48:57.301803",{"slug":10166,"name":10167,"fn":10168,"description":10169,"org":10170,"tags":10171,"stars":21,"repoUrl":22,"updatedAt":10180},"db-corepersistence","db-core\u002Fpersistence","implement SQLite-backed persistence for TanStack DB","SQLite-backed persistence for TanStack DB collections. persistedCollectionOptions wraps any adapter (Electric, Query, PowerSync, or local-only) with durable local storage. Platform adapters: browser (WA-SQLite OPFS), React Native (op-sqlite), Expo (expo-sqlite), Electron (IPC), Node (better-sqlite3), Capacitor, Tauri, Cloudflare Durable Objects. Multi-tab\u002Fmulti-process coordination via BrowserCollectionCoordinator \u002F ElectronCollectionCoordinator \u002F SingleProcessCoordinator. schemaVersion for migration resets. Local-only mode for offline-first without a server.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10172,10173,10176,10179],{"name":14,"slug":15,"type":16},{"name":10174,"slug":10175,"type":16},"Persistence","persistence",{"name":10177,"slug":10178,"type":16},"SQLite","sqlite",{"name":10,"slug":9,"type":16},"2026-07-17T06:06:39.182084",{"items":10182,"total":10322},[10183,10197,10209,10221,10236,10248,10258,10268,10281,10291,10302,10312],{"slug":10184,"name":10184,"fn":10185,"description":10186,"org":10187,"tags":10188,"stars":10194,"repoUrl":10195,"updatedAt":10196},"aggregation","perform data aggregation in TanStack Table","Aggregate TanStack Table columns independently of grouping, including grand totals, caller-selected row totals, multiple keyed aggregations, custom context-based definitions, grouped merges, manual values, and worker constraints.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10189,10192,10193],{"name":10190,"slug":10191,"type":16},"Data Analysis","data-analysis",{"name":10161,"slug":10162,"type":16},{"name":10,"slug":9,"type":16},28175,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Ftable","2026-07-30T05:25:59.429787",{"slug":10198,"name":10198,"fn":10199,"description":10200,"org":10201,"tags":10202,"stars":10194,"repoUrl":10195,"updatedAt":10208},"api-not-found","diagnose TanStack Table API errors","Diagnose missing TanStack Table v9 exports, options, state slices, and instance methods. Load before inventing an API when code sees a type error, undefined feature method, absent object key, adapter mismatch, or v8-shaped example.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10203,10206,10207],{"name":10204,"slug":10205,"type":16},"Debugging","debugging",{"name":10161,"slug":10162,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:05.418735",{"slug":10210,"name":10210,"fn":10211,"description":10212,"org":10213,"tags":10214,"stars":10194,"repoUrl":10195,"updatedAt":10220},"cell-selection","select rectangular cell ranges in tables","Select rectangular cell ranges with cellSelectionFeature: two-corner range state keyed by row and column id, mousedown\u002Fmouseenter handlers, selection edges, render-order resolution under pinning, and autoResetCellSelection. Load when ranges widen unexpectedly after sorting or column reordering, when a drag re-renders the whole table, or when building copy-to-clipboard from a selection.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10215,10216,10217],{"name":10190,"slug":10191,"type":16},{"name":10,"slug":9,"type":16},{"name":10218,"slug":10219,"type":16},"UI Components","ui-components","2026-07-30T05:25:38.403427",{"slug":10222,"name":10222,"fn":10223,"description":10224,"org":10225,"tags":10226,"stars":10194,"repoUrl":10195,"updatedAt":10235},"client-vs-server","manage TanStack Table data pipelines","Choose client or server ownership for filtering, grouping, sorting, expanding, and pagination in TanStack Table v9. Load for manual* flags, mixed pipelines, server counts, or deciding which dataset each row-model stage receives.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10227,10230,10231,10234],{"name":10228,"slug":10229,"type":16},"Data Pipeline","data-pipeline",{"name":10161,"slug":10162,"type":16},{"name":10232,"slug":10233,"type":16},"Performance","performance",{"name":10,"slug":9,"type":16},"2026-07-30T05:25:45.400104",{"slug":10237,"name":10237,"fn":10238,"description":10239,"org":10240,"tags":10241,"stars":10194,"repoUrl":10195,"updatedAt":10247},"column-faceting","build faceted filter UIs","Build faceted filter UIs with columnFacetingFeature, facetedRowModel, facetedUniqueValues, and facetedMinMaxValues. Load for facet counts, numeric ranges, own-filter exclusion, or server-page facet completeness.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10242,10245,10246],{"name":10243,"slug":10244,"type":16},"Data Visualization","data-visualization",{"name":10161,"slug":10162,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:41.397257",{"slug":10249,"name":10249,"fn":10250,"description":10251,"org":10252,"tags":10253,"stars":10194,"repoUrl":10195,"updatedAt":10257},"column-filtering","implement column filtering in TanStack Table","Filter columns with columnFilteringFeature, filteredRowModel, filterFns, filterMeta, nested-row direction, and manualFiltering. Load for accessor compatibility, controlled filter updaters, fuzzy metadata, or client\u002Fserver ownership.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10254,10255,10256],{"name":10190,"slug":10191,"type":16},{"name":10161,"slug":10162,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:53.391632",{"slug":10259,"name":10259,"fn":10260,"description":10261,"org":10262,"tags":10263,"stars":10194,"repoUrl":10195,"updatedAt":10267},"column-ordering","manage TanStack Table column ordering","Control TanStack Table v9 leaf columnOrder with stable IDs while accounting for pinning regions, visibility, and groupedColumnMode precedence. Load for drag-and-drop columns or rendered order that differs from state.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10264,10265,10266],{"name":10161,"slug":10162,"type":16},{"name":10,"slug":9,"type":16},{"name":10218,"slug":10219,"type":16},"2026-07-30T05:26:03.37801",{"slug":10269,"name":10269,"fn":10270,"description":10271,"org":10272,"tags":10273,"stars":10194,"repoUrl":10195,"updatedAt":10280},"column-pinning","configure column pinning in TanStack Table","Pin columns into logical start, center, and end regions with columnPinningFeature and renderer-owned sticky CSS. Load for RTL offsets, z-index, backgrounds, overflow, widths, gaps, or overlaps.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10274,10277,10278,10279],{"name":10275,"slug":10276,"type":16},"CSS","css",{"name":10161,"slug":10162,"type":16},{"name":10,"slug":9,"type":16},{"name":10218,"slug":10219,"type":16},"2026-07-30T05:25:55.377366",{"slug":10282,"name":10282,"fn":10283,"description":10284,"org":10285,"tags":10286,"stars":10194,"repoUrl":10195,"updatedAt":10290},"column-resizing","implement column resizing in TanStack Table","Wire columnResizingFeature, header.getResizeHandler, resize mode and direction, pointer or touch events, and performant CSS-variable updates. Load when resize state changes but widths do not, or large tables resize slowly.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10287,10288,10289],{"name":10161,"slug":10162,"type":16},{"name":10,"slug":9,"type":16},{"name":10218,"slug":10219,"type":16},"2026-07-30T05:25:51.400011",{"slug":10292,"name":10292,"fn":10293,"description":10294,"org":10295,"tags":10296,"stars":10194,"repoUrl":10195,"updatedAt":10301},"column-sizing","configure column sizing in TanStack Table","Use columnSizingFeature numeric size, minSize, maxSize, getSize, getStart, getAfter, and total-size APIs in table, grid, or flex CSS. Load for auto or percentage misconceptions and sizing\u002Fpinning layout mismatch.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10297,10298,10299,10300],{"name":10275,"slug":10276,"type":16},{"name":10161,"slug":10162,"type":16},{"name":10,"slug":9,"type":16},{"name":10218,"slug":10219,"type":16},"2026-07-30T05:25:48.703799",{"slug":10303,"name":10303,"fn":10304,"description":10305,"org":10306,"tags":10307,"stars":10194,"repoUrl":10195,"updatedAt":10311},"column-visibility","manage column visibility in TanStack Table","Hide columns with columnVisibilityFeature while rendering visibility-aware header, column, and cell collections. Load when hidden columns remain in the DOM, false-versus-absent state is confused, or enableHiding is misunderstood.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10308,10309,10310],{"name":10161,"slug":10162,"type":16},{"name":10,"slug":9,"type":16},{"name":10218,"slug":10219,"type":16},"2026-07-30T05:25:47.367943",{"slug":10313,"name":10313,"fn":10314,"description":10315,"org":10316,"tags":10317,"stars":10194,"repoUrl":10195,"updatedAt":10321},"core","build data grids with TanStack Table","Use TanStack Table v9 as a headless data-grid state and row-processing engine. Load for first-table architecture, stable data and columns, row numbering with getDisplayIndex, semantic rendering, framework adapter choice, or deciding what Table owns versus the renderer.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10318,10319,10320],{"name":10190,"slug":10191,"type":16},{"name":10161,"slug":10162,"type":16},{"name":10218,"slug":10219,"type":16},"2026-07-30T05:25:52.366295",125]