Link to home
Start Free TrialLog in
Avatar of James Talvy
James TalvyFlag for United States of America

asked on

Simple compare in Scala against a constant string...

How to compare a String in scala against a constant value?

def desks(sorted:Boolean, includeNtf:Boolean) = {

    val output = for {
        desk <- TableQuery[Desks] if(includeNtf && desk.test === Some("Y"))
    }

I want to set "desk" to only the records in TableQuery[Desks] that have test="Y"

test is type String

This does not work with various errors... desk.test === Some("Y")

I have never touched scala code before.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of James Talvy
James Talvy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial