shell - ArangoDB Exceptions -


i running commands in tutorial, , noticed kept getting exceptions didn't seem part of normal operation of shell.

command

arangosh [_system]> db._update(doc, { somevalue: 42 }); 

output

javascript exception in file 'c:/program files/arangodb 2.5.4/share/arangodb/js/ client/modules/org/arangodb/arango-database.js' @ 789,11: [arangoerror 1200: pr econdition failed]  !    throw new arangoerror(requestresult); !          ^ stacktrace: error     @ arangodatabase._update (c:/program files/arangodb 2.5.4/share/arangodb/js /client/modules/org/arangodb/arango-database.js:789:11)      @ <shell command>:1:4 

this happens, if try update revision of document has been updated.

for example:

arangosh [_system]> d1 = db.test.save({ value: 1 }) {    "_id" : "test/41839385817",    "_rev" : "41839385817",    "_key" : "41839385817"  } 

creates new document.

arangosh [_system]> d2 = db._update(d1, { value: 2 }) {    "_id" : "test/41839385817",    "_rev" : "41840762073",    "_key" : "41839385817"  } 

if try update original revision of document, error:

arangosh [_system]> db._update(d1, { value: 3 }) javascript exception in file '/usr/local/cellar/arangodb/head/share/arangodb/js/client/modules/org/arangodb/arango-database.js' @ 790,11: [arangoerror 1200: precondition failed] !    throw new arangoerror(requestresult); !          ^ stacktrace: error     @ arangodatabase._update (/usr/local/cellar/arangodb/head/share/arangodb/js/client/modules/org/arangodb/arango-database.js:790:11)     @ <shell command>:1:4 

because revision of document no longer valid.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -