arangosh> db.test.ensureIndex({ type: "hash", fields: [ "a", "b.c" ], unique: true });
{
"deduplicate" : true,
"fields" : [
"a",
"b.c"
],
"id" : "test/110311",
"isNewlyCreated" : true,
"selectivityEstimate" : 1,
"sparse" : false,
"type" : "hash",
"unique" : true,
"code" : 201
}
arangosh> db.test.save({ a : 1, b : { c : 1 } });
{
"_id" : "test/110314",
"_key" : "110314",
"_rev" : "_XWq57Dm--_"
}
arangosh> db.test.save({ a : 1, b : { c : 1 } });
[ArangoError 1210: unique constraint violated - in index 110311 of type hash over ["a","b.c"]; conflicting key: 110314]
arangosh> db.test.save({ a : 1, b : { c : null } });
{
"_id" : "test/110320",
"_key" : "110320",
"_rev" : "_XWq57Dq--_"
}
arangosh> db.test.save({ a : 1 });
[ArangoError 1210: unique constraint violated - in index 110311 of type hash over ["a","b.c"]; conflicting key: 110320]