{"action":"created","issue":{"url":"https://api.github.com/repos/cloudant/nodejs-cloudant/issues/89","labels_url":"https://api.github.com/repos/cloudant/nodejs-cloudant/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/cloudant/nodejs-cloudant/issues/89/comments","events_url":"https://api.github.com/repos/cloudant/nodejs-cloudant/issues/89/events","html_url":"https://github.com/cloudant/nodejs-cloudant/issues/89","id":102973775,"number":89,"title":"Cloudant search - non-intuitive handling of counts parameter","user":{"login":"glynnbird","id":697925,"avatar_url":"https://avatars.githubusercontent.com/u/697925?v=3","gravatar_id":"","url":"https://api.github.com/users/glynnbird","html_url":"https://github.com/glynnbird","followers_url":"https://api.github.com/users/glynnbird/followers","following_url":"https://api.github.com/users/glynnbird/following{/other_user}","gists_url":"https://api.github.com/users/glynnbird/gists{/gist_id}","starred_url":"https://api.github.com/users/glynnbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glynnbird/subscriptions","organizations_url":"https://api.github.com/users/glynnbird/orgs","repos_url":"https://api.github.com/users/glynnbird/repos","events_url":"https://api.github.com/users/glynnbird/events{/privacy}","received_events_url":"https://api.github.com/users/glynnbird/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cloudant/nodejs-cloudant/labels/Agenda","name":"Agenda","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cloudant/nodejs-cloudant/milestones/6","html_url":"https://github.com/cloudant/nodejs-cloudant/milestones/1.4.0","labels_url":"https://api.github.com/repos/cloudant/nodejs-cloudant/milestones/6/labels","id":1285742,"number":6,"title":"1.4.0","description":"","creator":{"login":"jhs","id":17575,"avatar_url":"https://avatars.githubusercontent.com/u/17575?v=3","gravatar_id":"","url":"https://api.github.com/users/jhs","html_url":"https://github.com/jhs","followers_url":"https://api.github.com/users/jhs/followers","following_url":"https://api.github.com/users/jhs/following{/other_user}","gists_url":"https://api.github.com/users/jhs/gists{/gist_id}","starred_url":"https://api.github.com/users/jhs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhs/subscriptions","organizations_url":"https://api.github.com/users/jhs/orgs","repos_url":"https://api.github.com/users/jhs/repos","events_url":"https://api.github.com/users/jhs/events{/privacy}","received_events_url":"https://api.github.com/users/jhs/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":1,"state":"open","created_at":"2015-09-02T08:05:07Z","updated_at":"2015-09-09T14:28:06Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-08-25T08:17:44Z","updated_at":"2015-10-23T08:08:51Z","closed_at":null,"body":"In the sample code below\r\n\r\n```\r\nvar cloudant = require('cloudant')('https://reader.cloudant.com');\r\nvar guitars = cloudant.db.use('guitars');\r\n\r\n\r\nguitars.search('search', 'search', {q:'*:*',limit:0, counts: [\"brand\"] }, function(err, data) {\r\n  if (err)\r\n    throw err\r\n  console.log(err,data);\r\n});\r\n```\r\n\r\ninstead I have to do:\r\n\r\n```\r\nguitars.search('search', 'search', {q:'*:*',limit:0, counts: JSON.stringify([\"brand\"]) }, function(err, data) {\r\n ...\r\n```\r\n\r\nI think our library should detect if `counts` is provided as an array and JSON.stringify it for the user.\r\n"},"comment":{"url":"https://api.github.com/repos/cloudant/nodejs-cloudant/issues/comments/150503010","html_url":"https://github.com/cloudant/nodejs-cloudant/issues/89#issuecomment-150503010","issue_url":"https://api.github.com/repos/cloudant/nodejs-cloudant/issues/89","id":150503010,"user":{"login":"jhs","id":17575,"avatar_url":"https://avatars.githubusercontent.com/u/17575?v=3","gravatar_id":"","url":"https://api.github.com/users/jhs","html_url":"https://github.com/jhs","followers_url":"https://api.github.com/users/jhs/followers","following_url":"https://api.github.com/users/jhs/following{/other_user}","gists_url":"https://api.github.com/users/jhs/gists{/gist_id}","starred_url":"https://api.github.com/users/jhs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhs/subscriptions","organizations_url":"https://api.github.com/users/jhs/orgs","repos_url":"https://api.github.com/users/jhs/repos","events_url":"https://api.github.com/users/jhs/events{/privacy}","received_events_url":"https://api.github.com/users/jhs/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T08:08:51Z","updated_at":"2015-10-23T08:08:51Z","body":"Fixed in Nano. @glynnbird Is the list you made above comprehensive?"}}