Key value doesn't work as json, only as string
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
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
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/couchdb
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 40/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 40/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
enhancement needs-triage
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Similar issues
-
bug CLI custom-model
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100