couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kowsik <kow...@gmail.com>
Subject Re: Views with variable parameters
Date Tue, 11 Jan 2011 07:11:13 GMT
In your design/view, say 'blah/foo', do this:

emit([ doc.field1, doc.field2 ], null)

And when you query:

GET /db/_design/blah/_view/foo?key=["abc","def"]

Hope that helps,

K.
---
http://www.pcapr.net
http://twitter.com
http://labs.mudynamics.com

On Mon, Jan 10, 2011 at 10:59 PM, Alistair Cunningham
<acunningham@integrics.com> wrote:
> Hello all,
>
> Is there an efficient way to implement a view that does the equivalent of
> this SQL?
>
> select * from documents where field1='abc' and field2='def';
>
> where 'abc' and 'def' are different for every query? It needs to be fast and
> scalable on large data sets (millions of documents).
>
> --
> Alistair Cunningham
> +1 888 468 3111
> +44 20 799 39 799
> http://integrics.com/
>

Mime
View raw message