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