I do use something similar in node.js, with changes feed.
But it'll be probably slower than in Couch, internally.
Depends how many updates you have.
------------------------------------------------------------------------
*With best regards,*
Kiril Stankov,
CEO
This Email disclaimer
<http://open-net.biz/emailsignature.html> is integral part
of this message.
On 15.12.2016 г. 22:46, David Squier wrote:
> Thanks, Kiril-- I'll give that a try.
>
> My fallback option is to move this logic into the Node.js/Express tier,
> but I'd prefer to use a more elegant approach via CouchDB, if possible.
>
> On Thu, Dec 15, 2016, at 12:31 PM, Kiril Stankov wrote:
>> Can't you use a for cycle?
>> For example in an update handler?
>>
>> ------------------------------------------------------------------------
>> *With best regards,*
>> Kiril Stankov
>>
>> On 15.12.2016 г. 21:56, David Squier wrote:
>>> Greetings,
>>>
>>>
>>>
>>> I have a master document that contains multiple references to child
>>> documents. I want to use the Linked Documents feature to "compose" a
>>> master document that replaces all the child document references (i.e.,
>>> keys) with the actual document contents.
>>>
>>>
>>> I can do this with a single linked document using the following emit
>>> in a view:
>>>
>>>
>>> emit(doc._id, { _id: "child_document_1" });
>>>
>>>
>>>
>>> With the include_docs=true, this populates the document contents for
>>> child_document_1 as expected. However, I have not found a way do this
>>> for multiple documents.
>>>
>>>
>>> For example, I'd like to do something like the following:
>>>
>>>
>>>
>>> emit(doc._id, "children": { _id: "child_document_1", _id:
>>> "child_document_2" });
>>>
>>>
>>> And have both child documents replaced with their document bodies._id.
>>> However, it appears the Linked Documents syntax is specific in wanting a
>>> single document referenced and therefore only allowing that documents
>>> contents to be populated.
>>>
>>>
>>> Is this even possible? If not through Views, through some other
>>> mechanism?
>>>
>>>
>>> NOTE: I do not want to generate multiple documents (i.e., use multiple
>>> emit() statements) as my goal is to return a single document.
>>>
>>>
>>> Thanks much!
>>>
>>>
>>>