PreethiVuchuru27916 opened a new issue, #4131:
URL: https://github.com/apache/couchdb/issues/4131
[NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^
)
## Description
I want to pass a dynamic parameter value to the Couchdb map function. But it
is failing when additional parameters except doc are passed. Please specify If
there is a way to pass a dynamic value to the map function parameter in CouchDB
to do some processing inside the function.
[NOTE]: # ( Describe the problem you're encountering. )
[TIP]: # ( Do NOT give us access or passwords to your actual CouchDB! )
## Steps to Reproduce
[1] Create a design document and Create a view
[2] Add the following code to the map function.
function (doc, employees) {//where employees is a array inside a document
if (doc[employees] && Array.isArray(doc[employees])) {
result = [];
doc[employees].forEach(function (employee) {
result.push(employee.empId);
});
emit("empIds", result);
}
}
[NOTE]: # ( Include commands to reproduce, if possible. curl is preferred. )
curl
"http://admin:adminpw@localhost:5984/ri-prototype/_design/OrganizationInfo/_view/GetEmployees?employees=\"employees"\""
## Expected Behaviour
To pass the employees variable to the view as a parameter.
[NOTE]: # ( Tell us what you expected to happen. )
I wanted to have dynamic value to be passed to the map function of a view in
CouchDB.
## Your Environment
[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: CouchDB v. 3.2.2
* Browser name and version: Safari Version 15.3
* Operating system and version: Mac OS
## Additional Context
[TIP]: # ( Add any other context about the problem here. )
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]