couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J Chris Anderson <jch...@gmail.com>
Subject Re: results without couch 'metadata'
Date Fri, 30 Apr 2010 20:46:07 GMT

On Apr 30, 2010, at 1:39 PM, erich oliphant wrote:

> Ok, but do I have to regen JSON manually in this casem since the _list
> function is designed to spit out arbitrary formats ?


yes you can return JSON.stringify({"foo":5})

> 
> On Wed, Apr 28, 2010 at 12:58 PM, Paul Bonser <misterpib@gmail.com> wrote:
> 
>> And of course, it didn't occur to me to mention that there was already
>> an even more general solution already in place...
>> 
>> On Tue, Apr 27, 2010 at 7:47 PM, Chris Anderson <jchris@gmail.com> wrote:
>>> You can use a _list or _show function for this.
>>> 
>>> Sent from my iPhone
>>> 
>>> On Apr 27, 2010, at 4:47 PM, Paul Bonser <misterpib@gmail.com> wrote:
>>> 
>>>> I'm pretty sure there is no such thing, but if it was to be added, I
>>>> think it would be better to add something a little more general, such
>>>> as "just_field" so you could do something like
>>>> ?just_field=id/key/doc/value to get a list of all the
>>>> ids/keys/docs/values, respectively.
>>>> 
>>>> I don't like the name "just_field", that's just the first thing that
>>>> came to mind, but I could see such a feature being useful.
>>>> 
>>>> There'd be no need to wrap an extra doc around it, it could just be a
>>>> json array returned, and it wouldn't make sense to strip out the _id
>>>> and _rev, so with your example, you'd end up with the following being
>>>> returned:
>>>> 
>>>>  [
>>>>  {"_id":"1","_rev":"1","important":"stuff"}
>>>>  ]
>>>> 
>>>> On Tue, Apr 27, 2010 at 5:36 PM, erich oliphant
>>>> <erich.oliphant@gmail.com> wrote:
>>>>> 
>>>>> Hi is there a way to get couch results without the extra metadata?
>>>>> Perhaps
>>>>> instead of 'include_docs' where you get:
>>>>> 
>>>>> 
>>>>> 
>> {"total_rows":1498,"offset":350,"rows":[{"id":"1","key":"1","doc":{"_id":"1","_rev":"1","important":"stuff"}}]}
>>>>> 
>>>>> a 'docs_only' or something  option that would return something like
>>>>> {[{"important","stuff"}]}
>>>>> 
>>>>> --
>>>>> Erich Oliphant
>>>>> 
>>>>> "There are, in fact, two things, science and opinion, the former begets
>>>>> knowledge, the latter ignorance"
>>>>> -- Hippocrates of Cos
>>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Paul Bonser
>>>> http://probablyprogramming.com
>>> 
>> 
>> 
>> 
>> --
>> Paul Bonser
>> http://probablyprogramming.com
>> 
> 
> 
> 
> -- 
> Erich Oliphant
> 
> "There are, in fact, two things, science and opinion, the former begets
> knowledge, the latter ignorance"
> -- Hippocrates of Cos


Mime
View raw message