Rethinkdb does not accept "undefined"

Undefined properties are set to null before saving to RethinkDB