I am working on riak-java client. while doing Mapreduce i got the following output. Now i want to get sum of ticketValue from the Result set that i got.I want to get it by passing userID.
update
From this method i get the resultSet as below
def fetchTicketValue(userID:String): Boolean = {
try{
val result = riakClient.mapReduce("table-ticket","userID:Kim")
.addMapPhase(new NamedJSFunction("Riak.mapValuesJson"),true)
.execute
val o:String = result.getResultRaw
}catch{
case e : Exception =>
e.printStackTrace
}
true
}
I forgot to mention large bracket [{....},{....},{....}] previously.
[{"ticketValue":3,"userID":"Kim","Date":"date","ticketID":"98394kjdf","ticketSource":"reg"},{"ticketValue":3,"userID":"Kim","Date":"date","ticketID":"98394kjdf","ticketSource":"reg"},{"ticketValue":3,"userID":"Kim","Date":"date","ticketID":"98394kjdf","ticketSource":"reg"}]
LIKE: userID:"kim"
RESULT: ticketValue:9
How can i get the data? Any idea will be highly appreciated. Thanks in advance.
(Riak Version : 1.3.2 and Riak Java Client : 1.1.4)