I'm trying to get a user by email or username from the database, imagine functionality that a user can login either with unique alias or email address, I thought the following would work but it doesn't,
User user =
coll.findOne(DBQuery.is("email", emailOrUsername).or(DBQuery.is("username", emailOrUsername)));
anything i'm missing?