Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Cloudant search - non-intuitive handling of counts parameter #89

Description

@glynnbird

In the sample code below

var cloudant = require('cloudant')('https://reader.cloudant.com');
var guitars = cloudant.db.use('guitars');


guitars.search('search', 'search', {q:'*:*',limit:0, counts: ["brand"] }, function(err, data) {
  if (err)
    throw err
  console.log(err,data);
});

instead I have to do:

guitars.search('search', 'search', {q:'*:*',limit:0, counts: JSON.stringify(["brand"]) }, function(err, data) {
 ...

I think our library should detect if counts is provided as an array and JSON.stringify it for the user.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions