Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Key value doesn't work as json, only as string

Open
#5,396 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
api, databases

Research direction

Start with the GET /{db}/_design/{ddoc}/_view/{view} request and compare how string and JSON key query values are parsed. Reproduce the supplied view and CouchDB 3.4.2 example, then add or adjust coverage for an object key; done when an existing emitted JSON key returns its row.

Written by the indexing model from the issue text.

Description

cant-reproduce

Description

When you pass "key" query to GET /{db}/_design/{ddoc}/_view/{view}
for example /your_db/_design/your_doc/_view/some_view?key="some_exist_key" works fine, it return rows if it match.
But if you use json as key: /your_db/_design/your_doc/_view/some_view?key={"json_example": "some_exist_key"} for example will not return any row even if {"json_example": "some_exist_key"} as key exist.

Steps to Reproduce

I use it

http://admin:admin@localhost:5984/account_documents/_design/unique_data_design_doc/_view/account_id_rev_by_hash_password_login?key={"login": "login_2","password_hash": "XKJyibT/PjDRPy2X/DP86v12ZmzKdHuVudId5E0+4ts"}

with view

function (doc) {
  emit({login:doc.login, password_hash:doc.password_hash}, [doc._id, doc._rev]);
}

If you want reproduce bag, just add document and then view with json as key and then try retrieve by then key row, you got empty row array

Expected Behaviour

Possibility to retrieve document by json not only by string, so key like

{"login": "login_2","password_hash": "XKJyibT/PjDRPy2X/DP86v12ZmzKdHuVudId5E0+4ts"} 

will return not empty array rows if key is exists

Your Environment

I think it's not matter
TIP: # ( Include as many relevant details about your environment as possible. )
TIP: # ( You can paste the output of curl http://YOUR-COUCHDB:5984/ here. )

  • CouchDB version used: 3.4.2
  • Browser name and version: edge, postman
  • Operating system and version: windows 10

Additional Context

Dominant language
Erlang
Stars
7k
Forks
1.1k
Avg merge
5h 24m
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/couchdb

All issues in apache/couchdb

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.