[MarkLogic Dev General] "global" variables in Query Console

Joe Bryan Joe.Bryan at marklogic.com
Fri Mar 20 23:34:25 PDT 2015


A quick detail: placing a document or search result directly in a server field throws the XDMP-SERVERFIELDDATABASENODE

ex:
xdmp:set-server-field("test", fn:doc()[1])

To get around this, you can copy the result into a new document node:

xdmp:set-server-field("test", document{ fn:doc()[1] })

The docs mention expiring database-node server values after 10 minutes, but I can't seem to duplicate that.

Thanks.

-jb

From: Joe Bryan <joe.bryan at marklogic.com<mailto:joe.bryan at marklogic.com>>
Reply-To: MarkLogic Developer Discussion <general at developer.marklogic.com<mailto:general at developer.marklogic.com>>
Date: Saturday, March 21, 2015 at 2:25 AM
To: MarkLogic Developer Discussion <general at developer.marklogic.com<mailto:general at developer.marklogic.com>>
Subject: Re: [MarkLogic Dev General] "global" variables in Query Console

Hi Alex,

You could put the query results in a server field, and then retrieve them from other QConsole buffers.

http://docs.marklogic.com/xdmp:set-server-field
http://docs.marklogic.com/xdmp:get-server-field

Thanks.

-jb

From: Alex Jouravlev <alexj at businessabstraction.com<mailto:alexj at businessabstraction.com>>
Reply-To: MarkLogic Developer Discussion <general at developer.marklogic.com<mailto:general at developer.marklogic.com>>
Date: Saturday, March 21, 2015 at 2:17 AM
To: MarkLogic Developer Discussion <General at developer.marklogic.com<mailto:General at developer.marklogic.com>>
Subject: [MarkLogic Dev General] "global" variables in Query Console

Hi everyone,

Just a quick easy question. I want to run a rather complex query, then do a few things with the result. I want to run the query once, and then try this and that in other qconsole windows. Other than saving the result of the first query as a separate document, what can I do?

Thank you

Alex


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20150321/dff89a26/attachment.html 


More information about the General mailing list