/[Apache-SVN]
ViewVC logotype

Revision 803245


Jump to revision: Previous Next
Author: jchris
Date: Tue Aug 11 18:50:08 2009 UTC (14 years, 8 months ago)
Changed paths: 10
Log Message:
Initial commit of _update handler. Thanks to Paul Davis, Jason Davies for code and others for discussion.

The _update handler accepts POSTs to paths like: /db/_design/foo/_update/bar and PUTs which include docids, like: /db/_design/foo/_update/bar/docid

The function signature:

function(doc, req) {
  doc.a_new_field = req.query.something;
  return [doc, "<h1>added something to your doc</h1>"];
}

The tests in update_documents.js are fairly complete and include examples of bumping a counter, changing only a single field, parsing from (and returning) XML, and creating new documents.



Changed paths

Path Details
Directorycouchdb/trunk/etc/couchdb/default.ini.tpl.in modified , text changed
Directorycouchdb/trunk/share/Makefile.am modified , text changed
Directorycouchdb/trunk/share/server/loop.js modified , text changed
Directorycouchdb/trunk/share/server/render.js modified , text changed
Directorycouchdb/trunk/share/www/script/couch_tests.js modified , text changed
Directorycouchdb/trunk/src/couchdb/couch_httpd.erl modified , text changed
Directorycouchdb/trunk/src/couchdb/couch_httpd_external.erl modified , text changed
Directorycouchdb/trunk/src/couchdb/couch_httpd_show.erl modified , text changed
Directorycouchdb/trunk/src/couchdb/couch_query_servers.erl modified , text changed
Directorycouchdb/trunk/test/query_server_spec.rb modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26