Philipp Mayer

09/18/2019, 7:40 PM
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
                .select { 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!

Evan R.

09/18/2019, 7:49 PM
I generally use
here. That way you’ll get a string if it exists or null if no results were returned.

Philipp Mayer

09/18/2019, 7:53 PM
That solved it. Thanks!
👍 1