I have the following mongodb model:
class Setting_Model private() extends MongoRecord[Setting_Model] with ObjectIdPk[Setting_Model] {
def meta = Setting_Model
/* Values -------------------------------------------------------*/
object set_id extends LongField(this)
object category extends StringField(this, 125)
object group extends StringField(this, 125)
object handle extends StringField(this, 125)
object label extends StringField(this, 125)
object relation extends StringField(this, 125)
object value extends StringField(this, 125)
}
To reduce queries I’m pulling all of the values from the “settings” collection at once.
What I’m looking for is a way to filter the list of models found so I can extract a single value from the desired field.
For example if I have the following object within the list:
{
"category": "limit",
"group": "lists",
"handle": "max_per_page",
"label": "Max items per page",
"relation": "grid",
"set_id": 1,
"value": "10"
}
I need a way to filter the list and return the “value” field of this object.
Thanks in advance for any help, much appreciated 🙂
P.S: Let me know if you need further clarification
Sorry,
Just solved it :S
For those interested:
Thanks anyhoo 😉