diff options
author | Fawn <fangrui_tong@brown.edu> | 2019-06-20 11:31:15 -0400 |
---|---|---|
committer | Fawn <fangrui_tong@brown.edu> | 2019-06-20 11:31:15 -0400 |
commit | cd2db5bf11fb89e3cd7016f7f798d65698c74c5e (patch) | |
tree | 9e46a9a6b940720e68eb1f390dacecae3f4730a8 /src/new_fields/Doc.ts | |
parent | 73f03785f938542a91b28b35043f2feda2bc1432 (diff) | |
parent | e9d62f4ca0dbeb57e46239047041a8a04da7b504 (diff) |
merge
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 10 |
1 files changed, 10 insertions, 0 deletions
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]; + } + } } } |