No key or value set when isReduce is false

Hi All,

When I query a view that has no reduce function, I am not getting values set for “key” or “value”.

In CouchbaseClient.cfc on line 1069 there is the following code:

// check for reduced if( isReduced ){ thisDocument.key = thisRow.getKey(); thisDocument.value = thisRow.getValue(); } else { thisDocument.id = thisRow.getID(); }

So if isReduce is false, then only the id gets set. Should it be:

// check for reduced if( isReduced ){ thisDocument.key = thisRow.getKey(); thisDocument.value = thisRow.getValue(); } else { thisDocument.id = thisRow.getID(); thisDocument.key = thisRow.getKey(); thisDocument.value = thisRow.getValue(); }

Or am I looking at it the wrong way?

Thanks,

Adam

Hi Adam, it looks like that was fixed in April
https://github.com/Ortus-Solutions/cfcouchbase-sdk/commit/deddc6f5ea268c96d223be945fffeff4399aa0f2
As part of COUCHBASESDK-24

However, it looks like we haven’t had a release of the CFCouchbase SDK since then. Can you use what’s on the development branch for now?
Our bleeding edge builds are here on the integration server:
http://integration.staging.ortussolutions.com/artifacts/ortussolutions/cfcouchbase/1.1.0/

I’ll check with Luis and see if we can do a minor release with some of these fixes.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Oh, I should add-- the bleeding edge has this comment from when I had fixed it that helps explain what to expect and when. It sort of obvious when you think about it, but frustratingly hard to glean from the official Couchbase docs:

ID: The id of the document in Couchbase, but only available if the query is NOT reduced
Document: Only available if the query is NOT reduced
Key: This is always available, but null if the query has been reduced, If un-redunced it is the first value passed into emit()
Value: This is always available. If reduced, this is the value returned by the reduce(), if not reduced it is the second value passed into emit()

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad,

I will use the development branch.

Thanks for the info and the cfcouchbase project,

Adam