Skip to content

Query for Objects with string type key #308

@ellenLyu

Description

@ellenLyu

Hello, I am working based on the 'Query for Objects' section on my couch db. The expected key is a string type, just similar to below.

ViewQuery query = new ViewQuery()
.designDocId("_design/Sofa")
.viewName("by_color")
.key("red");

However, I got the empty response.

It works fine with curl _design/example/_view/by_postcode?key='"3000"' in terminal. I debugged the code and find the key is encoded when querying. Just wondering does it caused by the encoding?

List redSofas = db.queryView(query, Sofa.class);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions