Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creation of a view with only the map fails #1

Open
mazzal1 opened this issue Apr 10, 2024 · 0 comments
Open

Creation of a view with only the map fails #1

mazzal1 opened this issue Apr 10, 2024 · 0 comments

Comments

@mazzal1
Copy link
Member

mazzal1 commented Apr 10, 2024

Code:
views.put(VIEW_BY_STATE_NAME, new CouchDesignDocument.View("function(doc) {" + "if(doc.state) {" + "emit(doc.state, doc);" + "}" + "}"));
In the code, only the map is set.

Error log:
request failed with code 400 {"error":"invalid_design_doc","reason":"views.byState.reduce field must have string type"}

Hint: probably the reduce is sent as "null" instead of being undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant