atom feed2 messages in com.marklogic.developer.generalRe: [MarkLogic Dev General] Regarding...
FromSent OnAttachments
Mani, Sivasubramani (ELS)Jan 9, 2018 10:17 pm 
Geert JostenJan 10, 2018 12:30 am 
Subject:Re: [MarkLogic Dev General] Regarding Spawn function not working
From:Geert Josten (Geer@marklogic.com)
Date:Jan 10, 2018 12:30:00 am
List:com.marklogic.developer.general

Hi Siva,

The xdmp:node functions only work on persisted nodes. Make sure
$userPersonalInfo is a reference to something from the database, or use an
in-memory update library:
https://github.com/ryanjdew/XQuery-XML-Memory-Operations

Cheers, Geert

From:
<gene@developer.marklogic.com<mailto:gene@developer.marklogic.com>>
on behalf of "Mani, Sivasubramani (ELS)"
<s.m@elsevier.com<mailto:s.m@elsevier.com>> Reply-To: MarkLogic Developer Discussion
<gene@developer.marklogic.com<mailto:gene@developer.marklogic.com>> Date: Wednesday, January 10, 2018 at 7:17 AM To: "gene@developer.marklogic.com<mailto:gene@developer.marklogic.com>"
<gene@developer.marklogic.com<mailto:gene@developer.marklogic.com>> Cc: "Sodihardjo, Aiwen (ELS-AMS)"
<a.so@elsevier.com<mailto:a.so@elsevier.com>> Subject: [MarkLogic Dev General] Regarding Spawn function not working

Hi Team,

I try to update the xml nodes more than one time using xdmp:spawn function , but
the update was not happened inside the spwan function , I have specified the
sample code below. Kindly do the needful

let $updateact_deact := xdmp:spawn-function(function(){ ( xdmp:node-replace($userPersonalInfo/us:isActive, <us:isActive>false</us:isActive>)>), xdmp:commit()) }, <options xmlns="xdmp:eval"> <transaction-mode>update</transaction-mode> </options>)

let $updatedeact_timestamp := xdmp:spawn-function(function(){ (xdmp:node-insert-child($userPersonalInfo/us:lastdeactAcntTimestamp, <us:lastdeactAcntTimestamp>
{current-dateTime()}</us:lastdeactAcntTimestamp>), xdmp:commit()) }, <options xmlns="xdmp:eval"> <transaction-mode>update</transaction-mode> </options>)

Thanks & Regards, Siva