mirror of https://gitee.com/bigwinds/arangodb
29 lines
924 B
Plaintext
29 lines
924 B
Plaintext
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/transaction <<EOF
|
|
{
|
|
"collections" : {
|
|
"write" : "products"
|
|
},
|
|
"action" : "function () {var db = require('internal').db;db.products.save({ _key: 'abc'});db.products.save({ _key: 'abc'});}"
|
|
}
|
|
EOF
|
|
|
|
HTTP/1.1 400 Bad Request
|
|
content-type: application/json; charset=utf-8
|
|
|
|
{
|
|
"exception" : "[ArangoError 1210: unique constraint violated]",
|
|
"stacktrace" : [
|
|
"[ArangoError 1210: unique constraint violated]",
|
|
" at Error (native)",
|
|
" at eval (<anonymous>:1:99)",
|
|
" at eval (<anonymous>:1:122)",
|
|
" at post_api_transaction (js/actions/api-transaction.js:268:16)",
|
|
" at Function.actions.defineHttp.callback (js/actions/api-transaction.js:288:11)"
|
|
],
|
|
"message" : "unique constraint violated",
|
|
"error" : true,
|
|
"code" : 400,
|
|
"errorNum" : 1210,
|
|
"errorMessage" : "unique constraint violated"
|
|
}
|