Closed lynchem closed 8 years ago
No, no repro needed. I get exactly what you're talking about. It's almost certainly a bug that needs fixing and I'm pretty sure I know where the guilty bit of code is.
Now, having said that ... if you wanted to write an jasmine server integration test to show this failing ...
;-)
Haven't been able to reproduce this exactly.
I'm getting this for the inverse:
{ $set: {foo: "", bar: 5 } }
... which is still problematic and needs fixing. (foo
should be unset, not set to an empty string).
or, if I reverse, the order of the fields in the update:
{ '$unset' : { bar: 5, foo: '' } }
... which is also problematic and needs fixing. (bar
should not be unset and foo
should).
0.7.8 fixes this. Tests written and passing.
Note sure if this is a known issue but if in a transaction you both create a new property and also update an existing one the inverse will $unset both.
Existing Doc { bar: 5 }
Update { $set: {foo : 5, bar: 3} }
Inverse { $unset: {foo: "", bar: "" } }
If you need a better repro let me know and I'll make one.