# How to compose an OR clause?

  1. construct the individual queries using the QueryBuilder as mentioned here
  2. join them with or.

For example to satisfy the following condition:

Find an open lottery with name starting with "metastay" or an open lottery with 100 participants:



 

val lotteryQry1 = LotteryQuery().open.is(true).lotteryName.is("metastay")
val lotteryQry2 = LotteryQuery().open.is(true).participantList.size(100)
val firstMatch:Option[LotteryRow] = lotteryQry1.or(lotteryQry2).findOne