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

1.4K
Views
How can I store and filter large JSON objects (above 70,000)?
const users = [
    {id:1, email:"abc@email.com"},
    {id:2, email:"xyz@email.com"},
    {....}(~70,000 objects)
]

function a(){
    const id = 545
    users.filter((value)=>{
        if(value.id === id)
            return true
    })
}

We have 70,000 users' objects. we need to filter the email based on the id.

users= [{id: '1001', email: "abc@gmail.com"}, {{id: '1002', email: "spc@gmail.com"} , ..];

Using array and array.filter() ends up in the error. Error

what's the best way of approach for this?

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

0

It might be best to convert your array into a Map so that lookups can be made without scanning the entire array. As such:

const lookupMap = new Map(users.map((u) => [u.id, u]));

so now you can

const user = lookupMap.get(userId)

without having to scan all 70000 user objects.

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!