@ View ( name = "by_principal" , map = "function(doc) { if (doc.principal && doc.deviceFingerprint && doc.recordDate) { emit(doc.principal, doc) } }" ) public List < CouchDbMultifactorAuthenticationTrustRecord > findByPrincipal ( final String principal ) { val view = createQuery ( "by_principal" ) . key ( principal ) ; return db . queryView ( view , CouchDbMultifactorAuthenticationTrustRecord . class ) ; }
Find by principal name .