SDK 2.1.4 and include_docs = unexpected end of input

Not sure from where it comes, but I updated couchbase node sdk from 2.1.2 to 2.1.4 and all my queries with include_docs(true) throw an error: SyntaxError: Unexpected end of input at parse (native)

With 2.1.2, everything was allright. Now with 2.1.4, include_docs(true) throws an error, include_docs(false) works as expected.

The case is, with a working connection:

var couchbase = require('couchbase'),
    cluster = new couchbase.Cluster("couchbase://127.0.0.1"),
    bucket = cluster.openBucket("mybucket"),
    view = couchbase.ViewQuery;

console.log("this is ok until here");

bucket.query(
    view.from('staff', 'list').include_docs(true),
    function (err, staff) { 
        console.log("this is never called with include_docs true");
    }
);

The staff/list view is extremely simple:

function (doc, meta) {
    if (doc.type !== 'staff') {
        return;
    }
    emit(doc.name, null);
}

What has changed between 2.1.2 and 2.1.4 ? And again everything went well with 2.1.2. I reverted back to this version and the problem disappeared.

Thanks!

Hey @rekam,
It looks like this may be the result of recent changes in libcouchbase rather than the Node.js SDK, as there have not been recent changes to this behaviour. I am going to pull in our libcouchbase engineer to see if he can shed any more light. I sincerely apologize for the delay here.
Cheers, Brett

Hello,

Anything what can be done about this?
Just stumbled about it… same scenario, same issue.

Best Regards,
Leon

@brett19 Is there anything i can do to fix this or help fixing it?

or @rekam did u find a solution?

// Edit: Currently it forces me to add the whole doc to an index - which is - as far as i read - bad practice

Can you see if you get the same discrepancy in behavior between the two versions?

btw, you don’t need to index the entire doc – just use the doc id with the row and issue a get(). The include_docs is essentially an SDK-side convenience function, not something core done by the server.