code: @View(name = "by_type_for_principal_id", map = "function(doc) { emit([doc.type, doc.principalId], doc) }")
      public Collection<CouchDbCasEvent> findByTypeForPrincipalId(final String type, final String principalId) {
          val view = createQuery("by_type_for_principal_id").key(ComplexKey.of(type, principalId));
          return db.queryView(view, CouchDbCasEvent.class);
      }
docs: Find by type and principal id.
  @param type event type
  @param principalId principal to search for
  @return events of requested type and principal