0

Is it possible to create the same query explained here: Cloudant Selector Query using the next java client: https://github.com/cloudant/java-cloudant?

xpqz
  • 3,617
  • 10
  • 16
Igor Dumchykov
  • 347
  • 1
  • 15

1 Answers1

2

You can pass the query selector string to the query method e.g.

String selector = "{\"selector\":{\"loansBorrowed\":{\"$elemMatch\":{\"loanamount\":{\"$gt\":1000}}}}}";
QueryResult<ProfileDocumentPojo> result = db.query(selector, ProfileDocumentPojo.class);
List<ProfileDocumentPojo> profiles = result.getDocs();
ricellis
  • 396
  • 1
  • 4