Would you know how to extract that metric object from a promisified invocation? I experimented a bit once I got the callback implementation working as you instructed. I tried using bluebird .spread as well as the updated, native .then with function ([results, meta]) { …}
Thanks, Eben. However, that isn’t useful. @brett19 provided a callback-style solution that worked for me. Would you know how to extract the metric object from a promisified invocation?
Any reason why Couchbase tied the query window count to ORDER BY only? It would be nice if the number of records matching the query criteria would return regardless of the presence or absence of an ORDER BY clause.
Extracting the metric from a promisified version would not be possible unfortunately. The promisification process expects there to be only 2 parameters to the callback function (which resolve and reject respectively). In order to access the metrics, a special wrapper would need to be used which merges the meta data into the result data for when it is resolved.
An example wrapper callback would be something like this, though it depends on what promisification library is being used for how you would integrate this into it.
I have been using bluebird with couchbase but without the metrics object, of course. I have been applying “promisifyAll” to the required couchbase module and it all works great with the xxxAsync operators generated by bluebird.
Indirectly says “regardless of value.”, As count required single argument one can use * or constant to count all input rows
.
if expression and depends on field it must be valued (not missing or not null).