You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/03/10 10:44:07 UTC

[GitHub] [couchdb-nano] creativityjuice opened a new issue #213: The `queries` parameter is no longer supported at this endpoint

creativityjuice opened a new issue #213: The `queries` parameter is no longer supported at this endpoint
URL: https://github.com/apache/couchdb-nano/issues/213
 
 
   <!--- Provide a general summary of the issue in the Title above -->
   
   ## Expected Behavior
   <!--- If you're describing a bug, tell us what should happen -->
   The _view_ method is no longer working since my upgrade to CouchDB 3.0. Apparently, Nano send the request to a view as a POST with search parameters in the body with this form { "queries": ... }. 
   <!--- If you're suggesting a change/improvement, tell us how it should work -->
   
   ## Current Behavior
   <!--- If describing a bug, tell us what happens instead of the expected behavior -->
   Here is the error I get : "Error: The `queries` parameter is no longer supported at this endpoint"
   And the stacktrace :
   at Request._callback (***/node_modules/nano/lib/nano.js:168:15)
   at Request.self.callback (***/node_modules/request/request.js:185:22)
   at Request.emit (events.js:198:13)
   at Request.EventEmitter.emit (domain.js:466:23)
   at Request.<anonymous> (***/node_modules/request/request.js:1154:10)
   at Request.emit (events.js:198:13)
   at Request.EventEmitter.emit (domain.js:466:23)
   at IncomingMessage.<anonymous> (***/node_modules/request/request.js:1076:12)
   at Object.onceWrapper (events.js:286:20)
   at IncomingMessage.emit (events.js:203:15)
   at IncomingMessage.EventEmitter.emit (domain.js:466:23)
   at endReadableNT (_stream_readable.js:1145:12)
   at process._tickCallback (internal/process/next_tick.js:63:19)
   <!--- If suggesting a change/improvement, explain the difference from current behavior -->
   
   ## Possible Solution
   <!--- Not obligatory, but suggest a fix/reason for the bug, -->
   <!--- or ideas how to implement the addition or change -->
   
   ## Steps to Reproduce (for bugs)
   Here is the content of the request :
   { method: 'POST',
   headers:
   { 'content-type': 'application/json',
   accept: 'application/json' },
   uri: 'http://localhost:5984/***/_design/v*/_view/***',
   body:
   '{"queries":[{"startkey":["25ea7f29-3246-41d9-a45b-280837c087fe"],"endkey":["25ea7f29-3246-41d9-a45b-280837c087fe",{}],"include_docs":true},{"startkey":["12bcdbc6-57dd-48bb-a45f-32c9731ebcf9"],"endkey":["12bcdbc6-57dd-48bb-a45f-32c9731ebcf9",{}],"include_docs":true}]}',
   qsStringifyOptions: { arrayFormat: 'repeat' } },
   headers:
   { uri:'http://localhost:5984/***/_design/v*/_view/***',
   statusCode: 400,
   'cache-control': 'must-revalidate',
   connection: 'close',
   'content-type': 'application/json',
   date: 'Tue, 10 Mar 2020 10:15:04 GMT',
   'x-couch-request-id': '27e5536e4a',
   'x-couchdb-body-time': '0' },
   errid: 'non_200',
   description: 'couch returned 400' }
   
   
   ## Your Environment
   <!--- Include as many relevant details about the environment you experienced the bug in -->
   * Version used: Nano 8.2.2 / CouchDB 3.0.0
   * Browser Name and version: Firefox 73.0.1
   * Operating System and version (desktop or mobile): Ubuntu 18.04
   * Link to your project:
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb-nano] glynnbird closed issue #213: The `queries` parameter is no longer supported at this endpoint

Posted by GitBox <gi...@apache.org>.
glynnbird closed issue #213: The `queries` parameter is no longer supported at this endpoint
URL: https://github.com/apache/couchdb-nano/issues/213
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb-nano] glynnbird commented on issue #213: The `queries` parameter is no longer supported at this endpoint

Posted by GitBox <gi...@apache.org>.
glynnbird commented on issue #213: The `queries` parameter is no longer supported at this endpoint
URL: https://github.com/apache/couchdb-nano/issues/213#issuecomment-597024047
 
 
   As the [release notes for CouchDB 3](https://docs.couchdb.org/en/latest/whatsnew/3.0.html#version-3-0-0) state, the queries parameter is no longer supported and is replaced by a [queries endpoint](https://docs.couchdb.org/en/latest/api/ddoc/views.html#api-ddoc-view-multiple-queries). The queries endpoint isn't directly modelled as function call, but you can create a custom request e.g you can do something like:
   
   ```js
   const q = {
       "queries": [
           {
               "keys": [
                   "meatballs",
                   "spaghetti"
               ]
           },
           {
               "limit": 3,
               "skip": 2
           }
       ]
   }
   const req = {
     method: 'post',
     db: 'mydb',
     path: '_design/mydesigndoc/_view/myview/_queries',
     body: q
   }
   const result = await db.request(req)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services