[MarkLogic Dev General] xpath string construction

Wayne Feick wayne.feick at marklogic.com
Tue Oct 14 09:09:58 PDT 2008


Hi Eric,

Yes, xdmp:request() would be unique to the particular web transaction,
but I'm not sure how that would be of use to you.

One other approach you could consider would be to assign a serial number
to the entire document, rather than putting an id on each person. With
that, you'd at least be able to tell if the document had changed since a
web form was generated, reject the delete request, and present the user
with a new version of the form.

Re: mapping from a relational model, the big thing is to think of
documents as rows and not as whole tables. I'm not sure how much you
simplified your example to ask the original question, but if you have
additional information to store for each person you could consider
giving each their own document with a unique identifier. (Hint:
xdmp:random() is a common way to generate unique IDs).

Wayne.


On Tue, 2008-10-14 at 10:47 -0400, Eric Palmitesta wrote:

> Hi Wayne,
> 
> Yes, I've been looking into generating unique identifiers to ease such 
> things as deletion.  I'm still new to the 'document' model, still 
> figuring out what's portable from my 'relational' model experience.
> 
> Is xdmp:request() guaranteed to be unique?  If so, that's a candidate to 
> use as a unique identifier when inserting a new node.
> 
> If there's a way to synchronize a particular block of code across all 
> sessions across all e-nodes, a hash of xdmp:request-timestamp() might 
> also work.
> 
> I'm sure some mailing-list-folk have needed to generate an identifier 
> which is guaranteed unique, anyone have suggestions / advice?
> 
> Much thanks,
> 
> Eric


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xqzone.marklogic.com/pipermail/general/attachments/20081014/6bb43584/attachment.html


More information about the General mailing list