incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tito Ciuro <tci...@mac.com>
Subject Re: Matching docs which values ending with a specific string
Date Thu, 13 Feb 2014 01:08:42 GMT
Hi Jens,

This is taken verbatim from the "Getting Started with CouchDB" book, page 49:

[...] If we want to restrict it to those starting with Apricot, we can use the UTF-8 sorting
to our advantage. If we add the UTF-8 character 007F to ‘Apricot’, the range will only
include recipes with the title starting with Apricot, even if the document ID contains other
characters. Let’s see that in action:

http://127.0.0.1:5984/recipes/_design/simple/_view/by_title?startkey=%22Apricot %22&endkey=%22Apricot%007F%22
[...]

In general, I've found the books/guides on CouchDB to be either outdated, plain wrong or short
in details. :-/

-- Tito

On Feb 12, 2014, at 4:45 PM, Jens Alfke <jens@couchbase.com> wrote:

> 
> On Feb 12, 2014, at 2:35 PM, Tito Ciuro <tciuro@mac.com> wrote:
> 
>> I have seen examples where %007F is used to match "begins with". 
> 
> In a URL? That would decode to a NUL (zero byte) followed by the digits '7' and 'F' …
not meaningful.
> If you meant %7F, that's a DEL control character … also not meaningful.
> 
> I don't think these are examples for CouchDB. It doesn't use any special metacharacters
like this for queries.
> 
> —Jens


Mime
View raw message