aboutsummaryrefslogtreecommitdiff
path: root/src/fields/DocumentReference.ts
diff options
context:
space:
mode:
authoryipstanley <stanley_yip@brown.edu>2019-02-11 20:25:15 -0500
committeryipstanley <stanley_yip@brown.edu>2019-02-11 20:25:15 -0500
commit867fd2bffb67be06e889d3ac0fb6603bc8c4d92a (patch)
tree6b045d218d8211b5e0ac9f2b7fdb9e45dfe30515 /src/fields/DocumentReference.ts
parent448f8880b50dc50090a596cafaf68d2f444ce3db (diff)
asdkjfl
Diffstat (limited to 'src/fields/DocumentReference.ts')
-rw-r--r--src/fields/DocumentReference.ts10
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