aboutsummaryrefslogtreecommitdiff
path: root/src/fields/DocumentReference.ts
diff options
context:
space:
mode:
authortschicke-brown <tyler_schicke@brown.edu>2019-02-19 21:58:18 -0500
committerGitHub <noreply@github.com>2019-02-19 21:58:18 -0500
commit4610f1cc4653aa3b8389a677b9a1bd94590752a1 (patch)
tree6fd1cfe02eaeaf1dc074a26cc4cde39c3313d1f3 /src/fields/DocumentReference.ts
parent190d0225d7bf605aa53847eb7beda5de72e753a8 (diff)
parentef10a6bdf753f75cbc5b5d8b7dcc53c3d4c219ad (diff)
Merge pull request #8 from browngraphicslab/server_database_merge
Server database merge
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