Reputation: 13
Trying to write a N1QL query like
SELECT * from bucket
WHERE s IN ["s1", "s2", ..., "sn"]
END;
in DSL. Assuming I have a list of Strings called s_array, I need to write something like this:
select("*").from("bucket")
.where(x("s").in(s_array);
Whats the best way to write the IN expression in DSL without concatenating all list elements in a String or something?
Upvotes: 1
Views: 162
Reputation: 516
You can do this with the JsonArray overload, as so:
select("*").from("bucket")
.where(x("s").in(JsonArray.from("s1", "s2", "s3"));
Upvotes: 1