I am using ektorp 1.4.1 Jar to connect to Cloudant database. Now I am able to write map and reduce functions using class EventRepository extends CouchDbRepositorySupport. But my problem here is, how I can query for Index and Selector using ektorp java API? Please help me out here by any one. Thanks in advance.
This is my Query Index :
{
"index": {
"fields": [
{"name": "userName", "type": "string"}
]
},
"type": "text"
}
and here is my selector code for getting all Events from cloudant by User Name Descending order by startDate.
{
"selector": {
"userName": "[email protected]"
},
"fields": [
"userName",
"startDate",
"days",
"_id",
"_rev"
],
"sort": [
{
"userName": "desc"
}
]
}
I am using the below code to connect cloudant using Cloudant java API...
CloudantClient client = ClientBuilder.url(new URL("https://userName:password@*****.cloudant.com")).username("*******").
password("*******").build();
List<String> dbsList = client.getAllDbs();
System.out.println("...dbsList size is :: " + dbsList.size());
CloudantClient client = ClientBuilder.account("username").username("username").password("password").
build();
but still same issue... and even I have tried in different way...
... and I am getting below mentioned error while running on Eclipse Websphere server 7.0 on local...
***********Error************* [3/9/16 23:53:43:547 IST] 00000031 SystemErr R com.cloudant.client.org.lightcouch.CouchDbException: 400 Bad request: