couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Metson <si...@cloudant.com>
Subject Re: How to fetch particular data from document in couchdb using jquery
Date Tue, 11 Sep 2012 07:40:14 GMT
Switching to the users list (that's where these sort of questions should go). 


On Tuesday, 11 September 2012 at 08:32, lenin wrote:

> this is my jquery method...
> 
> var db = $.couch.db(window.location.pathname.split("/")[1]);
> 
> db.view("myDesign/myView", {
> success: function(data){
> data.rows.map(function(row) {
> });
> },
> error: function(req, textStatus, errorThrown){alert('Error '+ textStatus);}
> });
> 
> how to set key value here...
> explain it..
> 
> thanks in advance....
> 
> 
> 

To be honest I'd just use jquery directly, the jquery.couch.js doesn't add much if you're
just doing a view look up. 

To answer your question, you just put the view parameter in the options object: 

db.view("myDesign/myView", {key:1, success: function(){}, error: function(){}})

Dale has done a nice job of documenting the script on http://daleharvey.github.com/jquery.couch.js-docs/symbols/%24.couch.db.html#.view
maybe that'll help.
Cheers
Simon

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message