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 <[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Saturday, March 21, 2015 at 2:25 AM
To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
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 
<[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Saturday, March 21, 2015 at 2:17 AM
To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
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


_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to