Search code examples
stringmongodbcommandmorphia

run command as string in morphia


can I run a query in morphia to which I write the command as String?

somehing like this:

query.executeCommand("db.collection.find()");

thank you


Solution

  • No, you can't do that. Neither Morphia nor the Java driver (nor any driver that I'm aware of) support the shell syntax.