[MarkLogic Dev General] Can marklogic generate unique sequential numbers

Geert Josten Geert.Josten at marklogic.com
Mon Jan 25 08:14:21 PST 2016

Hi Peter,

Yes, there are ways to generate sequential numbers, but they will slow down ingest. You can use this library instead to generate guaranteed unique random uris:


Kind regards,

From: <general-bounces at developer.marklogic.com<mailto:general-bounces at developer.marklogic.com>> on behalf of Peter Davies <pjjaad at hotmail.co.uk<mailto:pjjaad at hotmail.co.uk>>
Reply-To: MarkLogic Developer Discussion <general at developer.marklogic.com<mailto:general at developer.marklogic.com>>
Date: Monday, January 25, 2016 at 4:53 PM
To: "general at developer.marklogic.com<mailto:general at developer.marklogic.com>" <general at developer.marklogic.com<mailto:general at developer.marklogic.com>>
Subject: [MarkLogic Dev General] Can marklogic generate unique sequential numbers

In SQL server a record has a Primary key for a user

I would simply put an identity column (1,1) unique id into a table.
I utilise this property throughout the database and as in any standard sql rdbms I can use it as a foreign key

Say I have a document

Since in ML the record is the document is there a similar way to
create a unique id internal to the document.

I can migrate exists rdbms data with this already done. but from ML ho would I create a new user with a unique ID
I know that the document will have a unique doc it but say I want to xquery a company
by name and then get a list of all the users from that company to perform validation and sign on
it it possible that  company could have two users with the same name hence the requirement to uniquely id them.
I know I am thinking still as a DBA in an RDBMS but if I want to do this is there an already existing function that performs this task in ML

Is it achievable  or do I need to get rid of my sql notions and think again.
as you can guess by the question I am very new to ML
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20160125/4fff7025/attachment.html 

More information about the General mailing list