Query value always returns null


#1

I used the code below to query

var query = mycouchbase.view(‘doc’, ‘myview’);

query.query({
limit: 1
}, function(err, results) {

for (i in results) console.log(results[i]);

});

in admin console, it returns correct key/value

but in javascript console

it displayed

console - { id: ‘1NR10’, key: ‘1NR10’, value: null }

value always is null

your comment welcome


#2

I try to set ‘setIncludeDocs’ as true but same result


#3

Hey arachide99,
View queries do not by default return the value. You must use include_docs or alternatively perform a get operation on the key to retrieve the values.
Cheers, Brett