You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Larry White <lj...@gmail.com> on 2011/09/04 14:06:09 UTC

noobie problem getting view results

Hi,
I'm sending a query that looks like this:

http://localhost:5984/better1/_design/all_products

and I get the view query text, instead of the results:

{"_id":"_design/all_products","_rev":"5-0263a7865636ac57eae960b8ad2b63ac","language":"javascript","views":{"all
products":{"map":"function(doc) {\n if (doc.drr_class=='Product') {
\n\temit(null, doc); \n\t} \n}"}}}

How do I get the actual results (ie a list of 'products'). It works
fine from within the Couchbase web interface.

Thanks much.

Re: noobie problem getting view results

Posted by Larry White <lj...@gmail.com>.
On Sun, Sep 4, 2011 at 9:02 AM, Victor Nicollet <vn...@runorg.com>wrote:

> Also, if you have access to the HTTP queries performed by Futon (such as
> through Firefox+Firebog, or the Chrome developer tools), you can see the
> actual query sent to the database and just copy it.
>

That will be very helpful. Thanks again.


>
> On 4 September 2011 15:00, Larry White <lj...@gmail.com> wrote:
>
> > Thanks. It wasn't clear from the wiki what i was doing wrong, but then I
> > realized that it might appear in the url of the web interface when I run
> it
> > there, and it does, in a slightly modified version.
> >
> > thanks.
> >
> > On Sun, Sep 4, 2011 at 8:50 AM, Victor Nicollet <vnicollet@runorg.com
> > >wrote:
> >
> > > Hello,
> > >
> > > You're querying for the design document itself, so that is what you are
> > > receiving. To get the contents of a specific view, you need to ask for
> > that
> > > view:
> > >
> > > http://localhost:5984/better1/_design/all_products/_view/all_products
> > >
> > > You may want to peek at the Wiki on that topic for more information :
> > > http://wiki.apache.org/couchdb/HTTP_view_API
> > >
> > > -- VN
> > >
> > > On 4 September 2011 14:06, Larry White <lj...@gmail.com> wrote:
> > >
> > > > Hi,
> > > > I'm sending a query that looks like this:
> > > >
> > > > http://localhost:5984/better1/_design/all_products
> > > >
> > > > and I get the view query text, instead of the results:
> > > >
> > > >
> > > >
> > >
> >
> {"_id":"_design/all_products","_rev":"5-0263a7865636ac57eae960b8ad2b63ac","language":"javascript","views":{"all
> > > > products":{"map":"function(doc) {\n if (doc.drr_class=='Product') {
> > > > \n\temit(null, doc); \n\t} \n}"}}}
> > > >
> > > > How do I get the actual results (ie a list of 'products'). It works
> > > > fine from within the Couchbase web interface.
> > > >
> > > > Thanks much.
> > > >
> > >
> >
>

Re: noobie problem getting view results

Posted by Victor Nicollet <vn...@runorg.com>.
Also, if you have access to the HTTP queries performed by Futon (such as
through Firefox+Firebog, or the Chrome developer tools), you can see the
actual query sent to the database and just copy it.

On 4 September 2011 15:00, Larry White <lj...@gmail.com> wrote:

> Thanks. It wasn't clear from the wiki what i was doing wrong, but then I
> realized that it might appear in the url of the web interface when I run it
> there, and it does, in a slightly modified version.
>
> thanks.
>
> On Sun, Sep 4, 2011 at 8:50 AM, Victor Nicollet <vnicollet@runorg.com
> >wrote:
>
> > Hello,
> >
> > You're querying for the design document itself, so that is what you are
> > receiving. To get the contents of a specific view, you need to ask for
> that
> > view:
> >
> > http://localhost:5984/better1/_design/all_products/_view/all_products
> >
> > You may want to peek at the Wiki on that topic for more information :
> > http://wiki.apache.org/couchdb/HTTP_view_API
> >
> > -- VN
> >
> > On 4 September 2011 14:06, Larry White <lj...@gmail.com> wrote:
> >
> > > Hi,
> > > I'm sending a query that looks like this:
> > >
> > > http://localhost:5984/better1/_design/all_products
> > >
> > > and I get the view query text, instead of the results:
> > >
> > >
> > >
> >
> {"_id":"_design/all_products","_rev":"5-0263a7865636ac57eae960b8ad2b63ac","language":"javascript","views":{"all
> > > products":{"map":"function(doc) {\n if (doc.drr_class=='Product') {
> > > \n\temit(null, doc); \n\t} \n}"}}}
> > >
> > > How do I get the actual results (ie a list of 'products'). It works
> > > fine from within the Couchbase web interface.
> > >
> > > Thanks much.
> > >
> >
>

Re: noobie problem getting view results

Posted by Larry White <lj...@gmail.com>.
Thanks. It wasn't clear from the wiki what i was doing wrong, but then I
realized that it might appear in the url of the web interface when I run it
there, and it does, in a slightly modified version.

thanks.

On Sun, Sep 4, 2011 at 8:50 AM, Victor Nicollet <vn...@runorg.com>wrote:

> Hello,
>
> You're querying for the design document itself, so that is what you are
> receiving. To get the contents of a specific view, you need to ask for that
> view:
>
> http://localhost:5984/better1/_design/all_products/_view/all_products
>
> You may want to peek at the Wiki on that topic for more information :
> http://wiki.apache.org/couchdb/HTTP_view_API
>
> -- VN
>
> On 4 September 2011 14:06, Larry White <lj...@gmail.com> wrote:
>
> > Hi,
> > I'm sending a query that looks like this:
> >
> > http://localhost:5984/better1/_design/all_products
> >
> > and I get the view query text, instead of the results:
> >
> >
> >
> {"_id":"_design/all_products","_rev":"5-0263a7865636ac57eae960b8ad2b63ac","language":"javascript","views":{"all
> > products":{"map":"function(doc) {\n if (doc.drr_class=='Product') {
> > \n\temit(null, doc); \n\t} \n}"}}}
> >
> > How do I get the actual results (ie a list of 'products'). It works
> > fine from within the Couchbase web interface.
> >
> > Thanks much.
> >
>

Re: noobie problem getting view results

Posted by Victor Nicollet <vn...@runorg.com>.
Hello,

You're querying for the design document itself, so that is what you are
receiving. To get the contents of a specific view, you need to ask for that
view:

http://localhost:5984/better1/_design/all_products/_view/all_products

You may want to peek at the Wiki on that topic for more information :
http://wiki.apache.org/couchdb/HTTP_view_API

-- VN

On 4 September 2011 14:06, Larry White <lj...@gmail.com> wrote:

> Hi,
> I'm sending a query that looks like this:
>
> http://localhost:5984/better1/_design/all_products
>
> and I get the view query text, instead of the results:
>
>
> {"_id":"_design/all_products","_rev":"5-0263a7865636ac57eae960b8ad2b63ac","language":"javascript","views":{"all
> products":{"map":"function(doc) {\n if (doc.drr_class=='Product') {
> \n\temit(null, doc); \n\t} \n}"}}}
>
> How do I get the actual results (ie a list of 'products'). It works
> fine from within the Couchbase web interface.
>
> Thanks much.
>