diff options
author | madelinegr <mgriswold99@gmail.com> | 2019-02-25 17:33:05 -0500 |
---|---|---|
committer | madelinegr <mgriswold99@gmail.com> | 2019-02-25 17:33:05 -0500 |
commit | dfe69e008b073a5c1dace2dc047e6696318e4720 (patch) | |
tree | 522d81c60a0411d79f599ba73b068b5ecda7364f /src/fields/DocumentReference.ts | |
parent | d091617fa9a8c43914fb754ca170cb3b2750d1af (diff) | |
parent | bb418216efa9cc2e191b970e4cbe5080f4fd2b87 (diff) |
mer con
Diffstat (limited to 'src/fields/DocumentReference.ts')
-rw-r--r-- | src/fields/DocumentReference.ts | 15 |
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 |