Open History to see the last commit
1---
2id: CollectionRef
3title: CollectionRef
4---
5
6Defined in: [packages/db/src/query/ir.ts:87](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L87)
7
8## Extends
9
10- `BaseExpression`
11
12## Constructors
13
14### Constructor
15
16```ts
17new CollectionRef(collection, alias): CollectionRef;
18```
19
20Defined in: [packages/db/src/query/ir.ts:91](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L91)
21
22#### Parameters
23
24##### collection
25
26[`CollectionImpl`](../../../../classes/CollectionImpl.md)
27
28##### alias
29
30`string`
31
32#### Returns
33
34`CollectionRef`
35
36#### Overrides
37
38```ts
39BaseExpression.constructor
40```
41
42## Properties
43
44### \_\_returnType
45
46```ts
47readonly __returnType: any;
48```
49
50Defined in: [packages/db/src/query/ir.ts:84](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L84)
51
52**`Internal`**
53
54- Type brand for TypeScript inference
55
56#### Inherited from
57
58```ts
59BaseExpression.__returnType
60```
61
62***
63
64### alias
65
66```ts
67alias: string;
68```
69
70Defined in: [packages/db/src/query/ir.ts:93](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L93)
71
72***
73
74### collection
75
76```ts
77collection: CollectionImpl;
78```
79
80Defined in: [packages/db/src/query/ir.ts:92](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L92)
81
82***
83
84### sourceId
85
86```ts
87readonly sourceId: string;
88```
89
90Defined in: [packages/db/src/query/ir.ts:90](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L90)
91
92Opaque runtime identity; aliases are lexical names only.
93
94***
95
96### type
97
98```ts
99type: "collectionRef";
100```
101
102Defined in: [packages/db/src/query/ir.ts:88](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L88)
103
104#### Overrides
105
106```ts
107BaseExpression.type
108```