arangosh> db.ids.ensureIndex({ type: "persistent", fields: [ "name.first", "name.last" ], unique: true });
{
"deduplicate" : true,
"fields" : [
"name.first",
"name.last"
],
"id" : "ids/17549",
"isNewlyCreated" : true,
"sparse" : false,
"type" : "persistent",
"unique" : true,
"code" : 201
}
arangosh> db.ids.save({ "name" : { "first" : "hans", "last": "hansen" }});
{
"_id" : "ids/17552",
"_key" : "17552",
"_rev" : "_Vsb0bGm---"
}
arangosh> db.ids.save({ "name" : { "first" : "jens", "last": "jensen" }});
{
"_id" : "ids/17556",
"_key" : "17556",
"_rev" : "_Vsb0bGq---"
}
arangosh> db.ids.save({ "name" : { "first" : "hans", "last": "jensen" }});
{
"_id" : "ids/17559",
"_key" : "17559",
"_rev" : "_Vsb0bGq--_"
}
arangosh> db.ids.save({ "name" : { "first" : "hans", "last": "hansen" }});
[ArangoError 1210: unique constraint violated - in index 17549 of type persistent over ["name.first","name.last"]]