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

259
Views
MongoDB $ elemMatch en matriz

Tengo un documento como este:

 { "values": [ ["a","231"], ["b","232"], ["c","233"], ["a","235"] ] }

Cómo usar $elemMatch en la propiedad de valor. quiere proyectar elementos en valores que el primer elemento de ellos sea " a ".

algo como esto:

 db.test.find({"values" : {$elemMatch: { "matchedElemet"[0]: "a"}}},{"values.$":1})
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puedes usar algo como esto:

 db.test.find( { 'values': { $elemMatch: { $elemMatch: { $in: ['a'] } } } }, { "values.$": 1 } )

o

 db.test.find( {}, { 'values': { $elemMatch: { $elemMatch: { $in: ['a'] } } } } )

Espero haber recibido su requerimiento correctamente y esto ayude.

over 4 years ago · Santiago Trujillo 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!