Search code examples
couchdbcloudant

Cloudant Query: how to obtain a count of documents matching a selector?


Using Cloudant Query I would like to obtain a count of the number of documents which match a query, without returning the actual documents. Is there a way to do this with the current API, or are there plans to add it in the near future?


Solution

  • I don't think there's a way to get only the # of documents matched, but you can use the fields parameter to restrict what's returned to a single property of the document, then count those.