Search code examples
javamongodbmorphia

Mongodb morphia complex query


I want to do this query in Java with Morphia Driver for Mongo DB, this how i do in mongo shell (and works)

db.prova.find({"username":"prova", "roles":"user"})


Solution

  • You should check out the docs. There's a number of examples and reference material to get you started.

    (The tutorial in the comment above is really old and no longer matches the current Morphia releases, for what it's worth.)