couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anh <7za...@gmail.com>
Subject Re: Adding support for list functions to jquery.couch.js
Date Mon, 26 Apr 2010 16:35:37 GMT
POSTing to a list doesn't sound like it follows good REST conventions  
- e.g. nothing is being modified or added, correct?

On Apr 25, 2010, at 8:40 PM, Jarrod Roberson <jarrod@vertigrated.com>  
wrote:

> 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
> <jquery.couch.js>

Mime
View raw message