Can Couch compare two custom keys? For instance, using Cradle:

db.view("posts/byTitle", { title: "My Post", author: "Me" }, function(err, 
rows){...});

And inf your view have it set up to only return rows that match the queried 
title as well as the author:

"byTitle": {
       "map": "function (doc) { if (doc.type === 'post' && doc.title === 
options.title && doc.author === options.author ) { emit(doc.title, doc) } }"
   }

On Monday, December 19, 2011 9:28:32 AM UTC-8, Victor Debone wrote:
>
> I've been trying to use multiple keys in Cradle for a good time, I'm 
> almost giving up since I can't find help anywhere.
>
> I use this query with an HTTP request and it brings me results
>
> gps_map/_design/carros/_view/teste?startkey=[353451044986295]&endkey=[353451044986296,{}]&limit=50
>
> But I can't realize how do I use Cradle to reach the same results, I've 
> tried
>
> var car = 353451044986295;
> db.view('carros/teste',{limit:50,startkey:[car],endkey:[car,{}]},function(err,res)
>
> and
>
> var car = 353451044986295;
> db.view('carros/teste',{limit:50,startkey:'['+car+']',endkey:'['+car+',{}]'},function(err,res)
>
> and have no success, there's no result. How do I use multiple keys in 
> Cradle?
>
> -- Victor Debone
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to