Can't the database query results in the cloud code be modified?

The way cloud code works is when you return the results it gets encoded first and then decoded on the client side. If we add an options to either remove the encoding / decoding or both it should fix your issue. You can use the workaround posted here Return Plain Objects from Cloud Code - #7 by BobyIlea

Can you write a failing test on the JS SDK so we can replicate your issue?