How can I access all documents in the CouchDB database?

How to iterate over all CouchDB documents? As I know CouchDB can be accessed via curl

, but I can't get to any docs because I can't understand the syntax of the urls.

I have a database ibmuwarticles

and I found the syntax curl

to check if it exists via a parameter _all_dbs

:

curl -X GET http://10.10.211.133:5984/_all_dbs 
["ibmuwarticles"]

      

But how can I actually access the data? What would be the syntax curl

and parameter after the slash for accessing data in ibmuwarticles

?

I tried to guess and used the _all_data

slash option but it didn't work

curl -X GET http://10.10.211.133:5984/_all_data
{"error":"illegal_database_name","reason":"Only lowercase characters (a-z), digits (0-9), and any of the characters _, $, (, ), +, -, and / are allowed. Must begin with a letter."}

      

+3


source to share


1 answer


I believe the syntax is /db_name/_all_docs

. See the documentation for more information.

So, in your case, it would be the following:



curl -X GET http://10.10.211.133:5984/ibmuwarticles/_all_docs

      

Hope it helps

+6


source







All Articles