---
title: uniquenessConstraints
framework: coredata
role: symbol
role_heading: Instance Property
path: coredata/nsentitydescription/uniquenessconstraints
---

# uniquenessConstraints

An array of arrays that contains one or more attributes with a value that must be unique over the instances of that entity.

## Declaration

```swift
var uniquenessConstraints: [[Any]] { get set }
```

## Discussion

Discussion Each inner array contains one or more NSAttributeDescription objects or strings that contain the names of attributes on the entity. This value forms part of the entity’s version hash. Stores that don’t support uniqueness constraints must refuse to initialize when receiving a model that contains such constraints. note: Uniqueness constraint violations can be computationally expensive to handle. The recommendation is to use only one uniqueness constraint per entity hierarchy, although subentites may extend a superentity’s constraint.

## See Also

### Configuring indexes and constraints

- [indexes](coredata/nsentitydescription/indexes.md)
- [compoundIndexes](coredata/nsentitydescription/compoundindexes.md)
