Developing CouchApps
-
Upload
westhoff -
Category
Technology
-
view
3.029 -
download
0
Transcript of Developing CouchApps
![Page 1: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/1.jpg)
CouchDB application developmentDeveloping and deploying CouchApps
Jakob Westhoff <[email protected]>
PHPBarcamp.atMay 1, 2010
http://westhoffswelt.de [email protected] slide: 1 / 35
![Page 2: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/2.jpg)
About Me
Jakob Westhoff
PHP developer for more several years
Computer science student at the TU Dortmund
Co-Founder of the PHP Usergroup Dortmund
Active in different Open Source projects
http://westhoffswelt.de [email protected] slide: 2 / 35
![Page 3: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/3.jpg)
Asking the audience
Who is actively using CouchDB?
Who played with CouchDB just for fun?
Who has heard of CouchDB, but never used it?
Who has already developed a CouchApp?
Who does not know at all, what a CouchApp is?
http://westhoffswelt.de [email protected] slide: 3 / 35
![Page 4: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/4.jpg)
Asking the audience
Who is actively using CouchDB?
Who played with CouchDB just for fun?
Who has heard of CouchDB, but never used it?
Who has already developed a CouchApp?
Who does not know at all, what a CouchApp is?
http://westhoffswelt.de [email protected] slide: 3 / 35
![Page 5: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/5.jpg)
Asking the audience
Who is actively using CouchDB?
Who played with CouchDB just for fun?
Who has heard of CouchDB, but never used it?
Who has already developed a CouchApp?
Who does not know at all, what a CouchApp is?
http://westhoffswelt.de [email protected] slide: 3 / 35
![Page 6: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/6.jpg)
Asking the audience
Who is actively using CouchDB?
Who played with CouchDB just for fun?
Who has heard of CouchDB, but never used it?
Who has already developed a CouchApp?
Who does not know at all, what a CouchApp is?
http://westhoffswelt.de [email protected] slide: 3 / 35
![Page 7: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/7.jpg)
Asking the audience
Who is actively using CouchDB?
Who played with CouchDB just for fun?
Who has heard of CouchDB, but never used it?
Who has already developed a CouchApp?
Who does not know at all, what a CouchApp is?
http://westhoffswelt.de [email protected] slide: 3 / 35
![Page 8: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/8.jpg)
Goals of this session
Understand what a CouchApp actually is
Learn what features of CouchDB can be used to realize aCouchApp
Get a glimpse of third party tools and frameworks forCouchApp development
http://westhoffswelt.de [email protected] slide: 4 / 35
![Page 9: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/9.jpg)
Goals of this session
Understand what a CouchApp actually is
Learn what features of CouchDB can be used to realize aCouchApp
Get a glimpse of third party tools and frameworks forCouchApp development
http://westhoffswelt.de [email protected] slide: 4 / 35
![Page 10: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/10.jpg)
Goals of this session
Understand what a CouchApp actually is
Learn what features of CouchDB can be used to realize aCouchApp
Get a glimpse of third party tools and frameworks forCouchApp development
http://westhoffswelt.de [email protected] slide: 4 / 35
![Page 11: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/11.jpg)
What is CouchDB?
Document based NoSQL database
Written in Erlang
MapReduce based indexing
Javascript uses as embedded language
RESTful JSON API
Build in incremental bi-directional replication
http://westhoffswelt.de [email protected] slide: 5 / 35
![Page 12: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/12.jpg)
What is CouchDB?
Document based NoSQL database
Written in Erlang
MapReduce based indexing
Javascript uses as embedded language
RESTful JSON API
Build in incremental bi-directional replication
http://westhoffswelt.de [email protected] slide: 5 / 35
![Page 13: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/13.jpg)
What is CouchDB?
Document based NoSQL database
Written in Erlang
MapReduce based indexing
Javascript uses as embedded language
RESTful JSON API
Build in incremental bi-directional replication
http://westhoffswelt.de [email protected] slide: 5 / 35
![Page 14: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/14.jpg)
What is CouchDB?
Document based NoSQL database
Written in Erlang
MapReduce based indexing
Javascript uses as embedded language
RESTful JSON API
Build in incremental bi-directional replication
http://westhoffswelt.de [email protected] slide: 5 / 35
![Page 15: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/15.jpg)
What is CouchDB?
Document based NoSQL database
Written in Erlang
MapReduce based indexing
Javascript uses as embedded language
RESTful JSON API
Build in incremental bi-directional replication
http://westhoffswelt.de [email protected] slide: 5 / 35
![Page 16: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/16.jpg)
What is CouchDB?
Document based NoSQL database
Written in Erlang
MapReduce based indexing
Javascript uses as embedded language
RESTful JSON API
Build in incremental bi-directional replication
http://westhoffswelt.de [email protected] slide: 5 / 35
![Page 17: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/17.jpg)
CouchDB document example
Documents are stored as JSON
{” i d ” : ” r e c i p e−some−r e c i p e ” ,” r e v ” : ”1−859 e8f9a06b864ebca3a929750c17537 ” ,” date ” : 1270067388 ,” t i t l e ” : ”Some r e c i p e ” ,” i n g r e d i e n t s ” : [
” Sugar ” ,” F l ou r ”] ,” i n s t r u c t i o n s ” : ”Some i n s t r u c t i o n s ” ,” u s e r ” : ” use r−f o oba r ” ,
}
http://westhoffswelt.de [email protected] slide: 6 / 35
![Page 18: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/18.jpg)
CouchDB document example
Documents are stored as JSON
{” i d ” : ” r e c i p e−some−r e c i p e ” ,” r e v ” : ”1−859 e8f9a06b864ebca3a929750c17537 ” ,” date ” : 1270067388 ,” t i t l e ” : ”Some r e c i p e ” ,” i n g r e d i e n t s ” : [
” Sugar ” ,” F l ou r ”] ,” i n s t r u c t i o n s ” : ”Some i n s t r u c t i o n s ” ,” u s e r ” : ” use r−f o oba r ” ,
}
http://westhoffswelt.de [email protected] slide: 6 / 35
![Page 19: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/19.jpg)
What is a CouchApp?
Application build on top of CouchDB which fits the followingcriteria:
Using CouchDB as data storeStored inside the CouchDBServed using the CouchDB Http-Server
Most CouchApps are
Mostly written in JavascriptUsing some sort of Javascript library
CouchDB replication can be used to deploy applications
http://westhoffswelt.de [email protected] slide: 7 / 35
![Page 20: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/20.jpg)
What is a CouchApp?
Application build on top of CouchDB which fits the followingcriteria:
Using CouchDB as data storeStored inside the CouchDBServed using the CouchDB Http-Server
Most CouchApps are
Mostly written in JavascriptUsing some sort of Javascript library
CouchDB replication can be used to deploy applications
http://westhoffswelt.de [email protected] slide: 7 / 35
![Page 21: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/21.jpg)
What is a CouchApp?
Application build on top of CouchDB which fits the followingcriteria:
Using CouchDB as data storeStored inside the CouchDBServed using the CouchDB Http-Server
Most CouchApps are
Mostly written in JavascriptUsing some sort of Javascript library
CouchDB replication can be used to deploy applications
http://westhoffswelt.de [email protected] slide: 7 / 35
![Page 22: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/22.jpg)
What is a CouchApp?
Application build on top of CouchDB which fits the followingcriteria:
Using CouchDB as data storeStored inside the CouchDBServed using the CouchDB Http-Server
Most CouchApps are
Mostly written in JavascriptUsing some sort of Javascript library
CouchDB replication can be used to deploy applications
http://westhoffswelt.de [email protected] slide: 7 / 35
![Page 23: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/23.jpg)
What is a CouchApp?
Application build on top of CouchDB which fits the followingcriteria:
Using CouchDB as data storeStored inside the CouchDBServed using the CouchDB Http-Server
Most CouchApps are
Mostly written in JavascriptUsing some sort of Javascript library
CouchDB replication can be used to deploy applications
http://westhoffswelt.de [email protected] slide: 7 / 35
![Page 24: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/24.jpg)
What is a CouchApp?
Application build on top of CouchDB which fits the followingcriteria:
Using CouchDB as data storeStored inside the CouchDBServed using the CouchDB Http-Server
Most CouchApps are
Mostly written in JavascriptUsing some sort of Javascript library
CouchDB replication can be used to deploy applications
http://westhoffswelt.de [email protected] slide: 7 / 35
![Page 25: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/25.jpg)
What is a CouchApp?
Application build on top of CouchDB which fits the followingcriteria:
Using CouchDB as data storeStored inside the CouchDBServed using the CouchDB Http-Server
Most CouchApps are
Mostly written in JavascriptUsing some sort of Javascript library
CouchDB replication can be used to deploy applications
http://westhoffswelt.de [email protected] slide: 7 / 35
![Page 26: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/26.jpg)
What is a CouchApp?
Application build on top of CouchDB which fits the followingcriteria:
Using CouchDB as data storeStored inside the CouchDBServed using the CouchDB Http-Server
Most CouchApps are
Mostly written in JavascriptUsing some sort of Javascript library
CouchDB replication can be used to deploy applications
http://westhoffswelt.de [email protected] slide: 7 / 35
![Page 27: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/27.jpg)
What is a CouchApp?
Application build on top of CouchDB which fits the followingcriteria:
Using CouchDB as data storeStored inside the CouchDBServed using the CouchDB Http-Server
Most CouchApps are
Mostly written in JavascriptUsing some sort of Javascript library
CouchDB replication can be used to deploy applications
http://westhoffswelt.de [email protected] slide: 7 / 35
![Page 28: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/28.jpg)
Excursion: Futon
Futon is CouchDBs adminstration interfaceAutomatically available on every CouchDB
http://localhost:5984/ utils/
http://westhoffswelt.de [email protected] slide: 8 / 35
![Page 29: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/29.jpg)
Excursion: Futon
Futon is CouchDBs adminstration interfaceAutomatically available on every CouchDB
http://localhost:5984/ utils/
http://westhoffswelt.de [email protected] slide: 8 / 35
![Page 30: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/30.jpg)
Excursion: Futon
Futon is CouchDBs adminstration interfaceAutomatically available on every CouchDB
http://localhost:5984/ utils/
http://westhoffswelt.de [email protected] slide: 8 / 35
![Page 31: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/31.jpg)
Which CouchDB Version to use?
CouchDB 0.11 or greater
User managementAuthentication API: Cookie, OAuth, plain-HTTPPer-db reader access listsValidation functionsUrl rewritingVhost configuration
http://westhoffswelt.de [email protected] slide: 9 / 35
![Page 32: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/32.jpg)
Which CouchDB Version to use?
CouchDB 0.11 or greater
User managementAuthentication API: Cookie, OAuth, plain-HTTPPer-db reader access listsValidation functionsUrl rewritingVhost configuration
http://westhoffswelt.de [email protected] slide: 9 / 35
![Page 33: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/33.jpg)
Which CouchDB Version to use?
CouchDB 0.11 or greater
User managementAuthentication API: Cookie, OAuth, plain-HTTPPer-db reader access listsValidation functionsUrl rewritingVhost configuration
http://westhoffswelt.de [email protected] slide: 9 / 35
![Page 34: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/34.jpg)
Which CouchDB Version to use?
CouchDB 0.11 or greater
User managementAuthentication API: Cookie, OAuth, plain-HTTPPer-db reader access listsValidation functionsUrl rewritingVhost configuration
http://westhoffswelt.de [email protected] slide: 9 / 35
![Page 35: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/35.jpg)
Which CouchDB Version to use?
CouchDB 0.11 or greater
User managementAuthentication API: Cookie, OAuth, plain-HTTPPer-db reader access listsValidation functionsUrl rewritingVhost configuration
http://westhoffswelt.de [email protected] slide: 9 / 35
![Page 36: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/36.jpg)
Which CouchDB Version to use?
CouchDB 0.11 or greater
User managementAuthentication API: Cookie, OAuth, plain-HTTPPer-db reader access listsValidation functionsUrl rewritingVhost configuration
http://westhoffswelt.de [email protected] slide: 9 / 35
![Page 37: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/37.jpg)
Which CouchDB Version to use?
CouchDB 0.11 or greater
User managementAuthentication API: Cookie, OAuth, plain-HTTPPer-db reader access listsValidation functionsUrl rewritingVhost configuration
http://westhoffswelt.de [email protected] slide: 9 / 35
![Page 38: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/38.jpg)
CouchApp techniques
Store all application files as document attachments
Attachments can be stored for any document inside CouchDBCan be directly accesed using the RESTful interface
Use CouchDBs authentication backend for user management
Use validation function for access restrictions
Use show and list functions to output HTML
Access CouchDB using Javascript and XHR
Use CouchDB vhosts and url rewriting for nice urls
http://westhoffswelt.de [email protected] slide: 10 / 35
![Page 39: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/39.jpg)
CouchApp techniques
Store all application files as document attachments
Attachments can be stored for any document inside CouchDBCan be directly accesed using the RESTful interface
Use CouchDBs authentication backend for user management
Use validation function for access restrictions
Use show and list functions to output HTML
Access CouchDB using Javascript and XHR
Use CouchDB vhosts and url rewriting for nice urls
http://westhoffswelt.de [email protected] slide: 10 / 35
![Page 40: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/40.jpg)
CouchApp techniques
Store all application files as document attachments
Attachments can be stored for any document inside CouchDBCan be directly accesed using the RESTful interface
Use CouchDBs authentication backend for user management
Use validation function for access restrictions
Use show and list functions to output HTML
Access CouchDB using Javascript and XHR
Use CouchDB vhosts and url rewriting for nice urls
http://westhoffswelt.de [email protected] slide: 10 / 35
![Page 41: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/41.jpg)
CouchApp techniques
Store all application files as document attachments
Attachments can be stored for any document inside CouchDBCan be directly accesed using the RESTful interface
Use CouchDBs authentication backend for user management
Use validation function for access restrictions
Use show and list functions to output HTML
Access CouchDB using Javascript and XHR
Use CouchDB vhosts and url rewriting for nice urls
http://westhoffswelt.de [email protected] slide: 10 / 35
![Page 42: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/42.jpg)
CouchApp techniques
Store all application files as document attachments
Attachments can be stored for any document inside CouchDBCan be directly accesed using the RESTful interface
Use CouchDBs authentication backend for user management
Use validation function for access restrictions
Use show and list functions to output HTML
Access CouchDB using Javascript and XHR
Use CouchDB vhosts and url rewriting for nice urls
http://westhoffswelt.de [email protected] slide: 10 / 35
![Page 43: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/43.jpg)
CouchApp techniques
Store all application files as document attachments
Attachments can be stored for any document inside CouchDBCan be directly accesed using the RESTful interface
Use CouchDBs authentication backend for user management
Use validation function for access restrictions
Use show and list functions to output HTML
Access CouchDB using Javascript and XHR
Use CouchDB vhosts and url rewriting for nice urls
http://westhoffswelt.de [email protected] slide: 10 / 35
![Page 44: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/44.jpg)
CouchApp techniques
Store all application files as document attachments
Attachments can be stored for any document inside CouchDBCan be directly accesed using the RESTful interface
Use CouchDBs authentication backend for user management
Use validation function for access restrictions
Use show and list functions to output HTML
Access CouchDB using Javascript and XHR
Use CouchDB vhosts and url rewriting for nice urls
http://westhoffswelt.de [email protected] slide: 10 / 35
![Page 45: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/45.jpg)
CouchApp techniques
Store all application files as document attachments
Attachments can be stored for any document inside CouchDBCan be directly accesed using the RESTful interface
Use CouchDBs authentication backend for user management
Use validation function for access restrictions
Use show and list functions to output HTML
Access CouchDB using Javascript and XHR
Use CouchDB vhosts and url rewriting for nice urls
http://westhoffswelt.de [email protected] slide: 10 / 35
![Page 46: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/46.jpg)
Authentication backend: User Management
Managing users:
Futon:
RESTful API:
Create a new document in the users databasehttp://localhost:5984/ users/org.couchdb.user:foo
http://westhoffswelt.de [email protected] slide: 11 / 35
![Page 47: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/47.jpg)
Authentication backend: User Management
Managing users:
Futon:
RESTful API:
Create a new document in the users databasehttp://localhost:5984/ users/org.couchdb.user:foo
http://westhoffswelt.de [email protected] slide: 11 / 35
![Page 48: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/48.jpg)
Authentication backend: User Management
Managing users:
Futon:
RESTful API:
Create a new document in the users databasehttp://localhost:5984/ users/org.couchdb.user:foo
http://westhoffswelt.de [email protected] slide: 11 / 35
![Page 49: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/49.jpg)
Authentication backend: Logging in (Cookie)
Logging in:
POST username and password to
http://localhost:5984/ session
Parameters user and password
application/x-www-form-urlencoded encoded
Post:
name=foo&password=bar
Response:
{”ok” : true , ”name” : ” foo ” , ” r o l e s ” : [ ] }
http://westhoffswelt.de [email protected] slide: 12 / 35
![Page 50: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/50.jpg)
Authentication backend: Logging in (Cookie)
Logging in:
POST username and password to
http://localhost:5984/ session
Parameters user and password
application/x-www-form-urlencoded encoded
Post:
name=foo&password=bar
Response:
{”ok” : true , ”name” : ” foo ” , ” r o l e s ” : [ ] }
http://westhoffswelt.de [email protected] slide: 12 / 35
![Page 51: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/51.jpg)
Authentication backend: Logging in (Cookie)
Logging in:
POST username and password to
http://localhost:5984/ session
Parameters user and password
application/x-www-form-urlencoded encoded
Post:
name=foo&password=bar
Response:
{”ok” : true , ”name” : ” foo ” , ” r o l e s ” : [ ] }
http://westhoffswelt.de [email protected] slide: 12 / 35
![Page 52: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/52.jpg)
Authentication backend: Logging in (Cookie)
Logging in:
POST username and password to
http://localhost:5984/ session
Parameters user and password
application/x-www-form-urlencoded encoded
Post:
name=foo&password=bar
Response:
{”ok” : true , ”name” : ” foo ” , ” r o l e s ” : [ ] }
http://westhoffswelt.de [email protected] slide: 12 / 35
![Page 53: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/53.jpg)
Authentication backend: Logging in (Cookie)
Logging in:
POST username and password to
http://localhost:5984/ session
Parameters user and password
application/x-www-form-urlencoded encoded
Post:
name=foo&password=bar
Response:
{”ok” : true , ”name” : ” foo ” , ” r o l e s ” : [ ] }
http://westhoffswelt.de [email protected] slide: 12 / 35
![Page 54: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/54.jpg)
Excursion: Design documents
Design documents supply certain special functionallities per db
Stored with special id design/some-id
Multiple design documents allowed per database
Used to define:
View functions (Map&Reduce)List functionsShow functionsValidation functions. . .
http://westhoffswelt.de [email protected] slide: 13 / 35
![Page 55: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/55.jpg)
Excursion: Design documents
Design documents supply certain special functionallities per db
Stored with special id design/some-id
Multiple design documents allowed per database
Used to define:
View functions (Map&Reduce)List functionsShow functionsValidation functions. . .
http://westhoffswelt.de [email protected] slide: 13 / 35
![Page 56: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/56.jpg)
Excursion: Design documents
Design documents supply certain special functionallities per db
Stored with special id design/some-id
Multiple design documents allowed per database
Used to define:
View functions (Map&Reduce)List functionsShow functionsValidation functions. . .
http://westhoffswelt.de [email protected] slide: 13 / 35
![Page 57: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/57.jpg)
Excursion: Design documents
Design documents supply certain special functionallities per db
Stored with special id design/some-id
Multiple design documents allowed per database
Used to define:
View functions (Map&Reduce)List functionsShow functionsValidation functions. . .
http://westhoffswelt.de [email protected] slide: 13 / 35
![Page 58: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/58.jpg)
Excursion: Design documents
Design documents supply certain special functionallities per db
Stored with special id design/some-id
Multiple design documents allowed per database
Used to define:
View functions (Map&Reduce)List functionsShow functionsValidation functions. . .
http://westhoffswelt.de [email protected] slide: 13 / 35
![Page 59: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/59.jpg)
Excursion: Design documents
Design documents supply certain special functionallities per db
Stored with special id design/some-id
Multiple design documents allowed per database
Used to define:
View functions (Map&Reduce)List functionsShow functionsValidation functions. . .
http://westhoffswelt.de [email protected] slide: 13 / 35
![Page 60: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/60.jpg)
Excursion: Design documents
Design documents supply certain special functionallities per db
Stored with special id design/some-id
Multiple design documents allowed per database
Used to define:
View functions (Map&Reduce)List functionsShow functionsValidation functions. . .
http://westhoffswelt.de [email protected] slide: 13 / 35
![Page 61: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/61.jpg)
Excursion: Design documents
Design documents supply certain special functionallities per db
Stored with special id design/some-id
Multiple design documents allowed per database
Used to define:
View functions (Map&Reduce)List functionsShow functionsValidation functions. . .
http://westhoffswelt.de [email protected] slide: 13 / 35
![Page 62: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/62.jpg)
Excursion: Design documents
Design documents supply certain special functionallities per db
Stored with special id design/some-id
Multiple design documents allowed per database
Used to define:
View functions (Map&Reduce)List functionsShow functionsValidation functions. . .
http://westhoffswelt.de [email protected] slide: 13 / 35
![Page 63: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/63.jpg)
Validation functions: Validate updates
Validation of document creations or updates using Javascriptfunctions
Registration: Property validate doc update on any designdocument
Multiple validation functions on different design documentspossible
Called one after anotherNo defined execution order: Functions need to be isolatedOne fails: validation fails
http://westhoffswelt.de [email protected] slide: 14 / 35
![Page 64: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/64.jpg)
Validation functions: Validate updates
Validation of document creations or updates using Javascriptfunctions
Registration: Property validate doc update on any designdocument
Multiple validation functions on different design documentspossible
Called one after anotherNo defined execution order: Functions need to be isolatedOne fails: validation fails
http://westhoffswelt.de [email protected] slide: 14 / 35
![Page 65: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/65.jpg)
Validation functions: Validate updates
Validation of document creations or updates using Javascriptfunctions
Registration: Property validate doc update on any designdocument
Multiple validation functions on different design documentspossible
Called one after anotherNo defined execution order: Functions need to be isolatedOne fails: validation fails
http://westhoffswelt.de [email protected] slide: 14 / 35
![Page 66: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/66.jpg)
Validation functions: Validate updates
Validation of document creations or updates using Javascriptfunctions
Registration: Property validate doc update on any designdocument
Multiple validation functions on different design documentspossible
Called one after anotherNo defined execution order: Functions need to be isolatedOne fails: validation fails
http://westhoffswelt.de [email protected] slide: 14 / 35
![Page 67: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/67.jpg)
Validation functions: Validate updates
Validation of document creations or updates using Javascriptfunctions
Registration: Property validate doc update on any designdocument
Multiple validation functions on different design documentspossible
Called one after anotherNo defined execution order: Functions need to be isolatedOne fails: validation fails
http://westhoffswelt.de [email protected] slide: 14 / 35
![Page 68: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/68.jpg)
Validation functions: Validate updates
Validation of document creations or updates using Javascriptfunctions
Registration: Property validate doc update on any designdocument
Multiple validation functions on different design documentspossible
Called one after anotherNo defined execution order: Functions need to be isolatedOne fails: validation fails
http://westhoffswelt.de [email protected] slide: 14 / 35
![Page 69: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/69.jpg)
Validation functions: Validate updates II
Example
Ensure all documents have a type fieldadded is not allowed to be changed after document creation
f u n c t i o n ( newDoc , oldDoc , u s e rC tx ) {i f ( ! newDoc . type ) {
throw ({ f o r b i d d e n : ”Mandatory f i e l d ’ t ype ’ i sm i s s i n g ” }) ;
}
i f ( oldDoc && toJSON( oldDoc . added ) != toJSON(newDoc. added ) ) {
throw ( . . . )}
}
http://westhoffswelt.de [email protected] slide: 15 / 35
![Page 70: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/70.jpg)
Validation functions: Validate updates II
Example
Ensure all documents have a type fieldadded is not allowed to be changed after document creation
f u n c t i o n ( newDoc , oldDoc , u s e rC tx ) {i f ( ! newDoc . type ) {
throw ({ f o r b i d d e n : ”Mandatory f i e l d ’ t ype ’ i sm i s s i n g ” }) ;
}
i f ( oldDoc && toJSON( oldDoc . added ) != toJSON(newDoc. added ) ) {
throw ( . . . )}
}
http://westhoffswelt.de [email protected] slide: 15 / 35
![Page 71: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/71.jpg)
Validation functions: Validate updates II
Example
Ensure all documents have a type fieldadded is not allowed to be changed after document creation
f u n c t i o n ( newDoc , oldDoc , u s e rC tx ) {i f ( ! newDoc . type ) {
throw ({ f o r b i d d e n : ”Mandatory f i e l d ’ t ype ’ i sm i s s i n g ” }) ;
}
i f ( oldDoc && toJSON( oldDoc . added ) != toJSON(newDoc. added ) ) {
throw ( . . . )}
}
http://westhoffswelt.de [email protected] slide: 15 / 35
![Page 72: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/72.jpg)
Validation functions: Access control
Use validation doc update function as access controlsystem
Ensure the user is logged inEnsure username and author field are identical
f u n c t i o n ( newDoc , oldDoc , u s e rC tx ) {i f ( ! u s e rC tx . name ) {
throw ({ f o r b i d d e n : ”You need to be l ogged i n tochange documents . ” }) ;
}
i f ( ( oldDoc && use rCtx . name != oldDoc . au tho r ) | |use rCtx . name != newDoc . au tho r ) {
throw ( . . . )}
}
http://westhoffswelt.de [email protected] slide: 16 / 35
![Page 73: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/73.jpg)
Validation functions: Access control
Use validation doc update function as access controlsystem
Ensure the user is logged inEnsure username and author field are identical
f u n c t i o n ( newDoc , oldDoc , u s e rC tx ) {i f ( ! u s e rC tx . name ) {
throw ({ f o r b i d d e n : ”You need to be l ogged i n tochange documents . ” }) ;
}
i f ( ( oldDoc && use rCtx . name != oldDoc . au tho r ) | |use rCtx . name != newDoc . au tho r ) {
throw ( . . . )}
}
http://westhoffswelt.de [email protected] slide: 16 / 35
![Page 74: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/74.jpg)
Validation functions: Access control
Use validation doc update function as access controlsystem
Ensure the user is logged inEnsure username and author field are identical
f u n c t i o n ( newDoc , oldDoc , u s e rC tx ) {i f ( ! u s e rC tx . name ) {
throw ({ f o r b i d d e n : ”You need to be l ogged i n tochange documents . ” }) ;
}
i f ( ( oldDoc && use rCtx . name != oldDoc . au tho r ) | |use rCtx . name != newDoc . au tho r ) {
throw ( . . . )}
}
http://westhoffswelt.de [email protected] slide: 16 / 35
![Page 75: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/75.jpg)
Show and list functions
User formatted data instead of plain JSON
Show functions format documents
List functions format views
Multiple show and list functions are allowedper-design-document
Stored as shows and lists object
” shows” : {”summary” : ” f u n c t i o n ( doc , r eq ) { . . . } ” ,” d e t a i l ” : ” f u n c t i o n ( doc , r eq ) { . . . } ”
}
http://westhoffswelt.de [email protected] slide: 17 / 35
![Page 76: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/76.jpg)
Show and list functions
User formatted data instead of plain JSON
Show functions format documents
List functions format views
Multiple show and list functions are allowedper-design-document
Stored as shows and lists object
” shows” : {”summary” : ” f u n c t i o n ( doc , r eq ) { . . . } ” ,” d e t a i l ” : ” f u n c t i o n ( doc , r eq ) { . . . } ”
}
http://westhoffswelt.de [email protected] slide: 17 / 35
![Page 77: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/77.jpg)
Show and list functions
User formatted data instead of plain JSON
Show functions format documents
List functions format views
Multiple show and list functions are allowedper-design-document
Stored as shows and lists object
” shows” : {”summary” : ” f u n c t i o n ( doc , r eq ) { . . . } ” ,” d e t a i l ” : ” f u n c t i o n ( doc , r eq ) { . . . } ”
}
http://westhoffswelt.de [email protected] slide: 17 / 35
![Page 78: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/78.jpg)
Show and list functions
User formatted data instead of plain JSON
Show functions format documents
List functions format views
Multiple show and list functions are allowedper-design-document
Stored as shows and lists object
” shows” : {”summary” : ” f u n c t i o n ( doc , r eq ) { . . . } ” ,” d e t a i l ” : ” f u n c t i o n ( doc , r eq ) { . . . } ”
}
http://westhoffswelt.de [email protected] slide: 17 / 35
![Page 79: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/79.jpg)
Show and list functions
User formatted data instead of plain JSON
Show functions format documents
List functions format views
Multiple show and list functions are allowedper-design-document
Stored as shows and lists object
” shows” : {”summary” : ” f u n c t i o n ( doc , r eq ) { . . . } ” ,” d e t a i l ” : ” f u n c t i o n ( doc , r eq ) { . . . } ”
}
http://westhoffswelt.de [email protected] slide: 17 / 35
![Page 80: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/80.jpg)
Show function to output HTML
Arguments
doc - Document to be returnedreq - Request object
User contextGET parameterAccept header. . .
Return value is a response object
body - Content returned to the callerheaders - HTML headers (Can be used to set Content-Type)base64 - Can be used instead of body to send binary data
http://westhoffswelt.de [email protected] slide: 18 / 35
![Page 81: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/81.jpg)
Show function to output HTML
Arguments
doc - Document to be returnedreq - Request object
User contextGET parameterAccept header. . .
Return value is a response object
body - Content returned to the callerheaders - HTML headers (Can be used to set Content-Type)base64 - Can be used instead of body to send binary data
http://westhoffswelt.de [email protected] slide: 18 / 35
![Page 82: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/82.jpg)
Show function to output HTML
Arguments
doc - Document to be returnedreq - Request object
User contextGET parameterAccept header. . .
Return value is a response object
body - Content returned to the callerheaders - HTML headers (Can be used to set Content-Type)base64 - Can be used instead of body to send binary data
http://westhoffswelt.de [email protected] slide: 18 / 35
![Page 83: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/83.jpg)
Show function to output HTML
Arguments
doc - Document to be returnedreq - Request object
User contextGET parameterAccept header. . .
Return value is a response object
body - Content returned to the callerheaders - HTML headers (Can be used to set Content-Type)base64 - Can be used instead of body to send binary data
http://westhoffswelt.de [email protected] slide: 18 / 35
![Page 84: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/84.jpg)
Show function to output HTML
Arguments
doc - Document to be returnedreq - Request object
User contextGET parameterAccept header. . .
Return value is a response object
body - Content returned to the callerheaders - HTML headers (Can be used to set Content-Type)base64 - Can be used instead of body to send binary data
http://westhoffswelt.de [email protected] slide: 18 / 35
![Page 85: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/85.jpg)
Show function to output HTML
Arguments
doc - Document to be returnedreq - Request object
User contextGET parameterAccept header. . .
Return value is a response object
body - Content returned to the callerheaders - HTML headers (Can be used to set Content-Type)base64 - Can be used instead of body to send binary data
http://westhoffswelt.de [email protected] slide: 18 / 35
![Page 86: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/86.jpg)
Show function to output HTML
Arguments
doc - Document to be returnedreq - Request object
User contextGET parameterAccept header. . .
Return value is a response object
body - Content returned to the callerheaders - HTML headers (Can be used to set Content-Type)base64 - Can be used instead of body to send binary data
http://westhoffswelt.de [email protected] slide: 18 / 35
![Page 87: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/87.jpg)
Show function to output HTML
Arguments
doc - Document to be returnedreq - Request object
User contextGET parameterAccept header. . .
Return value is a response object
body - Content returned to the callerheaders - HTML headers (Can be used to set Content-Type)base64 - Can be used instead of body to send binary data
http://westhoffswelt.de [email protected] slide: 18 / 35
![Page 88: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/88.jpg)
Show function to output HTML
Arguments
doc - Document to be returnedreq - Request object
User contextGET parameterAccept header. . .
Return value is a response object
body - Content returned to the callerheaders - HTML headers (Can be used to set Content-Type)base64 - Can be used instead of body to send binary data
http://westhoffswelt.de [email protected] slide: 18 / 35
![Page 89: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/89.jpg)
Show function to output HTML
Arguments
doc - Document to be returnedreq - Request object
User contextGET parameterAccept header. . .
Return value is a response object
body - Content returned to the callerheaders - HTML headers (Can be used to set Content-Type)base64 - Can be used instead of body to send binary data
http://westhoffswelt.de [email protected] slide: 18 / 35
![Page 90: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/90.jpg)
Show function to output HTML
Arguments
doc - Document to be returnedreq - Request object
User contextGET parameterAccept header. . .
Return value is a response object
body - Content returned to the callerheaders - HTML headers (Can be used to set Content-Type)base64 - Can be used instead of body to send binary data
http://westhoffswelt.de [email protected] slide: 18 / 35
![Page 91: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/91.jpg)
Show function to output HTML II
Example
Output document type and author as HTML
f u n c t i o n ( doc , r eq ) {
re tu rn {body : [
”<h1>The ” ,doc . type ,” document has been c r e a t e d by ” ,doc . author ,”</h1>”
] . j o i n ( ”” ) ;} ;
}
http://westhoffswelt.de [email protected] slide: 19 / 35
![Page 92: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/92.jpg)
Show function to output HTML II
Example
Output document type and author as HTML
f u n c t i o n ( doc , r eq ) {
re tu rn {body : [
”<h1>The ” ,doc . type ,” document has been c r e a t e d by ” ,doc . author ,”</h1>”
] . j o i n ( ”” ) ;} ;
}
http://westhoffswelt.de [email protected] slide: 19 / 35
![Page 93: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/93.jpg)
Show function to output HTML II
Example
Output document type and author as HTML
f u n c t i o n ( doc , r eq ) {
re tu rn {body : [
”<h1>The ” ,doc . type ,” document has been c r e a t e d by ” ,doc . author ,”</h1>”
] . j o i n ( ”” ) ;} ;
}
http://westhoffswelt.de [email protected] slide: 19 / 35
![Page 94: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/94.jpg)
List functions: Streaming API
Arguments
head - Statistical data about the viewreq - Request object
Return value is not used
Streaming API
getRow() - Retrieve next row from the view, or null at the endsend(data) - Send out the next piece of data to the caller
http://westhoffswelt.de [email protected] slide: 20 / 35
![Page 95: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/95.jpg)
List functions: Streaming API
Arguments
head - Statistical data about the viewreq - Request object
Return value is not used
Streaming API
getRow() - Retrieve next row from the view, or null at the endsend(data) - Send out the next piece of data to the caller
http://westhoffswelt.de [email protected] slide: 20 / 35
![Page 96: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/96.jpg)
List functions: Streaming API
Arguments
head - Statistical data about the viewreq - Request object
Return value is not used
Streaming API
getRow() - Retrieve next row from the view, or null at the endsend(data) - Send out the next piece of data to the caller
http://westhoffswelt.de [email protected] slide: 20 / 35
![Page 97: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/97.jpg)
List functions: Streaming API
Arguments
head - Statistical data about the viewreq - Request object
Return value is not used
Streaming API
getRow() - Retrieve next row from the view, or null at the endsend(data) - Send out the next piece of data to the caller
http://westhoffswelt.de [email protected] slide: 20 / 35
![Page 98: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/98.jpg)
List functions: Streaming API
Arguments
head - Statistical data about the viewreq - Request object
Return value is not used
Streaming API
getRow() - Retrieve next row from the view, or null at the endsend(data) - Send out the next piece of data to the caller
http://westhoffswelt.de [email protected] slide: 20 / 35
![Page 99: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/99.jpg)
List functions: Streaming API
Arguments
head - Statistical data about the viewreq - Request object
Return value is not used
Streaming API
getRow() - Retrieve next row from the view, or null at the endsend(data) - Send out the next piece of data to the caller
http://westhoffswelt.de [email protected] slide: 20 / 35
![Page 100: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/100.jpg)
List functions: Streaming API
Arguments
head - Statistical data about the viewreq - Request object
Return value is not used
Streaming API
getRow() - Retrieve next row from the view, or null at the endsend(data) - Send out the next piece of data to the caller
http://westhoffswelt.de [email protected] slide: 20 / 35
![Page 101: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/101.jpg)
List functions: Example
Example
Output authors in list as unordered HTML list
f u n c t i o n ( head , r eq ) {va r cu r ;
send ( ’<ul> ’ ) ;
whi le ( cu r = getRow ( ) ) {send ( ’< l i > ’ + cur . au tho r + ’</ l i > ’ ) ;
}
send ( ’</ul> ’ ) ;}
http://westhoffswelt.de [email protected] slide: 21 / 35
![Page 102: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/102.jpg)
List functions: Example
Example
Output authors in list as unordered HTML list
f u n c t i o n ( head , r eq ) {va r cu r ;
send ( ’<ul> ’ ) ;
whi le ( cu r = getRow ( ) ) {send ( ’< l i > ’ + cur . au tho r + ’</ l i > ’ ) ;
}
send ( ’</ul> ’ ) ;}
http://westhoffswelt.de [email protected] slide: 21 / 35
![Page 103: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/103.jpg)
List functions: Example
Example
Output authors in list as unordered HTML list
f u n c t i o n ( head , r eq ) {va r cu r ;
send ( ’<ul> ’ ) ;
whi le ( cu r = getRow ( ) ) {send ( ’< l i > ’ + cur . au tho r + ’</ l i > ’ ) ;
}
send ( ’</ul> ’ ) ;}
http://westhoffswelt.de [email protected] slide: 21 / 35
![Page 104: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/104.jpg)
Query show and list functions
Queried based on design document and name
Show functions
GET /db/ design/mydesign/ show/show-name/doc-id
List functions
GET /db/ design/mydesign/ list/list-name/view-name
http://westhoffswelt.de [email protected] slide: 22 / 35
![Page 105: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/105.jpg)
Query show and list functions
Queried based on design document and name
Show functions
GET /db/ design/mydesign/ show/show-name/doc-id
List functions
GET /db/ design/mydesign/ list/list-name/view-name
http://westhoffswelt.de [email protected] slide: 22 / 35
![Page 106: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/106.jpg)
Query show and list functions
Queried based on design document and name
Show functions
GET /db/ design/mydesign/ show/show-name/doc-id
List functions
GET /db/ design/mydesign/ list/list-name/view-name
http://westhoffswelt.de [email protected] slide: 22 / 35
![Page 107: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/107.jpg)
Show and list functions in real applications
Use a templating system
Javscript micro template language based on John Resigs ideahttp://github.com/furf/jquery-template
Use integrated provides and registerType functions toserve multiple formats based on the accept header
Maybe do some sort of user authentication before showingcontent
http://westhoffswelt.de [email protected] slide: 23 / 35
![Page 108: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/108.jpg)
Show and list functions in real applications
Use a templating system
Javscript micro template language based on John Resigs ideahttp://github.com/furf/jquery-template
Use integrated provides and registerType functions toserve multiple formats based on the accept header
Maybe do some sort of user authentication before showingcontent
http://westhoffswelt.de [email protected] slide: 23 / 35
![Page 109: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/109.jpg)
Show and list functions in real applications
Use a templating system
Javscript micro template language based on John Resigs ideahttp://github.com/furf/jquery-template
Use integrated provides and registerType functions toserve multiple formats based on the accept header
Maybe do some sort of user authentication before showingcontent
http://westhoffswelt.de [email protected] slide: 23 / 35
![Page 110: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/110.jpg)
Show and list functions in real applications
Use a templating system
Javscript micro template language based on John Resigs ideahttp://github.com/furf/jquery-template
Use integrated provides and registerType functions toserve multiple formats based on the accept header
Maybe do some sort of user authentication before showingcontent
http://westhoffswelt.de [email protected] slide: 23 / 35
![Page 111: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/111.jpg)
Url rewriting
Urls like this one are neither readable nor usable
/db/ design/mydesign/ list/list-name/view-name?limit=5
CouchDB supports internal url rewriting
Defined as array of rewrites on any design document
” r e w r i t e s ” : [{
” from” : ”/ i ndex ” ,” to ” : ” l i s t / l i s t −name/view−name? l i m i t=5”
}]
http://westhoffswelt.de [email protected] slide: 24 / 35
![Page 112: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/112.jpg)
Url rewriting
Urls like this one are neither readable nor usable
/db/ design/mydesign/ list/list-name/view-name?limit=5
CouchDB supports internal url rewriting
Defined as array of rewrites on any design document
” r e w r i t e s ” : [{
” from” : ”/ i ndex ” ,” to ” : ” l i s t / l i s t −name/view−name? l i m i t=5”
}]
http://westhoffswelt.de [email protected] slide: 24 / 35
![Page 113: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/113.jpg)
Url rewriting
Urls like this one are neither readable nor usable
/db/ design/mydesign/ list/list-name/view-name?limit=5
CouchDB supports internal url rewriting
Defined as array of rewrites on any design document
” r e w r i t e s ” : [{
” from” : ”/ i ndex ” ,” to ” : ” l i s t / l i s t −name/view−name? l i m i t=5”
}]
http://westhoffswelt.de [email protected] slide: 24 / 35
![Page 114: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/114.jpg)
Url rewriting
Urls like this one are neither readable nor usable
/db/ design/mydesign/ list/list-name/view-name?limit=5
CouchDB supports internal url rewriting
Defined as array of rewrites on any design document
” r e w r i t e s ” : [{
” from” : ”/ i ndex ” ,” to ” : ” l i s t / l i s t −name/view−name? l i m i t=5”
}]
http://westhoffswelt.de [email protected] slide: 24 / 35
![Page 115: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/115.jpg)
Advanced url rewriting
Using named placeholders
Match each path segment
” from” : ”/ en t r y / : doc” ,” to ” : ” show/show−name / : doc”
Using match all at the end of an url
Appends given query parameters
” from” : ”/ en t r y /∗” ,” to ” : ” show/show−name/∗”
http://westhoffswelt.de [email protected] slide: 25 / 35
![Page 116: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/116.jpg)
Advanced url rewriting
Using named placeholders
Match each path segment
” from” : ”/ en t r y / : doc” ,” to ” : ” show/show−name / : doc”
Using match all at the end of an url
Appends given query parameters
” from” : ”/ en t r y /∗” ,” to ” : ” show/show−name/∗”
http://westhoffswelt.de [email protected] slide: 25 / 35
![Page 117: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/117.jpg)
Advanced url rewriting II
Rewriting to query parameters
” from” : ”/page / : s t a r t ” ,” to ” : ” l i s t / l i s t −name/ pages ” ,” query ” : {
” s t a r t k e y ” : ” : s t a r t ”}
Adress a context outside of the design document
Targets are always relative to the design documentRelative navigation with .. is allowed
” from” : ”/ raw / : doc” ,” to ” : ” . . / . . / : doc”
http://westhoffswelt.de [email protected] slide: 26 / 35
![Page 118: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/118.jpg)
Advanced url rewriting II
Rewriting to query parameters
” from” : ”/page / : s t a r t ” ,” to ” : ” l i s t / l i s t −name/ pages ” ,” query ” : {
” s t a r t k e y ” : ” : s t a r t ”}
Adress a context outside of the design document
Targets are always relative to the design documentRelative navigation with .. is allowed
” from” : ”/ raw / : doc” ,” to ” : ” . . / . . / : doc”
http://westhoffswelt.de [email protected] slide: 26 / 35
![Page 119: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/119.jpg)
Advanced url rewriting III
Rewriting based on HTTP methods
{” from” : ”/ en t r y /∗” ,” to ” : ” show/show−name/∗” ,”method” : ”GET”
} ,{
” from” : ”/ en t r y /∗” ,” to ” : ” update /update−name/∗” ,”method” : ”POST”
} ,
http://westhoffswelt.de [email protected] slide: 27 / 35
![Page 120: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/120.jpg)
Query rewritten urls
Queried on design document using special rewrite path
/db/ design/mydesign/ rewrite/some-url
Better, but far from being perfect → Vhost configuration
http://westhoffswelt.de [email protected] slide: 28 / 35
![Page 121: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/121.jpg)
Query rewritten urls
Queried on design document using special rewrite path
/db/ design/mydesign/ rewrite/some-url
Better, but far from being perfect → Vhost configuration
http://westhoffswelt.de [email protected] slide: 28 / 35
![Page 122: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/122.jpg)
Query rewritten urls
Queried on design document using special rewrite path
/db/ design/mydesign/ rewrite/some-url
Better, but far from being perfect → Vhost configuration
http://westhoffswelt.de [email protected] slide: 28 / 35
![Page 123: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/123.jpg)
Vhost configuration
CouchDB supports url changing based on the provided Host
Custom root path for every host/domain
Configured in local.ini
Direct all requests to the rewrite handler
[ v h o s t s ]example . com = /mydb/ d e s i g n /mydes ign / r e w r i t e
http://westhoffswelt.de [email protected] slide: 29 / 35
![Page 124: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/124.jpg)
Vhost configuration
CouchDB supports url changing based on the provided Host
Custom root path for every host/domain
Configured in local.ini
Direct all requests to the rewrite handler
[ v h o s t s ]example . com = /mydb/ d e s i g n /mydes ign / r e w r i t e
http://westhoffswelt.de [email protected] slide: 29 / 35
![Page 125: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/125.jpg)
Vhost configuration
CouchDB supports url changing based on the provided Host
Custom root path for every host/domain
Configured in local.ini
Direct all requests to the rewrite handler
[ v h o s t s ]example . com = /mydb/ d e s i g n /mydes ign / r e w r i t e
http://westhoffswelt.de [email protected] slide: 29 / 35
![Page 126: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/126.jpg)
Vhost configuration
CouchDB supports url changing based on the provided Host
Custom root path for every host/domain
Configured in local.ini
Direct all requests to the rewrite handler
[ v h o s t s ]example . com = /mydb/ d e s i g n /mydes ign / r e w r i t e
http://westhoffswelt.de [email protected] slide: 29 / 35
![Page 127: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/127.jpg)
Using CouchApp for deployment
CouchApp does not only categorize these application type
It is a utillity written in Python
http://github.com/couchapp/couchapp
Deployment system for CouchApps to CouchDBs
Providing some common widgets like login or profile
http://westhoffswelt.de [email protected] slide: 30 / 35
![Page 128: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/128.jpg)
Using CouchApp for deployment
CouchApp does not only categorize these application type
It is a utillity written in Python
http://github.com/couchapp/couchapp
Deployment system for CouchApps to CouchDBs
Providing some common widgets like login or profile
http://westhoffswelt.de [email protected] slide: 30 / 35
![Page 129: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/129.jpg)
Using CouchApp for deployment
CouchApp does not only categorize these application type
It is a utillity written in Python
http://github.com/couchapp/couchapp
Deployment system for CouchApps to CouchDBs
Providing some common widgets like login or profile
http://westhoffswelt.de [email protected] slide: 30 / 35
![Page 130: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/130.jpg)
Using CouchApp for deployment
CouchApp does not only categorize these application type
It is a utillity written in Python
http://github.com/couchapp/couchapp
Deployment system for CouchApps to CouchDBs
Providing some common widgets like login or profile
http://westhoffswelt.de [email protected] slide: 30 / 35
![Page 131: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/131.jpg)
CouchApp: Folder structure
Organize your applications into a special folder structure
.|−− a t tachment s|−− i d|−− l i s t s|−− r e w r i t e s|−− shows| ‘−− myshow . j s|−− updates|−− v a l i d a t e d o c u p d a t e . j s‘−− v i ews
‘−− myview|−− map . j s‘−− r educe . j s
http://westhoffswelt.de [email protected] slide: 31 / 35
![Page 132: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/132.jpg)
CouchApp: Javascript preprocessing
CouchApps preprocesses Javascript before deploying it
Provides two useful macros: !code and !json
// !code lib/helper/validation utillities.jsInclude Javascript code from any other fileReuse code throughout your application functions
// !json lib.templates.mytemplateDot notation of path to .json fileAvailable using the full object path:lib.templates.mytemplate
http://westhoffswelt.de [email protected] slide: 32 / 35
![Page 133: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/133.jpg)
CouchApp: Javascript preprocessing
CouchApps preprocesses Javascript before deploying it
Provides two useful macros: !code and !json
// !code lib/helper/validation utillities.jsInclude Javascript code from any other fileReuse code throughout your application functions
// !json lib.templates.mytemplateDot notation of path to .json fileAvailable using the full object path:lib.templates.mytemplate
http://westhoffswelt.de [email protected] slide: 32 / 35
![Page 134: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/134.jpg)
CouchApp: Javascript preprocessing
CouchApps preprocesses Javascript before deploying it
Provides two useful macros: !code and !json
// !code lib/helper/validation utillities.jsInclude Javascript code from any other fileReuse code throughout your application functions
// !json lib.templates.mytemplateDot notation of path to .json fileAvailable using the full object path:lib.templates.mytemplate
http://westhoffswelt.de [email protected] slide: 32 / 35
![Page 135: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/135.jpg)
CouchApp: Javascript preprocessing
CouchApps preprocesses Javascript before deploying it
Provides two useful macros: !code and !json
// !code lib/helper/validation utillities.jsInclude Javascript code from any other fileReuse code throughout your application functions
// !json lib.templates.mytemplateDot notation of path to .json fileAvailable using the full object path:lib.templates.mytemplate
http://westhoffswelt.de [email protected] slide: 32 / 35
![Page 136: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/136.jpg)
CouchApp: Javascript preprocessing
CouchApps preprocesses Javascript before deploying it
Provides two useful macros: !code and !json
// !code lib/helper/validation utillities.jsInclude Javascript code from any other fileReuse code throughout your application functions
// !json lib.templates.mytemplateDot notation of path to .json fileAvailable using the full object path:lib.templates.mytemplate
http://westhoffswelt.de [email protected] slide: 32 / 35
![Page 137: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/137.jpg)
CouchApp: Javascript preprocessing
CouchApps preprocesses Javascript before deploying it
Provides two useful macros: !code and !json
// !code lib/helper/validation utillities.jsInclude Javascript code from any other fileReuse code throughout your application functions
// !json lib.templates.mytemplateDot notation of path to .json fileAvailable using the full object path:lib.templates.mytemplate
http://westhoffswelt.de [email protected] slide: 32 / 35
![Page 138: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/138.jpg)
CouchApp: Deployment
Specifying all parameters on the commandline
couchapp push http://user:pw@localhost:5984/mydb
Use .couchapprc file
{” env” : {
” d e f a u l t ” : {”db” : ” h t tp : // u s e r : pw@ loca lho s t :5984/mydb−dev”
} ,” p r oduc t i o n ” : {
”db” : ” h t tp :/// u s e r : pw@example . com/mydb”}
}}
http://westhoffswelt.de [email protected] slide: 33 / 35
![Page 139: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/139.jpg)
CouchApp: Deployment
Specifying all parameters on the commandline
couchapp push http://user:pw@localhost:5984/mydb
Use .couchapprc file
{” env” : {
” d e f a u l t ” : {”db” : ” h t tp : // u s e r : pw@ loca lho s t :5984/mydb−dev”
} ,” p r oduc t i o n ” : {
”db” : ” h t tp :/// u s e r : pw@example . com/mydb”}
}}
http://westhoffswelt.de [email protected] slide: 33 / 35
![Page 140: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/140.jpg)
Further reading
Things we didn’t have time to discussUpdate functions
http://wiki.apache.org/couchdb/Document Update Handlers
View functions
http://wiki.apache.org/couchdb/Introduction to CouchDB views
changes stream
http://books.couchdb.org/relax/reference/change-notifications
Evently javascript library
http://vimeo.com/9847214
Further documentationCouchDB: The definitive guide
http://books.couchdb.org/relax/
The CouchDB wiki
http://wiki.apache.org/couchdb/
http://westhoffswelt.de [email protected] slide: 34 / 35
![Page 141: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/141.jpg)
Further reading
Things we didn’t have time to discussUpdate functions
http://wiki.apache.org/couchdb/Document Update Handlers
View functions
http://wiki.apache.org/couchdb/Introduction to CouchDB views
changes stream
http://books.couchdb.org/relax/reference/change-notifications
Evently javascript library
http://vimeo.com/9847214
Further documentationCouchDB: The definitive guide
http://books.couchdb.org/relax/
The CouchDB wiki
http://wiki.apache.org/couchdb/
http://westhoffswelt.de [email protected] slide: 34 / 35
![Page 142: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/142.jpg)
Further reading
Things we didn’t have time to discussUpdate functions
http://wiki.apache.org/couchdb/Document Update Handlers
View functions
http://wiki.apache.org/couchdb/Introduction to CouchDB views
changes stream
http://books.couchdb.org/relax/reference/change-notifications
Evently javascript library
http://vimeo.com/9847214
Further documentationCouchDB: The definitive guide
http://books.couchdb.org/relax/
The CouchDB wiki
http://wiki.apache.org/couchdb/
http://westhoffswelt.de [email protected] slide: 34 / 35
![Page 143: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/143.jpg)
Further reading
Things we didn’t have time to discussUpdate functions
http://wiki.apache.org/couchdb/Document Update Handlers
View functions
http://wiki.apache.org/couchdb/Introduction to CouchDB views
changes stream
http://books.couchdb.org/relax/reference/change-notifications
Evently javascript library
http://vimeo.com/9847214
Further documentationCouchDB: The definitive guide
http://books.couchdb.org/relax/
The CouchDB wiki
http://wiki.apache.org/couchdb/
http://westhoffswelt.de [email protected] slide: 34 / 35
![Page 144: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/144.jpg)
Further reading
Things we didn’t have time to discussUpdate functions
http://wiki.apache.org/couchdb/Document Update Handlers
View functions
http://wiki.apache.org/couchdb/Introduction to CouchDB views
changes stream
http://books.couchdb.org/relax/reference/change-notifications
Evently javascript library
http://vimeo.com/9847214
Further documentationCouchDB: The definitive guide
http://books.couchdb.org/relax/
The CouchDB wiki
http://wiki.apache.org/couchdb/
http://westhoffswelt.de [email protected] slide: 34 / 35
![Page 145: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/145.jpg)
Further reading
Things we didn’t have time to discussUpdate functions
http://wiki.apache.org/couchdb/Document Update Handlers
View functions
http://wiki.apache.org/couchdb/Introduction to CouchDB views
changes stream
http://books.couchdb.org/relax/reference/change-notifications
Evently javascript library
http://vimeo.com/9847214
Further documentationCouchDB: The definitive guide
http://books.couchdb.org/relax/
The CouchDB wiki
http://wiki.apache.org/couchdb/
http://westhoffswelt.de [email protected] slide: 34 / 35
![Page 146: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/146.jpg)
Further reading
Things we didn’t have time to discussUpdate functions
http://wiki.apache.org/couchdb/Document Update Handlers
View functions
http://wiki.apache.org/couchdb/Introduction to CouchDB views
changes stream
http://books.couchdb.org/relax/reference/change-notifications
Evently javascript library
http://vimeo.com/9847214
Further documentationCouchDB: The definitive guide
http://books.couchdb.org/relax/
The CouchDB wiki
http://wiki.apache.org/couchdb/
http://westhoffswelt.de [email protected] slide: 34 / 35
![Page 147: Developing CouchApps](https://reader035.fdocuments.net/reader035/viewer/2022081403/55500eb7b4c905af648b47c1/html5/thumbnails/147.jpg)
Thanks for listening
Questions, comments or annotations?
Slides: http://westhoffswelt.de/portfolio.htm
Contact: Jakob Westhoff <[email protected]>Twitter: @jakobwesthoff
Please leave comments and vote at: http://joind.in/1612
http://westhoffswelt.de [email protected] slide: 35 / 35