node.js - Is it possible to retrieve a deep nested object using nested $elemMatch -
{ key: val, groups: [{ key: val, components [{ key: val }]: }] }
basically data set similar above structure, want specific component object matches query. , possible retrieve component object using $elemmatch ( current code mentioned below )
findone({ _id: objectid(data._id), groups: { $elemmatch: { _id: data.groupid, competency: { $elemmatch: { c_id: data.c_id} } } }, }, { 'groups.$.competency.$$': 1 })
Comments
Post a Comment