class Person extends MongoRecord[Person] with ObjectIdPk[Person] {
def meta = Person
object name extends StringField(this, 20)
object age extends IntField(this)
}
object Person extends Person with MongoMetaRecord[Person] {
override def collectionName = "person"
}
val age : Option[Int] = None
// returns only records where name == "Joe" val qry =("name" -> "Joe") ~ ("age" -> age)
Person.findAll(qry)
// returns all records
val qry1 =("$or" -> List[JObject](("name" -> "Joe"), ("age" -> age)))
Person.findAll(qry1)
{
"$or":[
{
"name":"Joe"
},
{
}
]
}
{
"name":"Joe"
}
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.