New to CouchDB after years of MySQL. Why am I getting metadata _id and _rev in the values map in a view the returns all records? Here's my view:
"views": "{
"all": "{
"map": "function (doc) {
emit(doc.date, doc)
}"
}"
}"
When I query /database/_design/id/_view/all I get the following JSON:
{"total_rows":2,"offset":0,"rows":[
{"id":"b77bbd5ab73b809ca830fe4b6900506f","key":"[2013, 09, 21, 00, 00, 00]","value":{"_id":"b77bbd5ab73b809ca830fe4b6900506f","_rev":"11-b134dfe46f86c96b4f7e2cf0abb13b61","location":"Mesuk Market","product":"Traditional Pork Skewer","total_items":550,"created_at":"[2013, 09, 21, 23, 24, 06]","date":"[2013, 09, 21, 00, 00, 00]"}},
{"id":"b77bbd5ab73b809ca830fe4b69005f1e","key":"[2013, 09, 21, 00, 00, 00]","value":{"_id":"b77bbd5ab73b809ca830fe4b69005f1e","_rev":"2-ee4e464cdf5de23563c0cc6b62bc4b07","date":"[2013, 09, 21, 00, 00, 00]","created_at":"[2013, 09, 21, 23, 27, 00]","total_items":100,"product":"All Meat Skewer","location":"Mesuk Market"}}
]}
Why am I getting _id and _rev in the map of values? The docs here (and several other places) don't show those fields in the values.
This isn't really blocking my work on a project, but I don't understand why it's happening. Is it from the way I'm setting up my view or making a query?