@ View ( name = "by_uid_otp" , map = "function(doc) { if(doc.token && doc.userId) { emit([doc.userId, doc.token], doc) } }" ) public List < CouchDbGoogleAuthenticatorToken > findByUidForOtp ( final String uid , final Integer otp ) { val view = createQuery ( "by_uid_otp" ) . key ( ComplexKey . of ( uid , otp ) ) ; return db . queryView ( view , CouchDbGoogleAuthenticatorToken . class ) ; }
Find all by uid otp pair .