Specifying scan consistency on query causes a unhandled rejection.
Description
Environment
Gerrit Reviews
Release Notes Description
Activity
Brett Lawson February 10, 2020 at 9:15 PM
I'm going to resolve this for now on the basis that adding these checks would not really improve the user experience (they would get an equally confusing error such as "callback must be a parameter"). In reality, this comes down to the user not actually looking at the API to see what should be passed, and seems likely to be simply a migration issue.
Michael Reiche January 31, 2020 at 6:28 PM
The code for 'callback' makes it easy for users to end up with this bizarre 'callback is not a function'.
If the caller passes more than three args, the third arg is used as the 'callback'. Checking for the correct number of args would help. Also checking that the third arg is actually a function before assuming it is a 'callback'.
async query(query, options, callback) {
if (options instanceof Function) {
callback = arguments[1];
options = undefined;
}
See: https://forums.couchbase.com/t/n1ql-query-with-consistency-set-to-request-plus/24630/3