2016-09-21 10 views
1

arangodbトランザクションでいくつかの削除アクションを実行したいと思います。これは私のコードです:Arangodb削除アクションエラー

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

そして、いつも例外がいくつか出てきます。エラー情報:

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 !  ^

誰かが私に助けてくれてありがとう!トランザクション関数内

+0

どのバージョンあなたが使用していますか? – mpv1989

+1

答えがあなたのために機能しましたか?はいの場合は、「受け入れ」とマークできますか?そうでない場合、何が欠けていますか? – dothebart

答えて

2

dbが利用できない、あなたはrequire("internal").db

でそれを必要とする必要があなたのコードは次のようになります。arangodbの

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