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?

Was it helpful?

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)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top