From b0ac30172019713e1c75083c1199485d902e0eed Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Tue, 18 Jun 2019 16:37:28 -0400 Subject: Fixed zoomBasis stuff and added deletion handling for reponse from server --- src/new_fields/Doc.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/new_fields/Doc.ts') diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index c2cfda079..1b0ff812f 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -132,6 +132,16 @@ export class Doc extends RefField { this[fKey] = value; } } + const unset = diff.$unset; + if (unset) { + for (const key in unset) { + if (!key.startsWith("fields.")) { + continue; + } + const fKey = key.substring(7); + delete this[fKey]; + } + } } } -- cgit v1.2.3-70-g09d2