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

185
Views
Mongoose encuentra en una matriz de objetos dentro de un objeto

A continuación se muestra mi documento json mongpdb

 { categoryId: '1', categoryName: 'Outdoors Equipments', items: [ { itemId: '1', itemName: 'Camping Tent', itemDescription: 'A tent is a shelter consisting of sheets of fabric or other material draped over, attached to a frame of poles or attached to a supporting rope. While smaller tents may be free-standing or attached to the ground, large tents are usually anchored using guy ropes tied to stakes or tent pegs. First used as portable homes by nomads, tents are now more often used for recreational camping and as temporary shelters.', itemImage: '/images/camping-tent.jpeg', createdAt: DateTime.now().toLocaleString(DateTime.DATETIME_SHORT) }, { itemId: '2', itemName: 'Camping Chair', itemDescription: 'A tent is a shelter consisting of sheets of fabric or other material draped over, attached to a frame of poles or attached to a supporting rope. While smaller tents may be free-standing or attached to the ground, large tents are usually anchored using guy ropes tied to stakes or tent pegs. First used as portable homes by nomads, tents are now more often used for recreational camping and as temporary shelters.', itemImage: '/images/camping-chair.jpeg', createdAt: DateTime.now().toLocaleString(DateTime.DATETIME_SHORT) }, { itemId: '3', itemName: 'Camping Table', itemDescription: 'A tent is a shelter consisting of sheets of fabric or other material draped over, attached to a frame of poles or attached to a supporting rope. While smaller tents may be free-standing or attached to the ground, large tents are usually anchored using guy ropes tied to stakes or tent pegs. First used as portable homes by nomads, tents are now more often used for recreational camping and as temporary shelters.', itemImage: '/images/camping-table.jpeg', createdAt: DateTime.now().toLocaleString(DateTime.DATETIME_SHORT) }, ] }

¿Cómo busco en función de la categoría y el identificador de artículo y devuelvo json con datos de categoría y datos de artículo de ese artículo en particular usando mongoose y nodejs express?

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

0

Puede usar $elemMatch y $ operator para este documento $elemMatch $ operator document

aquí hay un ejemplo de trabajo https://mongoplayground.net/p/GxWp1MIcTcB

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!