{
  "_id": "_design/model",
  "language": "javascript",
  "views": {
    "id": {
      "map": "function(doc) {\n  emit(doc.id, doc._id);\n}",
      "reduce": "function(key, values, rereduce) {\nvar max = \"\"\n\nfor(var i=0;i<values.length;++i){\n\tvar val = values[i];\n\tif(val>=max){\n\t\tmax = val;\n\t}\n}\n\nreturn max;\n}"
    },
    "type": {
      "map": "function(doc) {\n  emit(doc.type, doc.id);\n}"
    }
  }
}