Closed endemecio02 closed 4 years ago
@endemecio02 to make a multi-query view request you'll need to make a custom request using cloudant.request(...)
against _view/{view}/queries
e.g.
var Cloudant = require('@cloudant/cloudant');
var cloudant = Cloudant({url: process.env.CLOUDANT_URL});
cloudant.request({
db: 'users',
path: '_design/new-ddoc/_view/newview/queries',
method: 'post',
body: {queries: [
{limit: 1},
{include_docs: true}
]}
}, function(err, data) {
console.log('Error:', err);
console.log('Data:', data);
});
thank you @emlaver that's what I've done to fix the issue for now. But this is more of a hack. The official Cloudant library should be able to handle this. I should be able to call cloudant.view(
The API change for this was also in CouchDB and a fix for it should go into nano upstream. We're unlikely to consume that fix here as our request
based plugin structures are not compatible with the latest versions of Nano.
However, our new cloudant-node-sdk(beta) has full compatibility for this via specific functions for single and multiple view queries.
Bug Description
IBM's official Cloudant JavaScript library has not been updated to account for the queries deprecation change. https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-deprecations#replaced-queries-parameter
1. Steps to reproduce and the simplest code sample possible to demonstrate the issue
send a multi-query request to any view
2. What you expected to happen
response with results
3. What actually happened
cloudant error message: "The
queries
parameter is no longer supported at this endpoint"Environment details
node v12.16.3 @cloudant/cloudant@4.2.4