I am trying to do a n1ql query in couchbaselite, where I am passing a parameter which is an Array, this to use it in the “IN” clause. But I am getting an error, what is the correct way to do it?
This is my parameter that I wanna use types: Array<Int?>
val query = db.createQuery(
"""
SELECT * FROM _
WHERE type IN \$types
""".trimIndent()
)
val typesFiltered = MutableArray().apply {
types.forEach { type ->
type?.let { addInt(it) }
}
}
query.parameters = Parameters().setArray("types", typesFiltered)