// , message: 'Unique constraint violated for key nedb' }
// , message: 'Unique constraint violated for key name' }
});
});
});
});
```
```
**Note: ** the ensureIndex creates the index synchronously, so it's best to use it at application startup. It's quite fast so it doesn't increase startup time much.