code: function resolveDocumentConstraint(constraintDefinition) {
      if (typeof constraintDefinition === 'function') {
        var dbName = userContext ? userContext.db : null;
  
        return constraintDefinition(newDoc, oldDoc, dbName);
      } else {
        return constraintDefinition;
      }
    }
docs: Retrieves the effective value of a top-level document constraint (e.g. "channels", "documentIdRegexPattern", "accessAssignments")