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

222
Views
¿Cómo puedo filtrar consultas elásticas en javascript?

Quiero filtrar la consulta elástica. Agregué un artículo pero no puedo eliminarlo. Mi matriz está abajo. Por ejemplo, quiero eliminar el elemento que contiene item2 en mi matriz. Quiero verificar si existe la clave item2 y eliminar ese elemento si es así. ¿Como lo puedo hacer?

 let array = [ { terms: { item1: [ '1111111111111', '2222222222222', '3333333333333', '4444444444444' ] } }, { terms: { item2: [ 'aaaaaaaaaaaaaaaaaaaaaaa', 'bbbbbbbbbbbbbbbbbbbbbbb', 'ccccccccccccccccccccccc' ] } }, { range: { item3: { from: 0, to: 99999 } } } ];
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Algo como esto?

 let array = [{ terms: { item1: [ '1111111111111', '2222222222222', '3333333333333', '4444444444444' ] } }, { terms: { item2: [ 'aaaaaaaaaaaaaaaaaaaaaaa', 'bbbbbbbbbbbbbbbbbbbbbbb', 'ccccccccccccccccccccccc' ] } }, { range: { item3: { from: 0, to: 99999 } } } ]; const filtered = array.filter((el) => !el[Object.keys(el)[0]].hasOwnProperty('item2')) console.log(JSON.stringify(filtered))

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!