text: Q:
  
  Update managed document without changing the version
  
  I have used Library services API to insert documents into MarkLogic. There are scenarios where in I need to just save the changes done without checkin. That means save the changes into current version itself without incrementing the version number. Have seen such facilities in some CMIS specs, where it provides out of the box solution for checkin of the document with same version. Could not find any such similar API in MarkLogic. Alternate option I could think of is unmanage the managed document, use xdmp functions to perform update and remanage the content. But this would loose the previous versions. Are there any other alternate ways of doing this?                           
  
  A:
  
  Have you tried to simply use the xdmp update functions and thus bypass DLS? For example you could use xdmp:node-replace to replace the root element of a document. The docs say that you "must" use DLS functions for updates, but I think what that means is that non-DLS updates won't be managed by DLS.
  Let's try.
  (: new managed document :)
  import module namespace dls = "http://marklogic.com/xdmp/dls" 
    at "/MarkLogic/dls.xqy";
  dls:document-insert-and-manage('test', true(), <test id="1"/>)
  => ()
  
  import module namespace dls = "http://marklogic.com/xdmp/dls" 
    at "/MarkLogic/dls.xqy";
  
  dls:document-is-managed('test'),
  dls:document-history('test')
  =>
  true
  <dls:document-history uri="test" xmlns:dls="http://marklogic.com/xdmp/dls">
    <dls:version>
      <dls:version-id>1</dls:version-id>
      <dls:document-uri>test</dls:document-uri>
      <dls:latest>true</dls:latest>
      <dls:created>2013-03-15T10:22:35.642645-07:00</dls:created>
      <dls:author>9712740001723797867</dls:author>
      <dls:annotation/>
      <dls:deleted>false</dls:deleted>
    </dls:version>
  </dls:document-history>
  
  Looks good. Let's try an unmanaged update.
  xdmp:node-replace(doc('test')/test, <test id="2"/>)
  => ()
  
  doc('test')
  => <test id="2"/>
  
  import module namespace dls = "http://marklogic.com/xdmp/dls" 
    at "/MarkLogic/dls.xqy";
  
  dls:document-is-managed('test'),
  dls:document-history('test')
  =>
  true
  <dls:document-history uri="test" xmlns:dls="http://marklogic.com/xdmp/dls">
    <dls:version>
      <dls:version-id>1</dls:version-id>
      <dls:document-uri>test</dls:document-uri>
      <dls:latest>true</dls:latest>
      <dls:created>2013-03-15T10:22:35.642645-07:00</dls:created>
      <dls:author>9712740001723797867</dls:author>
      <dls:annotation/>
      <dls:deleted>false</dls:deleted>
    </dls:version>
  </dls:document-history>
  
  So the update worked, but the document history still shows version 1. That was what you wanted, right?
  Now, I did this as the admin user. With a non-admin user you might have to grant some extra privileges - or it might be cleaner to create an amp. That could be used to guard against accidental unmanaged updates.
  
  