-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathexample_request.java
More file actions
32 lines (27 loc) · 922 Bytes
/
example_request.java
File metadata and controls
32 lines (27 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// section: code imports
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.AllDocsQueriesResult;
import com.ibm.cloud.cloudant.v1.model.AllDocsQuery;
import com.ibm.cloud.cloudant.v1.model.PostDesignDocsQueriesOptions;
import java.util.Arrays;
// section: code
Cloudant service = Cloudant.newInstance();
AllDocsQuery query1 = new AllDocsQuery.Builder()
.descending(true)
.includeDocs(true)
.limit(10)
.build();
AllDocsQuery query2 = new AllDocsQuery.Builder()
.inclusiveEnd(true)
.startKey("_design/allusers")
.skip(1)
.build();
PostDesignDocsQueriesOptions queriesOptions =
new PostDesignDocsQueriesOptions.Builder()
.db("users")
.queries(Arrays.asList(query1, query2))
.build();
AllDocsQueriesResult response =
service.postDesignDocsQueries(queriesOptions).execute()
.getResult();
System.out.println(response);