arangosh> db.test.ensureIndex({ type: "hash", fields: [ "a", "b.c" ], unique: true });
{
"id" : "test/15226",
"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/15229",
"_key" : "15229",
"_rev" : "_UWy-Nme---"
}
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/15235",
"_key" : "15235",
"_rev" : "_UWy-Nmm---"
}
arangosh> db.test.save({ a : 1 });
[ArangoError 1210: cannot create document, unique constraint violated]