Is it not possible to filter data using multiple keys using a view?


I’m using dreamfactory on bluemix. I’m using a cloudant database for all my data. I’ve set up some views with multiple keys, as an array. I’m able to pass the key param in the url and get the filtered data using the direct API provided by cloudant, like so:[“key1”, “key2”]

But I’m unable to do the same using the API provided by dreamfactory. But I’m able to do it using a single key instead of an array.

So my question is, is there a way to use multiple keys with the API generated by dreamfactory? If so, please do let me know how.

Thank you

Have you tried POSTing to the view with a JSON body of the keys? That’s what I’m seeing in CouchDB’s docs, but we haven’t tested it.

This page from the CouchDB wiki indicates that keys “Must be a proper URL encoded JSON array value.” That makes me think this would work:


Which would be URL-encoded as:


A quick Google search on how to pass JSON arrays to PHP in URL parameters yielded this Stack Overflow answer. According to that post, you should be able to accomplish this like so:


Which would be URL-encoded as:


Thank you for the reply.

I tried both of those methods and neither of them worked for me. Besides, aren’t these docs meant for when you directly call the database, and not through dreamfactory? Is there any other way to filter documents by multiple fields?

Also I’ve been wondering for a while, for “getRecords()” API, there are two fields named “id_field” and “id_type”. Could you let me know what they are and how they can be used? Do I use them to GET records by secondary indexes?

Thank you again.