aboutsummaryrefslogtreecommitdiff
path: root/src/fields/DocumentReference.ts
diff options
context:
space:
mode:
authorlaurawilsonri <laura_wilson@brown.edu>2019-02-24 14:37:07 -0500
committerlaurawilsonri <laura_wilson@brown.edu>2019-02-24 14:37:07 -0500
commitf7b46167a7fd5d7ecf560dbd72e7d3295ba6c0c9 (patch)
treecc96c12c49e6c03c98b0f0e6f642e0902948283b /src/fields/DocumentReference.ts
parent3ad38f0445178bdfe025e4f6da60f68f03876f56 (diff)
parentd9d55e422826da1fe87aa7973c92e54bc0c99f02 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into improveText
Diffstat (limited to 'src/fields/DocumentReference.ts')
-rw-r--r--src/fields/DocumentReference.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/fields/DocumentReference.ts b/src/fields/DocumentReference.ts
index 983b162a3..9d3c209b4 100644
--- a/src/fields/DocumentReference.ts
+++ b/src/fields/DocumentReference.ts
@@ -1,6 +1,8 @@
-import { Field, Opt, FieldValue } from "./Field";
+import { Field, Opt, FieldValue, FieldId } from "./Field";
import { Document } from "./Document";
import { Key } from "./Key";
+import { Types } from "../server/Message";
+import { ObjectID } from "bson";
export class DocumentReference extends Field {
get Key(): Key {
@@ -15,6 +17,10 @@ export class DocumentReference extends Field {
super();
}
+ UpdateFromServer() {
+
+ }
+
Dereference(): FieldValue<Field> {
return this.document.Get(this.key);
}
@@ -41,4 +47,11 @@ export class DocumentReference extends Field {
return "";
}
+ ToJson(): { type: Types, data: FieldId, _id: string } {
+ return {
+ type: Types.DocumentReference,
+ data: this.document.Id,
+ _id: this.Id
+ }
+ }
} \ No newline at end of file