> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class: VCollectionRef<I, Optional, Type, FieldPaths>

> Reference for the VCollectionRef class in bijection/values.

[values](https://docs.bijection.com/api/modules/values).VCollectionRef

## Type parameters

| Name | Type |
| :- | :- |
| `I` | extends [`ObjectInterface`](https://docs.bijection.com/api/modules/server#objectinterface) |
| `Optional` | extends [`OptionalProperty`](https://docs.bijection.com/api/modules/values#optionalproperty) = `"required"` |
| `Type` | [`CollectionRef`](https://docs.bijection.com/api/modules/server#collectionref)\<`I`> \| `Optional` extends `"optional"` ? `undefined` : `never` |
| `FieldPaths` | extends `string` = `"kind"` \| `"collection"` \| `"incarnation"` \| `"component"` \| `"relation_identity"` |

## Constructors

### constructor

• **new VCollectionRef**\<`I`, `Optional`, `Type`, `FieldPaths`>(`contract`, `isOptional`)

#### Type parameters

| Name | Type |
| :- | :- |
| `I` | extends [`ObjectInterface`](https://docs.bijection.com/api/modules/server#objectinterface) |
| `Optional` | extends [`OptionalProperty`](https://docs.bijection.com/api/modules/values#optionalproperty) = `"required"` |
| `Type` | `Readonly`\<\{ `kind`: `"collection_ref"` ; `collection`: `string` ; `incarnation`: `string` ; `component`: `string` ; `relation_identity`: `string` ; `[collectionReferenceType]`: `Readonly`\<`Record`\<`I` extends [`ObjectInterface`](https://docs.bijection.com/api/modules/server#objectinterface) ? [`InterfaceNames`](https://docs.bijection.com/api/modules/server#interfacenames)\<`I`> : `I` extends `string` ? `I` : `never`, `true`>>  }> \| `Optional` extends `"optional"` ? `undefined` : `never` |
| `FieldPaths` | extends `string` = `"collection"` \| `"kind"` \| `"incarnation"` \| `"component"` \| `"relation_identity"` |

#### Parameters

| Name | Type |
| :- | :- |
| `contract` | `I` |
| `isOptional` | `Optional` |

## Properties

### kind

• `Readonly` **kind**: `"object"`

***

### isConvexValidator

• `Readonly` **isConvexValidator**: `true`

***

### type

• `Readonly` **type**: `Type`

***

### fieldPaths

• `Readonly` **fieldPaths**: `FieldPaths`

***

### interfaceName

• `Readonly` **interfaceName**: `I`\[`"name"`]

***

### fields

• `Readonly` **fields**: `Object`

#### Type declaration

| Name | Type |
| :- | :- |
| `kind` | [`VLiteral`](https://docs.bijection.com/api/classes/values.VLiteral)\<`"collection_ref"`, `"required"`> |
| `collection` | [`VString`](https://docs.bijection.com/api/classes/values.VString)\<`string`, `"required"`> |
| `incarnation` | [`VString`](https://docs.bijection.com/api/classes/values.VString)\<`string`, `"required"`> |
| `component` | [`VString`](https://docs.bijection.com/api/classes/values.VString)\<`string`, `"required"`> |
| `relation_identity` | [`VString`](https://docs.bijection.com/api/classes/values.VString)\<`string`, `"required"`> |

***

### isOptional

• `Readonly` **isOptional**: `Optional`

## Accessors

### json

• `get` **json**(): [`ValidatorJSON`](https://docs.bijection.com/api/modules/values#validatorjson)

#### Returns

[`ValidatorJSON`](https://docs.bijection.com/api/modules/values#validatorjson)

## Methods

### optional

▸ **optional**(): [`VCollectionRef`](https://docs.bijection.com/api/classes/values.VCollectionRef)\<`I`, `"optional"`, `Type` | `undefined`, `FieldPaths`>

#### Returns

[`VCollectionRef`](https://docs.bijection.com/api/classes/values.VCollectionRef)\<`I`, `"optional"`, `Type` | `undefined`, `FieldPaths`>

***

### asOptional

▸ **asOptional**(): [`VCollectionRef`](https://docs.bijection.com/api/classes/values.VCollectionRef)\<`I`, `"optional"`, `Type` | `undefined`, `FieldPaths`>

#### Returns

[`VCollectionRef`](https://docs.bijection.com/api/classes/values.VCollectionRef)\<`I`, `"optional"`, `Type` | `undefined`, `FieldPaths`>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.