Ensure unique field value in loopback model
问题 How to ensure uniqueness of a particular field in loopback model. Like below is the model Post, I have a field genericId in it, I want it to be unique in the database, and loopback to through an error, on duplicate key insertion. { "name": "Post", "plural": "Post", "base": "PersistedModel", "properties": { "genericId": { "type": "string", "required":True }, "moderatedAt": { "type": "date" } }, "validations": [], "acls": [], "methods": [] } I have tried searching there documentation, and other