Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
how to find data in array key name nodejs from mongodb

how to find data from mongodb in nodejs i have below query but its return null, i want to find data in child_categories array Key name child_categoryname please help me i am very thanful to you

i am using nodejs i want to find 'truck repair' and in response i want to get child_categoryhrs in response related to truck repair
example = 4

     JobCategories.findOne({ child_categories : { child_categoryname : 'truck repair'} })
.exec().then(result => { console.log(result); })
                .catch(handleError(res));

        //mongodb

                {
                    "_id" : ObjectId("58cea64cfd70bb1aa472ef2c"),
                    "category_name" : "Repairing",
                    "date_updated" : ISODate("2017-03-20T12:04:16.323Z"),
                    "child_categories" : [ 
                        {
                            "child_categoryname" : "truck repair",
                            "child_categoryhrs" : 4,
                            "_id" : ObjectId("58cea64cfd70bb1aa472ef2d")
                        }, 
                        {
                            "child_categoryname" : "car repair",
                            "child_categoryhrs" : 8,
                            "_id" : ObjectId("58cfc5405895461b286238fa")
                        }
                    ],
                    "__v" : 0
                }
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!