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