diff options
Diffstat (limited to 'src/fields/DocumentReference.ts')
-rw-r--r-- | src/fields/DocumentReference.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/fields/DocumentReference.ts b/src/fields/DocumentReference.ts index 983b162a3..ab4c4644e 100644 --- a/src/fields/DocumentReference.ts +++ b/src/fields/DocumentReference.ts @@ -1,6 +1,7 @@ -import { Field, Opt, FieldValue } from "./Field"; +import { Field, Opt, FieldValue, FIELD_ID } from "./Field"; import { Document } from "./Document"; import { Key } from "./Key"; +import { Types } from "../server/Message"; export class DocumentReference extends Field { get Key(): Key { @@ -41,4 +42,11 @@ export class DocumentReference extends Field { return ""; } + ToJson(): { type: Types, data: FIELD_ID, id: string } { + return { + type: Types.DocumentReference, + data: this.document.Id, + id: this.Id as string + } + } }
\ No newline at end of file |