简体   繁体   English

Arangodb删除操作错误

[英]Arangodb remove action error

I want to do some remove action in arangodb transaction. 我想在arangodb事务中执行一些删除操作。 This is my code: 这是我的代码:

  db._executeTransaction
  ({ 
    collections: 
    {
            write: [ "demo" ]
        },
    action: function(){db.demo.removeByExample( {"Hello":"World"} );}
    }); 

And It's always raise some exception. 而且它总是引发一些例外。 Error Information is: 错误信息是:

 ERROR JavaScript exception in file 'f:/work_lc/aran
 odb/js/server/modules/org/arangodb/arango-database.j
 651: nested transactions detected]
 ERROR !  return TRANSACTION(data);
 ERROR !         ^

can somebody help me, Thanks! 有人可以帮我吗,谢谢!

Within a transaction-function db is not available, you have to require it with require("internal").db 在事务功能db中不可用,您必须通过require("internal").db要求它

Your code should look like this: 您的代码应如下所示:

  db._executeTransaction
  ({ 
    collections: 
    {
            write: [ "demo" ]
        },
    action: function(){require("internal").db.demo.removeByExample( {"Hello":"World"} );}
    }); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM