why the result of views is different in REST and Java? for example from
REST it gives exact result it supposed to return, but from Java it will
return whole document of specific key.
I have this document:
{
"doctype": "people",
"id": "person0",
"name": "Kasidit Treweek",
"homepage": "http://www.cohera.com/~Treweek",
"creditcard": "9941 9701 2489 4716",
"profile": {
"income": 20186.59,
"interest": [
{
"category": "category251"
}
],
"education": "Graduate School",
"business": "No"
}
}
when I use map function in my views:
function (doc, meta) {
if( (doc.doctype && doc.doctype=="people") && doc.id=="person0"){
emit(doc.id,doc.name);
}
}
The result in REST is:
{"total_rows":1,"rows":[
{"id":"person0","key":"person0","value":"Kasidit Treweek"}
]
}
But From Java it will return whole document with key "person0" like
{"person0":{"doctype": "people",.....}}
Here is my java code that I have simple implemented:
ViewResponse response = client.query(view, query);
java.util.Map<String, Object> map = response.getMap();
Same question also in
Stackoverflow<http://stackoverflow.com/questions/21047102/couchbase-views-result-is-different-from-java-and-rest>
--
You received this message because you are subscribed to the Google Groups
"Couchbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.