Closed CodipherX closed 4 years ago
Hi @CodipherX ,
The bug seems indeed valid: https://github.com/cloudant/python-cloudant/blob/14646b7c38caeceface6e2a35f94392356886b9f/src/cloudant/_common_util.py#L123 defines use_index
as STRTYPE
instead of (STRTYPE, list)
.
Are you interested in opening a PR for this?
Hi @bessbd , I will open a PR soon.
Thanks and regards
Our new cloudant-python-sdk(beta) has the array form of the API allowing for both a design document or a design document and an index to be specified in use_index
.
Please read these guidelines before opening an issue.
Bug Description
As per https://docs.couchdb.org/en/stable/api/database/find.html#db-find ,
use_index
could be either as"<design_document>"
or["<design_document>", "<index_name>"]
However on putting alist
in theuse_index
param, exception is thrown1. Steps to reproduce and the simplest code sample possible to demonstrate the issue
with couchdb("admin", "admin", url="http://localhost:5984") as couchClient: selector = {'_id': {'$gt': 0}} db = couchClient["foo"] docs = db.get_query_result(selector,use_index=["ddoc","index"],raw_result=True)
from cloudant import couchdb
with couchdb("admin", "admin", url="http://localhost:5984") as couchClient: selector = {'_id': {'$gt': 0}} db = couchClient["bar"] docs = db.get_partitioned_query_result("pkey",selector,use_index=["index","ddoc"],raw_result=True)