Hey guys, I'm quite new to exposed and pretty sure...
# exposed
p
Hey guys, I'm quite new to exposed and pretty sure I'm missing something:
Copy code
override fun getColorByCompany(company: String): List<String> {
        val color = transaction { Companies
                .slice(Companies.color)
                .select { Companies.name eq company }
                .map { it.toString() }
        }
       return color
    }
How can I get a single string as result and not a list of strings? Or should I convert it afterwards for myself? Thanks in advance!
e
I generally use
.firstOrNull()
here. That way you’ll get a string if it exists or null if no results were returned.
p
That solved it. Thanks!
👍 1