Converting a $cond Native query to Java DSL

I would debug this by trying to run the same update in the shell against a sample data - if the error doesn’t appear then the issue is something in how the update is expressed in Java, if you get the same error then some field that’s expected to be an array maybe isn’t?

Asya