Is it possible to add an index on a property of a transient model?

8 views
Skip to first unread message

Francois Laforge

unread,
Oct 12, 2016, 2:59:19 PM10/12/16
to LoopbackJS
I've modified the loopback-example-relations repository and added a unique index in the email-address model such that

  "properties": {
    "label": {
      "type": "string"
    },
    "address": {
      "type": "string",
      "index":{
        "unique": true
      }
    }
  }

However I am still able to create multiple email addresses for a customer with the same label and address.  Do indexes work on embedsMany relations?  How can I make the property of an embedded model unique?
Reply all
Reply to author
Forward
0 new messages