use of com.cloudant.client.api.query.QueryBuilder in project java-cloudant by cloudant.
the class QueryTests method basicSelector10_single.
// "$all operator used with full text indexing"
@Test
public void basicSelector10_single() {
QueryBuilder qb = new QueryBuilder(all("genre", "Comedy"));
Assertions.assertEquals("{\"selector\": {\"genre\": {\"$all\": [\"Comedy\"]}}}", qb.build());
}
use of com.cloudant.client.api.query.QueryBuilder in project java-cloudant by cloudant.
the class QueryTests method basicSelector15_single.
// "$in operator used with full text indexing"
@Test
public void basicSelector15_single() {
QueryBuilder qb = new QueryBuilder(in("year", 2010));
Assertions.assertEquals("{\"selector\": {\"year\": {\"$in\": [2010]}}}", qb.build());
}
use of com.cloudant.client.api.query.QueryBuilder in project java-cloudant by cloudant.
the class QueryTests method basicSelector1WithFields.
// "Selector basics"
@Test
public void basicSelector1WithFields() {
QueryBuilder qb = new QueryBuilder(eq("director", "Lars von Trier")).fields("_id", "_rev", "year", "title");
Assertions.assertEquals("{\"selector\": {\"director\": {\"$eq\": \"Lars von Trier\"}}, " + "\"fields\": [\"_id\", \"_rev\", \"year\", \"title\"]}", qb.build());
}
Aggregations