Ramesh
Ramesh

Reputation: 163

Is it possible to get results for various keys using curl for couchdb?

I have a key in key field in couchdb. where my key differs for each document. I need to get documents for various keys: say 1st key is "123123", 2nd key is "234234", I have to pass these in a single query and get results for both the keys using curl command.

In SQL we can do it as:

select * from table where user_id in "123123,234234";

Similarly I need to do this in couchdb using curl. Is this possible using curl command?

Thanks in advance.

Upvotes: 1

Views: 241

Answers (1)

Kxepal
Kxepal

Reputation: 4679

Sure it is:

curl -X POST http://localhost:5984/mydb/_design/users/_view/by_user_id -d '{"keys": ["123123", "234234"]}' -H "Content-Type: application/json"

More about CouchDB views query options

Upvotes: 1

Related Questions