arangosh> db.ids.ensureIndex({ type: "persistent", fields: [ "myId" ], unique: true }); { "deduplicate" : true, "fields" : [ "myId" ], "id" : "ids/15398", "isNewlyCreated" : true, "sparse" : false, "type" : "persistent", "unique" : true, "code" : 201 } arangosh> db.ids.save({ "myId": 123 }); { "_id" : "ids/15401", "_key" : "15401", "_rev" : "_VRerCxW---" } arangosh> db.ids.save({ "myId": 456 }); { "_id" : "ids/15405", "_key" : "15405", "_rev" : "_VRerCxW--_" } arangosh> db.ids.save({ "myId": 789 }); { "_id" : "ids/15408", "_key" : "15408", "_rev" : "_VRerCxa---" } arangosh> db.ids.save({ "myId": 123 }); [ArangoError 1210: unique constraint violated - in index 15398 of type persistent over ["myId"]]