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/12 08:26:02 UTC

[GitHub] [couchdb] rnewson commented on issue #2656: error: 'invalid_json' for View GET Request

rnewson commented on issue #2656: error: 'invalid_json' for View GET Request
URL: https://github.com/apache/couchdb/issues/2656#issuecomment-598064052
 
 
   I tried to reproduce this without success (i.e, it worked);
   
   ```
   ➜  ~ curl foo:bar@localhost:15984/db1 -XPUT
   {"ok":true}
   
   ➜  ~ curl foo:bar@localhost:15984/db1/doc1 -XPUT -d '{ "type": "TAGS", "origin_id": "2", "locale": "sv_SE", "values_translation": { "name": "Glasstårta", "explanation": "", "links": [], "alternativeTitle": [] } }'
   {"ok":true,"id":"doc1","rev":"1-ac04d6c912096181503c60944f35d5a2"}
   
   ➜  ~ curl foo:bar@localhost:15984/db1/doc1
   {"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}
   
   ➜  ~ curl 'foo:bar@localhost:15984/db1/_all_docs?include_docs=true'
   {"total_rows":1,"offset":0,"rows":[
   {"id":"doc1","key":"doc1","value":{"rev":"1-ac04d6c912096181503c60944f35d5a2"},"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
   ]}
   
   ➜  ~ curl 'foo:bar@localhost:15984/db1/_design/foo' -XPUT -d '{"views":{"bar":{"map":"function(doc){emit([doc.type, doc.origin_id]);}"}}}'
   {"ok":true,"id":"_design/foo","rev":"1-eb26a625dc5f7da1c4b50b29db08a1b9"}
   
   ➜  ~ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]' -g
   {"total_rows":1,"offset":0,"rows":[
   {"id":"doc1","key":["TAGS","2"],"value":null}
   ]}
   
   ➜  ~ curl 'foo:bar@localhost:15984/db1/_design/foo/_view/bar?key=["TAGS","2"]&include_docs=true' -g
   {"total_rows":1,"offset":0,"rows":[
   {"id":"doc1","key":["TAGS","2"],"value":null,"doc":{"_id":"doc1","_rev":"1-ac04d6c912096181503c60944f35d5a2","type":"TAGS","origin_id":"2","locale":"sv_SE","values_translation":{"name":"Glasstårta","explanation":"","links":[],"alternativeTitle":[]}}}
   ]}
   ```

----------------------------------------------------------------
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