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?
Puede usar $elemMatch y $ operator para este documento $elemMatch $ operator document
aquí hay un ejemplo de trabajo https://mongoplayground.net/p/GxWp1MIcTcB