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

122
Views
Having trouble trying to access nested data

So I have a data structure like below and I'm trying to access inside tournaments the '_id' Any help would be great. What would I need to console.log to get 29?

const sports = {
  "queryUrl": "config_tournaments/1/17",
  "doc": [{
    "event": "config_tournaments",
    "_dob": 1647341355,
    "_maxage": 600,
    "_configid": 12457,
    "data": {
      "tournaments": [{
        "_doc": "tournament",
        "_id": 29,
        "_sid": 1,
        "_rcid": 17,
        "_isk": 1,
        "_tid": 29,
        "_utid": 45,
        "name": "Bundesliga",
        "abbr": "BUN",
        "ground": null,
        "friendly": false,
        "seasonid": 84476,
        "currentseason": 84476,
        "year": "21/22",
        "seasontype": "21",
        "seasontypename": "Regular Season",
        "seasontypeunique": "68",
        "livetable": 57152,
        "cuprosterid": null,
        "roundbyround": true,
        "tournamentlevelorder": 1,
        "tournamentlevelname": "1st level",
        "outdated": false,
        "_sk": false
      }]
    }
  }]
}

console.log(sports.doc[0].data)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try this:

console.log(sports.doc[0].data.tournaments[0]._id)
about 4 years ago · Juan Pablo Isaza Report
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!