arangosh> db.ids.ensureIndex({ type: "persistent", fields: [ "name.first", "name.last" ], unique: true });
{
"deduplicate" : true,
"fields" : [
"name.first",
"name.last"
],
"id" : "ids/18037",
"isNewlyCreated" : true,
"sparse" : false,
"type" : "persistent",
"unique" : true,
"code" : 201
}
arangosh> db.ids.save({ "name" : { "first" : "hans", "last": "hansen" }});
{
"_id" : "ids/18040",
"_key" : "18040",
"_rev" : "_V8R1UDC--_"
}
arangosh> db.ids.save({ "name" : { "first" : "jens", "last": "jensen" }});
{
"_id" : "ids/18044",
"_key" : "18044",
"_rev" : "_V8R1UDC--B"
}
arangosh> db.ids.save({ "name" : { "first" : "hans", "last": "jensen" }});
{
"_id" : "ids/18047",
"_key" : "18047",
"_rev" : "_V8R1UDG--_"
}
arangosh> db.ids.save({ "name" : { "first" : "hans", "last": "hansen" }});
[ArangoError 1210: unique constraint violated - in index 18037 of type persistent over ["name.first","name.last"]; conflicting key: 18040]