Can spring data couchbase be used to access reduced views -


i know there way access reduced view results using couchbase java sdk. unable use spring-data access reduced view. possible?

view:

view byidgetdatestats = defaultview.create("byidgetdatestats",             "function (doc, meta) {"             + "if(doc.doctype == \"com.bd.idm.model.daylog\"){"             + "   emit(doc.userid, doc.date)"             +"    }}"             ,"_stats"             ); 

when attempt use spring-data access view this:

query query = new query(); query.setkey(complexkey.of(userid)).setreduce(true).setgroup(true); viewresult result = repo.findbyidgetdatestats(query); 

error message

java.lang.illegalstateexception: failed execute commandlinerunner ...  caused by: java.lang.runtimeexception: failed access view ...  caused by: java.util.concurrent.executionexception: operationexception: server: query_parse_error reason: invalid url parameter 'group' or  'group_level' non-reduce view. .... caused by: com.couchbase.client.protocol.views.viewexception: query_parse_error reason: invalid url parameter 'group' or  'group_level' non-reduce view. 

....

no, spring-data-couchbase 1.x set reduce false.

if want use reduced view , viewresult, use couchbasetemplate#queryview() method.

you can still in repository defining custom repository method (see chapter of doc, should able call getcouchbaseoperations in implementation).


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -