Skip to content

query view with multiple key values, but get wrong result #1395

Description

@lizhen921

I create a view with the Map function:

function(doc) {
    if (doc.market == "m_warehouse") {
        emit([doc.logTime,doc.dbName,doc.tableName], 1);
    }
}

and using the api to query :

http://10.23.244.33:8080/org1channel_access%24record/_design/_v_select_data/_view/new-view/?limit=10&skip=0&include_docs=false&reduce=false&descending=true&startkey=["2018-06-19T09:16:47,527","stage"]&endkey=["2018-06-19T09:16:43,717","stage"]

&startkey=["2018-06-19T09:16:47,527","stage"]&endkey=["2018-06-19T09:16:43,717","stage"]

but I got the result :

{
"total_rows": 248133,
"offset": 248129,
"rows": [
    {
        "id": "01CGBPYVXVD88FPDVR3NP50VJW",
        "key": [
            "2018-06-19T09:16:47,527",
            "ods",
            "o_ad_dsp_pvlog_realtime"
        ],
        "value": 1
    },
    {
        "id": "01CGBQ6JMEBR8KBMB8T7Q7CZY3",
        "key": [
            "2018-06-19T09:16:44,824",
            "stage",
            "s_ad_ztc_realpv_base_indirect"
        ],
        "value": 1
    },
    {
        "id": "01CGBQ4BKT8S2VDMT2RGH1FQ71",
        "key": [
            "2018-06-19T09:16:44,707",
            "stage",
            "s_ad_ztc_realpv_base_indirect"
        ],
        "value": 1
    },
    {
        "id": "01CGBQ18CBHQX3F28649YH66B9",
        "key": [
            "2018-06-19T09:16:43,717",
            "stage",
            "s_ad_ztc_realpv_base_indirect"
        ],
        "value": 1
    }
  ]
}

the key ods should not in the result.

did I do something wrong ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions