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