Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Compare: Sample design document

Showing with 1 addition and 2 deletions.
  1. +1 −2  Sample-design-document.textile
View
3  Sample-design-document.textile
@@ -2,7 +2,7 @@ Create a new database and call it odata.
Create new document in futon and paste this into it.
Go to [http://localhost:5984/odata/_design/odata/_show/odata_service/_design/odata](http://localhost:5984/odata/_design/odata/_show/odata_service/_design/odata) which will result in your first OData feed.
-```javascript
+
{
"_id": "_design/odata",
"_rev": "5-7be958d6e9ae68f6d1b344ed4507be08",
@@ -20,4 +20,3 @@ Go to [http://localhost:5984/odata/_design/odata/_show/odata_service/_design/oda
"odata_service": "function(doc, req) { \n var host = req.headers.Host;\n var path = req.path;\n var pathurl = \"\";\n for(var b in path){\n\tif (b < 3)\n\t pathurl = pathurl+'/'+path[b];\n }\n var baseUrl = \"http://\"+host+pathurl+\"/_list/odata_convert/\";\n\n var returnBody = '<service xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:app=\"http://www.w3.org/2007/app\" xmlns=\"http://www.w3.org/2007/app\" xml:base=\\\"'+baseUrl+'\\\"><workspace><atom:title>'+path[path.length-1]+'</atom:title>';\n if(doc){\n\tif (doc.views){\n\t for(var prop in doc.views) {\n\t\tif(doc.views.hasOwnProperty(prop)){\n\t\t returnBody = returnBody+'<collection href=\\\"'+prop+'\\\">';\n\t\t returnBody = returnBody+'<atom:title>'+\"\\\"\"+prop+\"\\\"\"+'</atom:title></collection>';\n\t\t}\n\t }\n\t}\n\n }\n returnBody = returnBody+'</workspace></service>';\n return {\n\theaders : {\n\t \"Content-Type\" : \"text/xml\"\n\t},\n\tbody : returnBody};\n}"
}
}
-```
Something went wrong with that request. Please try again.