# How to find a row based on a condition?
Construct the query using the collection's QueryBuilder class, then use the findOne api to fetch the row that matches the query.
For example to find an open lottery with name starting with "metastay":
val lotteryQry = LotteryQuery().open.is(true).lotteryName.startsWith("metastay")
val firstMatch:Option[LotteryRow] = lotteryQry.findOne
Query builder has customized query options based on the field's data-type. For example: startWith, endsWith , equalsIgnoreCase etc. are options available on a String field. Numeric fields have options like greaterThan, lessThan etc.