Skip to content

Creating views to read only keys #61

@akirillov

Description

@akirillov

Hi everyone,
I've been looking around for a way to get only String documents keys from the bucket. Here my map() function:

function (doc, meta) {
 if (doc.isDraft == false) {
   emit(null);
 } 
}

and I try to read keys the next way:

val query = new Query()
      .setLimit(Int.MaxValue)
      .setSkip(0)
      .setInclusiveEnd(true)
      .setStale(Stale.FALSE)

      bucket.find[String](DesignDocName, ViewName)(query)

When I try to execute the query I get Json Validation failed : Invalid JSON content : {"obj":[]}
Is there any way to get keys only without fetching whole documents? Any help appreciated.

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