Skip to content

Commit

Permalink
COUCHBASESDK-24 Always include key & value
Browse files Browse the repository at this point in the history
  • Loading branch information
bdw429s committed Apr 8, 2014
1 parent 94ab4fd commit deddc6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions cfcouchbase/CouchbaseClient.cfc
Expand Up @@ -1066,11 +1066,12 @@ component serializable="false" accessors="true"{
if( hasDocs ){
thisDocument.document = deserializeData( thisRow.getID(), thisRow.getDocument(), arguments.inflateTo, arguments.deserialize, arguments.deserializeOptions );
}

thisDocument.value = thisRow.getValue();
thisDocument.key = thisRow.getKey();

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

Expand Down
2 changes: 1 addition & 1 deletion test/specs/CouchbaseClientViewTest.cfc
Expand Up @@ -142,7 +142,7 @@ component{
var results = couchbase.query( 'beer', 'by_location', { limit: 10, reduce:false, group:true, groupLevel:1 }, false );
// The fact that this doesn't error is a test in itself since setting group options when reduce is false will normally blow stuff up.
expect( results ).toBeArray();
expect( results[1].value ).toHaveLength( 0 );
expect( results[1].value ).toBe( 1 );
});

it( "can return native results", function(){
Expand Down

0 comments on commit deddc6f

Please sign in to comment.