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