/* These are map() functions to be used in the browser.
 * They can be accessed through the following URLs (browser or cURL)
 * county-matchup:
 * http://localhost:5984/selected_counties/_design/selected_counties/_view/county-matchup?key=%22Ada%22
 * by-zip-code:
 * http://localhost:5984/us_addresses/_design/us_addresses/_view/by-zip-code?key=%2260101%22
 * Instructions for creating a view are in DATA.md

/* us_addresses/by-zip-code
 *
 *  View used for zip
 */

function(doc) {
  if (doc.zip) {
    emit([doc.zip, doc.county, doc.state]);
  }
}

/* selected_counties/county-matchup
 *
 * View received for matching countries
 */

function(doc) {
  if (doc.County) {
     emit([doc.County,doc.region]);
  }
}
@@ -493,30 +493,31 @@
 .zip) %7B%0A    
+  
 emit(
-%5B
 doc.zip, doc
@@ -513,16 +513,17 @@
 oc.zip, 
+%5B
 doc.coun
@@ -676,17 +676,16 @@
    emit(
-%5B
 doc.Coun
@@ -687,16 +687,17 @@
 .County,
+ 
 doc.regi
@@ -698,17 +698,16 @@
 c.region
-%5D
 );%0A  %7D%0A%7D

Fix CouchDB views