Question

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?

Était-ce utile?

La solution

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)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top