Question: This is a longshot, but I was wondering if in rethinkDB, let's say I update a document. Is there a magic function such that, if it is a field that is a string or int, it just updates it, but if the value of the field is an array, it appends it to the array?

Answer: 
In that case you'd need to use `.branch` and branch on the type. Something like `.update(function(row) { return {field: r.branch(row('field').typeOf().eq('ARRAY'), row('field').add([el]), el)}; })`
There is a magic function that does something similar. `.forEach` has the undocumented behaviour of adding numbers, combining arrays and drops strings:

```
>>> r.expr([{a:1, b:[2], c:"3"}, {a:2, b:[4], c:"6"}]).forEach(r.row)
{"a": 3, "b": [2,4], "c": "3"}

```