Hi. I'm trying to update a field in a column only ...
# exposed
l
Hi. I'm trying to update a field in a column only when the corresponding field in a request I'm receiving is not null. Here's what I want to do in pseudo code that isn't working:
Copy code
transaction {
    Table.update({ Table.id eq targetId }) {
        it[someField] = if (request.someField != null) { request.someField } else { it[someField] }
    }
}
How can I do something like this?
a
Assuming you’re updating other fields also:
Copy code
request?.someField?.let { value ->
  row[column] = value
}
l
Interesting, thanks!