ORM Basics: Adding Indexes

Last Updated: 12/09/2015 Introduced in Verision: 2.0

Adding index to field

Like marking up fields to be stored by the ORM, indexes can also be declared on fields. An index name and a flag to say if index is unique can be added to this.

Below is an example of specifying an index on a field.

 

Adding index to table

If an index includes more than one field, it can be specified at the table level.

Below is an example of specifying an index on a table.

Additional Resources