is a live query collection just an alias for a regular collection?
maybe im overthinking this. say i have
and want to imperatively, outside of react, get a user.
and i want to alias a view of this query. in react-query i would use the
select
callback. the docs (https://tanstack.com/db/latest/docs/guides/live-queries) say to use live query to alias—
but it doesn't say what usersCollection
is this scenario. so i'm assuming it is a regular createCollection(queryCollectionOptions({
. I guess I'm not understanding the difference in these two types and their compatibility.Live Queries | TanStack DB Docs
TanStack DB Live Queries TanStack DB provides a powerful, type-safe query system that allows you to fetch, filter, transform, and aggregate data from collections using a SQL-like fluent API. All queri...
3 Replies
mute-goldOP•4w ago
ill just give it a shot. but maybe my confusion is worth highlighting for docs purposes.
adverse-sapphire•4w ago
yeah you use
createCollection(liveQueryCollectionOptions({}))
to create a standalone query
queries are collections too which is why it has createCollection
there
you can query any other collection (including query collections!) so yeah, passing in your userCollection is what you domute-goldOP•4w ago
lovely thank you kyle 🙂