public List<User> findSupplierSubAcc(Set<String> uids) {
String query = “select * from c where UPPER(c.miD) IN (@UIDs) and ARRAY_CONTAINS(c.com,@com1,true)”;
try {
CosmosPagedIterable iterable = userContainer.queryItems(new SqlQuerySpec(query,
List.of(new SqlParameter(“@com1”, “SUP”),
new SqlParameter(“@UIDs”, uids.stream().collect(Collectors.joining(“‘,'”, “‘”, “‘”)).split(“,”)))),
new CosmosQueryRequestOptions(), User.class);
return iterable.stream().collect(Collectors.toList());
} catch (Exception e) {
log.error(MARKER_UNEXPECTED, “data could not be fetched because of unknown reasons”, e);
throw e;
}
}
above is the code that i am trying to run, but its not returning any results. So then, Instead of using the binding variable ‘UIDs’, i tried by passing hard coded values and it worked. So realized the problem is when i am trying to pass a binding variable by setting the string values to it. I tried a lot, but couldn’t understand why it is not returning values when using passing value by binding variables. Can someone help me out here? Thanks in advance!
Expecting bunch of values being returned