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

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -