mvcCouch Tutorial Part 4.5 - Building mvcCouch - Create a CouchDB View HD
Overview: Create the CouchDB view function. Objectives: Show how to write a simple CouchDB map function to use with our proxy reader in order to load in documents using HTTP GET requests. Show function in CouchDB design documents and how to view results. Step by Step: 1. What is a CouchDB view? Index... read-only... look at data in organized way. 2. What is a map function? Organize docs into lists... key/value pairs... design doc... Javascript. 3. Show where in the directory structure to create folders and files for CouchApp "views". 4. Show what a map function looks like in CouchDB design documents in Futon. 5. Review and explain map.js map function - highlighting the emit function. 6. Point out read property of api config in the proxy config of Doc.js Model ("include docs"). 7. Show what the "view results" JSON looks like in a browser. Resources: Download mvcCouch project source files: http://averydc.com/guest/mvcCouch.zip View the mvcCouch design document in CouchDB: http://shaneavery.couchone.com/_utils/document.html?mvccouch/_design/mvcCouch View mvcCouch view results: http://shaneavery.couchone.com/mvccouch/_design/mvcCouch/_view/region?include_docs=true
Похожие видео
Показать еще