incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jarrod Roberson <jar...@vertigrated.com>
Subject Adding support for list functions to jquery.couch.js
Date Mon, 26 Apr 2010 03:40:28 GMT
I needed to query list functions by both GET and POST and could not
find anything on how to do it so I added the following code to the db
function right about the view: function.

       list: function(list, view, options) {
         var list = list.split('/');
         var options = options || {};
         var type = 'GET';
         var data = null;
         if (options['keys']) {
           type = 'POST';
           var keys = options['keys'];
           delete options['keys'];
           data = toJSON({'keys': keys });
         }
         ajax({
             type: type,
             data: data,
             url: this.uri + '_design/' + list[0] +
                  '/_list/' + list[1] + '/' + view + encodeOptions(options)
             },
             options, 'An error occured accessing the list'
         );
       },

I can't get to the JIRA to submit a patch it appears to be down and I
already submitted pull request to couchapp which I patched up to use
this as well.
So if someone can check this out I would appreaciate it. Attached is
the entire jquery.couch.js file that I modified so you can diff it
against the most recent version.

--
Jarrod Roberson

Mime
View raw message