diff options
author | andrewdkim <adkim414@gmail.com> | 2019-06-20 11:09:03 -0400 |
---|---|---|
committer | andrewdkim <adkim414@gmail.com> | 2019-06-20 11:09:03 -0400 |
commit | b856d4c0be0b08bf154d552226457b82d31cf81c (patch) | |
tree | fbcf2ac0ebe6ea358bada7efb5689f92bf3d2bc9 /src/new_fields/Doc.ts | |
parent | da2157616ca4e614dacbf26fb5fa6758b51a209e (diff) | |
parent | a5478b2d4cc3b66c6b58471cbb05c623d0109724 (diff) |
merge with master
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]; + } + } } } |