arangosh> db.ids.ensureIndex({ type: "skiplist", fields: [ "myId" ], unique: true });
{
"id" : "ids/1139258929",
"type" : "skiplist",
"fields" : [
"myId"
],
"unique" : true,
"sparse" : false,
"isNewlyCreated" : true,
"code" : 201
}
arangosh> db.ids.save({ "myId": 123 });
{
"_id" : "ids/1139521073",
"_rev" : "1139521073",
"_key" : "1139521073"
}
arangosh> db.ids.save({ "myId": 456 });
{
"_id" : "ids/1139717681",
"_rev" : "1139717681",
"_key" : "1139717681"
}
arangosh> db.ids.save({ "myId": 789 });
{
"_id" : "ids/1139914289",
"_rev" : "1139914289",
"_key" : "1139914289"
}
arangosh> db.ids.save({ "myId": 123 });
[ArangoError 1210: cannot create document, unique constraint violated]