0
I’m using Kotlin with Mongo and have the following code snippet:
match(equal(Industry::addresses, Address::category, value = AddressCategory.MAIN.toString())!!)
The category of this address can be three types:
MAIN
,DELIVERY
andBILLING
.
If the address MAIN
not exist I want to take the DELIVERY
. In case it doesn’t exist either I should take the BILLING
. Always in this order of precedence. However, in this method he only makes the comparison of the MAIN
and I want to be able to make all three.
So I wish I could use, in this method match
, some kind of checker, so compare with the right values. I have tried using and
, ||
and operador ternário
, but always gave compilation error.