Replace database queries in repositories with Morphia

I am unsure if we need to check with this author about using this code.