Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Inconsistent documentation and behavior between platforms for REST API design document query parameters #97

Open
lasselaakkonen opened this issue Jun 10, 2017 · 0 comments
Labels

Comments

@lasselaakkonen
Copy link

When querying for a specific key from a design document, the documentation https://developer.couchbase.com/documentation/mobile/1.3/references/couchbase-lite/rest-api/index.html#!/query/post_db_design_ddoc_view_view generates curl command such as curl -X GET --header 'Accept: application/json' 'https://localhost:5984/db/_design/ddoc/_view/view?key=key', specifically key=key.

Depending on the platform and how the key is defined, the API might return:

  • An error
  • The correct documents
  • All the documents

On CBL macOS 1.3.1 using key=ddockey1 curl -X GET --header 'Accept: application/json' 'https://localhost:5984/db/_design/ddoc/_view/view?key=ddockey1' returns an error {"status":400,"error":"bad_request"}

On CBL macOS 1.3.1 using key="ddockey1" curl -X GET --header 'Accept: application/json' 'https://localhost:5984/db/_design/ddoc/_view/view?key="ddockey1"' returns the correct documents e.g. {"offset":0,"rows":[ ... ],"total_rows":17}

On CBL Android 1.4.0 using key=nonexistentkey with any string as a key GET /_design/GenericNote/_view/Deleted?key=nonexistentkey returns all the documents in the view e.g. {"offset":0,"rows":[ .. ALL THE DOCS IN THE VIEW .. ],"total_rows":17}

On CBL Android 1.4.0 using key="ddockey1" GET /_design/GenericNote/_view/Deleted?key=ddockey1 returns the correct documents e.g. {"offset":0,"rows":[ ... ],"total_rows":17}

On CBL iOS 1.4.0 behaves the same way as CBL macOS 1.3.1.

@djpongh djpongh added the icebox label Aug 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants