[英]Marklogic - How to rollback document
I am a newbie to marklogic. 我是marklogic的新手。 How do I rollback a document I deleted.
如何回滚删除的文档。 I use the function
xdmp:rollback()
from https://docs.marklogic.com/xdmp:rollback . 我使用https://docs.marklogic.com/xdmp:rollback中的功能
xdmp:rollback()
。 but I could not see a document restore back to database. 但是我看不到文档还原回数据库。 Thanks in advance.
提前致谢。
xdmp:document-delete("/data/edu/GMU.xml"),
xdmp:rollback()
In your example code you never actually committed the document (because the full statement never concluded successfully) and so you don't need to do a rollback. 在示例代码中,您实际上从未提交过文档(因为完整的语句从未成功得出结论),因此您无需进行回滚。 You just need to prevent the statement from succeeding by, for example, generating an
fn:error()
to fail the entire statement and then all pending changes in the statement will never be committed. 您只需要阻止语句成功,例如,生成一个
fn:error()
使整个语句失败,然后该语句中所有未决的更改将永远不会提交。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.