couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Bardubitzki <step...@bardubitzki.com>
Subject Re: View Collation
Date Wed, 17 Jul 2013 18:32:14 GMT
The third element in the startkey is the number property to be sorted. 
Here is my map function:

function(doc) {
     if (doc.kml_id && doc.marker && doc.language) {
         for (language in doc['language']) {
             var o = {};
             o.description = doc.language[language];
             o.gps = doc.gps;
             emit([language, doc.kml_id, doc.marker], o);
         }
     }
}

On 13-07-17 11:21 AM, Robert Newson wrote:
> Use start key of ["fr",id]
> On 17 Jul 2013 19:18, "Stephan Bardubitzki" <stephan@bardubitzki.com> wrote:
>
>> In my docs I have a Number property starting at 0. My start/end key looks
>> like this:
>>
>> startkey: ["fr", id, 0]. endkey: ["fr", id, {}]
>>
>> to sort the response by this property. It seems to work well, however, the
>> doc with the property value=0 is omitted.
>>
>> I presume the view collation for numbers is starting at 1?
>>
>>
>>
>>
>>
>>
>>
> --------------------------------
> Spam/Virus scanning by CanIt Pro
>
> For more information see
> http://www.kgbinternet.com/SpamFilter.htm
>
> To control your spam filter, log in at
> http://filter.kgbinternet.com
>


Mime
View raw message