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:72](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L72)
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:74](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L74)
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:69](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L69)
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:76](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L76)
73
74***
75
76### collection
77
78```ts
79collection: CollectionImpl;
80```
81
82Defined in: [packages/db/src/query/ir.ts:75](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L75)
83
84***
85
86### type
87
88```ts
89type: "collectionRef";
90```
91
92Defined in: [packages/db/src/query/ir.ts:73](https://github.com/TanStack/db/blob/main/packages/db/src/query/ir.ts#L73)
93
94#### Overrides
95
96```ts
97BaseExpression.type
98```