Details
-
Bug
-
Resolution: Won't Fix
-
None
-
None
-
*Location*: https://docs.couchbase.com/nodejs-sdk/3.0/howtos/n1ql-queries-with-sdk.html
*Referrer*: https://docs.couchbase.com/nodejs-sdk/3.0/howtos/kv-operations.html
*User-Agent*: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36
*Screen Resolution*: 1536 x 864*Location*: https://docs.couchbase.com/nodejs-sdk/3.0/howtos/n1ql-queries-with-sdk.html *Referrer*: https://docs.couchbase.com/nodejs-sdk/3.0/howtos/kv-operations.html *User-Agent*: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36 *Screen Resolution*: 1536 x 864
Description
I have been looking for a way to stream over the data using the emitter that is emitted by the QueryExecuter class (https://github.com/couchbase/couchnode/blob/3d0b7e8ef249ac2c912845320e5742b6fa6ff197/lib/queryexecutor.js#L9)
but reading the docs, I could not find that method to use this class. On going through the Cluster class
(https://github.com/couchbase/couchnode/blob/3d0b7e8ef249ac2c912845320e5742b6fa6ff197/lib/cluster.js#L228)
I realized that the method mentioned here, cluster.query(), is a wrapper that is using the emitter internally and giving the complete dataset.
I want to get the functionality mentioned in the code snippet in the docs. Also, I believe this snippet is misleading since the result receives a promise since the cluster.query is an async function and I get error result.on is not available
var result = cluster.query(
'SELECT x.* FROM `default` WHERE x.Type="User"');
result.on('row', (row) =>
);
Reporter: Divyanshu Bhatnagar
E-mail: bhatnagardivyanshu@gmail.com
Attachments
Issue Links
- relates to
-
DOC-11857 SDK Query Docs
- Open