Loading TOC...

xdmp:user-last-login

xdmp:user-last-login() as element(last-login)?

Summary

Returns the last-login node for the current user. If no last-login database is specified in the App Server configuration, then the empty sequence is returned.

Example

  xdmp:user-last-login()
  => 
  <last-login xmlns="http://marklogic.com/xdmp/last-login">
    <user-id>1134406269933351074</user-id>
    <last-successful-login>2008-03-19T15:41:08</last-successful-login>
    <last-unsuccessful-login>2008-03-19T15:40:45</last-unsuccessful-login>
    <number-unsuccessful-logins>0</number-unsuccessful-logins>
    <display-last-login>true</display-last-login>
  </last-login> 

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.
  • With xdmp:user-last-login(xdmp:user("myCurrentqConsoleUser")), this works. However, if I want to look up some other user xdmp:user-last-login(xdmp:user("differentUser")), I get "your query returned an empty sequence" error. I have logged in as the other user and was able to then get the last login information about that user. Both users are currently admins. I don't think this is working correctly. http://stackoverflow.com/questions/42794295/marklogic-user-management-with-last-login-database