# How to check if a query condition exists?
- Construct the query using the collection's QueryBuilder class
- use the
existsapi to check if the query condition exists
For example to check wether an open lottery with name starting with "metastay" exists:
val lotteryQry = LotteryQuery().open.is(true).lotteryName.startsWith("metastay")
val conditionExists = lotteryQry.exists