You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Steven Prentice <st...@gmail.com> on 2010/07/19 05:54:54 UTC

Will include_docs still work when querying a list (couch 0.10.0)?

Hi,
I am using a list function to filter a view, basically the list function
takes some parameters, filters the view and sends back JSON using the toJSON
function to my application. I am just wondering if I add include_docs that I
am still able to retrieve the docs as well, now that I have a raw JSON
object being sent back?

Cheers
Steve

Re: Will include_docs still work when querying a list (couch 0.10.0)?

Posted by Zachary Zolton <za...@gmail.com>.
@Steven, what Mikeal is alluding to is that when querying a list/view
with include_docs=true, the object returned by getRow() will have a
"doc" property that contains the document for that row. It is then
your responsibility to use the document object, in your list function,
to return whatever data you want to be in the response.

On Mon, Jul 19, 2010 at 7:54 PM, Mikeal Rogers <mi...@gmail.com> wrote:
> var row = getRow();
>
> row.doc is the document.
>
> Cheers,
>
> :)
>
> -Mikeal
>
> On Mon, Jul 19, 2010 at 5:39 PM, Steven Prentice <
> steven.prentice.87@gmail.com> wrote:
>
>> Can you please provide some explanation? because for me it is not working.
>> My view function outputs some JSON relating to the values in the view using
>> toJSON, when I request the list/view all I get is the JSON from the list
>> function and not the entire document(s)...regardless of include_docs being
>> true or false.
>>
>> On Mon, Jul 19, 2010 at 2:03 PM, Mikeal Rogers <mikeal.rogers@gmail.com
>> >wrote:
>>
>> > yes.
>> >
>> > On Sun, Jul 18, 2010 at 8:54 PM, Steven Prentice <
>> > steven.prentice.87@gmail.com> wrote:
>> >
>> > > Hi,
>> > > I am using a list function to filter a view, basically the list
>> function
>> > > takes some parameters, filters the view and sends back JSON using the
>> > > toJSON
>> > > function to my application. I am just wondering if I add include_docs
>> > that
>> > > I
>> > > am still able to retrieve the docs as well, now that I have a raw JSON
>> > > object being sent back?
>> > >
>> > > Cheers
>> > > Steve
>> > >
>> >
>>
>

Re: Will include_docs still work when querying a list (couch 0.10.0)?

Posted by Mikeal Rogers <mi...@gmail.com>.
var row = getRow();

row.doc is the document.

Cheers,

:)

-Mikeal

On Mon, Jul 19, 2010 at 5:39 PM, Steven Prentice <
steven.prentice.87@gmail.com> wrote:

> Can you please provide some explanation? because for me it is not working.
> My view function outputs some JSON relating to the values in the view using
> toJSON, when I request the list/view all I get is the JSON from the list
> function and not the entire document(s)...regardless of include_docs being
> true or false.
>
> On Mon, Jul 19, 2010 at 2:03 PM, Mikeal Rogers <mikeal.rogers@gmail.com
> >wrote:
>
> > yes.
> >
> > On Sun, Jul 18, 2010 at 8:54 PM, Steven Prentice <
> > steven.prentice.87@gmail.com> wrote:
> >
> > > Hi,
> > > I am using a list function to filter a view, basically the list
> function
> > > takes some parameters, filters the view and sends back JSON using the
> > > toJSON
> > > function to my application. I am just wondering if I add include_docs
> > that
> > > I
> > > am still able to retrieve the docs as well, now that I have a raw JSON
> > > object being sent back?
> > >
> > > Cheers
> > > Steve
> > >
> >
>

Re: Will include_docs still work when querying a list (couch 0.10.0)?

Posted by Steven Prentice <st...@gmail.com>.
Can you please provide some explanation? because for me it is not working.
My view function outputs some JSON relating to the values in the view using
toJSON, when I request the list/view all I get is the JSON from the list
function and not the entire document(s)...regardless of include_docs being
true or false.

On Mon, Jul 19, 2010 at 2:03 PM, Mikeal Rogers <mi...@gmail.com>wrote:

> yes.
>
> On Sun, Jul 18, 2010 at 8:54 PM, Steven Prentice <
> steven.prentice.87@gmail.com> wrote:
>
> > Hi,
> > I am using a list function to filter a view, basically the list function
> > takes some parameters, filters the view and sends back JSON using the
> > toJSON
> > function to my application. I am just wondering if I add include_docs
> that
> > I
> > am still able to retrieve the docs as well, now that I have a raw JSON
> > object being sent back?
> >
> > Cheers
> > Steve
> >
>

Re: Will include_docs still work when querying a list (couch 0.10.0)?

Posted by Mikeal Rogers <mi...@gmail.com>.
yes.

On Sun, Jul 18, 2010 at 8:54 PM, Steven Prentice <
steven.prentice.87@gmail.com> wrote:

> Hi,
> I am using a list function to filter a view, basically the list function
> takes some parameters, filters the view and sends back JSON using the
> toJSON
> function to my application. I am just wondering if I add include_docs that
> I
> am still able to retrieve the docs as well, now that I have a raw JSON
> object being sent back?
>
> Cheers
> Steve
>