Add a setting to set custom id of documents

With this patch, it's possible to change default Id to another type such as String, UUID, Hex.