nicknystrom / RedBranch.Hammock

No longer maintained, active fork is at:
https://github.com/DamianMac/Hammock
GNU General Public License v3.0
0 stars 0 forks source link

Why does the Query<TEntity>.Spec class not support a Key property? #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've built a view in CouchDb and would like to query docs from that view.  I'm 
using the Query class to do so, entering my design document and view name. 

I'd like to then pass a key to the design doc to return results which match 
that key, however, the Spec class does not support a Key parameter.   I'm 
wondering if this was left out intentionally?  I'd like to generate url with 
the following structure:

<database>/_design/<design doc>/_view/<view name>?key=[part1,part2]

FYI- I can build the [part1,part2] value without issue- looking at the code, 
there's no way to enter a key=.

Original issue reported on code.google.com by mham...@gmail.com on 4 Apr 2011 at 10:38

GoogleCodeExporter commented 9 years ago
Sorry this is likely rather a late reply, but according to 
http://wiki.apache.org/couchdb/HTTP_view_API:

"In a reduced view result, you need to use startkey and endkey to match rows 
instead of the key parameter."

So when you're looking for exact matches to a particular key, just call 
.From(key).To(key). If this is actually a different behavior from key=, let me 
know.

Original comment by nnyst...@gmail.com on 2 Jun 2011 at 1:03

GoogleCodeExporter commented 9 years ago
Added a convenience Exactly(object/JToken) method to Spec to more closely match
the key= querystring parameter supported by CouchDB, however internally it still
uses startkey=&endkey=

Original comment by nnyst...@gmail.com on 2 Jun 2011 at 1:05