chainQuery = function (prop, value) {
      var query = null;

      if (opts.ignoreCase === true && ctx.model.properties[prop] && ctx.model.properties[prop].type === 'text') {
        query = util.format('LOWER(%s.%s) LIKE LOWER(?)',
          ctx.driver.query.escapeId(ctx.model.table), ctx.driver.query.escapeId(prop)
        );
        chain.where(query, [value]);
      } else {
        query = {};
        query[prop] = value;
        chain.where(query);
      }
    }
Check if a property is unique in the collection.
This can take a while because a query has to be made against the Model.

Due to the async nature of node, and concurrent web server environments,
an index on the database column is the only way to gurantee uniqueness.

For sensibility's sake, undefined and null values are ignored for uniqueness
checks.

Options:
  ignoreCase: for postgres; mysql ignores case by default.
  scope: (Array) scope uniqueness to listed properties