You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Joe Freeman <jo...@bitroot.com> on 2011/04/16 17:26:55 UTC

Passing _changes feed through a map function?

Is there a way to pass the _changes feed (with include_docs=true)
through a map function (for example, one that exists as part of an
existing view)? If not, are there any plans for this?

Re: Passing _changes feed through a map function?

Posted by Jan Lehnardt <ja...@apache.org>.
On 16 Apr 2011, at 18:21, kowsik wrote:

> On Sat, Apr 16, 2011 at 9:05 AM, Joe Freeman <jo...@bitroot.com> wrote:
>> On 16 April 2011 16:42, Alexander Shorin <kx...@gmail.com> wrote:
>>> On Sat, Apr 16, 2011 at 7:26 PM, Joe Freeman <jo...@bitroot.com> wrote:
>>>> Is there a way to pass the _changes feed (with include_docs=true)
>>>> through a map function (for example, one that exists as part of an
>>>> existing view)? If not, are there any plans for this?
>>>> 
>>> 
>>> This functionality is already in trunk/1.1.x branch
>>> https://github.com/apache/couchdb/commit/56086f07c425bd272bda5a6609ed9db3758178ba
>> 
>> Awesome - looking forward to it :) Thanks Alexander.
> 
> Is this instead of the existing mechanism or yet another way to do
> filtered changes?

This is one of two new built in filters. The other is for design docs.

This so you can get a notification for when a view *would* be updated 
if you queried it.

Cheers
Jan
-- 


Re: Passing _changes feed through a map function?

Posted by Alexander Shorin <kx...@gmail.com>.
> Is this instead of the existing mechanism or yet another way to do
> filtered changes?

Yes, this is an extension of current filters mechanism, that could be
used (and be supported by query server) or could be not.

------------------
,,,^..^,,,



On Sat, Apr 16, 2011 at 8:21 PM, kowsik <ko...@gmail.com> wrote:
> On Sat, Apr 16, 2011 at 9:05 AM, Joe Freeman <jo...@bitroot.com> wrote:
>> On 16 April 2011 16:42, Alexander Shorin <kx...@gmail.com> wrote:
>>> On Sat, Apr 16, 2011 at 7:26 PM, Joe Freeman <jo...@bitroot.com> wrote:
>>>> Is there a way to pass the _changes feed (with include_docs=true)
>>>> through a map function (for example, one that exists as part of an
>>>> existing view)? If not, are there any plans for this?
>>>>
>>>
>>> This functionality is already in trunk/1.1.x branch
>>> https://github.com/apache/couchdb/commit/56086f07c425bd272bda5a6609ed9db3758178ba
>>
>> Awesome - looking forward to it :) Thanks Alexander.
>
> Is this instead of the existing mechanism or yet another way to do
> filtered changes?
>
> Thanks,
>
> K.
> ---
> http://blitz.io
> http://twitter.com/pcapr
>

Re: Passing _changes feed through a map function?

Posted by kowsik <ko...@gmail.com>.
On Sat, Apr 16, 2011 at 9:05 AM, Joe Freeman <jo...@bitroot.com> wrote:
> On 16 April 2011 16:42, Alexander Shorin <kx...@gmail.com> wrote:
>> On Sat, Apr 16, 2011 at 7:26 PM, Joe Freeman <jo...@bitroot.com> wrote:
>>> Is there a way to pass the _changes feed (with include_docs=true)
>>> through a map function (for example, one that exists as part of an
>>> existing view)? If not, are there any plans for this?
>>>
>>
>> This functionality is already in trunk/1.1.x branch
>> https://github.com/apache/couchdb/commit/56086f07c425bd272bda5a6609ed9db3758178ba
>
> Awesome - looking forward to it :) Thanks Alexander.

Is this instead of the existing mechanism or yet another way to do
filtered changes?

Thanks,

K.
---
http://blitz.io
http://twitter.com/pcapr

Re: Passing _changes feed through a map function?

