exclude undefined properties when persisting objects

RethinkDB does not support document properties with the value
`undefined`, so skip these properties.