Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8569603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:22:27+00:00 2026-06-11T18:22:27+00:00

I have the following mongodb model: class Setting_Model private() extends MongoRecord[Setting_Model] with ObjectIdPk[Setting_Model] {

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:22:28+00:00Added an answer on June 11, 2026 at 6:22 pm

    Sorry,

    Just solved it :S

    For those interested:

    var value = setting_model.filter(s => 
    
        s.category.toString == "limit" &&
        s.group.toString == "lists" &&
        s.relation.toString == "grid"
    
    )(0).value.is
    

    Thanks anyhoo 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in a collection: class Author(Agent): def foo(self): self.find_another_document_and_update_it(ids) self.processed
I have the following mongodb object: { _id: ObjectId(4d0b9c7a8b012fe287547157), messages: { 0: { toUname:
Greetings, I have the following mongodb object: { _id: ObjectId(4d0b9c7a8b012fe287547157), messages: { 0: {
I'm using RavenDB build 371 and I have the following model: class Product {
I have the following in admin.py class AdInline(admin.StackedInline): model = Ad class UnitAdmin(admin.ModelAdmin): fields
I have the following MongoDB object stored in my Mongo database: array ( '_id'
I have the following model: class Entry include Mongoid::Document field :title, type: String field
i have following kind of records in mongodb { user_id : 79102, country_code :
I have the following code to connect to MongoDB: try { $m = new
I am using the MongoDB PHP Library and have the following query array Array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.