arangosh> db.test.ensureIndex({ type: "hash", fields: [ "a", "b.c" ], unique: true });
{
"id" : "test/15180",
"type" : "hash",
"fields" : [
"a",
"b.c"
],
"selectivityEstimate" : 1,
"unique" : true,
"sparse" : false,
"isNewlyCreated" : true,
"code" : 201
}
arangosh> db.test.save({ a : 1, b : { c : 1 } });
{
"_id" : "test/15183",
"_key" : "15183",
"_rev" : "_U-_q2we---"
}
arangosh> db.test.save({ a : 1, b : { c : 1 } });
[ArangoError 1210: cannot create document, unique constraint violated]
arangosh> db.test.save({ a : 1, b : { c : null } });
{
"_id" : "test/15189",
"_key" : "15189",
"_rev" : "_U-_q2wi--_"
}
arangosh> db.test.save({ a : 1 });
[ArangoError 1210: cannot create document, unique constraint violated]