I have a really simple emit statement in a view.
emit([doc.salesDate, doc.companyId], doc.grossSales);
Is there any way I can make the JSON object it returns show up like this
{
"grossSales" : "100"
}
instead of
{
0: "100"
}
EDIT: I'm using the rest API if it makes a difference
Ideally you want the view to be as lightweight as possible but you can do this by simply emitting a JSON object
This assumes the document looks like this:
The output from the REST API:
Please note that the REST API for views should only be used for testing and debug. In a production environment a SDK should be used.