fakemongo / fongo

faked out in-memory mongo for java
Apache License 2.0
523 stars 156 forks source link

Performing a $rename update should be a noop if the field being rename does not exist #320

Closed shaw500 closed 6 years ago

shaw500 commented 6 years ago

I ran into an issue where performing a $rename did not work as expected. If I run $rename once, it will correctly rename the field. If I run the same $rename again it will try to rename the non-existent field over the new field, and null it out. Reading the mongo docs, if you try to rename a field that does not exist, it should be a noop.

I made the required change, and added a test to cover. Happy to take comments if I have missed something.

twillouer commented 6 years ago

Thanks !