Pergunta

I insert a Record into a MongoDB

var test = Entry.createRecord
.name("Williams")
.nr("1")
.save

How can I println these document via query to commandline console?

Foi útil?

Solução

It depends if you're mongo-java-driver apis, or use the lift-json DSL to construct your queries.

For JSON, something like.

Entry.findAll(("name" -> "Williams"))

For API

val qry = QueryBuilder.start("name").is("Williams").get
Entry.findAll(qry)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top