Posted by Joe Freeman <jo...@bitroot.com>.
On 16 April 2011 16:42, Alexander Shorin <kx...@gmail.com> wrote:
> On Sat, Apr 16, 2011 at 7:26 PM, Joe Freeman <jo...@bitroot.com> wrote:
>> Is there a way to pass the _changes feed (with include_docs=true)
>> through a map function (for example, one that exists as part of an
>> existing view)? If not, are there any plans for this?
>>
>
> This functionality is already in trunk/1.1.x branch
> https://github.com/apache/couchdb/commit/56086f07c425bd272bda5a6609ed9db3758178ba

Awesome - looking forward to it :) Thanks Alexander.


-- 
Bitroot - http://bitroot.com

Re: Passing _changes feed through a map function?

Posted by Alexander Shorin <kx...@gmail.com>.
No, you couldn't change returned document via filter_view. It just
works as regular filter, but it generates "passed" state for documents
that have been emitted by view map function at least once.
You probably wanted of some kind real-time view result stream?
Filter_view call doesn't update view index if I understood Jan right,
so you still have to make pure view function call to make result being
indexed and accessible.

About other new filter I know nothing, may be Jan or somebody other
could tell more. However, it doesn't present in query server now or
I've missed something interesting(:

------------------
,,,^..^,,,



On Mon, May 16, 2011 at 7:42 PM, Joe Freeman <jo...@bitroot.com> wrote:
> On 16 April 2011 16:42, Alexander Shorin <kx...@gmail.com> wrote:
>> On Sat, Apr 16, 2011 at 7:26 PM, Joe Freeman <jo...@bitroot.com> wrote:
>>> Is there a way to pass the _changes feed (with include_docs=true)
>>> through a map function (for example, one that exists as part of an
>>> existing view)? If not, are there any plans for this?
>>
>> This functionality is already in trunk/1.1.x branch
>> https://github.com/apache/couchdb/commit/56086f07c425bd272bda5a6609ed9db3758178ba
>
> Sorry to bring up an old thread, but having had a second look at that
> commit, I'm not sure it's really what I'm after.
>
> The feature I'm after involves being able to have a _changes feed with
> include_docs=true which also gives me the ability to pass each
> document through a map function first so that I can remove unnecessary
> (and potentially big) parts of the document. At the moment I have to
> listen to _changes, and then for each change, I do another HTTP
> request to find out what the change involved - I was hoping to skip
> out this extra request.
>
> Perhaps I'm mis-understanding that commit and it does actually do what
> I want? Or maybe I'm after the 'other' mechanism that Jan mentioned?
>
> Thanks.
>

Re: Passing _changes feed through a map function?

Posted by Joe Freeman <jo...@bitroot.com>.
On 16 April 2011 16:42, Alexander Shorin <kx...@gmail.com> wrote:
> On Sat, Apr 16, 2011 at 7:26 PM, Joe Freeman <jo...@bitroot.com> wrote:
>> Is there a way to pass the _changes feed (with include_docs=true)
>> through a map function (for example, one that exists as part of an
>> existing view)? If not, are there any plans for this?
>
> This functionality is already in trunk/1.1.x branch
> https://github.com/apache/couchdb/commit/56086f07c425bd272bda5a6609ed9db3758178ba

Sorry to bring up an old thread, but having had a second look at that
commit, I'm not sure it's really what I'm after.

The feature I'm after involves being able to have a _changes feed with
include_docs=true which also gives me the ability to pass each
document through a map function first so that I can remove unnecessary
(and potentially big) parts of the document. At the moment I have to
listen to _changes, and then for each change, I do another HTTP
request to find out what the change involved - I was hoping to skip
out this extra request.

Perhaps I'm mis-understanding that commit and it does actually do what
I want? Or maybe I'm after the 'other' mechanism that Jan mentioned?

Thanks.

Re: Passing _changes feed through a map function?

Posted by Alexander Shorin <kx...@gmail.com>.
On Sat, Apr 16, 2011 at 7:26 PM, Joe Freeman <jo...@bitroot.com> wrote:
> Is there a way to pass the _changes feed (with include_docs=true)
> through a map function (for example, one that exists as part of an
> existing view)? If not, are there any plans for this?
>

This functionality is already in trunk/1.1.x branch
https://github.com/apache/couchdb/commit/56086f07c425bd272bda5a6609ed9db3758178ba

------------------
,,,^..^,,,